RiemannA guide by Principia Superintelligence

Part II, chapter 12

From the table to G(x)

Averaging over translates forgets the column, the product of two quadratic characters expands into four smoothed prime sums, and two classical estimates do the rest: the three twisted sums are small for a well-chosen pair of auxiliary primes, and the cells with tiny weights are negligible. Together they give the bound on G(x)G(x) that chapter 4 turns into the Riemann Hypothesis. Behrend's construction and a random choice supply the two sets of columns.

draft, under review24 minfirst published in v0.1.0, 2026-11-22

Each cell is an arithmetic progression

This chapter is classical analytic number theory, and the exposition proves it in full from (M) and two estimates (Part II, §4–5; Part III, §III.1–III.3). The prime powers in a given cell are those in one pair of residue classes ±c\pm c modulo NN with a prescribed value of χq\chi_q; the coefficient 1−χd1 - \chi_d then selects the odd powers of primes inert in Q(−d)\mathbb Q(\sqrt{-d}). For fixed moduli and scale tending to infinity, the prime number theorem in progressions gives each cell the fraction 1/(2n)1/(2n) of the primes, half of them inert, and MM of chapter 11 is the resulting main term, with its constants. The identity P−M=∑iwiRi(a/wi)P - M = \sum_i w_i R_i(a/w_i) is exact, but no uniformity is claimed at this point: at the scale xx there are far more cells than primes, and a single Ri(x)R_i(x) need not be small. The argument uses only the average over translates. At the large scale the uniformity is Estimate C.

Two scales. A cell with weight wiw_i tests primes up to a/wia/w_i. For a distinguished cell this is a/b≈xa/b \approx x: the scale we care about. For every other cell it is at least 13exp⁡(xε/3)\tfrac13\exp(x^{\varepsilon/3}), an enormous scale, where the distribution of primes in these progressions can be controlled with a saving better than any power of xx from the classical zero-free region for Dirichlet LL-functions. In the finite example those cells account for 4.184.18 of the mean excess 12.8612.86.

The distinguished cell visits every column as uu runs over HH; the average forgets the column and keeps only χq(r)=1\chi_q(r) = 1 and 1−χd(r)1 - \chi_d(r); expanding the product gives G(x)G(x) plus three twisted sums, and Estimates B and C finish.

Averaging over translates

Fix t,jt, j and first replace each distinguished weight by bb. For a column ss, the equation s=uzs = uz with z∈T2z \in T_2 has exactly ∣T2∣|T_2| solutions uu, so for each admissible prime power rr,

1n∑u∈H1{v(r)=1, t[r]∈uT2}  =  δ 1{χq(r)=1}  =  δ2(1+χq(r)).\frac1n\sum_{u \in H}\mathbf 1\{v(r) = 1,\ t[r] \in uT_2\} \;=\; \delta\,\mathbf 1\{\chi_q(r) = 1\} \;=\; \frac\delta2\big(1 + \chi_q(r)\big).

The column label is gone. Multiplying by 1−χd(r)1 - \chi_d(r) gives the right contribution at the three special primes as well, and hence, with a=ata = a_t and Sq,d(y)=∑r≤yΛ(r)(1+χq(r))(1−χd(r))(y/r−1)S_{q,d}(y) = \sum_{r \le y}\Lambda(r)(1 + \chi_q(r))(1 - \chi_d(r))(y/r - 1),

1n∑u ∑i distinguished at ub Si(a/b)  =  δb2 Sq,d(a/b).\frac1n\sum_u\ \sum_{i\ \text{distinguished at } u} b\,S_i(a/b) \;=\; \frac{\delta b}{2}\,S_{q,d}(a/b).

This is an identity for every argument y=a/by = a/b, and the map sending a sum with expansion αylog⁡y+βy+o(y)\alpha y\log y + \beta y + o(y) to its remainder is linear, so the same identity holds for the remainders: 1n∑u∑distbRi(a/b)=δb2Rq,d(a/b)\frac1n\sum_u\sum_{\text{dist}} b R_i(a/b) = \frac{\delta b}{2}R_{q,d}(a/b). Since (1+χq)(1−χd)=1+χq−χd−χqχd(1 + \chi_q)(1 - \chi_d) = 1 + \chi_q - \chi_d - \chi_q\chi_d,

Rq,d(x)  =  G(x)+Gχq(x)−Gχd(x)−Gχqχd(x),R_{q,d}(x) \;=\; G(x) + G_{\chi_q}(x) - G_{\chi_d}(x) - G_{\chi_q\chi_d}(x),

where, for a primitive character χ≠1\chi \ne 1, Gχ(x)=∑r≤xΛ(r)χ(r)(x/r−1)+x L′/L(1,χ)G_\chi(x) = \sum_{r \le x}\Lambda(r)\chi(r)(x/r - 1) + x\,L'/L(1,\chi) is the analogue of GG for L(s,χ)L(s, \chi) (chapter 6’s family statistic). The function GG appears with coefficient +1+1. In the example each of the four row-1 cells is distinguished once, and the four remainders give 8.6796318.679631, which is 108R3,23(1000)\tfrac{10}{8}R_{3,23}(1000); a separate check from the four GG‘s at x=1000x = 1000 (1.5311.531, 1.0401.040, 1.3321.332, −5.704-5.704) gives R3,23(1000)=6.944R_{3,23}(1000) = 6.944.

Discarding the other scale. For the moduli of the construction and y≥exp⁡(xε/3)/3y \ge \exp(x^{\varepsilon/3})/3, every one of the 4n4n primitive characters that occur when the cells are expanded satisfies ∣Gχ(y)∣≤y e−κxε/8|G_\chi(y)| \le y\,e^{-\kappa x^{\varepsilon/8}} (Estimate C below). Each remainder RiR_i is a combination of the GχG_\chi with Fourier coefficients whose absolute values sum to 22, so a non-distinguished cell contributes at most 2a e−κxε/82a\,e^{-\kappa x^{\varepsilon/8}}, and summed over u,t,j,iu, t, j, i and divided by BnBn this is O(nxδe−κxε/8)=o(1)O\big(\tfrac{nx}{\delta}e^{-\kappa x^{\varepsilon/8}}\big) = o(1): exponential decay beats the polynomial factor. Changing the distinguished weights from bb to b+Δib + \Delta_i with Δi≪b/(nx2)\Delta_i \ll b/(nx^2) costs O(1/x)O(1/x), and moving at/ba_t/b to xx within 11 costs O(1+log⁡x)O(1 + \log x). Combining,

1n∑u,t,j(Pu,t,j−Mu,t,j)  =  B Rq,d(x)+Oε(B(1+log⁡x)).\frac1n\sum_{u,t,j}\big(P_{u,t,j} - M_{u,t,j}\big) \;=\; B\,R_{q,d}(x) + O_\varepsilon\big(B(1 + \log x)\big).

With (M) this gives Estimate A: for Y≤x≤Y3/2Y \le x \le Y^{3/2} and the parameters of the construction,

