Szemerédi's theorem in the primes (Green–Tao)
Route AP replaces the twenty-two-prime pattern by long arithmetic progressions of good slope
primes. They come from two theorems: the good slope primes have positive relative density
(Proposition D), and every set of primes of positive relative upper density contains arithmetic
progressions of every finite length (Green and Tao, Theorem 1.2). This chapter proves the second in
Lean. It is the only part of the formalization that rests on code not written in this project: the
Lean proof of the Green–Tao theorem for the set of all primes by Vasily Ilin, from the repository
Vilin97/Autoformalization (directory green-tao/), distributed under the Apache License 2.0 and
vendored in this repository with its license and a notice of the changes made to port it. The
chapter extends that proof to dense sets of primes without changing any vendored file.
Notation: \(\lambda_{\alpha,W,b}\) is the W-tricked prime weight on \(\mathbb Z/N\) and \(\lambda^A_{\alpha,W,b}\) its restriction to a set \(A\); \(\Lambda_k(f)\) is the normalized count of \(k\)-term progressions in \(\mathbb Z/N\) weighted by \(f\).
The statements
DefinitionSzemerédi's theorem in the primes#✓
A set \(A\) of natural numbers contains arithmetic progressions of every finite length if for every \(k\) there are natural numbers \(a\) and \(b\ge1\) with \(a+bj\in A\) for every \(j<k\). A set \(A\) has positive relative upper density in the primes if there is a real \(c>0\) such that $\(c\,\pi(N)\le\#\bigl(A\cap[0,N]\bigr)\)$ for infinitely many \(N\), where \(\pi\) is the prime counting function; for a set of primes this says \(\limsup_{N\to\infty}\#(A\cap[1,N])/\pi(N)>0\).
Szemerédi's theorem in the primes, in its dense form, is the assertion that every set of primes of positive relative upper density contains arithmetic progressions of every finite length.
This is Theorem 1.2 of Green and Tao, with "infinitely many progressions" weakened to "one". Green and Tao prove it in outline; Tao and Ziegler give a complete proof. Route AP needs it for the good slope primes above \(\max S_b\). It was first a hypothesis of the route AP variants of the main theorem; it is proved in this chapter (Szemerédi's theorem in the primes holds).
def GreenTaoDense : Prop :=
∀ A : Set ℕ, A ⊆ {p | p.Prime} → PrimesRelUpperDensityPos A → ContainsArbitraryAPs A
def ContainsArbitraryAPs (A : Set ℕ) : Prop :=
∀ k : ℕ, ∃ a b : ℕ, 1 ≤ b ∧ ∀ j : ℕ, j < k → a + b * j ∈ A
def PrimesRelUpperDensityPos (A : Set ℕ) : Prop :=
∃ c : ℝ, 0 < c ∧ ∃ᶠ N in atTop,
c * (Nat.primeCounting N : ℝ) ≤ (((Finset.range (N + 1)).filter (· ∈ A)).card : ℝ)
def PrimesRelUpperDensityPos (A : Set ℕ) : Prop :=
∃ c : ℝ, 0 < c ∧ ∃ᶠ N in atTop,
c * (Nat.primeCounting N : ℝ) ≤ (((Finset.range (N + 1)).filter (· ∈ A)).card : ℝ)
ZInQKernel/Hypotheses/GreenTao.lean:33
def ContainsArbitraryAPs (A : Set ℕ) : Prop :=
∀ k : ℕ, ∃ a b : ℕ, 1 ≤ b ∧ ∀ j : ℕ, j < k → a + b * j ∈ A
ZInQKernel/Hypotheses/GreenTao.lean:26
Used by 7
TheoremThe Green–Tao theorem#✓
The set of primes contains arithmetic progressions of every finite length: for every \(k\) there are natural numbers \(a\) and \(b\ge1\) such that \(a+bj\) is prime for every \(j<k\).
This is Theorem 1.1 of Green and Tao. Its Lean proof is not written in this project: it is Vasily Ilin's proof from the repository Vilin97/Autoformalization (its green-tao directory, commit 0dc67d87416c19690dd641a178ada32cca95c651), produced under Ilin's direction as a submission to the Green–Tao target of the lean-eval benchmark and distributed under the Apache License 2.0. It is vendored in this repository with its license and a notice, and ported to the project's Lean and Mathlib versions with proof edits only; its statement is unchanged, and it is the statement here, since the two definitions of "contains arithmetic progressions of every finite length" agree word for word.
Proof sketch. The vendored proof follows Green and Tao. After the W-trick (restricting to a reduced residue class \(b\) modulo \(W=\prod_{p\le w}p\) and weighting the primes \(Wn+b\) by \(\log(Wn+b)\)), the weighted primes in a cyclic group \(\mathbb Z/N\) of prime order are bounded by a Selberg-sieve majorant \(\nu\) that satisfies the linear forms condition. The relative Szemerédi theorem (transference: a weight \(0\le f\le\nu\) of positive mean has a dense model) and the dense Szemerédi theorem, from the hypergraph removal lemma, give a positive count of \(k\)-term progressions weighted by \(f\); the diagonal progressions are negligible, so some progression with nonzero difference has positive weight at every term, and a short-interval lift turns it into a progression of primes. Lengths \(k\le2\) come from the progression \(2,3\).
theorem greenTao_primes : ContainsArbitraryAPs {p : ℕ | p.Prime}
theorem green_tao : ContainsArbitraryAPs {p : ℕ | Nat.Prime p}
def ContainsArbitraryAPs (A : Set ℕ) : Prop :=
∀ k : ℕ, ∃ a b : ℕ, 1 ≤ b ∧ ∀ j : ℕ, j < k → a + b * j ∈ A
ZInQKernel/Hypotheses/GreenTao.lean:26
def ContainsArbitraryAPs (A : Set ℕ) : Prop :=
∀ k : ℕ, ∃ a b : ℕ, 1 ≤ b ∧ ∀ j : ℕ, j < k → a + b * j ∈ A
ThirdParty/GreenTao/ChallengeDeps.lean:23
Lean
The proof is directory green-tao/ of Vilin97/Autoformalization at commit
0dc67d87416c19690dd641a178ada32cca95c651, submitted to the lean-eval target green_tao, and vendored
under ThirdParty/GreenTao/ with its license and NOTICE.md. ZInQ.ContainsArbitraryAPs and
LeanEval.NumberTheory.ContainsArbitraryAPs have the same definition.
Sources
Uses 1 · Informal links 1
From density to windows
The density hypothesis counts all of \([0,N]\) at infinitely many \(N\); the W-trick samples a window \((X/4,X]\) at a scale tied to the cyclic modulus. A dyadic decomposition and Chebyshev's lower bound put a fixed share of the mass into some window of ratio \(2\), and Bertrand's postulate chooses a prime modulus whose sampled window contains most of it.
TheoremThe window lemma#✓
Let \(A\) be a set of natural numbers of positive relative upper density in the primes, with \(c\,\pi(N)\le\#(A\cap[0,N])\) for infinitely many \(N\), where \(c>0\). Put \(c_1=c\log2/24\). Then for infinitely many \(Z\), $\(\#\bigl(A\cap(\lfloor Z/2\rfloor,Z]\bigr)\ge\frac{c_1Z}{\log Z}.\)$ In particular some \(c_1>0\) has this property.
The set \(A\) need not consist of primes. The point is that the density hypothesis, which counts all of \([0,N]\), yields mass in a window of ratio \(2\), which is what the sampling of the W-trick sees.
Proof sketch. Let \(N\) be large with \(c\,\pi(N)\le\#(A\cap[0,N])\), and let \(J\) be the largest integer with \(2^J\le\lfloor\sqrt N\rfloor\). Cut \([0,N]\) into the tail \([0,\lfloor N/2^J\rfloor]\) and the windows \((\lfloor N/2^{j+1}\rfloor,\lfloor N/2^j\rfloor]\) for \(j<J\). The tail has at most \(2\sqrt N+1\) elements. Every window has \(Z_j=\lfloor N/2^j\rfloor\ge\lfloor\sqrt N\rfloor\), so \(\log Z_j\ge\frac13\log N\) for large \(N\), and \(Z_j\) tends to infinity with \(N\). If every window had fewer than \(c_1Z_j/\log Z_j\) elements of \(A\), the windows together would hold fewer than \(\sum_j 3c_1Z_j/\log N\le6c_1N/\log N=\frac c4\log2\cdot N/\log N\) elements. Chebyshev's lower bound \(\pi(N)\log N\ge N\log2-\log(N+1)\) then gives \(c\,\pi(N)>\#(A\cap[0,N])\) once the error terms \((2\sqrt N+2)\log N+c\log(N+1)\) are below \(\frac34c\log2\cdot N\), which holds for large \(N\) because \(\sqrt x\log x=o(x)\). So for every large such \(N\) some window, with \(Z_j\ge\lfloor\sqrt N\rfloor\), is good. Only the lower bound for \(\pi\) is used.
theorem frequently_window {A : Set ℕ} (h : ZInQ.PrimesRelUpperDensityPos A) :
∃ c₁ : ℝ, 0 < c₁ ∧ ∃ᶠ Z : ℕ in atTop, c₁ * Z / Real.log Z ≤
(((Ioc (Z / 2) Z).filter (· ∈ A)).card : ℝ)
theorem frequently_window_of {A : Set ℕ} [DecidablePred (· ∈ A)] {c : ℝ} (hc : 0 < c)
(h : ∃ᶠ N in atTop, c * (Nat.primeCounting N : ℝ) ≤
(((range (N + 1)).filter (· ∈ A)).card : ℝ)) :
∃ᶠ Z : ℕ in atTop, c * Real.log 2 / 24 * Z / Real.log Z ≤
(((Ioc (Z / 2) Z).filter (· ∈ A)).card : ℝ)
theorem card_filter_range_le_add_Ioc (A : Set ℕ) [DecidablePred (· ∈ A)] {a b : ℕ} (_hab : a ≤ b) :
((range (b + 1)).filter (· ∈ A)).card ≤
((range (a + 1)).filter (· ∈ A)).card + ((Ioc a b).filter (· ∈ A)).card
def PrimesRelUpperDensityPos (A : Set ℕ) : Prop :=
∃ c : ℝ, 0 < c ∧ ∃ᶠ N in atTop,
c * (Nat.primeCounting N : ℝ) ≤ (((Finset.range (N + 1)).filter (· ∈ A)).card : ℝ)
ZInQKernel/Hypotheses/GreenTao.lean:33
Uses 1 · Used by 1
TheoremChoosing the prime modulus#✓
Let \(A\) be a set of natural numbers and \(c_1>0\) such that \(\#(A\cap(\lfloor Z/2\rfloor,Z])\ge c_1Z/\log Z\) for infinitely many \(Z\). Then for every \(W>0\) and every bound \(Q_0\) there is a prime \(q\ge Q_0\) such that \(X=W\lfloor q/8\rfloor\) satisfies \(X\ge Q_0\) and $\(\#\bigl(A\cap(\lfloor X/4\rfloor,X]\bigr)\ge\frac{c_1}{6}\cdot\frac{X}{\log X}.\)$
The scale \(X=W\lfloor q/8\rfloor\) and the window \((X/4,X]\) are those that the W-trick of the Green–Tao proof samples in the cyclic group of order \(q\).
Proof sketch. Bertrand. For any \(Z\) put \(m=\lfloor Z/W\rfloor+1\); Bertrand's postulate gives a prime \(q\) with \(8m<q\le16m\), so \(m\le\lfloor q/8\rfloor\le2m\), hence \(q>8\lfloor Z/W\rfloor\) and \(Z\le W\lfloor q/8\rfloor\le2Z+2W\). Window transfer. For \(Z\le X\le2Z+2W\), the window \((\lfloor Z/2\rfloor,Z]\) lies in \((\lfloor X/4\rfloor,X]\) up to the at most \(W/2+1\) integers of \((\lfloor Z/2\rfloor,\lfloor X/4\rfloor]\). Now take a good \(Z\) so large that \(\log Z\le c_1Z/(2(W+1))\) and \(Z\ge Q_0W+2W+Q_0+3\). Then \(q\ge Q_0\), \(X\ge Z\ge Q_0\), \(X\le3Z\), and \(c_1Z/\log Z\ge2(W+1)\), so \(A\) has at least \(\frac12c_1Z/\log Z\ge\frac{c_1}6X/\log X\) elements in \((\lfloor X/4\rfloor,X]\), using \(X\le3Z\) and \(\log Z\le\log X\).
theorem exists_prime_modulus_of_frequently_window {A : Set ℕ} [DecidablePred (· ∈ A)] {c₁ : ℝ}
(hc₁ : 0 < c₁)
(h : ∃ᶠ Z : ℕ in atTop, c₁ * Z / Real.log Z ≤ (((Ioc (Z / 2) Z).filter (· ∈ A)).card : ℝ))
{W : ℕ} (hW : 0 < W) (Q₀ : ℕ) :
∃ q : ℕ, q.Prime ∧ Q₀ ≤ q ∧ Q₀ ≤ W * (q / 8) ∧
c₁ / 6 * ((W * (q / 8) : ℕ) : ℝ) / Real.log ((W * (q / 8) : ℕ) : ℝ) ≤
(((Ioc (W * (q / 8) / 4) (W * (q / 8))).filter (· ∈ A)).card : ℝ)
theorem exists_prime_scale_near (W Z : ℕ) (hW : 0 < W) :
∃ q : ℕ, q.Prime ∧ 8 * (Z / W) < q ∧ Z ≤ W * (q / 8) ∧ W * (q / 8) ≤ 2 * Z + 2 * W
theorem card_window_le_card_quarter (A : Set ℕ) [DecidablePred (· ∈ A)] {W Z X : ℕ}
(hZX : Z ≤ X) (hX : X ≤ 2 * Z + 2 * W) :
((Ioc (Z / 2) Z).filter (· ∈ A)).card ≤ ((Ioc (X / 4) X).filter (· ∈ A)).card + (W / 2 + 1)
Used by 1
The weight of a set of primes
The weight of \(A\) is the prime weight times the indicator of \(A\). It lies below the prime weight, so majorization and the height bound carry over; positivity now means membership in \(A\), and the residue pigeonhole runs over the elements of \(A\) only.
DefinitionThe W-tricked weight of a set of primes#✓
Let \(N\ge1\), let \(\alpha\) be real and \(W,b\) natural numbers, and for \(n\in\mathbb Z/N\) let \(\bar n\) be its representative in \([0,N)\). The W-tricked prime weight of the Green–Tao proof is $\(\lambda_{\alpha,W,b}(n)=\begin{cases}\alpha\,\dfrac{\varphi(W)}{W}\log(W\bar n+b)&\text{if } \lfloor N/64\rfloor\le\bar n\le\lfloor N/4\rfloor\text{ and }W\bar n+b\text{ is prime},\\[1ex] 0&\text{otherwise.}\end{cases}\)$ For a set \(A\) of natural numbers, the W-tricked weight of \(A\) is \(\lambda^A_{\alpha,W,b}(n)=\lambda_{\alpha,W,b}(n)\) if \(W\bar n+b\in A\) and \(0\) otherwise. If \(\alpha\ge0\), then \(0\le\lambda^A_{\alpha,W,b}\le\lambda_{\alpha,W,b}\); if \(\alpha>0\) and \(W>0\), then \(\lambda^A_{\alpha,W,b}(n)>0\) exactly when \(\lfloor N/64\rfloor\le\bar n\le\lfloor N/4\rfloor\) and \(W\bar n+b\) is a prime in \(A\).
The bound \(\lambda^A\le\lambda\) is what lets the weight of \(A\) inherit, unchanged, the majorization of the prime weight by the Selberg-sieve majorant and its pointwise height bound.
noncomputable def wTrickedSetWeight {N : ℕ} [NeZero N] (A : Set ℕ) (α : ℝ) (W b : ℕ)
(n : ZMod N) : ℝ :=
if wTrickedValue W b n ∈ A then wTrickedPrimeWeight α W b n else 0
theorem wTrickedSetWeight_nonneg (hα : 0 ≤ α) (W b : ℕ) (n : ZMod N) :
0 ≤ wTrickedSetWeight A α W b n
theorem wTrickedSetWeight_le (hα : 0 ≤ α) (W b : ℕ) (n : ZMod N) :
wTrickedSetWeight A α W b n ≤ wTrickedPrimeWeight α W b n
def wTrickedValue {N : ℕ} [NeZero N]
(W b : ℕ) (n : ZMod N) : ℕ :=
W * n.val + b
ThirdParty/GreenTao/Submission/Primes/WTrick.lean:41
noncomputable def wTrickedPrimeWeight {N : ℕ} [NeZero N]
(α : ℝ) (W b : ℕ) (n : ZMod N) : ℝ :=
if n.val ∈ greenTaoInterval N ∧ Nat.Prime (wTrickedValue W b n) then
α * ((W.totient : ℝ) / W) * Real.log (wTrickedValue W b n)
else
0
ThirdParty/GreenTao/Submission/Primes/WTrick.lean:46
noncomputable def wTrickedSetWeight {N : ℕ} [NeZero N] (A : Set ℕ) (α : ℝ) (W b : ℕ)
(n : ZMod N) : ℝ :=
if wTrickedValue W b n ∈ A then wTrickedPrimeWeight α W b n else 0
ZInQKernel/External/GreenTaoDense/SetWeight.lean:30
TheoremExtraction of a progression in the set#✓
Let \(A\) be a set of natural numbers, \(k\ge2\), \(N\ge1\), \(\alpha>0\), \(W>0\) and \(b\) natural. If the off-diagonal mass of the weight of \(A\) is positive, $\(\sum_{a\in\mathbb Z/N}\ \sum_{d\in\mathbb Z/N,\ d\ne0}\ \prod_{j<k}\lambda^A_{\alpha,W,b}(a+jd)>0,\)$ then \(A\) contains a \(k\)-term arithmetic progression: there are natural numbers \(a'\) and \(d'>0\) with \(a'+jd'\in A\) for every \(j<k\).
Proof sketch. Some \(a\) and \(d\ne0\) have \(\lambda^A(a+jd)>0\) for every \(j<k\). By the positivity criterion of the weight, every representative \(\overline{a+jd}\) lies in \([\lfloor N/64\rfloor,\lfloor N/4\rfloor]\), an interval of less than half the length of \(\mathbb Z/N\), and \(W\overline{a+jd}+b\in A\). The short-interval lift of the vendored proof turns a cyclic progression inside such an interval into an integer progression with positive difference in \(\{n:Wn+b\in A\}\), and the affine map \(n\mapsto Wn+b\) carries it into \(A\). This is the vendored extraction for the primes, with the positivity criterion of the weight of \(A\) in place of that of the prime weight.
theorem containsAP_of_wTrickedSetWeight_offDiagMass_pos {A : Set ℕ} {k N : ℕ} [NeZero N]
(hk : 2 ≤ k) {α : ℝ} (hα : 0 < α) {W : ℕ} (hW : 0 < W) (b : ℕ)
(hmass : 0 < cyclicAPOffDiagMass k N (wTrickedSetWeight A α W b)) :
ContainsAP A k
noncomputable def cyclicAPOffDiagMass (k N : ℕ) [NeZero N]
(f : ZMod N → ℝ) : ℝ :=
∑ a : ZMod N,
∑ d ∈ (Finset.univ.filter fun d : ZMod N => d ≠ 0),
cyclicAPProduct k N f a d
ThirdParty/GreenTao/Submission/ArithmeticProgression/CountExtraction.lean:29
noncomputable def wTrickedSetWeight {N : ℕ} [NeZero N] (A : Set ℕ) (α : ℝ) (W b : ℕ)
(n : ZMod N) : ℝ :=
if wTrickedValue W b n ∈ A then wTrickedPrimeWeight α W b n else 0
ZInQKernel/External/GreenTaoDense/SetWeight.lean:30
def ContainsAP (A : Set ℕ) (k : ℕ) : Prop :=
∃ a d : ℕ, IsAPIn A k a d
ThirdParty/GreenTao/Submission/ArithmeticProgression/Basic.lean:12
Uses 1 · Used by 1
TheoremThe residue pigeonhole for a set of primes#✓
Let \(A\) be a set of natural numbers, \(w\) and \(N\ge1\) natural numbers, \(\alpha\ge0\), \(W=\prod_{p\le w}p\) and \(X=W\lfloor N/8\rfloor\), and suppose \(w\le\lfloor X/4\rfloor\). Let \(S\) be the set of primes \(p\in A\) with \(\lfloor X/4\rfloor<p\le X\). Then there is a residue \(0\le b<W\) coprime to \(W\) such that the mean of the W-tricked weight of \(A\) over \(\mathbb Z/N\) satisfies $\(\frac1N\sum_{n\in\mathbb Z/N}\lambda^A_{\alpha,W,b}(n)\ \ge\ \frac{\alpha}{W}\cdot\frac{\#S\cdot\log(\lfloor X/4\rfloor+1)}{N}.\)$
Proof sketch. Every \(p\in S\) exceeds \(w\), so it is coprime to \(W\); pigeonholing \(S\) over the \(\varphi(W)\) reduced classes gives a class \(b\) with \(\#S\le\varphi(W)\,\#S_b\), where \(S_b\) is the set of \(p\in S\) with \(p\equiv b\pmod W\). Each \(p\in S_b\) is \(W\bar n+b\) for the residue \(n\) of \((p-b)/W\), which lies in \([\lfloor N/64\rfloor,\lfloor N/4\rfloor]\), and these \(n\) are distinct; at each, \(\lambda^A(n)=\alpha\frac{\varphi(W)}W\log p\ge\alpha\frac{\varphi(W)}W\log(\lfloor X/4\rfloor+1)\). Summing over \(S_b\) and dividing by \(N\) gives the bound. This is the vendored density selection with the primes of \((\lfloor X/4\rfloor,X]\) replaced by the elements of \(A\) among them; the original pigeonhole is already stated for an arbitrary finite set of primes above \(w\).
theorem exists_reducedResidue_setWeight_mean_lower_bound (A : Set ℕ) {w N : ℕ} [NeZero N]
{α : ℝ} (hα : 0 ≤ α) (hw : w ≤ wTrickPrimeScale (primorial w) N / 4) :
∃ b ∈ reducedResidues (primorial w),
(((α / (primorial w : ℝ)) *
(#((primesInQuarterInterval (wTrickPrimeScale (primorial w) N)).filter (· ∈ A)) : ℝ) *
log (wTrickPrimeScale (primorial w) N / 4 + 1 : ℕ)) / N) ≤
mean (wTrickedSetWeight A α (primorial w) b : ZMod N → ℝ)
noncomputable def quarterIntervalSetClass (A : Set ℕ) (W N b : ℕ) : Finset ℕ :=
(quarterIntervalResidueClass W N b).filter (· ∈ A)
theorem wTrickedSetWeight_untrickPrimeZMod (α : ℝ) (hW : 0 < W) {p : ℕ}
(hp : p ∈ quarterIntervalSetClass A W N b) :
wTrickedSetWeight A α W b (untrickPrimeZMod N W b p) =
α * ((W.totient : ℝ) / W) * log p
def wTrickPrimeScale (W N : ℕ) : ℕ :=
W * (N / 8)
ThirdParty/GreenTao/Submission/Primes/WTrickDensity.lean:22
def reducedResidues (W : ℕ) : Finset ℕ :=
{b ∈ Finset.range W | W.Coprime b}
ThirdParty/GreenTao/Submission/Primes/ReducedResidues.lean:12
def primesInQuarterInterval (X : ℕ) : Finset ℕ :=
{p ∈ Finset.range (X + 1) | p.Prime ∧ X / 4 < p}
ThirdParty/GreenTao/Submission/Primes/Chebyshev.lean:10
noncomputable def mean {α : Type*} [Fintype α] (f : α → ℝ) : ℝ :=
𝔼 x, f x
ThirdParty/GreenTao/Submission/Finite/Mean.lean:19
noncomputable def wTrickedSetWeight {N : ℕ} [NeZero N] (A : Set ℕ) (α : ℝ) (W b : ℕ)
(n : ZMod N) : ℝ :=
if wTrickedValue W b n ∈ A then wTrickedPrimeWeight α W b n else 0
ZInQKernel/External/GreenTaoDense/SetWeight.lean:30
def quarterIntervalResidueClass (W N b : ℕ) : Finset ℕ :=
residueFiber (primesInQuarterInterval (wTrickPrimeScale W N)) W b
ThirdParty/GreenTao/Submission/Primes/WTrickDensity.lean:27
noncomputable def quarterIntervalSetClass (A : Set ℕ) (W N b : ℕ) : Finset ℕ :=
(quarterIntervalResidueClass W N b).filter (· ∈ A)
ZInQKernel/External/GreenTaoDense/SetWeight.lean:104
def untrickPrimeZMod (N W b p : ℕ) : ZMod N :=
(untrickPrime W b p : ℕ)
ThirdParty/GreenTao/Submission/Primes/WTrickDensity.lean:46
Uses 1 · Used by 1
Transference
The relative Szemerédi theorem of the vendored proof holds for every weight below the sieve majorant; restated for every large prime modulus and every density, it applies to the weight of \(A\).
TheoremTransference for every large prime modulus#✓
For \(k\ge3\) let \(\alpha_k>0\) be the scale of the W-tricked prime weight in the Green–Tao proof (the constant fixed there from \(k\) and the normalizer of the smooth sieve cutoff, small enough that the weight lies below the sieve majorant). For \(f:\mathbb Z/N\to\mathbb R\) write \(\mathbb E f=\frac1N\sum_nf(n)\) and \(\Lambda_k(f)=\mathbb E_{a,d\in\mathbb Z/N}\prod_{j<k}f(a+jd)\).
For every \(k\ge3\) and every \(\delta>0\) there are a natural number \(w\) and a real \(c>0\) such that, with \(W=\prod_{p\le w}p\), for every sufficiently large \(M\) with \(N=M+1\) prime, every residue \(0\le b<W\) coprime to \(W\) and every \(f:\mathbb Z/N\to\mathbb R\) with $\(0\le f\le\lambda_{\alpha_k,W,b}\qquad\text{and}\qquad\mathbb Ef\ge\delta,\)$ the count satisfies \(\Lambda_k(f)\ge c\).
The Green–Tao proof for the set of all primes shows this only for the prime weight itself, at one prime modulus beyond each bound, and for one fixed density. The proof never uses more: the change is in the quantifiers.
Proof sketch. Write \(k=r+2\). The dense Szemerédi theorem, from the ordered hypergraph removal of the vendored proof, gives for density \(\delta/2\) a count \(\Lambda_k(g)\ge c_0>0\) for every \(g:\mathbb Z/N\to[0,1]\) with \(\mathbb Eg\ge\delta/2\), uniformly in \(N\). The parameter package of the relative counting step, chosen for the reserves \(\delta/2\) and \(c_0/2\), and the linear forms condition of the Selberg-sieve majorant \(\nu_b\), uniform over the reduced classes \(b\), fix \(w\) and a threshold. For \(N=M+1\) prime and large, \(N\) is coprime to \((r+1)!\), the prime weight lies below \(\nu_b\) for every \(b<W\) at once, and so does every \(f\le\lambda\). The relative Szemerédi theorem, which holds for every \(0\le f\le\nu\), then gives \(\Lambda_k(f)\ge c_0-c_0/2=c\). The deep inputs, the hypergraph removal lemma and the linear forms estimate for the majorant, are those of the vendored proof, used unchanged.
theorem hasPrimeModulusSubweightCounts : HasPrimeModulusSubweightCounts
def HasPrimeModulusSubweightCounts : Prop :=
∀ k : ℕ, 3 ≤ k → ∀ δ : ℝ, 0 < δ →
∃ (w : ℕ) (c : ℝ), 0 < c ∧
∀ᶠ M : ℕ in atTop, Nat.Prime (M + 1) →
∀ b ∈ reducedResidues (primorial w), ∀ f : ZMod (M + 1) → ℝ,
(∀ x, 0 ≤ f x) →
(∀ x, f x ≤ wTrickedPrimeWeight (primeScale k standardSmoothSieveCutoff.normalizer)
(primorial w) b x) →
δ ≤ mean f → c ≤ cyclicAPCount k (M + 1) f
theorem hasPrimeModulusSubweightCounts_of_orderedRemoval_of_linearForms
(hremoval : HasOrderedRemovalForAllAPLengths)
(hsieve : HasStandardCyclicMajorantLinearForms) :
HasPrimeModulusSubweightCounts
def HasPrimeModulusSubweightCounts : Prop :=
∀ k : ℕ, 3 ≤ k → ∀ δ : ℝ, 0 < δ →
∃ (w : ℕ) (c : ℝ), 0 < c ∧
∀ᶠ M : ℕ in atTop, Nat.Prime (M + 1) →
∀ b ∈ reducedResidues (primorial w), ∀ f : ZMod (M + 1) → ℝ,
(∀ x, 0 ≤ f x) →
(∀ x, f x ≤ wTrickedPrimeWeight (primeScale k standardSmoothSieveCutoff.normalizer)
(primorial w) b x) →
δ ≤ mean f → c ≤ cyclicAPCount k (M + 1) f
ZInQKernel/External/GreenTaoDense/PrimeModulusTransference.lean:30
def reducedResidues (W : ℕ) : Finset ℕ :=
{b ∈ Finset.range W | W.Coprime b}
ThirdParty/GreenTao/Submission/Primes/ReducedResidues.lean:12
noncomputable def wTrickedPrimeWeight {N : ℕ} [NeZero N]
(α : ℝ) (W b : ℕ) (n : ZMod N) : ℝ :=
if n.val ∈ greenTaoInterval N ∧ Nat.Prime (wTrickedValue W b n) then
α * ((W.totient : ℝ) / W) * Real.log (wTrickedValue W b n)
else
0
ThirdParty/GreenTao/Submission/Primes/WTrick.lean:46
noncomputable def primeScale (k : ℕ)
(cutoffNormalizer : ℝ) : ℝ :=
min (1 / 2)
(sieveExponent k / (8 * cutoffNormalizer))
ThirdParty/GreenTao/Submission/GreenTao/Parameters.lean:39
noncomputable def standardSmoothSieveCutoff : SmoothSieveCutoff where
toFun := standardSmoothSieveBump
smooth := ContDiffBump.contDiff standardSmoothSieveBump
nonneg := fun x ↦ ContDiffBump.nonneg' standardSmoothSieveBump x
le_one := fun _ ↦ ContDiffBump.le_one standardSmoothSieveBump
support_subset := by
rw [ContDiffBump.support_eq]
intro x hx
have habs : |x| < 1 := by
simpa [standardSmoothSieveBump, Metric.mem_ball, Real.dist_eq] using hx
exact ⟨(abs_lt.mp habs).1.le, (abs_lt.mp habs).2.le⟩
zero_of_one_le := by
⋯
ThirdParty/GreenTao/Submission/Sieve/SmoothCutoff.lean:139
noncomputable def mean {α : Type*} [Fintype α] (f : α → ℝ) : ℝ :=
𝔼 x, f x
ThirdParty/GreenTao/Submission/Finite/Mean.lean:19
noncomputable def cyclicAPCount (k N : ℕ) [NeZero N]
(f : ZMod N → ℝ) : ℝ :=
mean₂ (fun a d => cyclicAPProduct k N f a d)
ThirdParty/GreenTao/Submission/ArithmeticProgression/Count.lean:31
def HasOrderedRemovalForAllAPLengths : Prop :=
∀ k : ℕ, 3 ≤ k →
HasUniformOrderedPatternRemoval k (k - 1)
ThirdParty/GreenTao/Submission/GreenTao/FinalTransferenceAssembly.lean:30
def HasStandardCyclicMajorantLinearForms : Prop :=
∀ k : ℕ, 3 ≤ k →
∀ η : ℝ, 0 < η →
∃ w : ℕ,
exceptionalPrimeBound
(fun q : CFZFormIndex k => cfzAffineForm q) ≤ w ∧
∀ᶠ M : ℕ in atTop,
∀ b : ℕ, b ∈ reducedResidues (primorial w) →
HasLinearFormsCondition k (M + 1)
(standardSmoothSieveCutoff.cyclicMajorant
(sieveLevel k (M + 1))
(primorial w) b)
⋯
ThirdParty/GreenTao/Submission/GreenTao/FinalTransferenceAssembly.lean:40
Uses 1 · Used by 2
Assembly
TheoremProgressions in a set of primes with mass in dyadic windows#✓
Let \(A\) be a set of primes and \(c_1>0\) such that \(\#(A\cap(\lfloor Z/2\rfloor,Z])\ge c_1Z/\log Z\) for infinitely many \(Z\). Then for every \(k\) the set \(A\) contains a \(k\)-term arithmetic progression: there are natural numbers \(a\) and \(d>0\) with \(a+jd\in A\) for every \(j<k\).
Proof sketch. For \(k\le2\) truncate a progression of length \(3\); so let \(k\ge3\) and \(\alpha=\alpha_k\). Put \(c_2=c_1/6\) and \(\delta=\alpha c_2/32\), fixed before \(w\). Transference for every large prime modulus gives \(w\), \(c>0\) and a threshold; put \(W=\prod_{p\le w}p\). The modulus selection gives a prime \(q=M+1\) beyond the transference threshold, the threshold of the height bound \((2\alpha\log q)^k<qc\) and \(2W+4w+16\), such that \(A\) has at least \(c_2X/\log X\) elements in \((\lfloor X/4\rfloor,X]\), \(X=W\lfloor q/8\rfloor\); these are primes, so they form the set \(S\) of the residue pigeonhole. The pigeonhole gives a reduced class \(b\) with \(\mathbb E\lambda^A\ge\frac\alpha W\#S\log(\lfloor X/4\rfloor+1)/q\), and the vendored Chebyshev arithmetic, with the constant \(\log2/4\) replaced by \(c_2\), bounds this below by \(\alpha c_2/32=\delta\). Since \(0\le\lambda^A\le\lambda\), transference gives \(\Lambda_k(\lambda^A)\ge c\). The weight is at most \(2\alpha\log q\), so the diagonal progressions (\(d=0\)) carry less than the count, and the off-diagonal mass is positive. Extraction gives the progression in \(A\).
theorem containsAP_of_frequently_window (hT : HasPrimeModulusSubweightCounts) {A : Set ℕ}
(hA : A ⊆ {p | p.Prime}) {c₁ : ℝ} (hc₁ : 0 < c₁)
(hwin : ∃ᶠ Z : ℕ in atTop, c₁ * Z / Real.log Z ≤
(((Ioc (Z / 2) Z).filter (· ∈ A)).card : ℝ)) (k : ℕ) :
ContainsAP A k
def HasPrimeModulusSubweightCounts : Prop :=
∀ k : ℕ, 3 ≤ k → ∀ δ : ℝ, 0 < δ →
∃ (w : ℕ) (c : ℝ), 0 < c ∧
∀ᶠ M : ℕ in atTop, Nat.Prime (M + 1) →
∀ b ∈ reducedResidues (primorial w), ∀ f : ZMod (M + 1) → ℝ,
(∀ x, 0 ≤ f x) →
(∀ x, f x ≤ wTrickedPrimeWeight (primeScale k standardSmoothSieveCutoff.normalizer)
(primorial w) b x) →
δ ≤ mean f → c ≤ cyclicAPCount k (M + 1) f
ZInQKernel/External/GreenTaoDense/PrimeModulusTransference.lean:30
def ContainsAP (A : Set ℕ) (k : ℕ) : Prop :=
∃ a d : ℕ, IsAPIn A k a d
ThirdParty/GreenTao/Submission/ArithmeticProgression/Basic.lean:12
TheoremSzemerédi's theorem in the primes holds#✓
Every set of primes of positive relative upper density contains arithmetic progressions of every finite length.
This is Theorem 1.2 of Green and Tao (in the weakened form of Szemerédi's theorem in the primes), proved here by extending the vendored Lean proof of the Green–Tao theorem from the set of all primes to dense subsets. No vendored file is changed: the steps that use a property of the set of all primes are redone for the subset in new files, those adapted from vendored proofs under the vendored proof's Apache License.
Proof sketch. Let \(A\) be a set of primes of positive relative upper density and \(k\) a length. The window lemma gives \(c_1>0\) with \(\#(A\cap(\lfloor Z/2\rfloor,Z])\ge c_1Z/\log Z\) for infinitely many \(Z\). Transference holds for every large prime modulus and every weight below the W-tricked prime weight, so the theorem on progressions in a set with mass in dyadic windows applies and gives a \(k\)-term progression in \(A\) with positive difference.
The proof for all primes uses three properties that a dense set lacks: Chebyshev's lower bound in the fixed window \((X/4,X]\) at every large scale, a modulus chosen freely after the density, and the progression \(2,3\) for the small lengths. They are replaced by the window lemma, the Bertrand modulus selection with transference at every large prime modulus, and truncation of a progression of length \(3\).
theorem _root_.ZInQ.greenTaoDense : ZInQ.GreenTaoDense
def GreenTaoDense : Prop :=
∀ A : Set ℕ, A ⊆ {p | p.Prime} → PrimesRelUpperDensityPos A → ContainsArbitraryAPs A
ZInQKernel/Hypotheses/GreenTao.lean:51
Informally uses
Sources
Uses 4 · Used by 3 · Informal links 1
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.