Documentation

AnalyticNumberTheory.Sieve.PanMeanValueBody

AnalyticNumberTheory.Sieve.PanMeanValueBody #

Finite reductions for weighted Pan mean values #

This module supplies reductions toward PanMeanValueUniform (WeightedPan.lean), following Liu 2022 §II--§III:

Section 1 defines natInvMod q a and proves a·p ≡ l [MOD q] ⟺ p ≡ natInvMod q a · l [MOD q] for (a,q)=1. Section 2 uses this and a·p ≤ y ⟺ p ≤ y/a for positive a to prove primesInAPBelow y a q l = primesInAP (y/a) q (natInvMod q a · l % q). The counting bijection is the identity on p. Consequently the distribution error is π(y/a;q,l·a⁻¹) − li(y/a)/φ(q), with natural division in the prime-count cutoff and real division in the main-term argument. Here li denotes the project's x/log x proxy.

The weighted sum becomes Σ_{1≤a≤X} [a.Coprime q]·f(a)·(π(y/a;q,l·a⁻¹) − li(y/a)/φ(q)) plus the explicitly separated a = 0 term. This is an exact identity, not an asymptotic error term.

Related inputs include the Farey-point large sieve LargeSieve.Multiplicative.largeSieveRationalPoints, the per-modulus character bound characterSieveModulus_le, Vaughan's identity (Sieve.VaughanIdentity), and the squarefree weight identity 3^{ω(q)} = Σ_{d|q} 2^{ω(d)} in WeightedPan.

The Type I and Type II reductions are conditional: PanTypeIWeightedBound.of_characterMeanValue and PanTypeIIWeightedBound.of_characterMeanValue require their respective character-mean inputs. The later square-mean reductions do not prove those analytic inputs or an unrestricted uniform all-character bound. Further assembly is in PanAssembly.lean; the main-term distinction is described in PanMainTerm.lean.

1. Inverse residues and congruence cancellation modulo q #

noncomputable def AnalyticNumberTheory.Sieve.natInvMod (q a : ) :

Inverse residue modulo q: when (a,q)=1, take the natural representative of the inverse of a in ZMod q. ZMod.val is the least nonnegative representative, or the absolute value at modulus 0. It satisfies a·b ≡ 1 [MOD q]. Otherwise use 0; the inverse properties are only used under the coprimality hypothesis.

