Tao's twin prime constant and pair-sieve weight
DefinitionTaoFivePrimes_SingularSeriesThe twin prime constant and the pair-sieve weight
The twin prime constant is the Euler product
the leading factor being the contribution of the prime to the singular series of the prime-pair problem. The formalization works with the partial products
and defines the constant as , twice the infimum of the range of the partial products. Every factor lies in , so the partial products decrease; the infimum therefore coincides with the infinite product, while the formulation by an infimum keeps the estimate `every finite partial product dominates the full product' elementary, with no convergence machinery.
The second object is the pair-sieve weight used in Tao's proof of Proposition 4.10,
which records that is odd (the indicator ) and squarefree (the factor ), and attaches the local factor at each odd prime divisor of .
In Lean these are TaoFivePrimes.twinPrimePartial, TaoFivePrimes.twinPrimeConstant and TaoFivePrimes.pairSieveWeight.
import Mathlib.Data.Nat.Prime.Basic
import Mathlib.Data.Nat.Factors
import Mathlib.Data.Nat.Squarefree
import Mathlib.Algebra.Order.Archimedean.Real.Basic
/-!
# The twin prime constant and Tao's pair-sieve weight
Source: Terence Tao, *Every odd number greater than 1 is the sum of at most
five primes*, https://arxiv.org/abs/1201.6656, proof of Proposition 4.10.
The twin prime constant is the Euler product
`𝔖₂ = 2 ∏_{p>2} (1 - 1/(p-1)²)`, and the multiplicative weight `f` used in
the prime-pair sieve expansion is
`f(n) = 𝟙_{(n,2)=1} μ²(n) ∏_{p|n, p>2} 1/(p-2)`.
The infinite product is defined as twice the infimum of its partial products
`∏_{2<p≤Q} (1 - 1/(p-1)²)` over `Q`. Since each factor lies in `(0,1)`, the
partial products form a decreasing sequence whose limit is this infimum, so
the value coincides with the infinite product; the infimum formulation keeps
the facts needed in sieve estimates (every finite partial product dominates
the full product) elementary, with no convergence machinery.
-/
open scoped BigOperators
namespace TaoFivePrimes
/-- The partial Euler product over the odd primes `p` with `2 < p ≤ Q`. -/
noncomputable def twinPrimePartial (Q : ℕ) : ℝ :=
∏ p ∈ Finset.range (Q + 1),
if Nat.Prime p ∧ 2 < p then 1 - 1 / ((p : ℝ) - 1) ^ 2 else 1
/-- The twin prime constant `𝔖₂ = 2 ∏_{p>2} (1 - 1/(p-1)²)`, defined as twice
the infimum over `Q` of the partial products `twinPrimePartial Q`. -/
noncomputable def twinPrimeConstant : ℝ :=
2 * sInf (Set.range twinPrimePartial)
/-- Tao's pair-sieve weight
`f(n) = 𝟙_{(n,2)=1} μ²(n) ∏_{p|n, p>2} 1/(p-2)`
from the proof of Proposition 4.10. The condition `n % 2 = 1` encodes
`(n,2)=1`, and `Squarefree n` encodes `μ²(n) = 1`. -/
noncomputable def pairSieveWeight (n : ℕ) : ℝ :=
if n % 2 = 1 ∧ Squarefree n then
∏ p ∈ Nat.primeFactors n, if 2 < p then 1 / ((p : ℝ) - 2) else 1
else 0
end TaoFivePrimes