AnalyticNumberTheory.Sieve.WeightedPan #
Weighted Pan--Bombieri--Vinogradov input #
The upper bound for Ω in Chen's theorem, and more general
Goldbach-type sieves, requires a weighted average distribution
condition, not a uniform bound for each modulus:
for each A > 0, a uniform constant C gives
Σ_{d|P} 3^{ω(d)}·|Δ(d)| ≤ C·x/log^A x.
Here Δ(d) is the difference between the congruence count and
ν(d)·x/log x. The weight counts pairs (d₁,d₂) with
[d₁,d₂]=d in the Selberg expansion (lcmPairCount).
This module supplies:
- Finite weight identities: for squarefree
d,3^{ω(d)}counts lcm pairs; henceΣ_{d|Q}3^{ω(d)}f(d) = Σ_{d₁|Q}Σ_{d₂|Q}f([d₁,d₂])for squarefreeQ(lcmPairWeightedSum). - Sieve application interface:
WeightedPanConditionfor a familyS N : BoundingSieveand scalex N. In the Chen specialization,x N = N,S N = correctedChenBoundingSieve N, andw d = 3^{ω(d)};|S.rem d|is the absolute congruence-count error|#{p∈support : p≡N [MOD d]} − ν(d)·N/log N|. - Weighted mean-value target:
PanMeanValueUniformhas the classical logarithmic-saving shapeΣ_{q≤(x X)^{1/2}/log^B(x X)} μ²(q)·3^{ω(q)} ·max_{y≤x X} max_{0<l<q,(l,q)=1} |Σ_{a≤X,(a,q)=1} f(a)·Δ(y;a,q,l)| ≤ C·x X/log^A(x X), with constants preceding all sufficiently largeX.
The large sieve and Vaughan's identity are analytic ingredients
for the classical Pan theorem (Pan 1963; Halberstam--Richert
1974 Ch. 10; Liu 2022 §III). This module fixes definitions and
proves finite bridges, not an unconditional uniform mean-value
theorem. The implemented main term uses the x/log x proxy;
connecting it to a classical logarithmic-integral formulation
and to sieve remainders requires additional main-term and support
analysis. The coarse polylogarithmic proposition is kept separate.
References:
- Pan, C.D. (1963), Sci. Sinica 12, 465-473
- Bombieri, E. (1965), Math. Ann. 157, 220-260
- Vinogradov, A.I. (1965), Izv. Akad. Nauk SSSR 29, 903-934
- Halberstam & Richert, "Sieve Methods" (1974), Ch. 10
- Liu, Z. (2022), arXiv:2203.07871
1. Origin of the weight: 3^{ω(d)} counts lcm pairs #
For squarefree d, exactly 3^{ω(d)} divisor pairs
(d₁,d₂) satisfy lcm d₁ d₂ = d.
Each prime factor has three exponent choices:
(0,1), (1,0), and (1,1). This is the exact source of
the Selberg upper-sieve weight 3^{ω(d)}.
Grouping the Selberg double sum: for squarefree Q,
Σ_{d|Q} 3^{ω(d)}·f(d) = Σ_{d₁|Q} Σ_{d₂|Q} f([d₁,d₂]).
The weight counts pairs with lcm d (lcmPairCount).
This exact finite identity turns the lcm double sum into
the single weighted sum used by the Pan input.
1b. Pan weight decomposition: 3^{ω(q)} = Σ_{d|q} 2^{ω(d)} #
Pan weight decomposition (Pan 1963; see also the weighted
form of Halberstam--Richert 1974 Lemma 10.3):
for squarefree q,
3^{ω(q)} = Σ_{d|q} 2^{ω(d)} = Σ_{d|q} τ(d),
since 2^{ω(d)} = τ(d) for squarefree d.
The three choices for each prime are regrouped by the divisor
d and its two inclusion choices. This divisor expansion is
the mechanism for handling the 3^{ω(q)} weight in the outer
modulus sum of the weighted Pan argument.
Regrouping Pan weights: for squarefree Q,
Σ_{q|Q}3^{ω(q)}f(q) = Σ_{d|Q}2^{ω(d)}·Σ_{m|Q/d}f(d·m).
Combine 3^{ω(q)} = Σ_{d|q}2^{ω(d)} with the
divisibility-indexed bijection (q,d) ↔ (d,m=q/d).
This replaces the 3^{ω(q)}-weighted modulus sum by a
2^{ω(d)}-weighted double sum, as in Pan's classical
enlargement of the modulus sum (1963).
2. Uniform weighted distribution interface for sieve applications #
Weighted remainder sum over sieve-product divisors:
Σ_{d|P} w(d)·|rem d|, where
rem d = multSum d − ν(d)·totalMass is the BoundingSieve
distribution remainder.
Equations
- AnalyticNumberTheory.Sieve.weightedPanRemainder S w = ∑ d ∈ S.prodPrimes.divisors, w d * |BoundingSieve.rem d|
Instances For
The 3^{ω(d)}-weighted remainder is exactly the lcm
double sum Σ_{d₁,d₂}|rem [d₁,d₂]| in the Selberg expansion.
The counting-sieve error with coefficient sequence 1 is
bounded by the 3^{ω(d)}-weighted remainder sum, generalizing
correctedChenErrSum_le_panWeighted.
Grouping the Λ²-weight remainder: if ∀ d, |w d| ≤ 1,
then |Λ²w(d)| ≤ 3^{ω(d)} for squarefree d, by the lcm-pair
count lcmPairCount. Therefore
errSum(Λ²w) ≤ Σ_{d|P}3^{ω(d)}·|rem d| = weightedPanRemainder S 3^ω.
This is the finite Selberg remainder Σ 3^{ω(d)}|Δ(d)|,
connecting a weighted Pan input to
selberg_upper_bound_sieveProduct in the Chen upper bound for Ω.
Uniform weighted Pan distribution condition:
for each A > 0, there is a uniform C > 0 such that for
every even N ≥ 1000,
Σ_{d|P(N)} w(d)·|rem(N,d)| ≤ C·x(N)/log^A x(N).
For x N = N, S N = correctedChenBoundingSieve N,
and w d = 3^{ω(d)}, the absolute remainder is
|#{p∈support : p≡N [MOD d]} − ν(d)·N/log N|,
the form in CorrectedChenDistributionCondition.
Once this input holds, errSum_le_threeOmegaWeightedPanRemainder
gives errSum = O(N/log^A N). The constant precedes ∀ N;
the threshold in this API is the fixed value 1000.
Equations
Instances For
The 3^{ω(d)}-weighted specialization needed in Chen's theorem.
Equations
- AnalyticNumberTheory.Sieve.ThreeOmegaWeightedPanCondition x S = AnalyticNumberTheory.Sieve.WeightedPanCondition x S fun (d : ℕ) => 3 ^ d.primeFactors.card
Instances For
3. Weighted Pan mean-value target #
π(y;a,q,l): count primes p with a·p ≤ y and
a·p ≡ l [MOD q], as in Liu 2022 §II for positive a.
The definition explicitly searches p ≤ y, including at a = 0.
The congruence is on the product a·p, not on p;
this is the scaled AP prime count in the error for the Ω bound.
Equations
Instances For
The scaled proxy error
π(y; a, q, l) - logarithmicIntegral(y/a)/φ(q).
Here logarithmicIntegral is the x / log x proxy, not the
paper's true logarithmic integral. Source-facing Liu interfaces should
parameterize the main-term function instead of identifying the two.
Equations
- AnalyticNumberTheory.Sieve.panDistributionError y a q l = ↑(AnalyticNumberTheory.Sieve.primesInAPBelow y a q l) - AnalyticNumberTheory.Sieve.logarithmicIntegral (↑y / ↑a) / ↑q.totient
Instances For
Weighted distribution-error sum modulo q:
Σ_{(a,q)=1, a≤X} f(a)·Δ(y;a,q,l).
This is a signed sum, before taking absolute values.
The restriction (a,q)=1 is essential to Liu §IV's correction.
Equations
- AnalyticNumberTheory.Sieve.panDistributionSum y X q l f = ∑ a ∈ Finset.range (X + 1), if a.Coprime q then f a * AnalyticNumberTheory.Sieve.panDistributionError y a q l else 0
Instances For
The unrestricted inner sum occurring before Liu's coprime/non-coprime
partition of the paper remainder R.
Equations
- AnalyticNumberTheory.Sieve.panDistributionFullSum y X q l f = ∑ a ∈ Finset.range (X + 1), f a * AnalyticNumberTheory.Sieve.panDistributionError y a q l
Instances For
The signed non-coprime part removed from panDistributionSum.
Equations
- AnalyticNumberTheory.Sieve.panDistributionNoncoprimeSum y X q l f = ∑ a ∈ Finset.range (X + 1), if ¬a.Coprime q then f a * AnalyticNumberTheory.Sieve.panDistributionError y a q l else 0
Instances For
The termwise absolute majorant of the non-coprime part. This is the finite
inner sum used in Liu's R₁, before the outer modulus weights are applied.
Equations
- AnalyticNumberTheory.Sieve.panDistributionNoncoprimeMajorant y X q l f = ∑ a ∈ Finset.range (X + 1), if ¬a.Coprime q then |f a| * |AnalyticNumberTheory.Sieve.panDistributionError y a q l| else 0
Instances For
Exact finite partition of the unrestricted paper sum into its coprime Pan part and its signed non-coprime part.
The signed non-coprime sum is bounded by Liu's termwise R₁ majorant.
Liu's finite R = R_coprime + R_noncoprime triangle bound. The first term
is the source-faithful Pan sum; the second is the still-separate R₁
majorant.
Canonical representatives of the reduced residue classes modulo q.
For q = 1 this is the singleton {0}; for q = 0 it is empty.
Equations
- AnalyticNumberTheory.Sieve.unitResidues q = {l ∈ Finset.range q | l.Coprime q}
Instances For
For a nontrivial modulus, the canonical representatives agree with the
traditional interval 1 ≤ l ≤ q - 1.
max_{0≤l<q,(l,q)=1} |panDistributionSum y X q l f|, with the unique
class modulo 1 represented by 0; the empty q = 0 maximum is 0.
Equations
- AnalyticNumberTheory.Sieve.panMaxL y X q f = if h : (AnalyticNumberTheory.Sieve.unitResidues q).Nonempty then (Finset.image (fun (l : ℕ) => |AnalyticNumberTheory.Sieve.panDistributionSum y X q l f|) (AnalyticNumberTheory.Sieve.unitResidues q)).max' ⋯ else 0
Instances For
max_{y≤x} panMaxL y X q f: uniform maximum over
the truncation parameter y, as in Liu Theorem 2.
Equations
- AnalyticNumberTheory.Sieve.panMaxY X q x f = (Finset.image (fun (y : ℕ) => AnalyticNumberTheory.Sieve.panMaxL y X q f) (Finset.range (x + 1))).max' ⋯
Instances For
Coarse pure-li bound: the polylogarithmic result of
separating the positive main term and taking its absolute value
in the coarse Vaughan chain. It is not Liu 2022 Theorem 2
and cannot supply WeightedPanCondition. This separate
proposition records exactly the scope of the coarse reductions.
Equations
- AnalyticNumberTheory.Sieve.PanMeanValueUniformCrude x f = ∀ (A : ℝ), 0 < A → ∃ (C : ℝ), 0 < C ∧ ∃ (B : ℝ) (x₀ : ℕ), ∀ (X : ℕ), x₀ ≤ X → ∑ q ∈ Finset.range (⌊x X ^ (1 / 2) / Real.log (x X) ^ B⌋₊ + 1), ↑(ArithmeticFunction.moebius q) ^ 2 * 3 ^ q.primeFactors.card * AnalyticNumberTheory.Sieve.panMaxY X q ⌊x X⌋₊ f ≤ C * x X * Real.log (x X) ^ (A + 7)
Instances For
Weighted Pan mean-value target, with the quantifier and
signed-sum structure of Liu 2022 Theorem 2:
for each A > 0, there are C > 0, B, and x₀ such that
for all X ≥ x₀,
Σ_{q ≤ (x X)^{1/2}/log^B(x X)} μ²(q)·3^{ω(q)}· max_{y ≤ x X} max_{0<l<q,(l,q)=1} |Σ_{(a,q)=1, a≤X} f(a)·Δ(y;a,q,l)| ≤ C·x X/log^A(x X).
Here Δ(y;a,q,l) = π(y;a,q,l) − li(y/a)/φ(q), with the
implemented li name denoting the x/log x proxy.
Three structural features are essential (see PAN_PROOF_ATLAS.md):
the inner coprimality restriction, the maximum over y, and the
absolute value around the whole signed sum, not Σ f·|Δ|.
Dropping coprimality fails for the Chen weights: Liu §IV's
R₁ correction depends on the specific weight and sieve product
and is handled in the Chen application.
The inverse logarithm bounds the signed distribution error,
not a pure absolute-li block. The coarse split gives only
PanMeanValueUniformCrude. A classical proof retains li
and the Vaughan middle/small terms inside one absolute value,
while the nondecaying Selberg main term remains in the Chen
main-term estimate; this is Liu §III's M = M₁ + R separation.
This proposition is an analytic input, not an unconditional theorem
proved here. The classical error estimate for Ω uses the
large sieve and Vaughan's identity (Pan 1963; Halberstam--Richert
1974 Ch. 10; Liu 2022 §III).
Connecting it to WeightedPanCondition additionally requires
support truncation and main-term comparison, including the
classical relation li(x) = x/log x + O(x/log²x) with the
genuine logarithmic integral.
Equations
- AnalyticNumberTheory.Sieve.PanMeanValueUniform x f = ∀ (A : ℝ), 0 < A → ∃ (C : ℝ), 0 < C ∧ ∃ (B : ℝ) (x₀ : ℕ), ∀ (X : ℕ), x₀ ≤ X → ∑ q ∈ Finset.range (⌊x X ^ (1 / 2) / Real.log (x X) ^ B⌋₊ + 1), ↑(ArithmeticFunction.moebius q) ^ 2 * 3 ^ q.primeFactors.card * AnalyticNumberTheory.Sieve.panMaxY X q ⌊x X⌋₊ f ≤ C * x X / Real.log (x X) ^ A
Instances For
From the Pan expression to sieve remainders #
At a = 1, primesInAPBelow y a q l is the ordinary count
#{p≤y : p is prime, p≡l [MOD q]}.
This identifies the source of the sieve remainder
#{p∈support : p≡N [MOD d]}. Further comparison hypotheses
are needed to bound the sieve's weighted remainder sum
by the 3^{ω(q)}-weighted panMaxY sum.
WeightedPanCondition requires C·xN/log^A(xN) for every
A > 0; the switching sieve and error absorption need
arbitrarily large logarithmic savings.
PanMeanValueUniformCrude, with right side
C·xX·(log xX)^{A+7}, cannot meet that requirement.
PanMeanValueUniform retains the inverse-log target and is
assembled only under analytic inputs such as
PanSourceFaithfulSignedMainBound.
The generic absolute-value chain under |f| ≤ 1 cannot provide
the saving. The inner pure-main-term sum has a refined
y·(1+log log y) shape in suitable ranges, or the coarse bound
(y/log 2)·(1+log X); multiplying by the q-factor log⁶
does not produce inverse-log decay. Even retaining coprimality,
the choice f = 1 leaves a pure-main-term contribution of
the indicated (y/log y)·log X size.
The classical application needs the specific Chen weights
and control of their harmonic sum Σ f(a)/a, together with
the sieve main term of shape x/log x·∏(1-ν(p)/p)
in the unnormalized density convention.
The saving is a difference estimate
|main term − sieve main term| ≪ x/log^A x.
These weight and main-term requirements belong to the Chen
application and its analytic bridge, not to the a = 1
identities below; see PAN_PROOF_ATLAS.md.
At a = 1, the scaled count is the ordinary AP prime count.
At a = 1, the scaled count equals primesInAP,
the ordinary AP count in the BV interface.
At a = 1, the distribution error is
π(y;q,l) − li(y)/φ(q), the ordinary AP prime error for
the implemented main-term proxy.