Rq,d(x)  ≤  xCε(xm+xmk+m+kn2)  ≤  x1/2+C′ε.R_{q,d}(x) \;\le\; x^{C\varepsilon}\Big(\frac xm + \frac{xm}{k} + m + \frac k{n^2}\Big) \;\le\; x^{1/2 + C'\varepsilon}.

Only an upper bound follows, which is all chapter 4 needs.

The three twisted sums: Estimate B

To pass from Rq,dR_{q,d} to GG one needs the three twists to be small. Estimate B. Let 0<ε<1/520 < \varepsilon < 1/52. For all large YY there are primes q≡3 mod 8q \equiv 3 \bmod 8, d≡7 mod 16d \equiv 7 \bmod 16 with q∣d+1q \mid d + 1, log⁡q≍Yε/5\log q \asymp Y^{\varepsilon/5}, log⁡d≍Yε/5(log⁡Y)2\log d \asymp Y^{\varepsilon/5}(\log Y)^2, such that ∣Gχ(x)∣≤x1/2+ε|G_\chi(x)| \le x^{1/2+\varepsilon} for χ=χq,χd,χqχd\chi = \chi_q, \chi_d, \chi_q\chi_d and all x∈[Y,Y3/2]x \in [Y, Y^{3/2}].

Is this circular? It looks like assuming the Riemann Hypothesis for three LL-functions. It is not, for a reason of scale. The moduli qq and dd are astronomically larger than xx: their logarithms are powers of xx. The quantity Gχ(x)G_\chi(x) has two parts, the constant L′/L(1,χ)L'/L(1,\chi), an infinite sum over prime powers, and the finite sum over r≤xr \le x. The tail of the constant beyond Z=Y600Z = Y^{600} is small by a zero-density estimate for zeros close to the line Re⁡s=1\operatorname{Re}s = 1, which discards a small proportion of the moduli and uses nothing about zeros near 12\tfrac12. What remains is a sum over r≤Zr \le Z, still very short compared with qq and dd, and mean-square estimates over the modulus show that for most pairs (q,d)(q, d) such a sum is as small as a random sum, about x\sqrt x. One only needs one good pair. The archive proves this with the exponent 12+ε2\tfrac12 + \tfrac\varepsilon2 and on any interval [Y,YA][Y, Y^A]:

UpperTheory.Top.WinPairstructureCharacterBoxes/ExistsPageN.lean:27The pair: qq prime, q≡3 mod 8q \equiv 3 \bmod 8, 12Yε/5<log⁡q≤Yε/5\tfrac12 Y^{\varepsilon/5} < \log q \le Y^{\varepsilon/5}; dd prime, d≡7 mod 16d \equiv 7 \bmod 16, 12Yε/5(log⁡Y)2<log⁡d≤Yε/5(log⁡Y)2\tfrac12 Y^{\varepsilon/5}(\log Y)^2 < \log d \le Y^{\varepsilon/5}(\log Y)^2; q∣d+1q \mid d + 1; and every odd prime p≤Yε/5p \le Y^{\varepsilon/5} divides d+1d + 1.
structure WinPair (eps Y : ℝ) (q d : ℕ) : Prop

The pair: qq prime, q≡3 mod 8q \equiv 3 \bmod 8, 12Yε/5<log⁡q≤Yε/5\tfrac12 Y^{\varepsilon/5} < \log q \le Y^{\varepsilon/5}; dd prime, d≡7 mod 16d \equiv 7 \bmod 16, 12Yε/5(log⁡Y)2<log⁡d≤Yε/5(log⁡Y)2\tfrac12 Y^{\varepsilon/5}(\log Y)^2 < \log d \le Y^{\varepsilon/5}(\log Y)^2; q∣d+1q \mid d + 1; and every odd prime p≤Yε/5p \le Y^{\varepsilon/5} divides d+1d + 1.

Full declaration with proof
structure WinPair (eps Y : ℝ) (q d : ℕ) : Prop where
  q_prime : q.Prime
  q_mod : q % 8 = 3
  q_lo : Y ^ (eps / 5) / 2 < Real.log q
  q_up : Real.log q ≤ Y ^ (eps / 5)
  d_prime : d.Prime
  d_mod : d % 16 = 7
  d_lo : Y ^ (eps / 5) * Real.log Y ^ 2 / 2 < Real.log d
  d_up : Real.log d ≤ Y ^ (eps / 5) * Real.log Y ^ 2
  d_q : q ∣ d + 1
  d_small : ∀ p : ℕ, p.Prime → p ≠ 2 → (p : ℝ) ≤ Y ^ (eps / 5) → p ∣ d + 1
UpperTheory.Top.PairGoodstructureCharacterBoxes/PairGood.lean:18A good pair for a modulus MM: a window pair coprime to MM such that every twist ξχqiχdj\xi\chi_q^i\chi_d^j with (i,j)≠(0,0)(i,j) \ne (0,0) of a character ξ\xi modulo MM has ∥Gχ(y)∥≤y1/2+ε/2\|G_\chi(y)\| \le y^{1/2+\varepsilon/2} and ∥L′/L(1,χ)∥≤4log⁡y\|L'/L(1,\chi)\| \le 4\log y on [Y,X][Y, X], and every real such twist has no zero in the box Re⁡s>1−1/400\operatorname{Re}s > 1 - 1/400, ∣Im⁡s∣≤height|\operatorname{Im}s| \le \mathrm{height}.
structure PairGood (M : ℕ) (eps Y X : ℝ) (q d : ℕ) : Prop

A good pair for a modulus MM: a window pair coprime to MM such that every twist ξχqiχdj\xi\chi_q^i\chi_d^j with (i,j)≠(0,0)(i,j) \ne (0,0) of a character ξ\xi modulo MM has ∥Gχ(y)∥≤y1/2+ε/2\|G_\chi(y)\| \le y^{1/2+\varepsilon/2} and ∥L′/L(1,χ)∥≤4log⁡y\|L'/L(1,\chi)\| \le 4\log y on [Y,X][Y, X], and every real such twist has no zero in the box Re⁡s>1−1/400\operatorname{Re}s > 1 - 1/400, ∣Im⁡s∣≤height|\operatorname{Im}s| \le \mathrm{height}.

Full declaration with proof
structure PairGood (M : ℕ) (eps Y X : ℝ) (q d : ℕ) : Prop where
  pair : WinPair eps Y q d
  coprime : Nat.Coprime M (q * d)
  bounds : ∀ (ξ : DirichletCharacter ℂ M) (i j : Fin 2), (i ≠ 0 ∨ j ≠ 0) →
    ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N), An.Induces χ (tw (fun a => ξ (a : ZMod M)) q d i j) (2 * M * q * d) →
      ∀ y : ℝ, Y ≤ y → y ≤ X → ‖An.gChi χ y‖ ≤ y ^ ((1 : ℝ) / 2 + eps / 2) ∧ ‖An.logDerivativeAtOne χ‖ ≤ 4 * Real.log y
  boxes : ∀ ρ : PChar, ρ.IsReal → ρ.N ∣ 8 * M → ∀ i j : Fin 2, (i ≠ 0 ∨ j ≠ 0) →
    ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N), An.Induces χ (tw ρ.val q d i j) (2 * M * q * d) →
      ZeroBox (height M eps Y j) χ
UpperTheory.Top.PairExdefCharacterBoxes/PairGood.lean:28For every M≥1M \ge 1, 0<ε<1/520 < \varepsilon < 1/52 and A≥1A \ge 1 there is Y1Y_1 such that every Y≥Y1Y \ge Y_1 has a good pair on [Y,YA][Y, Y^A].
def PairEx : Prop

For every M≥1M \ge 1, 0<ε<1/520 < \varepsilon < 1/52 and A≥1A \ge 1 there is Y1Y_1 such that every Y≥Y1Y \ge Y_1 has a good pair on [Y,YA][Y, Y^A].

Full declaration with proof
def PairEx : Prop :=
  ∀ (M : ℕ), 0 < M → ∀ eps A : ℝ, 0 < eps → eps < 1 / 52 → 1 ≤ A →
    ∃ Y1 : ℝ, ∀ Y ≥ Y1, ∃ q d : ℕ, PairGood M eps Y (Y ^ A) q d
