Documentation

MathlibNt.SieveTheory.Arithmetic.MertensTheorem

MathlibNt.SieveTheory.MertensTheorem #

Mertens' theorems #

Mertens' theorems provide the basis for estimates of the sieve product V(z) and its relation to the singular series 𝔖(N) in Chen's theorem.

Mertens' second theorem: there is a constant B₁ such that Ξ£_{p ≀ x} 1/p = log log x + B₁ + O(1/log x).

Mertens' product formula: Ξ _{p ≀ x} (1 - 1/p) ~ e^(-Ξ³) / log x, where Ξ³ is the Euler-Mascheroni constant.

Applications to Chen's theorem:

The exact finite identity below uses singularSeriesTruncated N (z - 1); both its main term and its error term retain this factor.

References:

1. Mertens' second theorem #

The sum of prime reciprocals: Ξ£_{p ≀ x} 1/p.

Equations
Instances For
    theorem MathlibNt.SieveTheory.MertensTheorem.mertens_second_theorem :
    βˆƒ (B₁ : ℝ) (C : ℝ), βˆ€ (x : β„•), 2 ≀ x β†’ |primeReciprocalSum x - (Real.log (Real.log ↑x) + B₁)| ≀ C / Real.log ↑x

    Mertens' second theorem: there is a constant B₁ such that Ξ£_{p ≀ x} 1/p = log log x + B₁ + O(1/log x)

    This underlies Lemma 1 in the proof of Chen's theorem. One possible proof uses the prime number theorem and Abel summation, but the PNT is not necessary: Mertens' theorem also has elementary proofs.

    Smooth weights on logarithmic prime intervals #

    The floor of the real power used as an exact natural cutoff.

    Equations
    Instances For

      The reciprocal-prime sum with a test function on logarithmic scale.

      The Ioc endpoints are literal floors of the real powers. Thus, when N β‰₯ 1, membership is exactly N ^ a < p ∧ p ≀ N ^ b; no endpoint error is hidden in the definition.

      Equations
      Instances For
        theorem MathlibNt.SieveTheory.MertensTheorem.mem_Ioc_rpowFloor_iff {N p : β„•} {a b : ℝ} :
        p ∈ Finset.Ioc (rpowFloor N a) (rpowFloor N b) ↔ ↑N ^ a < ↑p ∧ ↑p ≀ ↑N ^ b

        The floor cutoffs encode the intended half-open real-power interval exactly.

        Finite Abel summation for a logarithmically rescaled smooth test function. This is an exact identity, including both floored real-power endpoints.

        For a constant test function, the exact real-power prime interval has the expected logarithmic limit. This is the base case for finite-step approximations of general continuous test functions.

        theorem MathlibNt.SieveTheory.MertensTheorem.tendsto_finset_weightedPrimeReciprocalLogSum_const {ΞΉ : Type u_1} (s : Finset ΞΉ) (c a b : ΞΉ β†’ ℝ) (ha : βˆ€ i ∈ s, 0 < a i) (hab : βˆ€ i ∈ s, a i < b i) :
        Filter.Tendsto (fun (N : β„•) => βˆ‘ i ∈ s, weightedPrimeReciprocalLogSum (fun (x : ℝ) => c i) N (a i) (b i)) Filter.atTop (nhds (βˆ‘ i ∈ s, c i * Real.log (b i / a i)))

        A fixed finite linear combination of constant logarithmic cells converges to the same linear combination of logarithmic masses.

        theorem MathlibNt.SieveTheory.MertensTheorem.tendsto_weightedPrimeReciprocalLogSum_of_hasDerivAt {a b : ℝ} (ha : 0 < a) (hab : a < b) {f f' : ℝ β†’ ℝ} (hf : βˆ€ (x : ℝ), HasDerivAt f (f' x) x) (hf' : Continuous f') :

        A continuously differentiable test function on a fixed positive logarithmic interval has the expected Mertens-weighted prime-sum limit. The sum uses the literal floored cutoffs ⌊N ^ aβŒ‹ and ⌊N ^ bβŒ‹.

        A continuous test function on a fixed positive logarithmic interval has the expected reciprocal-prime limit.

        2. Mertens' product formula #

        The prime product: Ξ _{p ≀ x} (1 - 1/p).

        Equations
        Instances For

          The Chen-local Euler product is definitionally the reusable ANT object.

          Mertens' product formula: Ξ _{p ≀ x} (1 - 1/p) ~ e^(-Ξ³) / log x.

          The quantitative form here gives a constant C such that |Ξ _{p ≀ x} (1 - 1/p) - e^(-Ξ³) / log x| ≀ C / (log x)Β².

          This is a central tool for estimating V(z).

          theorem MathlibNt.SieveTheory.MertensTheorem.primeProduct_asymptotic_order :
          βˆƒ (c₁ : ℝ) (cβ‚‚ : ℝ), 0 < c₁ ∧ βˆ€ (x : β„•), 2 ≀ x β†’ c₁ / Real.log ↑x ≀ primeProduct x ∧ primeProduct x ≀ cβ‚‚ / Real.log ↑x

          Order form of Mertens' product formula: primeProduct x = Θ(1/log x); there are positive constants c₁, cβ‚‚ such that c₁/log x ≀ Ξ _{p ≀ x}(1 - 1/p) ≀ cβ‚‚/log x.

          This weaker version of mertens_product_formula, which has the exact constant e^{-Ξ³}, follows directly from Mertens' second theorem via -log Ξ  = Ξ£ 1/p + O(1). It does not require the Euler-Mascheroni constant identity. Proof outline:

          1. log Ξ  = Ξ£ log(1 - 1/p), and |log(1 - 1/p) + 1/p| ≀ 2/pΒ².
          2. Thus -log Ξ  = Ξ£ 1/p + E(x), with |E(x)| ≀ Ξ£ 2/pΒ² ≀ 2Β·Ξ£_{nβ‰₯1} 1/nΒ² < ∞.
          3. Mertens' second theorem gives Ξ£ 1/p = log log x + B₁ + O(1/log x).
          4. Hence Ξ  = exp(-B₁ - Ξ΄ - E)/log x, where |Ξ΄| and |E| are bounded, so Ξ  = Θ(1/log x).

          3. Application: bounded prime-reciprocal sums (Lemma 1) #

          theorem MathlibNt.SieveTheory.MertensTheorem.primeProduct_lower_bound :
          βˆƒ (cpp : ℝ), 0 < cpp ∧ βˆ€ (m : β„•), 3 ≀ m β†’ cpp / Real.log ↑m ≀ primeProduct m

          Mertens product lower bound: there is cpp > 0 such that, for every m β‰₯ 3, cpp / log m ≀ primeProduct m.

          This follows directly from primeProduct_asymptotic_order, which gives c₁/log x ≀ primeProduct x for every x β‰₯ 2. It is one of the two standard inputs to the main-term lower bound CorrectedChenMainTermLower.

          Existentially named form of primeProduct_lower_bound, for clients that choose a fixed lower-bound constant.

          theorem MathlibNt.SieveTheory.MertensTheorem.prime_reciprocal_sum_bounded (Ξ± Ξ² : ℝ) (hΞ± : 0 < Ξ±) (_hΞ² : Ξ± < Ξ²) :
          βˆƒ (C : ℝ), βˆ€ (x : β„•), 2 ≀ x β†’ |βˆ‘ p ∈ Finset.range (x + 1) with Nat.Prime p ∧ ↑x ^ Ξ± < ↑p ∧ ↑p ≀ ↑x ^ Ξ², 1 / ↑p| ≀ C

          Lemma 1 (Liu 2022): for fixed 0 < Ξ± < Ξ², the sum Ξ£_{x^Ξ± < p ≀ x^Ξ²} 1/p is bounded.

          By Mertens' second theorem, Ξ£_{x^Ξ± < p ≀ x^Ξ²} 1/p = (log log x^Ξ² + B₁ + O(1/log x)) - (log log x^Ξ± + B₁ + O(1/log x)) = log(Ξ²/Ξ±) + O(1/log x)

          Thus the sum is bounded, as is the further truncation to p ≀ x used here.

          4. Application: an asymptotic formula for the sieve product V(z) #

          Goldbach sieve product V(z, N) = Π_{p < z, p ∀ N} (1 - 1/(p-1)).

          Equations
          Instances For
            theorem MathlibNt.SieveTheory.MertensTheorem.goldbachSieveProduct_lower_bound :
            βˆƒ (c₁ : ℝ), 0 < c₁ ∧ βˆ€ (N z : β„•), 2 ≀ z β†’ Even N β†’ 4 ≀ N β†’ c₁ / Real.log ↑z ≀ goldbachSieveProduct N z

            Sieve-product lower bound: there is c₁ > 0 such that, for every even N β‰₯ 4 and z β‰₯ 2, c₁ / log z ≀ V(z, N) = Ξ _{p < z, p ∀ N}(1 - 1/(p-1)).

            Proof outline:

            1. Evenness of N excludes p = 2 from the sieve product. Omitting factors with p | N can only increase the product, so V β‰₯ W(z) := Ξ _{p < z, p > 2}(1 - 1/(p-1)).
            2. Use the local correction |log(1 - 1/(p-1)) + 1/(p-1)| ≀ 2/(p-1)Β².
            3. By Mertens' second theorem, -log W = Ξ£_{p<z,p>2} 1/(p-1) + O(1) ≀ log log z + O(1).
            4. Exponentiating gives W = exp(log W) β‰₯ e^{-C}/log z.

            This supplies the lower-bound scale in V β‰ˆ 𝔖(N)Β·e^{-Ξ³}/log z, as needed for the Jurkat-Richert main term.

            Sieve-product upper bound: V(z, N) ≀ 1, since every factor lies in [0, 1]. The factor at p = 2 can be zero when N is odd.

            Sieve-product identity: V(z,N) = Ξ _{p<z}(1-1/p) Β· 𝔖(N,z-1).

            For odd primes, factor (1-1/(p-1)) = (1-1/p)(1-1/(p-1)Β²). Then:

            • if p ∀ N (which excludes p = 2 for even N), (1-1/p)Β·localFactor(p,N) = 1-1/(p-1);
            • if p | N (including p = 2, since N is even), (1-1/p)Β·localFactor(p,N) = 1. Thus Ξ _{p<z}(1-1/p)·𝔖(N,z-1) = Ξ _{p<z}[(1-1/p)Β·localFactor(p,N)] = V.

            This is the exact identity underlying V β‰ˆ 𝔖(N)Β·e^{-Ξ³}/log z.

            theorem MathlibNt.SieveTheory.MertensTheorem.sieveProduct_order :
            βˆƒ (c₁ : ℝ) (cβ‚‚ : ℝ), 0 < c₁ ∧ βˆ€ (N z : β„•), 3 ≀ z β†’ Even N β†’ 4 ≀ N β†’ c₁ * SingularSeries.singularSeriesTruncated N (z - 1) / Real.log ↑z ≀ goldbachSieveProduct N z ∧ goldbachSieveProduct N z ≀ cβ‚‚ * SingularSeries.singularSeriesTruncated N (z - 1) / Real.log ↑z

            Order of the sieve product: there are c₁, cβ‚‚ > 0 such that, for every even N β‰₯ 4 and z β‰₯ 3, c₁·𝔖(N,z-1)/log z ≀ V(z,N) ≀ c₂·𝔖(N,z-1)/log z.

            This follows directly from V = Ξ _{p<z}(1-1/p)·𝔖(N,z-1) and primeProduct_asymptotic_order, which gives Ξ _{p<z}(1-1/p) = Θ(1/log z).

            4.5 Sums of 1/(p-1) over primes (for Selberg Lemma 2) #

            theorem MathlibNt.SieveTheory.MertensTheorem.prime_inv_sq_bound :
            βˆƒ (K : ℝ), 0 ≀ K ∧ βˆ€ (y : β„•), βˆ‘ p ∈ Finset.range (y + 1) with Nat.Prime p, 1 / ↑p ^ 2 ≀ K

            Ξ£_{p ≀ y} 1/pΒ² is bounded by a constant depending only on Ξ£_{nβ‰₯1} 1/nΒ².

            theorem MathlibNt.SieveTheory.MertensTheorem.prime_inv_pminus1_bound :
            βˆƒ (C : ℝ), 0 ≀ C ∧ βˆ€ (y : β„•), 3 ≀ y β†’ βˆ‘ p ∈ Finset.range (y + 1) with Nat.Prime p, 1 / (↑p - 1) ≀ Real.log (Real.log ↑y) + C

            Ξ£_{p ≀ y} 1/(p-1) ≀ log(log y) + C for y β‰₯ 3, by Mertens' second theorem and a decomposition of each summand.

            Sieve-product asymptotic formula: V(z, N) β‰ˆ 𝔖(N, z-1) Β· e^(-Ξ³) / log(z-1).

            Here 𝔖(N, z) = Ξ _{p ≀ z, p.Prime} localFactor(p, N) is the truncated singular series (SingularSeries.singularSeriesTruncated).

            The singular-series factor cannot be omitted: N with many small odd prime factors contribute local corrections p/(p-1) that are not uniformly bounded. The asymptotic V β‰ˆ 𝔖(N)Β·e^{-Ξ³}/log z follows from (1 - 1/(p-1)) = (1 - 1/p)Β·(1 - 1/(p-1)Β²) at odd primes and Mertens' product formula. It underlies the calculation of the Jurkat-Richert main term X Β· V(z).

            The error must also be multiplied by the truncated singular series to obtain a consequence of Mertens' product formula uniform in N. The cutoff z - 1 corresponds exactly to the range p < z in goldbachSieveProduct.

            5. Auxiliary lemmas: the prime-counting function #

            Prime-counting function Ο€(x) = |{p ≀ x : p prime}|.

            Equations
            Instances For

              The project's finite prime count agrees definitionally with mathlib's Nat.primeCounting. This is the normalization needed when importing a PNT stated using mathlib's standard counting function.

              A prime-counting PNT in the normal form exported by PNTAnd's pi_alt.

              This is kept as a separate interface: adapting an external proof to the project toolchain only has to establish this proposition.

              Equations
              Instances For
                theorem MathlibNt.SieveTheory.MertensTheorem.primeCountingPNT_implies_prime_number_theorem (hPNT : PrimeCountingPNT) (Ξ΅ : ℝ) :
                0 < Ξ΅ β†’ βˆƒ (xβ‚€ : β„•), βˆ€ (x : β„•), xβ‚€ ≀ x β†’ |↑(primeCount x) - ↑x / Real.log ↑x| ≀ Ξ΅ * ↑x / Real.log ↑x

                The pi_alt normal form implies the epsilon formulation used by the project's PNT declaration.

                Ο€(x) β‰₯ 1 for x β‰₯ 2, since the prime 2 is counted.

                theorem MathlibNt.SieveTheory.MertensTheorem.prime_number_theorem (Ξ΅ : ℝ) :
                0 < Ξ΅ β†’ βˆƒ (xβ‚€ : β„•), βˆ€ (x : β„•), xβ‚€ ≀ x β†’ |↑(primeCount x) - ↑x / Real.log ↑x| ≀ Ξ΅ * ↑x / Real.log ↑x

                Prime number theorem (PNT): Ο€(x) ~ x / log x.

                That is, |Ο€(x) - x/log x| / (x/log x) β†’ 0 as x β†’ ∞. The PNT provides one possible route to Mertens' theorems, though elementary proofs are also available.

                6. The twin-prime constant and a finite truncation #

                Legacy finite truncation of the twin-prime Euler product.

                This is a working finite product, not the canonical infinite twin-prime constant, and it is not used to justify the canonical Chen endpoint.

                Equations
                Instances For

                  The legacy finite twin-prime product is positive because each factor is positive.

                  The finite twin-prime product is less than 1: every factor is in (0, 1), and the factor at p = 3 is 3/4 < 1.

                  6.5 Local interval factors #

                  theorem MathlibNt.SieveTheory.MertensTheorem.exists_log_goldbach_inverse_interval_bound :
                  βˆƒ (C : ℝ), 0 ≀ C ∧ βˆ€ (k n : β„•), 2 ≀ k β†’ k ≀ n β†’ βˆ€ (s : Finset β„•), (βˆ€ p ∈ s, Nat.Prime p ∧ k < p ∧ p ≀ n) β†’ Real.log (∏ p ∈ s, (1 - 1 / (↑p - 1))⁻¹) ≀ Real.log (Real.log ↑n / Real.log ↑k) + (2 * C + 24) / Real.log ↑k

                  A quantitative interval form of Mertens' second theorem for inverse Goldbach local factors. The error has the sharp inverse-logarithmic shape needed by the dimension-one sieve hypothesis.

                  theorem MathlibNt.SieveTheory.MertensTheorem.exists_goldbach_inverse_interval_bound :
                  βˆƒ (K : ℝ), 1 < K ∧ βˆ€ (s : Finset β„•), (βˆ€ p ∈ s, Nat.Prime p ∧ 2 < p) β†’ βˆ€ (z₁ zβ‚‚ : ℝ), 2 ≀ z₁ β†’ z₁ ≀ zβ‚‚ β†’ (βˆ€ p ∈ s, z₁ ≀ ↑p ∧ ↑p < zβ‚‚) β†’ ∏ p ∈ s, (1 - 1 / (↑p - 1))⁻¹ ≀ Real.log zβ‚‚ / Real.log z₁ * (1 + K / Real.log z₁)

                  The inverse Goldbach local factors on an arbitrary real interval satisfy the standard dimension-one product bound.

                  7. Mathematical scope #