Equations
Instances For
    theorem AnalyticNumberTheory.Sieve.natInvMod_spec {q a : } (hcop : a.Coprime q) :
    a * natInvMod q a % q = 1 % q

    Defining property of natInvMod: if (a,q)=1, then a · natInvMod q a % q = 1 % q, equivalently a · natInvMod q a ≡ 1 [MOD q]. This holds for every q, including the trivial cases q = 0,1.

    Congruence form of natInvMod: a · natInvMod q a ≡ 1 [MOD q] under coprimality, for every q, including q = 0,1.

    theorem AnalyticNumberTheory.Sieve.modEq_mul_left_inv_iff {q a p l b : } (hb : a * b 1 [MOD q]) :
    a * p l [MOD q] p b * l [MOD q]

    Cancellation by an invertible factor: if a·b ≡ 1 [MOD q], then a·p ≡ l [MOD q] ⟺ p ≡ b·l [MOD q]. This is the congruence step in Liu §II's absorption of a: replace the congruence on the coprime multiple a·p by a residue condition on p.

    2. Absorbing a as in Liu §II: scaled counts and weighted errors #

    theorem AnalyticNumberTheory.Sieve.primesInAPBelow_eq_primesInAP_inv (y a q l : ) (ha : 0 < a) (hcop : a.Coprime q) :
    primesInAPBelow y a q l = primesInAP (y / a) q (natInvMod q a * l % q)

    Scaled count as an ordinary AP count (Liu §II): for (a,q)=1 and a ≥ 1, π(y;a,q,l) = π(y/a;q,l·a⁻¹). Among primes, #{p : a·p ≤ y, a·p ≡ l [MOD q]} = #{p : p ≤ y/a, p ≡ l·a⁻¹ [MOD q]}. Division is in , since the integer solutions of a·p ≤ y satisfy p ≤ ⌊y/a⌋.

    theorem AnalyticNumberTheory.Sieve.panDistributionError_scaled_inv (y a q l : ) (ha : 0 < a) (hcop : a.Coprime q) :
    panDistributionError y a q l = (primesInAP (y / a) q (natInvMod q a * l % q)) - logarithmicIntegral (y / a) / q.totient

    Distribution-error form of a-absorption (Liu §II): for (a,q)=1 and a ≥ 1, Δ(y;a,q,l) = π(y/a;q,l·a⁻¹) − li(y/a)/φ(q). The li proxy uses the real argument (y : ℝ)/a, whereas the prime count uses natural division y/a. This distinction must be retained when comparing the main term with the sieve main term.

    theorem AnalyticNumberTheory.Sieve.panDistributionSum_eq_weighted (y X q l : ) (f : ) :
    panDistributionSum y X q l f = (if Nat.Coprime 0 q then f 0 * panDistributionError y 0 q l else 0) + aFinset.Icc 1 X, if a.Coprime q then f a * ((primesInAP (y / a) q (natInvMod q a * l % q)) - logarithmicIntegral (y / a) / q.totient) else 0

    Weighted distribution sum in Liu §II form: for any f, Σ_{(a,q)=1, a≤X} f(a)·Δ(y;a,q,l) equals Σ_{1≤a≤X} [a.Coprime q]·f(a)·(π(y/a;q,l·a⁻¹) − li(y/a)/φ(q)) plus the a = 0 term. That term can be nonzero only when q = 1, since 0.Coprime q ↔ q = 1. It is left unreduced and explicit: the classical sum starts at 1, so separating it preserves exactness.

    3. Maximum bounds for panMaxL and panMaxY #

    theorem AnalyticNumberTheory.Sieve.panMaxL_nonneg (y X q : ) (f : ) :
    0 panMaxL y X q f

    Every |panDistributionSum| is nonnegative, so its finite maximum panMaxL is nonnegative, with value 0 for an empty set.

    theorem AnalyticNumberTheory.Sieve.panMaxL_le_sum_abs (y X q : ) (f : ) (hS : (unitResidues q).Nonempty) :
    panMaxL y X q f lunitResidues q, |panDistributionSum y X q l f|

    The residue maximum is bounded by the sum of absolute values: max_l |·| ≤ Σ_l |·|.

    theorem AnalyticNumberTheory.Sieve.panMaxY_le_sum (X q x : ) (f : ) :
    panMaxY X q x f yFinset.range (x + 1), panMaxL y X q f

    The y-maximum panMaxY is bounded by the sum of the individual panMaxL values.

    theorem AnalyticNumberTheory.Sieve.panMaxY_le_sum_abs (X q x : ) (f : ) (hS : (unitResidues q).Nonempty) :
    panMaxY X q x f yFinset.range (x + 1), lunitResidues q, |panDistributionSum y X q l f|

    Combined bound: panMaxY ≤ Σ_{y≤x} Σ_{(l,q)=1} |panDistributionSum y X q l f|. It replaces both maxima by finite sums for termwise Type I/II estimates.

    4. Type I, Type II, and main-term input propositions #

    After a-absorption, the classical argument (Liu 2022 §III; Halberstam--Richert 1974 Ch. 10) separates Vaughan V1 with d ≤ u, V3 with d > u, e > v, and the signed small/middle/main-term contribution involving li and the middle Vaughan term. The def ... : Prop declarations below record bounds as explicit analytic inputs; defining them does not prove them.

    The relevant analytic ingredients are the Farey-point large sieve LargeSieve.Multiplicative.largeSieveRationalPoints, the per-modulus character bound characterSieveModulus_le, Vaughan's identity in Sieve.VaughanIdentity, and prime-distribution main-term estimates. The pure-li bound below is deliberately coarse and does not replace the signed classical main-term estimate.

    noncomputable def AnalyticNumberTheory.Sieve.apVonMangoldt (y q l : ) :

    AP von Mangoldt count after a-absorption: Σ_{n≤y, n≡l [MOD q]} Λ(n), the AP version of ψ. Applying vaughanIdentity to each Λ n supplies the Type I/II pieces apV1 and apV3 together with the small and middle terms.

    Equations
    Instances For
      noncomputable def AnalyticNumberTheory.Sieve.apV1 (y q l u : ) :

      Type I piece (Vaughan V1): Σ_{n≤y, n≡l [MOD q]} Σ_{d|n, d≤u} μ(d)·log(n/d).

      Equations
      Instances For
        noncomputable def AnalyticNumberTheory.Sieve.apV3 (y q l u v : ) :

        Type II piece (Vaughan V3): Σ_{n≤y, n≡l [MOD q]} Σ_{d|n, u<d} Σ_{e|n/d, v<e} μ(d)·Λ(e).

        Equations
        Instances For
          noncomputable def AnalyticNumberTheory.Sieve.panPieceSum (y X q l : ) (f : ) (g : ) :

          Weighted piece before maxima: Σ_{1≤a≤X, (a,q)=1} f(a)·g(y/a,q,l·a⁻¹ mod q). This is the a-absorbed expression for any piece g. Only positive a occur; the zero term is separated in panDistributionSum_eq_weighted.

          Equations
          Instances For
            noncomputable def AnalyticNumberTheory.Sieve.panPieceMaxL (y X q : ) (f : ) (g : ) :

            Residue maximum of a weighted piece, mirroring panMaxL.

            Equations
            Instances For
              @[simp]
              theorem AnalyticNumberTheory.Sieve.panPieceMaxL_zero (y X : ) (f : ) (g : ) :
              panPieceMaxL y X 0 f g = 0
              @[simp]
              theorem AnalyticNumberTheory.Sieve.panPieceMaxL_one (y X : ) (f : ) (g : ) :
              panPieceMaxL y X 1 f g = |panPieceSum y X 1 0 f g|
              noncomputable def AnalyticNumberTheory.Sieve.panPieceMaxY (X q x : ) (f : ) (g : ) :

              Truncation maximum of a weighted piece, mirroring panMaxY.

              Equations
              Instances For
                @[simp]
                theorem AnalyticNumberTheory.Sieve.panPieceMaxY_zero (X x : ) (f : ) (g : ) :
                panPieceMaxY X 0 x f g = 0
                theorem AnalyticNumberTheory.Sieve.panPieceMaxY_one (X x : ) (f : ) (g : ) :
                panPieceMaxY X 1 x f g = (Finset.image (fun (y : ) => |panPieceSum y X 1 0 f g|) (Finset.range (x + 1))).max'

                Type I weighted-bound proposition: for each A > 0, there exist C > 0, B, and x₀ such that for every X ≥ x₀, with Q = (xX)^{1/2}/log^B(xX), Σ_{q≤Q} μ²(q)·3^{ω(q)}·max_{y≤xX} max_{(l,q)=1} |Σ_{1≤a≤X, (a,q)=1} f(a)·apV1(y/a;q,l·a⁻¹;u)/log(y/a)| ≤ C·xX/log^A(xX). The classical small-factor argument uses character expansion and a Farey-point large-sieve mean estimate (Liu §III Lemma 1; HR 1974 Ch. 10). This declaration is for fixed x,f,u; it does not establish uniformity over all |f| ≤ 1, which requires additional support conditions as discussed in LargeSieve/PanTypeIAssembly.lean.

                Equations
                Instances For

                  Type II weighted-bound proposition for the bilinear Vaughan V3 piece. The classical argument bounds bilinear expressions with |α|, |β| ≤ 1 using a large-sieve mean estimate on Farey points (largeSieveRationalPoints) for Σ_{q≤Q} Σ_{(l,q)=1} |Σ α(d)β(e)·e(de·l/q)|², then applies Cauchy--Schwarz (Liu §III; Montgomery's mean-value theorem). The proposition below is an input, not a proof of that uniform estimate.

                  Equations
                  Instances For

                    Pure main-term weighted bound, polylogarithmic form: Σ_{q≤Q} μ²(q)·3^{ω(q)}·max |Σ_{(a,q)=1} f(a)·li(y/a)/φ(q)| ≤ C·xX·(log xX)^{A+7}. Classically, subtraction of the sieve main term x/log x·∏(1-ν(p)) leaves O(x/log^A x) (Liu 2022 §III; HR 1974 Ch. 10). That requires a sieve-product object and PNT-level main-term input such as PrimeDistribution.primeCounting_asymptotic_real, not just the elementary absolute-value chain here.

                    The present coarse bound uses a larger log power to absorb a fixed degree-7 polylogarithmic factor (PanMainTerm.lean §6). PanMainTermBound.of_sieveBound reduces it to PanMainTermSieveBound, which follows from PanMainSieveAbsorption under its scale-domination hypothesis. The classical signed logarithmic-saving main-term input is a separate requirement.

                    Equations
                    Instances For

                      5. Type I reduction to a character mean #

                      The finite chain for the small-factor V1 piece (d ≤ u) is:

                      apV1 -- charSum_ap --> V_χ(y,u) = Σ_{n≤y} vaughanFirst(n,u)·χ(n)
                           -- |apV1| ≤ φ(q)⁻¹·Σ_χ ‖V_χ‖, |χ(l)| = 1 --> termwise triangle bound
                           -- residue-independent bound --> panPieceMaxL ≤ panTypeIDistributionSum
                           -- maximum over y --> panPieceMaxY ≤ panTypeIMeanValueMaxY
                           -- nonnegative weights --> PanTypeICharacterMeanValue → PanTypeIWeightedBound.
                      

                      The only analytic input to this implication is PanTypeICharacterMeanValue. The classical approach uses a multiplicative large-sieve mean for Σ_χ‖V_χ‖² and Cauchy--Schwarz (Liu 2022 §III Lemma 1; HR 1974 Ch. 10). The implication does not assert that the input holds without the required analytic and support conditions.

                      Complex Type I character sum: V_χ(y,u) = Σ_{n≤y} vaughanFirst(n,u)·χ(n).

                      Equations
                      Instances For

                        A Dirichlet character has norm 1 on units: the image of a finite-order unit is a root of unity.

                        theorem AnalyticNumberTheory.Sieve.apV1_charSum {q y u : } (hq : 0 < q) {l : } (hl : IsUnit l) :
                        (apV1 y q l u) = (↑q.totient)⁻¹ * χ : DirichletCharacter q, star (χ l) * panTypeIV1CharSum q y u χ

                        Complex character expansion: (apV1 y q l u : ℂ) = φ(q)⁻¹·Σ_χ star(χ(l))·V_χ(y,u) for unit l, directly from charSum_ap.

                        theorem AnalyticNumberTheory.Sieve.apV1_abs_le {q y u : } (hq : 0 < q) {l : } (hl : IsUnit l) :

                        Pointwise bound for unit l: |apV1 y q l u| ≤ φ(q)⁻¹·Σ_χ ‖V_χ(y,u)‖.

                        theorem AnalyticNumberTheory.Sieve.isUnit_natInvMod_mul_residue {q a l : } (hq : 0 < q) (hcop_a : a.Coprime q) (hl : l.Coprime q) :
                        IsUnit ↑(natInvMod q a * l % q)

                        The inverse representative of a unit a times a unit l is again a unit modulo q, as needed for the pointwise apV1 bound.

                        noncomputable def AnalyticNumberTheory.Sieve.panTypeIDistributionSum (y X q : ) (f : ) (u : ) :

                        Type I character-mean expression: for each y, the a-absorbed weighted piece reduces to Σ_{1≤a≤X} |f(a)|/|log(y/a)| · Σ_χ ‖V_χ(y/a,u)‖.

                        Equations
                        Instances For

                          The distribution sum is nonnegative.

                          theorem AnalyticNumberTheory.Sieve.panPieceSum_typeI_abs_le (y X q : ) (f : ) (u l : ) (hq : 0 < q) (hl : l.Coprime q) :
                          |panPieceSum y X q l f fun (y' q' l' : ) => apV1 y' q' l' u / Real.log y'| panTypeIDistributionSum y X q f u

                          Residue-uniform Type I reduction: for unit l, |panPieceSum y X q l f g| is bounded by panTypeIDistributionSum, independently of l.

                          theorem AnalyticNumberTheory.Sieve.panPieceMaxL_le_typeIDistributionSum (y X q : ) (f : ) (u : ) :
                          (panPieceMaxL y X q f fun (y' q' l' : ) => apV1 y' q' l' u / Real.log y') panTypeIDistributionSum y X q f u

                          Residue-maximum reduction: panPieceMaxLpanTypeIDistributionSum, since the bound is independent of the residue.

                          noncomputable def AnalyticNumberTheory.Sieve.panTypeIMeanValueMaxY (X q x : ) (f : ) (u : ) :

                          Maximum over y of the character-mean expression, mirroring panPieceMaxY.

                          Equations
                          Instances For
                            theorem AnalyticNumberTheory.Sieve.panPieceMaxY_le_typeIMeanValueMaxY (X q x : ) (f : ) (u : ) :
                            (panPieceMaxY X q x f fun (y' q' l' : ) => apV1 y' q' l' u / Real.log y') panTypeIMeanValueMaxY X q x f u

                            Truncation-maximum reduction: panPieceMaxYpanTypeIMeanValueMaxY, by maximizing the pointwise bound panPieceMaxLpanTypeIDistributionSum.

                            Type I character-mean input under |f| ≤ 1, with weight 3^{ω(q)}. It is the remaining analytic hypothesis in the reduction to PanTypeIWeightedBound. The classical approach uses a multiplicative large-sieve mean for Σ_χ‖V_χ‖² and Cauchy--Schwarz; this definition does not establish a uniform estimate for every bounded f.

                            Equations
                            Instances For

                              Type I reduction: PanTypeICharacterMeanValuePanTypeIWeightedBound. Character expansion, pointwise estimates, both maximum reductions, and weight monotonicity are proved here; the character mean itself remains the analytic hypothesis.

                              5.1 Type I square-mean reduction #

                              The proposed analytic chain (Liu 2022 §III Lemma 1; HR 1974 Ch. 10) is

                              Σ_{q≤Q} μ²(q)·3^{ω(q)}·max_{y≤xX}
                                Σ_{1≤a≤X} |f(a)|/|log(y/a)|·Σ_χ ‖V_χ(y/a)‖
                              ≤ Σ_{q≤Q} μ²(q)·3^{ω(q)}·√φ(q)·max_{y≤xX}
                                Σ_{1≤a≤X} |f(a)|/|log(y/a)|·√(Σ_χ ‖V_χ(y/a)‖²).
                              

                              The inequality follows from Cauchy--Schwarz and the character count φ(q). A further logarithmic-saving bound would require a multiplicative large-sieve mean, a square-sum estimate for vaughanFirst, totient-weight estimates, and the outer (y,a) sum.

                              This section proves the finite components: panTypeI_charAbsSum_le_cs, using DirichletCharacter.card_eq_totient_of_hasEnoughRootsOfUnity; panTypeIDistributionSum_le_csWeighted; panTypeIMeanValueMaxY_le_charSqrtMeanMaxY; panTypeI_weight_nonneg; panTypeICharSqrtMeanMaxY_le_of_abs_le_one; and PanTypeICharacterMeanValue.of_sieveBound. The input is panTypeICharMeanSieveBound, with the separate square-mean proposition panTypeICharSquareMeanBound.

                              Primitive-character decomposition and Gauss sums are essential in the classical Bombieri--Davenport theorem. Directly summing all-character Parseval bounds does not work: for a_n ≡ 1, Q = 2, and large N, Σ_q (q/φ(q))Σ_χ |S(χ)|² ≈ 3N²/2, whereas C(N,1/4)·N = (N+64)·N. See Multiplicative.lean; the all-character input is not a consequence of the primitive-character theorem alone.

                              Character-sum L² expression t_q(m) = Σ_χ ‖V_χ(m)‖², the natural square-mean object for the multiplicative large sieve.

                              Equations
                              Instances For

                                Cauchy--Schwarz: Σ_χ ‖V_χ(m)‖ ≤ √φ(q)·√(Σ_χ ‖V_χ(m)‖²), using the character count φ(q) and (Σa_i)² ≤ n·Σa_i².

                                theorem AnalyticNumberTheory.Sieve.panTypeIDistributionSum_le_csWeighted (y X q : ) (f : ) (u : ) (hq : 0 < q) :
                                panTypeIDistributionSum y X q f u q.totient * aFinset.Icc 1 X, |f a| / |Real.log ↑(y / a)| * (panTypeICharSqSum q (y / a) u)

                                Termwise weighted Cauchy--Schwarz in the distribution sum: panTypeIDistributionSum y X q f u ≤ √φ(q)·Σ_{1≤a≤X} |f(a)|/|log(y/a)|·√t_q(y/a).

                                noncomputable def AnalyticNumberTheory.Sieve.panTypeICharSqrtMean (y X q : ) (f : ) (u : ) :

                                The fixed-y slice of the weighted square-mean expression: W(y) = Σ_{1≤a≤X} |f(a)|/|log(y/a)|·√t_q(y/a).

                                Equations
                                Instances For
                                  noncomputable def AnalyticNumberTheory.Sieve.panTypeICharSqrtMeanMaxY (X q x : ) (f : ) (u : ) :

                                  Maximum over y of the weighted square-mean expression, mirroring panTypeIMeanValueMaxY.

                                  Equations
                                  Instances For

                                    Truncation-maximum reduction: panTypeIMeanValueMaxY ≤ √φ(q)·panTypeICharSqrtMeanMaxY, by maximizing the weighted Cauchy--Schwarz bound.

                                    Nonnegative weight: μ²(q)·3^{ω(q)} ≥ 0.

                                    theorem AnalyticNumberTheory.Sieve.panTypeICharSqrtMeanMaxY_le_of_abs_le_one (X q x u : ) {f : } (hfb : ∀ (a : ), |f a| 1) :
                                    panTypeICharSqrtMeanMaxY X q x f u panTypeICharSqrtMeanMaxY X q x (fun (x : ) => 1) u

                                    Under |f(a)| ≤ 1, the maximum weighted square-mean expression is bounded by its version with f ≡ 1.

                                    Type I square-mean assembly input: under |f| ≤ 1, for each A > 0 there are C > 0, B, and x₀ such that for every X ≥ x₀, with Q = (xX)^{1/2}/log^B(xX), Σ_{q≤Q} μ²(q)·3^{ω(q)}·√φ(q)·max_{y≤xX} Σ_{1≤a≤X} |f(a)|/|log(y/a)|·√(Σ_χ ‖V_χ(y/a)‖²) ≤ C·xX/log^A(xX).

                                    This is the remaining hypothesis in the reduction to PanTypeICharacterMeanValue. The classical route combines the multiplicative large sieve, Cauchy--Schwarz in q, a square-sum bound for vaughanFirst, totient weights, and the outer (y,a) sum (Liu 2022 §III Lemma 1; HR 1974 Ch. 10). The all-character sum is not obtained by direct Parseval stacking; primitive-character and Gauss-sum analysis is separate (Multiplicative.lean). Nor does this definition prove uniformity for all bounded f; see the support obstruction in PanTypeIAssembly.lean.

                                    Equations
                                    Instances For

                                      Type I all-character square-mean proposition: Σ_{q≤Q} μ²(q)·3^{ω(q)}·Σ_χ ‖V_χ(m)‖² ≤ C·(m+Q²)·Σ_{n≤m} vaughanFirst(n,u)².

                                      The classical Bombieri--Davenport theorem (Montgomery 1971 Ch. 1; Iwaniec--Kowalski 2004 Ch. 7) uses primitive characters and Gauss sums |τ(χ)|² = q; direct all-character Parseval stacking fails, as explained in Multiplicative.lean. The proposed further assembly also calls for a square-sum estimate for vaughanFirst (classically of m·log³(m+2) shape), Σ_{q≤Q} μ²(q)3^{ω(q)}φ(q) ≪ Q²·log³(Q+2), and a uniform outer-sum bound of the form Σ_{a≤X} |f(a)|/|log(y/a)|·(y/a)^{1/2}·(y/a+Q²)^{1/2}·log³ for y ≤ xX, followed by Cauchy--Schwarz in q. The maximum must remain outside the modulus-dependent estimates. These requirements describe a proposed route to panTypeICharMeanSieveBound, not a theorem supplied by this definition.

                                      Equations
                                      Instances For

                                        Type I square-mean reduction: panTypeICharMeanSieveBoundPanTypeICharacterMeanValue. Cauchy--Schwarz, the maximum reduction, nonnegative weights, and the zero weight at q = 0 are proved here; the supplied mean estimate is the sole analytic input.

                                        5.2 Type II character and square-mean reductions #

                                        For V3 with u < d, v < e, the finite chain parallels §§5--5.1, replacing apV1, vaughanFirst, and panTypeI* by apV3, vaughanThird, and panTypeII*:

                                        apV3 -- charSum_ap --> V_χ(y,u,v) = Σ_{n≤y} vaughanThird(n,u,v)·χ(n)
                                             -- |apV3| ≤ φ(q)⁻¹·Σ_χ ‖V_χ‖ --> termwise triangle bound
                                             -- residue-uniform bound --> panPieceMaxL ≤ panTypeIIDistributionSum
                                             -- maximum over y --> panPieceMaxY ≤ panTypeIIMeanValueMaxY
                                             -- nonnegative weights --> PanTypeIICharacterMeanValue → PanTypeIIWeightedBound
                                             -- Cauchy--Schwarz, character count φ(q) --> panTypeIICharSqSum / panTypeIICharSqrtMeanMaxY
                                             -- panTypeIICharMeanSieveBound --> PanTypeIICharacterMeanValue.of_sieveBound.
                                        

                                        The remaining analytic input is panTypeIICharMeanSieveBound. The classical bilinear route combines a multiplicative large-sieve mean for Σ_χ‖V_χ‖², a square-sum bound for vaughanThird, and Cauchy--Schwarz in q (Liu 2022 §III; Montgomery 1971 Ch. 1). All finite implications here are conditional on that input.

                                        Complex Type II character sum: V_χ(y,u,v) = Σ_{n≤y} vaughanThird(n,u,v)·χ(n).

                                        Equations
                                        Instances For
                                          theorem AnalyticNumberTheory.Sieve.apV3_charSum {q y u v : } (hq : 0 < q) {l : } (hl : IsUnit l) :
                                          (apV3 y q l u v) = (↑q.totient)⁻¹ * χ : DirichletCharacter q, star (χ l) * panTypeIIV3CharSum q y u v χ

                                          Complex character expansion: (apV3 y q l u v : ℂ) = φ(q)⁻¹·Σ_χ star(χ(l))·V_χ(y,u,v) for unit l, directly from charSum_ap.

                                          theorem AnalyticNumberTheory.Sieve.apV3_abs_le {q y u v : } (hq : 0 < q) {l : } (hl : IsUnit l) :
                                          |apV3 y q l u v| (↑q.totient)⁻¹ * χ : DirichletCharacter q, panTypeIIV3CharSum q y u v χ

                                          Pointwise bound for unit l: |apV3 y q l u v| ≤ φ(q)⁻¹·Σ_χ ‖V_χ(y,u,v)‖.

                                          noncomputable def AnalyticNumberTheory.Sieve.panTypeIIDistributionSum (y X q : ) (f : ) (u v : ) :

                                          Type II character-mean expression: for each y, the a-absorbed weighted piece reduces to Σ_{1≤a≤X} |f(a)|/|log(y/a)| · Σ_χ ‖V_χ(y/a,u,v)‖.

                                          Equations
                                          Instances For

                                            The distribution sum is nonnegative.

                                            theorem AnalyticNumberTheory.Sieve.panPieceSum_typeII_abs_le (y X q : ) (f : ) (u v l : ) (hq : 0 < q) (hl : l.Coprime q) :
                                            |panPieceSum y X q l f fun (y' q' l' : ) => apV3 y' q' l' u v / Real.log y'| panTypeIIDistributionSum y X q f u v

                                            Residue-uniform Type II reduction: for unit l, |panPieceSum y X q l f g| is bounded by panTypeIIDistributionSum, independently of l.

                                            theorem AnalyticNumberTheory.Sieve.panPieceMaxL_le_typeIIDistributionSum (y X q : ) (f : ) (u v : ) :
                                            (panPieceMaxL y X q f fun (y' q' l' : ) => apV3 y' q' l' u v / Real.log y') panTypeIIDistributionSum y X q f u v

                                            Residue-maximum reduction: panPieceMaxLpanTypeIIDistributionSum, since the bound is independent of the residue.

                                            noncomputable def AnalyticNumberTheory.Sieve.panTypeIIMeanValueMaxY (X q x : ) (f : ) (u v : ) :

                                            Maximum over y of the Type II character-mean expression, mirroring panTypeIMeanValueMaxY.

                                            Equations
                                            Instances For
                                              theorem AnalyticNumberTheory.Sieve.panPieceMaxY_le_typeIIMeanValueMaxY (X q x : ) (f : ) (u v : ) :
                                              (panPieceMaxY X q x f fun (y' q' l' : ) => apV3 y' q' l' u v / Real.log y') panTypeIIMeanValueMaxY X q x f u v

                                              Truncation-maximum reduction: panPieceMaxYpanTypeIIMeanValueMaxY, by maximizing the pointwise bound panPieceMaxLpanTypeIIDistributionSum.

                                              Type II character-mean input under |f| ≤ 1, with weight 3^{ω(q)}. It is the remaining analytic hypothesis in the reduction to PanTypeIIWeightedBound. The classical approach uses a multiplicative large-sieve mean for Σ_χ‖V_χ‖² and Cauchy--Schwarz; this definition does not itself prove the estimate.

                                              Equations
                                              Instances For

                                                Type II reduction: PanTypeIICharacterMeanValuePanTypeIIWeightedBound. Character expansion, pointwise estimates, both maximum reductions, and weight monotonicity are proved here; the character mean itself remains the analytic hypothesis.

                                                Character-sum L² expression t_q(m) = Σ_χ ‖V_χ(m)‖², the natural square-mean object for the multiplicative large sieve.

                                                Equations
                                                Instances For

                                                  Cauchy--Schwarz: Σ_χ ‖V_χ(m)‖ ≤ √φ(q)·√(Σ_χ ‖V_χ(m)‖²), using the character count φ(q) and (Σa_i)² ≤ n·Σa_i².

                                                  theorem AnalyticNumberTheory.Sieve.panTypeIIDistributionSum_le_csWeighted (y X q : ) (f : ) (u v : ) (hq : 0 < q) :
                                                  panTypeIIDistributionSum y X q f u v q.totient * aFinset.Icc 1 X, |f a| / |Real.log ↑(y / a)| * (panTypeIICharSqSum q (y / a) u v)

                                                  Termwise weighted Cauchy--Schwarz: panTypeIIDistributionSum y X q f u v ≤ √φ(q)·Σ_{1≤a≤X} |f(a)|/|log(y/a)|·√t_q(y/a).

                                                  noncomputable def AnalyticNumberTheory.Sieve.panTypeIICharSqrtMean (y X q : ) (f : ) (u v : ) :

                                                  The fixed-y slice of the weighted square-mean expression: W(y) = Σ_{1≤a≤X} |f(a)|/|log(y/a)|·√t_q(y/a).

                                                  Equations
                                                  Instances For
                                                    noncomputable def AnalyticNumberTheory.Sieve.panTypeIICharSqrtMeanMaxY (X q x : ) (f : ) (u v : ) :

                                                    Maximum over y of the weighted square-mean expression, mirroring panTypeICharSqrtMeanMaxY.

                                                    Equations
                                                    Instances For

                                                      Truncation-maximum reduction: panTypeIIMeanValueMaxY ≤ √φ(q)·panTypeIICharSqrtMeanMaxY, by maximizing the weighted Cauchy--Schwarz bound.

                                                      Nonnegative weight: μ²(q)·3^{ω(q)} ≥ 0.

                                                      theorem AnalyticNumberTheory.Sieve.panTypeIICharSqrtMeanMaxY_le_of_abs_le_one (X q x u v : ) {f : } (hfb : ∀ (a : ), |f a| 1) :
                                                      panTypeIICharSqrtMeanMaxY X q x f u v panTypeIICharSqrtMeanMaxY X q x (fun (x : ) => 1) u v

                                                      Under |f(a)| ≤ 1, the maximum weighted square-mean expression is bounded by its version with f ≡ 1.

                                                      Type II square-mean assembly input: under |f| ≤ 1, for each A > 0 there are C > 0, B, and x₀ such that for every X ≥ x₀, with Q = (xX)^{1/2}/log^B(xX), Σ_{q≤Q} μ²(q)·3^{ω(q)}·√φ(q)·max_{y≤xX} Σ_{1≤a≤X} |f(a)|/|log(y/a)|·√(Σ_χ ‖V_χ(y/a)‖²) ≤ C·xX/log^A(xX). This is the remaining hypothesis in the reduction to PanTypeIICharacterMeanValue. The classical bilinear route combines the multiplicative large sieve, Cauchy--Schwarz in q, a square-sum bound for vaughanThird, totient weights, and the outer (y,a) sum (Liu 2022 §III; Montgomery 1971 Ch. 1; HR 1974 Ch. 10). The definition is not an unconditional uniform estimate.

                                                      Equations
                                                      Instances For

                                                        Type II all-character square-mean proposition: Σ_{q≤Q} μ²(q)·3^{ω(q)}·Σ_χ ‖V_χ(m)‖² ≤ C·(m+Q²)·Σ_{n≤m} vaughanThird(n,u,v)². The classical Bombieri--Davenport theorem (Montgomery 1971 Ch. 1; Iwaniec--Kowalski 2004 Ch. 7) uses primitive-character decomposition and Gauss sums. The bilinear Type II structure enters after expanding Vaughan's identity in d,e (Liu 2022 §III). This declaration records an input, not a proved all-character bound.

                                                        Equations
                                                        Instances For

                                                          Type II square-mean reduction: panTypeIICharMeanSieveBoundPanTypeIICharacterMeanValue. Cauchy--Schwarz, the maximum reduction, nonnegative weights, and the zero weight at q = 0 are proved here; the supplied character mean is the sole analytic input.