QH.pairExtheoremMeanSquareBounds/pairEx.lean:112The theorem that proves it, from a mean-square estimate over the modulus and the zero-density input (the exposition's Theorem III.1.1).
theorem pairEx :
    UpperTheory.Top.PairEx

The theorem that proves it, from a mean-square estimate over the modulus and the zero-density input (the exposition's Theorem III.1.1).

Full declaration with proof
theorem pairEx :
    UpperTheory.Top.PairEx := by
  intro M hM eps A heps heps' hA
  obtain ⟨C, hC, hpair⟩ := pair_exists
  obtain ⟨Y₀, hY₀⟩ := hpair eps (eps / 2) A (8 * M) heps heps' (by linarith) hA (by omega)
  obtain ⟨Y₁, hY₁⟩ := kappa4 eps 3 heps heps' (by norm_num)
  refine ⟨max (max Y₀ Y₁) (Real.exp (1 + Real.log (8 * M))), fun Y hY => ?_⟩
  have hYa : Y₀ ≤ Y := le_trans (le_trans (le_max_left _ _) (le_max_left _ _)) hY
  have hYb : Y₁ ≤ Y := le_trans (le_trans (le_max_right _ _) (le_max_left _ _)) hY
  have hYc : Real.exp (1 + Real.log (8 * M)) ≤ Y := le_trans (le_max_right _ _) hY
  have hM1 : (1 : ℝ) ≤ M := by exact_mod_cast hM
  have hlog8 : 0 ≤ Real.log (8 * M) := Real.log_nonneg (by linarith)
  have hY1 : 1 ≤ Y := le_trans (Real.one_le_exp (by linarith)) hYc
  have hz0 : 0 ≤ Y ^ (eps / 5) * Real.log Y ^ 2 := by
    have := Real.log_nonneg hY1
    positivity
  have hA2 : 1 ≤ A ^ 2 := by nlinarith
  obtain ⟨q, d, hR, hq, hQ, hD⟩ := hY₀ Y hYa (Y ^ A) (Y ^ (eps / 5) * Real.log Y ^ 2) le_rfl le_rfl
    (le_mul_of_one_le_left hz0 hA2)
  have hq2 : q ≠ 2 := by
    intro h2
    have hm := hR.q_mod
    rw [h2] at hm
    norm_num at hm
  haveI : NeZero (8 * M) := ⟨by omega⟩
  have hM8 : M ∣ 8 * M := Dvd.intro_left 8 rfl
  refine ⟨q, d, ?_, ?_, ?_, ?_⟩
  · refine ⟨hR.q_prime, hR.q_mod, hR.q_gt, hR.q_le, hR.d_prime, hR.d_mod, hR.d_gt, hR.d_le, ?_, ?_⟩
    · exact Nat.dvd_of_mod_eq_zero (hR.d_class q hR.q_prime hq2 (Or.inr rfl))
    · intro p hp hp2 hpl
      exact Nat.dvd_of_mod_eq_zero (hR.d_class p hp hp2 (Or.inl hpl))
  · have hqM : ¬ q ∣ M := fun h => by
      have := Nat.le_of_dvd hM h
      omega
    have hdM : ¬ d ∣ M := fun h => by
      have := Nat.le_of_dvd hM h
      have := hR.q_lt_d
      omega
    exact Nat.Coprime.mul_right ((Nat.Prime.coprime_iff_not_dvd hR.q_prime).mpr hqM).symm
      ((Nat.Prime.coprime_iff_not_dvd hR.d_prime).mpr hdM).symm
  · intro ξ i j hij N _ χ hI y hy1 hy2
    have hB := pairEx_box M hM C (eps / 2) Y (Y ^ A) (Y ^ (eps / 5)) (Y ^ (eps / 5) * Real.log Y ^ 2) q d
      hR hq hQ hD (fun a ↦ ξ a) (DirichletCharacter.changeLevel hM8 ξ)
      (fun n hn => pairEx_lift hM8 ξ n hn) i j hij N χ hI
    obtain ⟨hgood, _, hG⟩ := hB
    have hne : χ ≠ 1 := hgood.1
    constructor
    · rw [pairEx_g χ hne]
      exact hG y ⟨hy1, hy2⟩
    · obtain ⟨hk1, hk2⟩ := log_exp_product_bounds M hM eps Y heps hYc (j : ℕ) (Nat.lt_succ_iff.mp j.isLt)
      have hk := hY₁ Y hYb _ N χ hk1 hk2 hgood
      have hlog : Real.log Y ≤ Real.log y := Real.log_le_log (by linarith) hy1
      exact le_trans hk (by linarith)
  · intro ρ hρ hρN i j hij N _ χ hI
    have hB := pairEx_box M hM C (eps / 2) Y (Y ^ A) (Y ^ (eps / 5)) (Y ^ (eps / 5) * Real.log Y ^ 2) q d
      hR hq hQ hD ρ.val (DirichletCharacter.changeLevel hρN ρ.χ)
      (fun n hn => pairEx_lift hρN ρ.χ n hn) i j hij N χ hI
    exact hB.1.2.2
UpperTheory.Top.ZeroBoxdefCharacterBoxes/PairGood.lean:12No zero with Re⁡s>1−1/400\operatorname{Re}s > 1 - 1/400 and ∣Im⁡s∣≤Q|\operatorname{Im}s| \le Q.
def ZeroBox (Q : ℝ) {N : ℕ} [NeZero N] (χ : DirichletCharacter ℂ N) : Prop

No zero with Re⁡s>1−1/400\operatorname{Re}s > 1 - 1/400 and ∣Im⁡s∣≤Q|\operatorname{Im}s| \le Q.

Full declaration with proof
def ZeroBox (Q : ℝ) {N : ℕ} [NeZero N] (χ : DirichletCharacter ℂ N) : Prop :=
  ∀ s : ℂ, 1 - 1 / 400 < s.re → |s.im| ≤ Q → DirichletCharacter.LFunction χ s ≠ 0

The last condition of the window pair has a consequence not visible in the plain statement: every odd prime up to Yε/5Y^{\varepsilon/5} divides d+1d + 1, so χd(p)=1\chi_d(p) = 1 for all of them, and χd(2)=1\chi_d(2) = 1. Every small prime splits in Q(−d)\mathbb Q(\sqrt{-d}); the inert primes, which carry the whole argument, all exceed Yε/5Y^{\varepsilon/5}.

The large scale: Estimate C

Estimate C. For the same primes q,dq, d and every x∈[Y,Y3/2]x \in [Y, Y^{3/2}], every one of the 4n4n primitive characters that occur when the cells are expanded (their conductors divide 4nqd4nqd) satisfies ∣Gχ(y)∣≤yexp⁡(−κxε/8)|G_\chi(y)| \le y\exp(-\kappa x^{\varepsilon/8}) for all y≥13exp⁡(xε/3)y \ge \tfrac13\exp(x^{\varepsilon/3}), with a constant κ>0\kappa > 0, GG for the trivial character. It rests on the classical zero-free region Re⁡s>1−c/log⁡(conductor⋅(∣Im⁡s∣+2))\operatorname{Re}s > 1 - c/\log(\text{conductor}\cdot(|\operatorname{Im}s| + 2)); it is available because log⁡q\log q and log⁡d\log d are much smaller than xε/3x^{\varepsilon/3}, and because qq and dd were chosen so that no exceptional real zero interferes (the zero boxes of the good pair).

UpperTheory.Top.ThinHdefCharacterBoxes/PairGood.lean:36There is c>0c > 0 such that for 0<ε<1/520 < \varepsilon < 1/52 and xx large, every host whose odd level is bounded, whose conductor satisfies log⁡N≤2xε/5(log⁡x)2\log N \le 2x^{\varepsilon/5}(\log x)^2 and which has no real zero in the box, satisfies the Chebyshev-type character bound at scale xx with constant cc.
def ThinH : Prop

There is c>0c > 0 such that for 0<ε<1/520 < \varepsilon < 1/52 and xx large, every host whose odd level is bounded, whose conductor satisfies log⁡N≤2xε/5(log⁡x)2\log N \le 2x^{\varepsilon/5}(\log x)^2 and which has no real zero in the box, satisfies the Chebyshev-type character bound at scale xx with constant cc.

Full declaration with proof
def ThinH : Prop :=
  ∃ c : ℝ, 0 < c ∧ ∀ B eps : ℝ, 0 < eps → eps < 1 / 52 → ∃ x0 : ℝ, ∀ x ≥ x0, ∀ (φ : Frame) (H : HostRaw φ),
    ((ordCompl[2] H.QS : ℕ) : ℝ) ≤ B → Real.log (H.condN : ℝ) ≤ 2 * x ^ (eps / 5) * Real.log x ^ 2 → RealBox H →
      H.ChebyshevCharacterBound x eps c
QH.thinHtheoremMeanSquareBounds/GaussSumFunctionEq.lean:55Its proof (the exposition's Theorem III.2.1).
theorem thinH :
    UpperTheory.Top.ThinH

Its proof (the exposition's Theorem III.2.1).

Full declaration with proof
theorem thinH :
    UpperTheory.Top.ThinH := by
  refine ⟨1, one_pos, fun B eps he he52 => ?_⟩
  obtain ⟨c₀s, hc₀s, hsmall⟩ := small_zeros (8 * ⌊B⌋₊)
  have hc₀ : 0 < min c₀s (1 / 400) := lt_min hc₀s (by norm_num)
  obtain ⟨x₀, hx₀⟩ := thin eps 2 1 (min c₀s (1 / 400)) he two_pos one_pos hc₀
  refine ⟨x₀, fun x hx φ H hB hlog hRB => ?_⟩
  intro N _ χ hχ y hy
  rw [gauss_sum_function_eq]
  have hprim : χ.IsPrimitive := by
    obtain ⟨θ, hθ⟩ := hχ
    exact hθ.1
  have hNd : N ∣ H.condN := level_dvd H χ hχ
  have hNpos : 0 < N := Nat.pos_of_ne_zero (NeZero.ne N)
  have hlogN : Real.log N ≤ 2 * x ^ (eps / 5) * Real.log x ^ 2 :=
    (Real.log_le_log (by exact_mod_cast hNpos)
      (by exact_mod_cast Nat.le_of_dvd H.condN_pos hNd)).trans hlog
  refine hx₀ x hx N χ hprim hlogN ?_ y hy
  intro h2 h1 β hβ hβ1
  have hq : H.q.Prime := H.hyp.1
  have hd : H.d.Prime := H.hyp.2.1
  by_cases hqd : H.q ∣ N ∨ H.d ∣ N
  · exact hRB (Formalism.HC.PChar.mk N χ hprim) hχ (isReal_of_sq χ h2) hqd β
      (by have := min_le_right c₀s (1 / 400); linarith)
  · push_neg at hqd
    have hQ0 : H.QS ≠ 0 := (H.QS_pos).ne'
    have hsplitQ := Nat.ordProj_mul_ordCompl_eq_self H.QS 2
    have hprimes : ∀ p : ℕ, p.Prime → p ∣ N → p ∣ 8 * (H.QS / 2 ^ H.QS.factorization 2) ∨ p = H.q ∨ p = H.d := by
      intro p hp hpN
      have hpc : p ∣ H.QS * H.q * H.d := hpN.trans hNd
      rcases (Nat.Prime.dvd_mul hp).1 hpc with h | h
      · rcases (Nat.Prime.dvd_mul hp).1 h with h' | h'
        · left
          by_cases hp2 : p = 2
          · subst hp2
            exact Dvd.dvd.mul_right (by norm_num) _
          · apply Dvd.dvd.mul_left
            rw [← hsplitQ] at h'
            have hcop : Nat.Coprime p (2 ^ H.QS.factorization 2) :=
              Nat.Coprime.pow_right _ ((Nat.coprime_primes hp Nat.prime_two).2 hp2)
            exact hcop.dvd_of_dvd_mul_left h'
        · exact Or.inr (Or.inl ((Nat.prime_dvd_prime_iff_eq hp hq).1 h'))
      · exact Or.inr (Or.inr ((Nat.prime_dvd_prime_iff_eq hp hd).1 h))
    have hdiv := real_cond (8 * (H.QS / 2 ^ H.QS.factorization 2)) H.q H.d N χ hprim h2
      (dvd_mul_right 8 _) hq hd hprimes
    have hcq : Nat.Coprime N H.q := ((Nat.Prime.coprime_iff_not_dvd hq).2 hqd.1).symm
    have hcd : Nat.Coprime N H.d := ((Nat.Prime.coprime_iff_not_dvd hd).2 hqd.2).symm
    have hN0 : N ∣ 8 * (H.QS / 2 ^ H.QS.factorization 2) :=
      hcq.dvd_of_dvd_mul_right (hcd.dvd_of_dvd_mul_right hdiv)
    have hopos : 0 < H.QS / 2 ^ H.QS.factorization 2 := Nat.ordCompl_pos 2 hQ0
    have hofl : H.QS / 2 ^ H.QS.factorization 2 ≤ ⌊B⌋₊ := Nat.le_floor hB
    have hNle : N ≤ 8 * ⌊B⌋₊ := (Nat.le_of_dvd (by omega) hN0).trans (by omega)
    exact hsmall N χ hNle h1 β (by have := min_le_left c₀s (1 / 400); linarith) hβ1
UpperTheory.Top.RealBoxdefCharacterBoxes/PairGood.lean:32The no-exceptional-zero condition: real characters of the host divisible by qq or dd have L(β,χ)≠0L(\beta, \chi) \ne 0 for real β>1−1/400\beta > 1 - 1/400.
def RealBox {φ : Frame} (H : HostRaw φ) : Prop

The no-exceptional-zero condition: real characters of the host divisible by qq or dd have L(β,χ)≠0L(\beta, \chi) \ne 0 for real β>1−1/400\beta > 1 - 1/400.

Full declaration with proof
def RealBox {φ : Frame} (H : HostRaw φ) : Prop :=
  ∀ ψ : PChar, H.IsCharE ψ.χ → ψ.IsReal → (H.q ∣ ψ.N ∨ H.d ∣ ψ.N) →
    ∀ β : ℝ, 1 - 1 / 400 < β → DirichletCharacter.LFunction ψ.χ β ≠ 0

From A and B, with A itself using (M), B and C: G(x)≤Rq,d(x)+3x1/2+ε≤x1/2+C′′εG(x) \le R_{q,d}(x) + 3x^{1/2+\varepsilon} \le x^{1/2 + C''\varepsilon} on the interval. By chapter 4 this proves the Riemann Hypothesis. The archive bundles the window, the pair and the parameters into one datum per character:

UpperTheory.Top.WinDatumstructureCharacterBoxes/TwistForm.lean:19For a character ψ\psi: x1/J≤Y≤xx^{1/J} \le Y \le x, a good pair (q,d)(q, d) for the modulus of ψ\psi on [Y,x][Y, x], n=c 2en = c\,2^e with x2+8ε≤n≤2x2+8εx^{2+8\varepsilon} \le n \le 2x^{2+8\varepsilon}, and the Galois-cohomology bound b\sqrt b for the field EE built from ψ,e,q,d\psi, e, q, d (chapter 14).
structure WinDatum (ψ : PChar) (eps J c x Y : ℝ) (q d e : ℕ) : Prop

For a character ψ\psi: x1/J≤Y≤xx^{1/J} \le Y \le x, a good pair (q,d)(q, d) for the modulus of ψ\psi on [Y,x][Y, x], n=c 2en = c\,2^e with x2+8ε≤n≤2x2+8εx^{2+8\varepsilon} \le n \le 2x^{2+8\varepsilon}, and the Galois-cohomology bound b\sqrt b for the field EE built from ψ,e,q,d\psi, e, q, d (chapter 14).

Full declaration with proof
structure WinDatum (ψ : PChar) (eps J c x Y : ℝ) (q d e : ℕ) : Prop where
  lo : x ^ (1 / J) ≤ Y
  up : Y ≤ x
  good : PairGood ψ.N eps Y x q d
  n_lo : x ^ (2 + 8 * eps) ≤ c * 2 ^ e
  n_up : c * 2 ^ e ≤ 2 * x ^ (2 + 8 * eps)
  bound : ∀ (E : Type) [Field E] [NumberField E], IsChiField ψ e q d E →
    VVle E ⌊x ^ (400 : ℝ)⌋₊ (Real.sqrt (Real.exp (x ^ eps)))
UpperTheory.Top.winPairstheoremCharacterBoxes/WinPairs.lean:5From the cohomological window (`VWinAt`, chapter 14) and the existence of good pairs: for every yy there is Z≥yZ \ge y such that every x∈[Z,Z3/2]x \in [Z, Z^{3/2}] has a window datum.
theorem UpperTheory.Top.winPairs :
    ∀ (ψ : PChar) (eps c : ℝ), 0 < eps → eps < 1 / 52 → 1 ≤ c → VWinAt ψ 401 → PairEx →
      ∃ J : ℝ, 1 ≤ J ∧ ∀ y : ℝ, ∃ Z : ℝ, y ≤ Z ∧ ∀ x : ℝ, Z ≤ x → x ≤ Z ^ ((3 : ℝ) / 2) →
        ∃ (Y : ℝ) (q d e : ℕ), WinDatum ψ eps J c x Y q d e

From the cohomological window (`VWinAt`, chapter 14) and the existence of good pairs: for every yy there is Z≥yZ \ge y such that every x∈[Z,Z3/2]x \in [Z, Z^{3/2}] has a window datum.

Excerpt: the first 60 of 77 lines
theorem UpperTheory.Top.winPairs :
    ∀ (ψ : PChar) (eps c : ℝ), 0 < eps → eps < 1 / 52 → 1 ≤ c → VWinAt ψ 401 → PairEx →
      ∃ J : ℝ, 1 ≤ J ∧ ∀ y : ℝ, ∃ Z : ℝ, y ≤ Z ∧ ∀ x : ℝ, Z ≤ x → x ≤ Z ^ ((3 : ℝ) / 2) →
        ∃ (Y : ℝ) (q d e : ℕ), WinDatum ψ eps J c x Y q d e := by
  intro ψ eps c heps heps52 hc hV hP
  obtain ⟨e, he⟩ := exists_pageN eps heps
  obtain ⟨J, hJ, X0, hX0⟩ := hV eps heps heps52 e he
  have hN : 0 < ψ.N := Nat.pos_of_ne_zero (NeZero.ne _)
  obtain ⟨Y1, hY1⟩ := hP ψ.N hN eps J heps heps52 hJ
  have ha : 0 < 2 + 8 * eps := by linarith
  have hc0 : 0 ≤ c := by linarith
  obtain ⟨k, hk1, hka⟩ : ∃ k : ℝ, 1 ≤ k ∧ k ^ (2 + 8 * eps) = c := by
    refine ⟨c ^ (1 / (2 + 8 * eps)), Real.one_le_rpow hc (one_div_nonneg.2 ha.le), ?_⟩
    rw [one_div, Real.rpow_inv_rpow hc0 ha.ne']
  have hk0 : 0 ≤ k := by linarith
  refine ⟨J, hJ, fun y => ?_⟩
  have hJ0 : J ≠ 0 := ne_of_gt (by linarith)
  have hJi : 0 ≤ 1 / J := one_div_nonneg.2 (by linarith)
  obtain ⟨M, hM1, hMy, hMY1, hMk3, hMk400⟩ : ∃ M : ℝ, 1 ≤ M ∧ y ≤ M ∧ Y1 ≤ M ∧
      k ^ (3 : ℝ) ≤ M ∧ k ^ (400 : ℝ) ≤ M :=
    ⟨max 1 (max y (max Y1 (max (k ^ (3 : ℝ)) (k ^ (400 : ℝ))))), by simp, by simp, by simp, by simp, by simp⟩
  obtain ⟨X, hXX0, hXM⟩ : ∃ X : ℝ, X0 ≤ X ∧ M ^ J ≤ X := ⟨max X0 (M ^ J), le_max_left _ _, le_max_right _ _⟩
  have hM0 : 0 ≤ M := by linarith
  have hX1 : 1 ≤ X := (Real.one_le_rpow hM1 (by linarith)).trans hXM
  have hX0' : 0 ≤ X := by linarith
  have hY0M : M ≤ X ^ (1 / J) := by
    calc M = (M ^ J) ^ (1 / J) := by rw [one_div, Real.rpow_rpow_inv hM0 hJ0]
      _ ≤ X ^ (1 / J) := Real.rpow_le_rpow (Real.rpow_nonneg hM0 _) hXM hJi
  have hXJ : (X ^ (1 / J)) ^ J = X := by rw [one_div, Real.rpow_inv_rpow hX0' hJ0]
  obtain ⟨q, d, hpg⟩ := hY1 (X ^ (1 / J)) (hMY1.trans hY0M)
  obtain ⟨W, hW0, hW2, hWV⟩ := hX0 X hXX0 q d hpg.pair
  have hWM : M ≤ W := hY0M.trans hW0
  have hW1 : 1 ≤ W := hM1.trans hWM
  have hWnn : 0 ≤ W := by linarith
  have hk3 : k ^ (3 : ℝ) ≤ W := hMk3.trans hWM
  have hlem : (k * W) ^ ((3 : ℝ) / 2) ≤ W ^ (2 : ℝ) := by
    have h1 : (k * W) ^ ((3 : ℝ) / 2) = ((k * W) ^ (3 : ℝ)) ^ ((1 : ℝ) / 2) := by
      rw [← Real.rpow_mul (mul_nonneg hk0 hWnn)]
      norm_num
    have h2 : W ^ (2 : ℝ) = (W ^ (4 : ℝ)) ^ ((1 : ℝ) / 2) := by
      rw [← Real.rpow_mul hWnn]
      norm_num
    rw [h1, h2]
    apply Real.rpow_le_rpow (Real.rpow_nonneg (mul_nonneg hk0 hWnn) _) _ (by norm_num)
    rw [Real.mul_rpow hk0 hWnn, show (4 : ℝ) = 1 + 3 by norm_num, Real.rpow_add (by linarith : 0 < W),
      Real.rpow_one]
    exact mul_le_mul_of_nonneg_right hk3 (Real.rpow_nonneg hWnn _)
  refine ⟨k * W, hMy.trans (hWM.trans (le_mul_of_one_le_left hWnn hk1)), fun x hZx hxZ => ?_⟩
  have hkpos : 0 < k := by linarith
  have hxW2 : x ≤ W ^ (2 : ℝ) := hxZ.trans hlem
  have hxX : x ≤ X := hxW2.trans hW2
  have hx1 : W ≤ x := (le_mul_of_one_le_left hWnn hk1).trans hZx
  have hx0 : 0 ≤ x := by linarith
  obtain ⟨x', rfl⟩ : ∃ x', x = k * x' := ⟨x / k, by field_simp⟩
  have hWx' : W ≤ x' := le_of_mul_le_mul_left hZx hkpos
  have hx'0 : 0 ≤ x' := hWnn.trans hWx'
  have hx'1 : 1 ≤ x' := hW1.trans hWx'
  have hx'x : x' ≤ k * x' := le_mul_of_one_le_left hx'0 hk1
  have hpage : x' ^ (2 + 8 * eps) ≤ 2 ^ (e x') ∧ 2 ^ (e x') ≤ 2 * x' ^ (2 + 8 * eps) := he x' hx'1
  have hpow : (k * x') ^ (2 + 8 * eps) = c * x' ^ (2 + 8 * eps) := by rw [Real.mul_rpow hk0 hx'0, hka]
  …

The complete declaration runs to line 81 of Development/AutomorphicArithmetic/CharacterBoxes/WinPairs.lean in the archive; the statement above is its full header.

The two sets of columns

The table of chapter 11 has nn columns, indexed by the cyclic group HH; write it additively as A=Z/nZA = \mathbb Z/n\mathbb Z. The construction singles out two sets of columns, both needed only through combinatorial properties.

The set T2T_2: a construction of Behrend. Let L≥2L \ge 2 be an integer with L≤CLlog⁡xL \le C_L\log x. For xx large there is a set T2T_2 of positive integers with 4Ls<n4Ls < n for every s∈T2s \in T_2, ∣T2∣≥x−εn|T_2| \ge x^{-\varepsilon}n, and no relation: if s1,s2,s3∈T2s_1, s_2, s_3 \in T_2 are distinct and 0<∣i∣,∣j∣≤L0 < |i|, |j| \le L, i≠ji \ne j, then j(s2−s1)≠i(s3−s1)j(s_2 - s_1) \ne i(s_3 - s_1). For i=1i = 1, j=2j = 2 this says T2T_2 contains no three-term arithmetic progression. The proof is Behrend's (background): among the DSD^S vectors in {0,…,D−1}S\{0, \ldots, D-1\}^S some sphere ∣v∣2=k|v|^2 = k contains at least DS−2/SD^{S-2}/S of them, and three points of a sphere are never collinear; writing the vectors in the base B=4LDB = 4LD turns the sphere into a set of integers with no relation, and the parameters S≈log⁡n/log⁡LS \approx \sqrt{\log n/\log L}, D≈ea/4LD \approx e^{a}/4L make its density ≥exp⁡(−32log⁡nlog⁡L)\ge \exp(-32\sqrt{\log n\log L}), which exceeds 4x−ε4x^{-\varepsilon} for large xx. The archive uses Mathlib’s Behrend.map for the base-BB encoding and proves the orbit property too: among any LL consecutive terms of a progression t+iht + ih whose step has order above 4L4L, at most two lie in a translate u0+T2u_0 + T_2.

Formalism.FrobeniusOrbits.HostThickExistsdefFrobeniusOrbits/HostThickExists.lean:30There is C>0C > 0 such that for all nn and L≥2L \ge 2 there is a finite set TT of naturals with 4Ls<n4Ls < n on TT, no relation at level LL, and ∣T∣≥nexp⁡(−Clog⁡nlog⁡L)/L|T| \ge n\exp(-C\sqrt{\log n\log L})/L.
def HostThickExists : Prop

There is C>0C > 0 such that for all nn and L≥2L \ge 2 there is a finite set TT of naturals with 4Ls<n4Ls < n on TT, no relation at level LL, and ∣T∣≥nexp⁡(−Clog⁡nlog⁡L)/L|T| \ge n\exp(-C\sqrt{\log n\log L})/L.

Full declaration with proof
def HostThickExists : Prop :=
  ∃ C : ℝ, 0 < C ∧ ∀ n L : ℕ, 2 ≤ L → ∃ T : Finset ℕ, (∀ s ∈ T, 4 * L * s < n) ∧ NoRel T L ∧
    (n : ℝ) * Real.exp (-C * Real.sqrt (Real.log n * Real.log L)) / L ≤ T.card
Formalism.FrobeniusOrbits.NoReldefFrobeniusOrbits/HostThickExists.lean:13No relation: for distinct s1,s2,s3∈Ts_1, s_2, s_3 \in T and 0<∣i∣,∣j∣≤L0 < |i|, |j| \le L with i≠ji \ne j, j(s2−s1)≠i(s3−s1)j(s_2 - s_1) \ne i(s_3 - s_1).
def NoRel (T : Finset ℕ) (L : ℕ) : Prop

No relation: for distinct s1,s2,s3∈Ts_1, s_2, s_3 \in T and 0<∣i∣,∣j∣≤L0 < |i|, |j| \le L with i≠ji \ne j, j(s2−s1)≠i(s3−s1)j(s_2 - s_1) \ne i(s_3 - s_1).

Full declaration with proof
def NoRel (T : Finset ℕ) (L : ℕ) : Prop :=
  ∀ s₁ ∈ T, ∀ s₂ ∈ T, ∀ s₃ ∈ T, s₁ ≠ s₂ → s₁ ≠ s₃ → s₂ ≠ s₃ →
    ∀ i j : ℤ, 0 < |i| → |i| ≤ L → 0 < |j| → |j| ≤ L → i ≠ j →
      j * ((s₂ : ℤ) - s₁) ≠ i * ((s₃ : ℤ) - s₁)
Formalism.FrobeniusOrbits.hostThickExiststheoremFrobeniusOrbitsProofs/ThickExists.lean:181The proof by the sphere construction.
theorem hostThickExists : HostThickExists

The proof by the sphere construction.

Excerpt: the first 60 of 154 lines
theorem hostThickExists : HostThickExists := by
  unfold HostThickExists
  refine ⟨32, by norm_num, ?_⟩
  intro n L hL
  have hL2 : (2 : ℝ) ≤ L := by exact_mod_cast hL
  have hLpos : (0 : ℝ) < L := by linarith
  obtain ⟨y, hy⟩ : ∃ y : ℝ, y = Real.log (L : ℝ) := ⟨_, rfl⟩
  obtain ⟨x, hx⟩ : ∃ x : ℝ, x = Real.log (n : ℝ) := ⟨_, rfl⟩
  obtain ⟨s, hs⟩ : ∃ s : ℝ, s = Real.sqrt (x * y) := ⟨_, rfl⟩
  have hrw : Real.sqrt (Real.log (n : ℝ) * Real.log (L : ℝ)) = s := by rw [hs, hx, hy]
  rw [hrw]
  have hy_half : (1 : ℝ) / 2 < y := by
    have h1 := Real.log_two_gt_d9
    have h2 := Real.log_le_log (by norm_num) hL2
    rw [hy]
    linarith
  have hy0 : 0 < y := by linarith
  by_cases hsmall : (n : ℝ) * Real.exp (-32 * s) / L ≤ 1
  · rcases Nat.eq_zero_or_pos n with hn | hn
    · refine ⟨∅, by simp, ?_, by simp [hn]⟩
      unfold NoRel
      intro s₁ hs₁
      simp at hs₁
    · refine ⟨{0}, ?_, ?_, ?_⟩
      · intro m hm
        rw [Finset.mem_singleton] at hm
        subst hm
        simpa using hn
      · unfold NoRel
        intro s₁ hs₁ s₂ hs₂ s₃ hs₃ h12
        rw [Finset.mem_singleton] at hs₁ hs₂
        exact absurd (hs₁.trans hs₂.symm) h12
      · rw [Finset.card_singleton, Nat.cast_one]
        exact hsmall
  push_neg at hsmall
  have hnpos : (0 : ℝ) < n := by
    rcases Nat.eq_zero_or_pos n with hn | hn
    · rw [hn] at hsmall
      norm_num at hsmall
    · exact_mod_cast hn
  have eL : Real.exp y = L := by rw [hy, Real.exp_log hLpos]
  have en : Real.exp x = n := by rw [hx, Real.exp_log hnpos]
  have hpos : 0 < x + -32 * s - y := by
    rw [← Real.exp_lt_exp, Real.exp_zero, Real.exp_sub, Real.exp_add, eL, en]
    exact hsmall
  have hs0 : 0 ≤ s := by rw [hs]; exact Real.sqrt_nonneg _
  have hxpos : 0 < x := by linarith
  have hs2 : s ^ 2 = x * y := by rw [hs]; exact Real.sq_sqrt (mul_pos hxpos hy0).le
  have hs32 : 32 * y < s := by
    by_contra hc
    push_neg at hc
    nlinarith [mul_nonneg hs0 (sub_nonneg.mpr hc), mul_pos hpos hy0, sq_nonneg y]
  have hs16 : 16 < s := by linarith
  obtain ⟨S, hSdef⟩ : ∃ S : ℕ, S = ⌊s / y⌋₊ := ⟨_, rfl⟩
  have hS1 : (S : ℝ) ≤ s / y := by rw [hSdef]; exact Nat.floor_le (div_nonneg hs0 hy0.le)
  have hS2 : s / y < S + 1 := by rw [hSdef]; exact Nat.lt_floor_add_one _
  have hSy : (S : ℝ) * y ≤ s := (le_div_iff₀ hy0).mp hS1
  have hSy2 : s < (S + 1) * y := (div_lt_iff₀ hy0).mp hS2
  have hS31 : (31 : ℝ) < S := by
    have h := lt_of_mul_lt_mul_right (show (32 : ℝ) * y < (S + 1) * y by linarith) hy0.le
  …

The complete declaration runs to line 334 of Formalism/FrobeniusOrbits/FrobeniusOrbitsProofs/ThickExists.lean in the archive; the statement above is its full header.

Formalism.FrobeniusOrbits.HostThickOrbitdefFrobeniusOrbits/HostThickExists.lean:22Arithmetic progressions meet translates of TT rarely: at most two of LL consecutive terms when the step has order above 4L4L, at most one point of the whole progression otherwise.
def HostThickOrbit : Prop

Arithmetic progressions meet translates of TT rarely: at most two of LL consecutive terms when the step has order above 4L4L, at most one point of the whole progression otherwise.

Full declaration with proof
def HostThickOrbit : Prop :=
  ∀ (n L : ℕ), 0 < n → 2 ≤ L → ∀ T : Finset ℕ, (∀ s ∈ T, 4 * L * s < n) → NoRel T L →
  ∀ u₀ t h : ZMod n,
    (4 * L < addOrderOf h → ∀ i₀ : ℤ,
      ((Finset.Ico i₀ (i₀ + L)).filter (fun i : ℤ => InTranslate T u₀ (t + i • h))).card ≤ 2) ∧
    (addOrderOf h ≤ 4 * L →
      {x : ZMod n | (∃ i : ℤ, x = t + i • h) ∧ InTranslate T u₀ x}.ncard ≤ 1)
Formalism.FrobeniusOrbits.hostThickOrbittheoremFrobeniusOrbitsProofs/ThickOrbit.lean:132Its proof.
theorem hostThickOrbit : HostThickOrbit

Its proof.

Full declaration with proof
theorem hostThickOrbit : HostThickOrbit := by
  intro n L hn _ T hT hR u₀ t h
  exact ⟨fun hord i₀ => ThickOrbit.part_one T hT hR u₀ t h hord i₀,
    fun hord => ThickOrbit.part_two hn T hT u₀ t h hord⟩

The set TT: a random choice. The set T⊂AT \subset A of labels is chosen so that ∣T∣|T| is about δ1n\delta_1 n with δ1=x−ε/8\delta_1 = x^{-\varepsilon/8}, and so that for most primes pp and most t∈Tt \in T the points of TT on the Frobenius orbit of tt are evenly spread in a precise sense (the exposition’s good orbits, with windows, tiles and marked cells). Each element of AA is put in TT independently with probability δ1\delta_1; the three bad events have probability at most Cbx−2C_b x^{-2} per orbit, and a first-moment argument produces one set TT with 12δ1n≤∣T∣≤2δ1n\tfrac12\delta_1 n \le |T| \le 2\delta_1 n and few bad orbits, weighted by log⁡p/p\log p/p.

Formalism.FrobeniusOrbits.HostTopsdefFrobeniusOrbits/HostThickExists.lean:39The probabilistic lemma: if each bad event has Bernoulli weight at most βδ\beta\delta, some set TT with 12δ∣α∣≤∣T∣≤2δ∣α∣\tfrac12\delta|\alpha| \le |T| \le 2\delta|\alpha| has weighted bad count at most 4βδ∣α∣∑pωp4\beta\delta|\alpha|\sum_p\omega_p.
def HostTops : Prop

The probabilistic lemma: if each bad event has Bernoulli weight at most βδ\beta\delta, some set TT with 12δ∣α∣≤∣T∣≤2δ∣α∣\tfrac12\delta|\alpha| \le |T| \le 2\delta|\alpha| has weighted bad count at most 4βδ∣α∣∑pωp4\beta\delta|\alpha|\sum_p\omega_p.

Full declaration with proof
def HostTops : Prop :=
  ∀ (α ι : Type) [Fintype α] [Fintype ι] (δ β : ℝ) (ω : ι → ℝ) (BAD : ι → α → Finset α → Prop),
    0 < δ → δ ≤ 1 → 0 ≤ β → (∀ p, 0 ≤ ω p) → 16 ≤ δ * Fintype.card α →
    (∀ p t, (∑ T : Finset α, if t ∈ T ∧ BAD p t T then bern δ T else 0) ≤ β * δ) →
    ∃ T : Finset α, δ * Fintype.card α / 2 ≤ T.card ∧ (T.card : ℝ) ≤ 2 * δ * Fintype.card α ∧
      (∑ p, ω p * ((T.filter (fun t => BAD p t T)).card : ℝ)) ≤
        4 * β * δ * Fintype.card α * ∑ p, ω p
Formalism.FrobeniusOrbits.hostTopstheoremFrobeniusOrbitsProofs/ThickFrames.lean:55Its proof: the expectation of a variance term plus the normalised bad count is at most 3/43/4, so some TT has both small.
theorem hostTops : HostTops

Its proof: the expectation of a variance term plus the normalised bad count is at most 3/43/4, so some TT has both small.

Excerpt: the first 60 of 104 lines
theorem hostTops : HostTops := by
  intro α ι _ _ δ β ω BAD hδ hδ1 hβ hω hn hBAD
  set n : ℝ := (Fintype.card α : ℝ) with hn_def
  set M : ℝ := β * δ * n * ∑ p, ω p with hM_def
  set X : Finset α → ℝ := fun T => ∑ p, ω p * ((T.filter (fun t => BAD p t T)).card : ℝ)
    with hX_def
  have hb0 : ∀ T : Finset α, 0 ≤ bern δ T := bern_nonneg hδ.le hδ1
  have hX0 : ∀ T, 0 ≤ X T := fun T => sum_nonneg fun p _ => mul_nonneg (hω p) (Nat.cast_nonneg _)
  have hM0 : 0 ≤ M := by
    have : 0 ≤ ∑ p, ω p := sum_nonneg fun p _ => hω p
    have : 0 ≤ n := Nat.cast_nonneg _
    positivity

  have hc : ∀ p (T : Finset α), ((T.filter (fun t => BAD p t T)).card : ℝ) =
      ∑ t, if t ∈ T ∧ BAD p t T then (1 : ℝ) else 0 := by
    intro p T
    rw [Finset.sum_boole]
    congr 2
    ext t
    simp
  have hEX : ∑ T, bern δ T * X T ≤ M := by
    calc ∑ T, bern δ T * X T
        = ∑ T : Finset α, ∑ p, ∑ t, ω p * (if t ∈ T ∧ BAD p t T then bern δ T else 0) := by
          refine sum_congr rfl fun T _ => ?_
          simp only [X, hc, mul_sum]
          refine sum_congr rfl fun p _ => sum_congr rfl fun t _ => ?_
          split_ifs <;> ring
      _ = ∑ p, ∑ t, ω p * ∑ T : Finset α, (if t ∈ T ∧ BAD p t T then bern δ T else 0) := by
          rw [sum_comm]
          refine sum_congr rfl fun p _ => ?_
          rw [sum_comm]
          simp only [mul_sum]
      _ ≤ ∑ p, ∑ _t : α, ω p * (β * δ) :=
          sum_le_sum fun p _ => sum_le_sum fun t _ => mul_le_mul_of_nonneg_left (hBAD p t) (hω p)
      _ = M := by
          simp only [hM_def, hn_def, sum_const, card_univ, nsmul_eq_mul, mul_sum]
          refine sum_congr rfl fun p _ => ?_
          ring

  have hA : ∑ T : Finset α, (if 4 * M < X T then bern δ T else 0) ≤ 1 / 4 := by
    have key : 4 * M * ∑ T : Finset α, (if 4 * M < X T then bern δ T else 0) ≤ M := by
      rw [mul_sum]
      refine le_trans (sum_le_sum fun T _ => ?_) hEX
      split_ifs with h
      · nlinarith [hb0 T]
      · simp only [mul_zero]; exact mul_nonneg (hb0 T) (hX0 T)
    rcases hM0.lt_or_eq with hpos | hzero
    · nlinarith
    · have hsum0 : ∑ T, bern δ T * X T = 0 :=
        le_antisymm (hzero ▸ hEX) (sum_nonneg fun T _ => mul_nonneg (hb0 T) (hX0 T))
      have hall := (Finset.sum_eq_zero_iff_of_nonneg
        (fun T _ => mul_nonneg (hb0 T) (hX0 T))).mp hsum0
      have : ∑ T : Finset α, (if 4 * M < X T then bern δ T else 0) = 0 := by
        refine sum_eq_zero fun T _ => ?_
        split_ifs with h
        · have hXT : 0 < X T := by rw [← hzero] at h; linarith
          have := hall T (mem_univ _)
          rcases mul_eq_zero.mp this with h' | h'
          · exact h'
          · linarith
  …

The complete declaration runs to line 158 of Formalism/FrobeniusOrbits/FrobeniusOrbitsProofs/ThickFrames.lean in the archive; the statement above is its full header.

UpperTheory.BernoulliSumsFrobeniusOrbits.topsChoiceHtheoremThickFrames/topsChoiceH.lean:30The application: for the scale ss, ranks RR and a host HH, a set TTTT of labels with 12δ1n≤∣TT∣≤2δ1n\tfrac12\delta_1 n \le |TT| \le 2\delta_1 n, bad orbits controlled, and the shares condition of the frame.
theorem UpperTheory.BernoulliSumsFrobeniusOrbits.topsChoiceH :
    ∀ eps C8 : ℝ, 0 < eps → eps < 1 / 52 → ∃ Cb x0 : ℝ, 0 < Cb ∧ ∀ (s : Scale) (R : Ranks) (H : Host R), s.eps = eps → x0 ≤ s.x →
      RankVal s R → HostConst s C8 H → (∃ Y : ℝ, PairWin s Y ∧ PairRow Y s.eps H) →
      ∃ TT : Finset R.A, s.delta1 * R.n / 2 ≤ (TT.card : ℝ) ∧ (TT.card : ℝ) ≤ 2 * s.delta1 * R.n ∧
        BadOK s Cb { H with TT

The application: for the scale ss, ranks RR and a host HH, a set TTTT of labels with 12δ1n≤∣TT∣≤2δ1n\tfrac12\delta_1 n \le |TT| \le 2\delta_1 n, bad orbits controlled, and the shares condition of the frame.

Full declaration with proof
theorem UpperTheory.BernoulliSumsFrobeniusOrbits.topsChoiceH :
    ∀ eps C8 : ℝ, 0 < eps → eps < 1 / 52 → ∃ Cb x0 : ℝ, 0 < Cb ∧ ∀ (s : Scale) (R : Ranks) (H : Host R), s.eps = eps → x0 ≤ s.x →
      RankVal s R → HostConst s C8 H → (∃ Y : ℝ, PairWin s Y ∧ PairRow Y s.eps H) →
      ∃ TT : Finset R.A, s.delta1 * R.n / 2 ≤ (TT.card : ℝ) ∧ (TT.card : ℝ) ≤ 2 * s.delta1 * R.n ∧
        BadOK s Cb { H with TT := TT } ∧ R.toFrame.Shares TT (s.x ^ (-1 + eps)) := by
  intro eps C8 heps heps52
  obtain ⟨Cb, x0, hCb, hT⟩ := topsBase eps (max C8 2) heps heps52
    (le_trans (by norm_num) (le_max_right _ _))
  refine ⟨Cb, x0, hCb, ?_⟩
  intro s R H hse hx hRV hHC hex
  obtain ⟨Y, hPW, hPR⟩ := hex
  obtain ⟨⟨hn1, hn2⟩, _, ⟨hk1, hk2⟩, _⟩ := hRV
  obtain ⟨hJ, ho, hQS⟩ := hHC
  rw [hse] at hn1 hn2 hk1 hk2 hPR
  have hCo1 : C8 ≤ max C8 2 := le_max_left _ _
  have hCo2 : (2 : ℝ) ≤ max C8 2 := le_max_right _ _
  have hx1 : 1 < s.x := s.one_lt_alt
  have hJ1 : 1 ≤ s.J := s.one_le_J
  have hkron := hPR.2.2.2.2.2.2.2.2.2.1
  have hsmall : s.x ^ (eps / (5 * max C8 2)) ≤ Y ^ (eps / 5) := by
    calc s.x ^ (eps / (5 * max C8 2)) = (s.x ^ (1 / max C8 2)) ^ (eps / 5) := by
          rw [← Real.rpow_mul (by linarith)]
          congr 1
          field_simp
      _ ≤ (s.x ^ (1 / s.J)) ^ (eps / 5) :=
          Real.rpow_le_rpow (Real.rpow_nonneg (by linarith) _)
            (Real.rpow_le_rpow_of_exponent_le hx1.le
              (one_div_le_one_div_of_le (by linarith) (by linarith))) (by positivity)
      _ ≤ Y ^ (eps / 5) := Real.rpow_le_rpow (Real.rpow_nonneg (by linarith) _) hPW.1 (by positivity)
  have hC0 : ∀ p : ℕ, p.Prime → (baseOf s 0 0 H).IsResidueClassZero p → s.x ^ (eps / (5 * max C8 2)) < p := by
    intro p hp hc
    exact lt_of_le_of_lt hsmall (lt_of_classC0' H hp hc hkron)
  have hxe : 0 ≤ s.x ^ (2 + 8 * eps) := Real.rpow_nonneg (by linarith) _
  obtain ⟨TT, h1, h2, h3, h4⟩ := hT (baseOf s 0 0 H) (hPH H) hse hx (by
      show s.x ^ (2 + 8 * eps) / 2 ≤ (R.n : ℝ)
      linarith)
    (le_trans hn2 (mul_le_mul_of_nonneg_right hCo2 hxe)) (le_trans ho hCo1) hk2 hC0
  exact ⟨TT, h1, h2, h4, h3⟩

Closing the loop with chapter 6

Chapter 6 ended with the contract : for every requirement a host satisfies, the family of LL-functions it serves is “class-connected”, meaning its statistic obeys the window bound on the scales of the family. The heart delivers this contract in three moves, and the archive’s final assembly is short enough to read.

UpperTheory.Comparison₂.core_gmtheoremPrimitiveCosets/CoreGm.lean:12The bound on GG in the archive (Estimates A, B and C assembled): for a level Λ\Lambda and exponents eD,eLe_D, e_L of the error bracket, there is x1x_1 such that for x≥x1x \ge x_1, every host HH and label set TTTT satisfying the host condition `EAtH` and the core comparison `CoreAtH` give Gm(x)≤x1/2+(eD+eL+7)εG_m(x) \le x^{1/2 + (e_D + e_L + 7)\varepsilon} for the family statistic GmG_m of chapter 6. The proof assembles `ch_top` (chapter 11) with the character-sum identity and the estimates B and C at the host.
theorem UpperTheory.Comparison₂.core_gm :
    ∀ (Λ : Level) (eD eL K cHH eK C eps : ℝ), 0 < eps → ∃ x1 : ℝ, ∀ x ≥ x1, ∀ (φ : Frame) (H : HostAx φ) (TT : Finset φ.A),
      EAtH Λ H.toHostRaw TT x eps C → CoreAtH H.toHostRaw TT eD eL K cHH eK eps x →
        Λ.Gm x ≤ x ^ ((1 : ℝ) / 2 + (eD + eL + 7) * eps)

The bound on GG in the archive (Estimates A, B and C assembled): for a level Λ\Lambda and exponents eD,eLe_D, e_L of the error bracket, there is x1x_1 such that for x≥x1x \ge x_1, every host HH and label set TTTT satisfying the host condition `EAtH` and the core comparison `CoreAtH` give Gm(x)≤x1/2+(eD+eL+7)εG_m(x) \le x^{1/2 + (e_D + e_L + 7)\varepsilon} for the family statistic GmG_m of chapter 6. The proof assembles `ch_top` (chapter 11) with the character-sum identity and the estimates B and C at the host.

Excerpt: the first 60 of 63 lines
theorem UpperTheory.Comparison₂.core_gm :
    ∀ (Λ : Level) (eD eL K cHH eK C eps : ℝ), 0 < eps → ∃ x1 : ℝ, ∀ x ≥ x1, ∀ (φ : Frame) (H : HostAx φ) (TT : Finset φ.A),
      EAtH Λ H.toHostRaw TT x eps C → CoreAtH H.toHostRaw TT eD eL K cHH eK eps x →
        Λ.Gm x ≤ x ^ ((1 : ℝ) / 2 + (eD + eL + 7) * eps) := by
  intro Λ eD eL K cHH eK C eps heps
  have ho : (0 : ℝ) ≤ Λ.o := Nat.cast_nonneg _
  have hc : |(3 * (Λ.o : ℝ) + 1)⁻¹| ≤ 1 := by
    rw [abs_of_nonneg (by positivity)]
    exact inv_le_one_of_one_le₀ (by linarith)
  obtain ⟨x₁, hx₁⟩ := Deduction.ch_core (max (eD + eL) 0 + 3) eps C (koOf Λ) (3 * (Λ.o : ℝ) + 1)⁻¹ (4 * (Λ.o : ℝ))
    (by positivity) heps hc
  obtain ⟨x₂, hx₂⟩ := large_x_eventually eps K cHH eK heps
  obtain ⟨x₃, hx₃⟩ := Filter.eventually_atTop.1
    ((tendsto_rpow_atTop heps).eventually_ge_atTop (1 + 4 * (Λ.o : ℝ)))
  refine ⟨max x₁ (max x₂ x₃), fun x hx φ H TT hE hCore => ?_⟩
  have g1 : x₁ ≤ x := le_trans (le_max_left _ _) hx
  have g2 : x₂ ≤ x := le_trans (le_trans (le_max_left _ _) (le_max_right _ _)) hx
  have g3 : x₃ ≤ x := le_trans (le_trans (le_max_right _ _) (le_max_right _ _)) hx
  obtain ⟨U0, i0, tr, W, i4, i5, Top, i6, m, f, Dd, Cc, Xpp, ell, N, T2, a, w, eT, eP, η, X', θ,
    hell, hxx, hε, heD, heL, hcHH, hcov, hId, hLed, hWin, hBN, hSz, hThin, hCost, hRest, hT2⟩ := hCore
  subst hxx hε
  have hLX := hx₂ _ g2
  have hWin' := hWin
  obtain ⟨⟨w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15, w16, w17, w18, w19, w20, w21, w22,
    w23, w24, w25, w26, w27, wC⟩, wEta⟩ := hWin'
  obtain ⟨c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17⟩ := wC
  have hLX' : LargeX Dd.x Dd.ε K Cc.cHH eK := by
    refine ⟨hLX.1, le_trans ?_ hLX.2⟩
    unfold KBig
    exact mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left (by linarith) (by positivity)) (by linarith)
  have hb : 0 < Dd.b := by linarith
  have hx0 : 0 < Dd.x := by linarith
  have hk : 0 < Dd.k := by linarith
  have ha : 0 ≤ Dd.a := le_trans (by positivity) w5
  have hE0 : 0 ≤ eD + eL := by linarith
  rw [max_eq_left hE0] at hx₁
  have hBr : 0 ≤ errorBracketSizeWindows Dd.x Dd.ε (Fintype.card φ.A) TT.card T2.card m Dd.b Dd.k Dd.a := by
    unfold errorBracketSizeWindows
    positivity
  have hExp : Dd.x ^ (CErr Cc * Dd.ε) ≤ Dd.x ^ ((eD + eL + 3) * Dd.ε) := by
    refine Real.rpow_le_rpow_of_exponent_le w1 (mul_le_mul_of_nonneg_right ?_ w2.le)
    unfold CErr
    linarith
  have hmain := hx₁ _ g1 φ.A m (arith H.toHostRaw) _ ell N TT T2 a w Dd.b Dd.b' Dd.k Dd.a η X' θ φ.A0
    (keptA Λ H.toHostRaw) (hostFactsS φ H) hb ha hk w7 w8 hSz hThin hCost hRest hT2
    (charsA Λ φ H TT _ _ C ell hx0 hE hell) (fun u hu => by
      obtain ⟨v, rfl⟩ := hcov u hu
      exact le_trans (Deduction.ch_top Dd tr Cc Xpp eK K _ ell N TT T2 a w eT eP hId hLed hWin hBN hLX' v)
        (mul_le_mul_of_nonneg_right hExp hBr))
  rw [gmA_eq Λ φ H TT _ _ C ell hE hell] at hmain
  have hs := sigA_le Λ φ H TT _ _ C ell hx0 hE hell
  have h1 : Dd.x ^ ((1 : ℝ) / 2 + Dd.ε) ≤ Dd.x ^ ((1 : ℝ) / 2 + (eD + eL + 3 + 3) * Dd.ε) :=
    Real.rpow_le_rpow_of_exponent_le w1 (by nlinarith)
  have h2 : Dd.x ^ ((1 : ℝ) / 2 + (eD + eL + 7) * Dd.ε)
      = Dd.x ^ Dd.ε * Dd.x ^ ((1 : ℝ) / 2 + (eD + eL + 3 + 3) * Dd.ε) := by
    rw [← Real.rpow_add hx0]
    congr 1
    ring
  have h3 := mul_le_mul_of_nonneg_right (hx₃ _ g3)
    (Real.rpow_nonneg hx0.le ((1 : ℝ) / 2 + (eD + eL + 3 + 3) * Dd.ε))
  …

The complete declaration runs to line 74 of Development/AutomorphicArithmetic/PrimitiveCosets/CoreGm.lean in the archive; the statement above is its full header.

Formalism.HC.EAtHstructureTotientGaloisClasses/ExplicitFormulaErrorOfHostConditions.lean:144The host condition: the orders agree, the kept characters are those of the level, the shares condition on TTTT, the pointwise bound of Estimate B for the kept characters at scale xx, and ∥L′/L(1,χ)∥≤Clog⁡x\|L'/L(1,\chi)\| \le C\log x for them.
structure EAtH (Λ : Level) {φ : Frame} (H : HostRaw φ) (TT : Finset φ.A) (x eps C : ℝ) : Prop

The host condition: the orders agree, the kept characters are those of the level, the shares condition on TTTT, the pointwise bound of Estimate B for the kept characters at scale xx, and ∥L′/L(1,χ)∥≤Clog⁡x\|L'/L(1,\chi)\| \le C\log x for them.

Full declaration with proof
structure EAtH (Λ : Level) {φ : Frame} (H : HostRaw φ) (TT : Finset φ.A) (x eps C : ℝ) : Prop where
  o_eq : φ.o = Λ.o
  kept : H.KeptInXp Λ.KEPT
  ps : H.ExceptionalCharacterKept Λ.KEPT Λ.psK
  shares : φ.Shares TT (x ^ (-1 + eps))
  bdG : H.BoundedCharsPointwise Λ.KEPT x eps
  bdL : ∀ θ ∈ H.Bounded Λ.KEPT, ∀ (N : ℕ) [NeZero N] (χ : DirichletCharacter ℂ N), H.IsPrimOf θ χ →
    ‖An.logDerivativeAtOne χ‖ ≤ C * Real.log x
UpperTheory.Comparison₂.CoreAtHdefPrimitiveCosets/CoreAtH.lean:29The core comparison at a host: the existence of translates, words, labels, the weighted-mean record `Data` of chapter 11 with its constants, the character ℓ\ell, the sets T2T_2 and the weights, compatible with the host.
def CoreAtH (H : HostRaw φ) (TT : Finset φ.A) (eD eL K cHH eK eps x : ℝ) : Prop

The core comparison at a host: the existence of translates, words, labels, the weighted-mean record `Data` of chapter 11 with its constants, the character ℓ\ell, the sets T2T_2 and the weights, compatible with the host.

Full declaration with proof
def CoreAtH (H : HostRaw φ) (TT : Finset φ.A) (eD eL K cHH eK eps x : ℝ) : Prop :=
  ∃ (U0 : Type) (_ : Fintype U0) (tr : U0 → φ.A)
    (W : U0 → Type) (_ : ∀ u0, Fintype (W u0)) (_ : ∀ u0, Nonempty (W u0)) (Top : Type) (_ : Fintype Top)
    (m f : ℕ) (Dd : Data U0 W Top m f) (C : Consts) (Xpp : ℝ)
    (ell : AddChar (E0 × φ.A) ℂ → ℂ) (N : ℕ) (T2 : Finset φ.A) (a : φ.A → ℝ)
    (w : φ.A → Fin m → E0 × φ.A → ℝ) (eT : Top ≃ TT) (eP : Fin f ≃ PhiSet (H := φ.A)) (η X' θ : ℝ),
    HostAddCharCompatible H ell ∧ Dd.x = x ∧ Dd.ε = eps ∧ C.eDiv ≤ eD ∧ C.eLoss ≤ eL ∧ C.cHH ≤ cHH ∧
    (∀ s ∈ φ.A0, ∃ u, tr u = s) ∧ IdentU Dd tr (arith H) N ell TT a w eT eP ∧
    Formalism.LFunctionChainParameters.LChain.SizeData₂ Dd C Xpp ∧ ErrWindows Dd C Xpp eK K ∧ BNBoundsU Dd T2 ∧
    SizesA φ.A0 TT T2 a w N x Dd.b Dd.b' η X' θ ∧ ThinScales (arith H) ell X' θ ∧
    CostWindows x (fPl φ.A) Dd.b η θ ∧
    RestSize eps x (Fintype.card φ.A) TT.card T2.card m Dd.b Dd.k Dd.a ∧
    ∀ s ∈ T2, s ∈ φ.A0
UpperTheory.Top.GChidefCharacterBoxes/Supply.lean:42The requirement for a character ψ\psi: `EAtH` at the level of ψ\psi with constant 44, and the cohomological bound b\sqrt b for the host's field.
def GChi (ψ : PChar) : FReq

The requirement for a character ψ\psi: `EAtH` at the level of ψ\psi with constant 44, and the cohomological bound b\sqrt b for the host's field.

Full declaration with proof
def GChi (ψ : PChar) : FReq := fun s _ H TT t =>
  EAtH (Level.cyc ψ) H.toHostRaw TT s.x s.eps 4 ∧ VVle H.E t (Real.sqrt s.b)
UpperTheory.Top.supplyChitheoremCharacterBoxes/SupplyChi.lean:8From the cohomological window for ψ\psi, a host that meets the requirement at the scale 3/23/2.
theorem UpperTheory.Top.supplyChi :
    ∀ ψ : PChar, VWinAt ψ 401 → HostExW (3 / 2) (GChi ψ).req

From the cohomological window for ψ\psi, a host that meets the requirement at the scale 3/23/2.

Full declaration with proof
theorem UpperTheory.Top.supplyChi :
    ∀ ψ : PChar, VWinAt ψ 401 → HostExW (3 / 2) (GChi ψ).req := by
  intro ψ hψ
  refine supplyOfAdm ψ hψ ?_
  intro eps he0 he1
  obtain ⟨x0, hx0⟩ := admissibleClassesTwistedChar eps he0 he1
  refine ⟨x0, fun s φ H0 hs hx hlo hhi _ _ => ?_⟩
  subst hs
  exact hx0 s φ H0 rfl hx hlo hhi
UpperTheory.Top.shapeWintheoremCharacterBoxes/ShapeWin.lean:27The theorem that proves `TopG` from Green's theorem and the long list of links of the construction (sizes, divisibility, denominators, ranks); its hypotheses are the quoted statements of chapters 13 to 15.
theorem UpperTheory.Top.shapeWin : GlobalTheory.GLq.Green → GlobalTheory.Fc.TopShape True True (fun 𝒞 => Closed 𝒞 fun Fm _ => LinkN Fm) UpperTheory.Top.TopG

The theorem that proves `TopG` from Green's theorem and the long list of links of the construction (sizes, divisibility, denominators, ranks); its hypotheses are the quoted statements of chapters 13 to 15.

Full declaration with proof
theorem UpperTheory.Top.shapeWin : GlobalTheory.GLq.Green → GlobalTheory.Fc.TopShape True True (fun 𝒞 => Closed 𝒞 fun Fm _ => LinkN Fm) UpperTheory.Top.TopG := by
  intro hGreen 𝒜 cT hEx sel hduty selS selP selDH selC selB hRB hTw hPA hLamP hDivG hDcPtG hTu hn4 hLit hVC hWu hRF hTF c30 hc30 sTy sNG sM sLp sO h30 hInstR selJ jOn hMt rRows aPt0 aPtTw aPer0 aPerTw aP10 aAtG aC2 hServ nR nRest cIc hcI irrC zL tie hU hG la G hla hH hV
  have hgl := GlobalTheory.Top.link_gl 𝒜 hduty tie hU hG
  have bRest := GlobalTheory.Top.link_brest 𝒜 sel selS selP selDH selC selB hRB hPA hDivG hDcPtG rRows tie
  have hCsz : Closed (D3 3 𝒜) fun Fm _ => 0 ≤ Fm.Csz := Formalism.MainNotions.DIV.closed_Csz_ge_fn (D3 3 𝒜) fun _ => 0
  have oneMap : Closed (D3 3 𝒜) fun Fm _ => ∀ hc : D3 3 𝒜 Fm, EvSel sel Fm (d3_a hc) ((OneMapOf selB) Fm (d3_a hc)) :=
    Closed.of_class fun Fm _ _ hc => ⟨0, fun x hx h _ i j => (hRB Fm (d3_a hc) x hx h i).oneMap j⟩
  have hA2 := GlobalTheory.Top.closed_family_admissible_twist_link 𝒜 sel aPt0 aPtTw aPer0 aPerTw aP10 aAtG hServ
  have hC5 := GlobalTheory.Top.selection_closed_of_wu_decay 𝒜 sel selS selP selDH selC selB hWu hRF selJ jOn rRows
  have hBR : Closed (D3 3 𝒜) fun Fm CH => ∀ hc : D3 3 𝒜 Fm, TuSize Fm → DGamSize Fm →
      Formalism.L2.DIV.BridgeRowsK Fm (RkOf sel selS selP selDH selC (selKOf selB) (selIOf selB) hPA Fm hc) 2 CH :=
    (bRest.and ((Closed.of_class fun Fm _ hc => cut_of_stable (hMt Fm (d3_a hc))).and (rRows.and (oneMap.and (hCsz.and (hA2.and (aC2.and hC5))))))).imp
      fun Fm CH _ ⟨r, o, rr, om, cz, a, c, c5⟩ hc hT hD =>
        (r hc hT hD).toRows (fun hN => GlobalTheory.Top.wire_sel 𝒜 sel selS selP selDH selC selB hTw hPA hDivG hDcPtG Fm hc CH cz hD (rr hc) (om hc) (r hc hT hD).bu hN) o a (complement_two_of_items c) c5
  have hDIV := Formalism.L2.DIV.linkDIVt_closedK (D3 3 𝒜) 2 (RkOf sel selS selP selDH selC (selKOf selB) (selIOf selB) hPA) hBR
  have hsub : ∀ {eps : ℝ} (Fm : FamP eps), WithTw (WithSm (WithChN fun Fm => 𝒜 Fm ∧ G.cls la Fm)) Fm →
      WithTw (WithSm (WithChN 𝒜)) Fm := fun _ hc => ⟨⟨⟨hc.1.1.1.1, hc.1.1.2⟩, hc.1.2⟩, hc.2⟩
  have hE := GlobalTheory.Top.link_ex (fun Fm => 𝒜 Fm ∧ G.cls la Fm) cT (fun hM => hEx hM la G hla hH) (fun Fm hc => sel Fm hc.1)
    (fun Fm hc => hduty Fm hc.1) (Pk.Closed.sub hTu hsub) (Pk.Closed.sub hn4 hsub) hLit
  exact UpperTheory.Top.topDesWin (WithChN 𝒜) (WithChN fun Fm => 𝒜 Fm ∧ G.cls la Fm) (G.cls la) 2 3 2 0 hE
    (fun _ hc => ⟨hc.1.1, hc.2⟩) (fun _ hc => hc.1.2) hV nRest (GlobalTheory.Top.link_eta 𝒜 sel hduty)
    (GlobalTheory.Top.Irr.link_irr hGreen 𝒜 sel cIc hcI irrC) (GlobalTheory.Top.smallLevelRankEq_closed_of_levelProjection_surjective 𝒜 sel selS selP selDH selC selB hPA hLamP hDivG zL) hDIV hgl.1 (GlobalTheory.Top.link_g 𝒜 sel hduty)
    (GlobalTheory.Top.link_alt 𝒜 sel selS hWu hRF hTF c30 hc30 sTy sNG sM sLp sO h30 hInstR) hgl.2
UpperTheory.Top.plugWintheoremCharacterBoxes/EveryCharacter.lean:8The assembly: Green's theorem, the cohomological window `VWin` and the closed family of links give `ZeroFreeAll`, by `zeroFreeAll_of_topG` applied to `shapeWin` (for `TopG`) and `supplyChi` (for the hosts). Chapter 5's `imprimitive` then gives every character.
theorem UpperTheory.Top.plugWin (hG : GlobalTheory.GLq.Green) (hV : UpperTheory.Top.VWin)
    (h : Nonempty (Hyps (fun 𝒞 => Closed 𝒞 fun Fm _ => LinkN Fm) DRS)) : Formalism.HC.ZeroFreeAll

The assembly: Green's theorem, the cohomological window `VWin` and the closed family of links give `ZeroFreeAll`, by `zeroFreeAll_of_topG` applied to `shapeWin` (for `TopG`) and `supplyChi` (for the hosts). Chapter 5's `imprimitive` then gives every character.

Full declaration with proof
theorem UpperTheory.Top.plugWin (hG : GlobalTheory.GLq.Green) (hV : UpperTheory.Top.VWin)
    (h : Nonempty (Hyps (fun 𝒞 => Closed 𝒞 fun Fm _ => LinkN Fm) DRS)) : Formalism.HC.ZeroFreeAll :=
  h.elim fun h => UpperTheory.Top.zeroFreeAll_of_topG (la := 3 / 2) (by norm_num)
    (GlobalTheory.Fc.shape_of _ _ _ _ (UpperTheory.Top.shapeWin hG) trivial trivial h) fun ψ => UpperTheory.Top.supplyChi ψ (hV ψ)
UpperTheory.Top.FamilyClassConnecteddefCharacterBoxes/DivinNOfHypV.lean:13The conclusion of `TopG` for a family class: exponents eD,eLe_D, e_L and a threshold ε1\varepsilon_1 such that for every ε<ε1\varepsilon < \varepsilon_1 some family in the class is chain-tied at every large xx in its windows.
def FamilyClassConnected (ℰ : FamClass) : Prop

The conclusion of `TopG` for a family class: exponents eD,eLe_D, e_L and a threshold ε1\varepsilon_1 such that for every ε<ε1\varepsilon < \varepsilon_1 some family in the class is chain-tied at every large xx in its windows.

Full declaration with proof
def FamilyClassConnected (ℰ : FamClass) : Prop :=
  ∃ eD eL ε₁ : ℝ, 0 < ε₁ ∧ ∀ eps : ℝ, 0 < eps → eps < ε₁ →
    ∃ Fm : FamP eps, ℰ Fm ∧ ∃ K cHH eK CL x0 : ℝ, ∀ x ≥ x0, x ∈ Fm.Win → ChainTied Fm eD eL K cHH eK CL x

our exposition The theorem shapeWin has a hypothesis list that runs to several dozen named links; the exposition’s Part III proves the analytic parts of several of them (the size estimates, the trace-formula deductions, the passage from the Galois-cohomology bound to denominators) from named statements of the archive and leaves the construction of the maps and weights, and the assembly of (M), quoted. Chapters 13 to 15 explain the three groups of links that remain.

The exposition's status table for this chapter

Estimate B: proved in his Part III, §III.1 from four cited theorems on Dirichlet LL-functions (a zero-density estimate near Re⁡s=1\operatorname{Re}s = 1, mean-square estimates over the modulus, and the standard explicit formula inputs). Estimate C: proved in §III.2 from three cited theorems and part (e) of Theorem III.1.1. The sets T2T_2 and TT: constructed with proof in §III.3; their use in (M) belongs to the part not yet written. He checked that the Lean proofs these sections follow (QH.thinH, twistK, meanSqK, bad_share, tailK, count_bad, hostThickExists, topsChoiceH) are all among the declarations the final theorem depends on.