RiemannA guide by Principia Superintelligence

Part II, chapter 10

How a derivative gains a prime

The divisibility side of the main inequality. A derivative of order aa gains a(1/p+1/p3+⋯ )a(1/p + 1/p^3 + \cdots) at an inert prime; each minor of the polynomial can absorb one derivative per direction, so a weight ww is subtracted at every scale php^h; and the identity (a/ph−w)+=w (x/ph−1)+(a/p^h - w)_+ = w\,(x/p^h - 1)_+ turns the gain into bb times the ramp of G(x)G(x). This is where the kernel of GG was decided.

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

What the exponent really is

For the entries of a theta lift the exponent of an inert prime is not a(1/p+1/p3+⋯ )a(1/p + 1/p^3 + \cdots) but a modification of it. Fix one of the 2n2n embeddings of the field; call it the place. Let aa be the order (the degree of the polynomial PP of chapter 9) at that place. Then, schematically,

exponent of an inert prime p  ≥  ∑h odd(aph−wh)+  −  (small losses),\text{exponent of an inert prime } p \;\ge\; \sum_{h \text{ odd}} \Big(\frac{a}{p^h} - w_h\Big)_+ \;-\; (\text{small losses}),

where wh>0w_h > 0 is a weight attached to another place: the one reached from the given place by the Frobenius automorphism of php^h followed by complex conjugation. The display keeps only the main term. The statement proved in the archive is an inequality for sums of such exponents over the mm lifts and over the places, with several loss terms: from the digits of the integers involved, from repeated visits of a Frobenius orbit to the same place, and from indices of lattices (the exposition §I.4.3 and Part II, §6.4). This chapter explains the main term and shows the archive’s elementary lemmas behind it.

The Frobenius and the places. The field EE lies inside a field generated by roots of unity. The Frobenius of pp is the automorphism of EE induced by raising those roots of unity to the pp-th power. It permutes the 4n4n embeddings of EE, and it depends only on residue classes of pp. The 2n2n places are chosen embeddings, one from each pair of complex conjugates. At a prime that is inert in Q(−d)\mathbb Q(\sqrt{-d}) an odd power of the Frobenius carries each chosen embedding to one that is not chosen; composing with complex conjugation brings it back. This is the reason for the conjugation above, and since the Frobenius depends only on a residue class of php^h, residue classes of prime powers are what the table of chapter 11 sorts.

Where the subtraction of ww comes from

The polynomial PP is a product, over the 2n2n places, of minors (determinants of sub-matrices) of the matrix variable at each place. Its shape at each place is described by a diagram of boxes. At the chosen place the diagram has a first row of length about aa. At another place τ′\tau' the polynomial contains about wτ′w_{\tau'} minors, where wτ′w_{\tau'} is the weight parameter at τ′\tau'. At the scale php^h the Frobenius links the chosen place to the place τh\tau_h, and each minor there can absorb only one derivative in a linked direction: in

det⁡(X+s b,  Y+t b)  =  det⁡(X,Y)+sdet⁡(b,Y)+tdet⁡(X,b)+stdet⁡(b,b)\det(X + s\,b,\; Y + t\,b) \;=\; \det(X,Y) + s\det(b,Y) + t\det(X,b) + st\det(b,b)

the last term is zero, so there is no term in stst, s2s^2 or t2t^2. Each derivative absorbed at τh\tau_h costs one unit of the gain at the scale php^h. There are about whw_h minors at τh\tau_h, each absorbing at most one, and at most a/pha/p^h units are available; so the loss at that scale is at most min⁡(a/ph,wh)\min(a/p^h, w_h), and what survives is (a/ph−wh)+(a/p^h - w_h)_+.

A minor absorbs one derivative per direction; the ledger for a=81a = 81, p=3p = 3, w=2w = 2; and the identity that turns (a/ph−w)+(a/p^h - w)_+ into ww times the ramp (x/ph−1)+(x/p^h - 1)_+ at the scale x=a/wx = a/w.

Example. Take a=81a = 81, p=3p = 3 and wh=2w_h = 2 for all hh. At h=1,3,5,7h = 1, 3, 5, 7 the values a/pha/p^h are 27,3,0.33,0.0427, 3, 0.33, 0.04; subtracting 22 and keeping the positive parts gives 25,1,0,025, 1, 0, 0. The exponent is at least 25+1=2625 + 1 = 26, up to the losses, and every term with ph>a/w=40.5p^h > a/w = 40.5 is zero. The explorer below recomputes this ledger for other orders, primes and weights.

h (odd)p^ha / p^ha / p^h − wpositive part= w · (x/p^h − 1)₊
1327.0025.0025.002 · 12.50
3273.001.001.002 · 0.50
52430.33-1.670.002 · 0.00
total gain, before losses26.00a·p/(p²−1) = 30.38

With these values the scale is x = a/w = 40.50; only prime powers p^h below x contribute, and each contributes w times the ramp (x/p^h − 1)₊ of chapter 2. Without any weight (w = 0) the gain would be the full a(1/p + 1/p³ + ⋯) = 30.38 of chapter 8.

Hasse derivatives and minors in the archive

The archive works with Hasse derivatives rather than ordinary ones, because they carry no factorial denominators: the directional Hasse derivative of order β\beta of a polynomial QQ in the directions b1,b2,…b_1, b_2, \ldots is the coefficient of ZβZ^\beta in Q(X+∑jbjZj)Q(X + \sum_j b_j Z_j) (background). Three facts are proved about them.

Formalism.InvariantFactorPaths.G7.hasseDirdefUniformThetaSubstitution/StatementAB.lean:25The definition: shift QQ by ∑kZk bk\sum_k Z_k\,b_k and take the coefficient of ZβZ^\beta.
def hasseDir {K ι κ : Type} [Field K] [Fintype κ] (b : κ → ι → K) (β : κ →₀ ℕ)
    (Q : MvPolynomial ι K) : MvPolynomial ι K

The definition: shift QQ by ∑kZk bk\sum_k Z_k\,b_k and take the coefficient of ZβZ^\beta.

Full declaration with proof
def hasseDir {K ι κ : Type} [Field K] [Fintype κ] (b : κ → ι → K) (β : κ →₀ ℕ)
    (Q : MvPolynomial ι K) : MvPolynomial ι K :=
  MvPolynomial.coeff β (shiftPoly b Q)
Formalism.InvariantFactorPaths.G7.HasseDerivIntegralHomogeneousdefUniformThetaSubstitution/StatementAB.lean:35Over a non-archimedean field, Hasse derivatives of a polynomial with integral coefficients in integral directions have integral coefficients; they lower the degree of a homogeneous polynomial by ∣β∣|\beta|, and vanish when ∣β∣|\beta| exceeds the degree.
def HasseDerivIntegralHomogeneous : Prop

Over a non-archimedean field, Hasse derivatives of a polynomial with integral coefficients in integral directions have integral coefficients; they lower the degree of a homogeneous polynomial by ∣β∣|\beta|, and vanish when ∣β∣|\beta| exceeds the degree.

Full declaration with proof
def HasseDerivIntegralHomogeneous : Prop :=
  ∀ (K ι κ : Type) [NormedField K] [IsUltrametricDist K] [Fintype κ] (b : κ → ι → K)
    (β : κ →₀ ℕ) (Q : MvPolynomial ι K),
    ((∀ n, ‖MvPolynomial.coeff n Q‖ ≤ 1) → (∀ k x, ‖b k x‖ ≤ 1) →
      ∀ n, ‖MvPolynomial.coeff n (hasseDir b β Q)‖ ≤ 1) ∧
    (∀ d, Q.IsHomogeneous d → (hasseDir b β Q).IsHomogeneous (d - ∑ k, β k)) ∧
    (∀ d, Q.IsHomogeneous d → d < ∑ k, β k → hasseDir b β Q = 0)
Formalism.InvariantFactorPaths.G7.HasseDerivProdVanishdefUniformThetaSubstitution/StatementAB.lean:43The product-vanishing lemma: if the derivative of each factor fcf_c vanishes whenever its order in a set SS of directions exceeds mcm_c, then the derivative of ∏cfc\prod_c f_c vanishes whenever its order in SS exceeds ∑cmc\sum_c m_c. Each term of the Leibniz expansion exceeds the allowance of some factor.
def HasseDerivProdVanish : Prop

The product-vanishing lemma: if the derivative of each factor fcf_c vanishes whenever its order in a set SS of directions exceeds mcm_c, then the derivative of ∏cfc\prod_c f_c vanishes whenever its order in SS exceeds ∑cmc\sum_c m_c. Each term of the Leibniz expansion exceeds the allowance of some factor.

Full declaration with proof
def HasseDerivProdVanish : Prop :=
  ∀ (K ι κ : Type) [Field K] [Fintype κ] (b : κ → ι → K) (C : ℕ)
    (f : Fin C → MvPolynomial ι K) (m : Fin C → ℕ) (S : Finset κ),
    (∀ c (β' : κ →₀ ℕ), m c < ∑ k ∈ S, β' k → hasseDir b β' (f c) = 0) →
    ∀ β : κ →₀ ℕ, ∑ c, m c < ∑ k ∈ S, β k → hasseDir b β (∏ c, f c) = 0
Formalism.InvariantFactorPaths.G7.Top.e_one_vanishtheoremUniformThetaSubstitution/KOneConsequence.lean:27The proof of the product-vanishing lemma (by `e_one_vanish_of`).
theorem e_one_vanish : HasseDerivProdVanish

The proof of the product-vanishing lemma (by `e_one_vanish_of`).

For a determinant the allowance has the simple origin shown above. The archive states it for minors of the matrix variable at a place ss, built from a frame of row vectors TT and a choice II of columns:

Formalism.InvariantFactorPaths.G7.minorAtdefUniformThetaSubstitution/StatementAB.lean:53The minor at the place ss: the determinant of the l×ll \times l matrix whose (i,c)(i, c) entry is ∑aTia X(s,a,Ic)\sum_a T_{ia}\,X_{(s, a, I_c)}.
def minorAt {K σ : Type} [Field K] {r0 r1 l : ℕ} (s : σ) (T : Fin l → Fin r0 → K)
    (I : Fin l → Fin r1) : MvPolynomial (σ × Fin r0 × Fin r1) K

The minor at the place ss: the determinant of the l×ll \times l matrix whose (i,c)(i, c) entry is ∑aTia X(s,a,Ic)\sum_a T_{ia}\,X_{(s, a, I_c)}.

Full declaration with proof
def minorAt {K σ : Type} [Field K] {r0 r1 l : ℕ} (s : σ) (T : Fin l → Fin r0 → K)
    (I : Fin l → Fin r1) : MvPolynomial (σ × Fin r0 × Fin r1) K :=
  (Matrix.of fun (i c : Fin l) =>
    (∑ a, MvPolynomial.C (T i a) * MvPolynomial.X (s, a, I c) :
      MvPolynomial (σ × Fin r0 × Fin r1) K)).det
Formalism.InvariantFactorPaths.G7.MinorHitsdefUniformThetaSubstitution/StatementAB.lean:59A directional Hasse derivative of a single minor vanishes as soon as some direction is hit twice, or two distinct directions at the same place share a row vector or a column, or a direction points at another place or at a column outside II. One hit per direction, and only in the minor's own columns.
def MinorHits : Prop

A directional Hasse derivative of a single minor vanishes as soon as some direction is hit twice, or two distinct directions at the same place share a row vector or a column, or a direction points at another place or at a column outside II. One hit per direction, and only in the minor's own columns.

Full declaration with proof
def MinorHits : Prop :=
  ∀ (K σ κ : Type) [Field K] [DecidableEq σ] [Fintype κ] (r0 r1 l : ℕ) (s : σ)
    (T : Fin l → Fin r0 → K) (I : Fin l → Fin r1) (pos : κ → σ) (ξ : κ → Fin r0 → K)
    (col : κ → Fin r1) (β : κ →₀ ℕ),
    ((∃ k, 2 ≤ β k) ∨
      (∃ k k', k ≠ k' ∧ 1 ≤ β k ∧ 1 ≤ β k' ∧ pos k = pos k' ∧ (ξ k = ξ k' ∨ col k = col k')) ∨
      (∃ k, 1 ≤ β k ∧ (pos k ≠ s ∨ col k ∉ Set.range I))) →
    hasseDir (fun k => colDir (pos k) (ξ k) (col k)) β (minorAt s T I) = 0
Formalism.InvariantFactorPaths.G7.Top.minorHitstheoremUniformThetaSubstitution/KOneConsequence.lean:28The proof (by `minor_hits`).
theorem minorHits : MinorHits

The proof (by `minor_hits`).

Formalism.InvariantFactorPaths.G7.HitsCapdefUniformThetaSubstitution/StatementAB.lean:68A product of CC minors takes at most CC hits from directions sharing a place and a row vector.
def HitsCap : Prop

A product of CC minors takes at most CC hits from directions sharing a place and a row vector.

Full declaration with proof
def HitsCap : Prop :=
  ∀ (K σ κ : Type) [Field K] [DecidableEq σ] [Fintype κ] (r0 r1 C : ℕ) (l : Fin C → ℕ)
    (sf : Fin C → σ) (T : ∀ c, Fin (l c) → Fin r0 → K) (I : ∀ c, Fin (l c) → Fin r1) (pos : κ → σ)
    (ξ : κ → Fin r0 → K) (col : κ → Fin r1) (S : Finset κ),
    (∀ k ∈ S, ∀ k' ∈ S, pos k = pos k' ∧ ξ k = ξ k') →
    ∀ β : κ →₀ ℕ, C < ∑ k ∈ S, β k →
      hasseDir (fun k => colDir (pos k) (ξ k) (col k)) β (∏ c, minorAt (sf c) (T c) (I c)) = 0
Formalism.InvariantFactorPaths.G7.HitsColumnsdefUniformThetaSubstitution/StatementAB.lean:76With directions confined to a set JJ of columns, the number of available columns, summed over the minors, is another upper bound on the hits.
def HitsColumns : Prop

With directions confined to a set JJ of columns, the number of available columns, summed over the minors, is another upper bound on the hits.

Full declaration with proof
def HitsColumns : Prop :=
  ∀ (K σ κ : Type) [Field K] [DecidableEq σ] [Fintype κ] (r0 r1 C : ℕ) (l : Fin C → ℕ)
    (sf : Fin C → σ) (T : ∀ c, Fin (l c) → Fin r0 → K) (I : ∀ c, Fin (l c) → Fin r1) (pos : κ → σ)
    (ξ : κ → Fin r0 → K) (col : κ → Fin r1) (S : Finset κ) (J : Finset (Fin r1)),
    (∀ k ∈ S, ∀ k' ∈ S, pos k = pos k') → (∀ k ∈ S, col k ∈ J) →
    ∀ β : κ →₀ ℕ, ∑ c, ((univ.image (I c)) ∩ J).card < ∑ k ∈ S, β k →
      hasseDir (fun k => colDir (pos k) (ξ k) (col k)) β (∏ c, minorAt (sf c) (T c) (I c)) = 0

These are constraints on nonvanishing terms before any prime is mentioned. Suppose a local expansion of derivative order aa supplies a valuation lower bound γpa−∑hih−D0\gamma_p a - \sum_h i_h - D_0, with γp=p/(p2−1)\gamma_p = p/(p^2-1), where D0D_0 is a loss and the nonvanishing terms satisfy 0≤ih≤min⁡(a/ph,wh)0 \le i_h \le \min(a/p^h, w_h) for odd hh. Then the gain after charging these terms is at least ∑h odd(a/ph−wh)+−D0\sum_{h\text{ odd}} (a/p^h - w_h)_+ - D_0. The first bound phih≤ap^h i_h \le a is a degree bound; the second is supplied by the column and minor capacities above. The archive packages this charging step as a statement about an excess gain:

Formalism.GrowthSums.excessGaindefGrowthSums/StatementA.lean:108The sum over places ss in the distinguished set and over odd exponents 2e+12e+1 of (αs/p2e+1−cap(s+2e+1))+(\alpha_s/p^{2e+1} - \mathrm{cap}(s + 2e + 1))_+, minus a loss term de\mathrm{de}: the main term above, with the capacity cap\mathrm{cap} at the place reached by the Frobenius standing for whw_h.
def excessGain {n : ℕ} (p : ℝ) (TT : Finset (ZMod n)) (D : ZMod n → Finset ℕ) (al cap : ZMod n → ℝ)
    (de : ℝ) : ℝ

The sum over places ss in the distinguished set and over odd exponents 2e+12e+1 of (αs/p2e+1−cap(s+2e+1))+(\alpha_s/p^{2e+1} - \mathrm{cap}(s + 2e + 1))_+, minus a loss term de\mathrm{de}: the main term above, with the capacity cap\mathrm{cap} at the place reached by the Frobenius standing for whw_h.

Full declaration with proof
def excessGain {n : ℕ} (p : ℝ) (TT : Finset (ZMod n)) (D : ZMod n → Finset ℕ) (al cap : ZMod n → ℝ)
    (de : ℝ) : ℝ :=
  ∑ s ∈ TT, ∑' e : ℕ,
    (if 2 * e + 1 ∈ D s then 0 else max (al s / p ^ (2 * e + 1) - cap (s + ((2 * e + 1 : ℕ) : ZMod n))) 0)
    - de
Formalism.InvariantFactorPaths.G7.ExcessGainBounddefUniformThetaSubstitution/StatementAB.lean:120If a valuation vv is at least γp∑αs−∑(charges+hits)−de\gamma_p\sum\alpha_s - \sum(\text{charges} + \text{hits}) - \mathrm{de} and each charge is bounded by the degree and by the capacity, then the excess gain is at most vv.
def ExcessGainBound : Prop

If a valuation vv is at least γp∑αs−∑(charges+hits)−de\gamma_p\sum\alpha_s - \sum(\text{charges} + \text{hits}) - \mathrm{de} and each charge is bounded by the degree and by the capacity, then the excess gain is at most vv.

Full declaration with proof
def ExcessGainBound : Prop :=
  ∀ (n : ℕ) (p : ℝ) (TT : Finset (ZMod n)) (D : ZMod n → Finset ℕ) (al cap : ZMod n → ℝ)
    (de v : ℝ) (i ch : ZMod n → ℕ → ℝ) (E : Finset ℕ),
    1 < p → (∀ s, 0 ≤ al s) → (∀ s, 0 ≤ cap s) → (∀ s e, 0 ≤ i s e) → (∀ s e, 0 ≤ ch s e) →
    (∀ s e, e ∉ E → i s e = 0 ∧ ch s e = 0) → (∀ s e, 2 * e + 1 ∉ D s → ch s e = 0) →
    gamP p * ∑ s ∈ TT, al s - ∑ s ∈ TT, ∑ e ∈ E, ch s e - ∑ s ∈ TT, ∑ e ∈ E, i s e - de ≤ v →
    (∀ s ∈ TT, ∀ e, 2 * e + 1 ∈ D s → ch s e + i s e ≤ al s / p ^ (2 * e + 1)) →
    (∀ s ∈ TT, ∀ e, 2 * e + 1 ∉ D s →
      i s e ≤ min (al s / p ^ (2 * e + 1)) (cap (s + ((2 * e + 1 : ℕ) : ZMod n)))) →
    excessGain p TT D al cap de ≤ v
Formalism.InvariantFactorPaths.G7.excessGainBoundtheoremFrobeniusLiftNorms/ABArith.lean:193Its proof.
theorem excessGainBound : ExcessGainBound

Its proof.

Full declaration with proof
theorem excessGainBound : ExcessGainBound := by
  intro n p TT D al cap de v i ch E hp hal hcap hi0 hch0 hE hchD hv hD hnD
  have hp0 : 0 < p := by linarith
  obtain ⟨hgs, -⟩ := Formalism.GrowthSums.oddPowerInvSumIdentity p hp
  have key : ∀ s ∈ TT, (∑' e : ℕ, (if 2 * e + 1 ∈ D s then 0 else
      max (al s / p ^ (2 * e + 1) - cap (s + ((2 * e + 1 : ℕ) : ZMod n))) 0)) ≤
      gamP p * al s - ∑ e ∈ E, ch s e - ∑ e ∈ E, i s e := by
    intro s hs
    have hA : HasSum (fun e : ℕ => al s / p ^ (2 * e + 1)) (gamP p * al s) := by
      have h := hgs.mul_right (al s)
      have hf : (fun e : ℕ => al s / p ^ (2 * e + 1)) =
          fun e : ℕ => (p ^ (2 * e + 1))⁻¹ * al s := by
        funext e
        rw [div_eq_mul_inv, mul_comm]
      rw [hf]
      exact h
    have hC : HasSum (fun e : ℕ => ch s e) (∑ e ∈ E, ch s e) :=
      hasSum_sum_of_ne_finset_zero (fun e he => (hE s e he).2)
    have hI : HasSum (fun e : ℕ => i s e) (∑ e ∈ E, i s e) :=
      hasSum_sum_of_ne_finset_zero (fun e he => (hE s e he).1)
    have hR := (hA.sub hC).sub hI
    have hpos : ∀ e : ℕ, 0 ≤ al s / p ^ (2 * e + 1) :=
      fun e => div_nonneg (hal s) (pow_nonneg hp0.le _)
    have hsum : Summable (fun e : ℕ => (if 2 * e + 1 ∈ D s then (0 : ℝ) else
        max (al s / p ^ (2 * e + 1) - cap (s + ((2 * e + 1 : ℕ) : ZMod n))) 0)) := by
      refine Summable.of_nonneg_of_le (fun e => ?_) (fun e => ?_) hA.summable
      · split_ifs
        · exact le_rfl
        · exact le_max_right _ _
      · split_ifs
        · exact hpos e
        · exact max_le (by linarith [hcap (s + ((2 * e + 1 : ℕ) : ZMod n))]) (hpos e)
    refine hasSum_le (fun e => ?_) hsum.hasSum hR
    split_ifs with h
    · have := hD s hs e h
      linarith
    · have h1 := hnD s hs e h
      have h2 := hchD s e h
      have h3 := le_trans h1 (min_le_left _ _)
      have h4 := le_trans h1 (min_le_right _ _)
      rw [h2]
      exact max_le (by linarith) (by linarith)
  have hsum := Finset.sum_le_sum key
  rw [Finset.sum_sub_distrib, Finset.sum_sub_distrib, ← Finset.mul_sum] at hsum
  unfold excessGain
  linarith

The factorial count

The initial lower bound comes from the valuations of the factorials that the substitution produces, and the archive proves it with explicit digit losses. Let λp(n)\lambda_p(n) be the number of base-pp digits of nn. Given nonnegative integers αs\alpha_s (the orders, zero outside the distinguished set TT), ℓs\ell_s, lists es,be_{s,b} summing to αs\alpha_s, lists as,xa_{s,x} summing to at most ℓs\ell_s, and charges is,e′i_{s,e'} with p2e′+1is,e′≤αsp^{2e'+1} i_{s,e'} \le \alpha_s, with ∑a+∑i=∑ℓ\sum a + \sum i = \sum \ell and p i2≤∑ℓp\,i_2 \le \sum\ell, the total valuation VV of all the factorials satisfies

V  ≥  γp A+ρp (A+Λ)+i2−Δ,A=∑sαs, Λ=∑sℓs, ρp=1p2−1,V \;\ge\; \gamma_p\,A + \rho_p\,(A + \Lambda) + i_2 - \Delta, \qquad A = \sum_s\alpha_s,\ \Lambda = \sum_s \ell_s,\ \rho_p = \frac{1}{p^2-1},

where Δ=∑s(r1λp(αs)+r0r1λp(ℓs))+∑s∈Tλp(αs)2\Delta = \sum_s\big(r_1\lambda_p(\alpha_s) + r_0 r_1\lambda_p(\ell_s)\big) + \sum_{s \in T}\lambda_p(\alpha_s)^2 counts digits. The proof is Legendre’s formula, vp(n!)≥n/(p−1)−λp(n)v_p(n!) \ge n/(p-1) - \lambda_p(n), applied to every factorial, then (A+Λ)/(p−1)=γpA+γpΛ+ρp(A+Λ)(A+\Lambda)/(p-1) = \gamma_p A + \gamma_p\Lambda + \rho_p(A+\Lambda) and γpΛ≥Λ/p≥i2\gamma_p\Lambda \ge \Lambda/p \ge i_2. The term γpA\gamma_p A is the model gain of chapter 8; ρp(A+Λ)\rho_p(A+\Lambda) pays exactly for the denominators 1/(p2−1)1/(p^2-1) per unit of degree in the inverse series; i2i_2 pays for one further division. The loss is small: with p=3p = 3, one index, α=81\alpha = 81, ℓ=0\ell = 0 and no charges, V=v3(81!)=40V = v_3(81!) = 40 while γ3A+ρ3A=40.5\gamma_3 A + \rho_3 A = 40.5 and Δ=λ(81)+λ(81)2=30\Delta = \lambda(81) + \lambda(81)^2 = 30. The main terms agree to within one.

Formalism.InvariantFactorPaths.G7.StarArithdefUniformThetaSubstitution/StatementAB.lean:103The factorial count, exactly as stated above, with `gamP`, `rhoP`, the digit loss `deLoss` and the three families of factorials.
def StarArith : Prop

The factorial count, exactly as stated above, with `gamP`, `rhoP`, the digit loss `deLoss` and the three families of factorials.

Full declaration with proof
def StarArith : Prop :=
  ∀ (S : Type) [Fintype S] (p r0 r1 : ℕ) (TT : Finset S) (al ls : S → ℕ)
    (e : S → Fin r1 → ℕ) (a : S → Fin r0 × Fin r1 → ℕ) (i : S → ℕ → ℕ) (E : Finset ℕ) (i0 i2 : ℕ),
    p.Prime → (∀ s, s ∉ TT → al s = 0) → (∀ s, ∑ b, e s b = al s) →
    (∀ s, ∑ x, a s x ≤ ls s) → (∀ s e', e' ∉ E → i s e' = 0) → (∀ s, s ∉ TT → ∀ e', i s e' = 0) →
    (∀ s e', p ^ (2 * e' + 1) * i s e' ≤ al s) →
    (∑ s, ∑ x, a s x + ∑ s, ∑ e' ∈ E, i s e' = ∑ s, ls s) → p * i2 ≤ ∑ s, ls s →
    gamP p * ∑ s ∈ TT, (al s : ℝ) - i0 - ∑ s ∈ TT, ∑ e' ∈ E, (i s e' : ℝ) - deLoss p r0 r1 TT al ls ≤
      (∑ s, ∑ b, (padicValNat p (e s b).factorial : ℝ)) +
        (∑ s, ∑ e' ∈ E, (padicValNat p (i s e').factorial : ℝ)) +
        (∑ s, ∑ x, (padicValNat p (a s x).factorial : ℝ)) -
        rhoP p * (∑ s, ((al s : ℝ) + ls s)) - (i0 + ∑ s, ∑ e' ∈ E, (i s e' : ℝ) + i2)
Formalism.InvariantFactorPaths.G7.gainFactorialInequalitytheoremFrobeniusLiftNorms/ABArith.lean:103Its proof, from `FactorialLg` (chapter 7).
theorem gainFactorialInequality : StarArith

Its proof, from `FactorialLg` (chapter 7).

Excerpt: the first 60 of 81 lines
theorem gainFactorialInequality : StarArith := by
  intro S _ p r0 r1 TT al ls e a i E i0 i2 hp halT he ha hiE hiT hpi htot hi2
  have hp1 : (1 : ℝ) < p := by exact_mod_cast hp.one_lt
  have hp0 : (0 : ℝ) < p := by linarith
  obtain ⟨-, hgam⟩ := Formalism.GrowthSums.oddPowerInvSumIdentity (p : ℝ) hp1
  set c : ℝ := 1 / ((p : ℝ) - 1) with hc

  have H1 : ∀ s, (al s : ℝ) * c - (r1 : ℝ) * lgN p (al s) ≤
      ∑ b, (padicValNat p (e s b).factorial : ℝ) := by
    intro s
    have h := sum_factorial_ge p hp univ (e s) (al s)
      (fun x _ => by rw [← he s]; exact Finset.single_le_sum (fun _ _ => Nat.zero_le _) (mem_univ x))
    rw [he s, card_univ, Fintype.card_fin] at h
    rw [hc, mul_one_div]
    exact h

  have H3 : ∀ s, ((∑ x, a s x : ℕ) : ℝ) * c - (r0 : ℝ) * r1 * lgN p (ls s) ≤
      ∑ x, (padicValNat p (a s x).factorial : ℝ) := by
    intro s
    have h := sum_factorial_ge p hp univ (a s) (ls s)
      (fun x _ => le_trans (Finset.single_le_sum (fun _ _ => Nat.zero_le _) (mem_univ x)) (ha s))
    rw [card_univ, Fintype.card_prod, Fintype.card_fin, Fintype.card_fin, Nat.cast_mul] at h
    rw [hc, mul_one_div]
    exact h

  have H2 : ∀ s, ((∑ e' ∈ E, i s e' : ℕ) : ℝ) * c - ((lgN p (al s) : ℝ)) ^ 2 ≤
      ∑ e' ∈ E, (padicValNat p (i s e').factorial : ℝ) := by
    intro s
    have h1 : ∑ e' ∈ E, ((i s e' : ℝ) / ((p : ℝ) - 1) - lgN p (i s e')) ≤
        ∑ e' ∈ E, (padicValNat p (i s e').factorial : ℝ) :=
      Finset.sum_le_sum (fun e' _ => factorialValuationLowerBound p (i s e') hp)
    have h2 : ((∑ e' ∈ E, lgN p (i s e') : ℕ) : ℝ) ≤ ((lgN p (al s) : ℝ)) ^ 2 := by
      exact_mod_cast sum_lgN_le p hp.one_lt (al s) (i s) E (hpi s)
    rw [Finset.sum_sub_distrib, ← Finset.sum_div] at h1
    rw [Nat.cast_sum] at h2
    rw [hc, mul_one_div, Nat.cast_sum]
    linarith
  have hlg0 : ∀ s, s ∉ TT → ((lgN p (al s) : ℝ)) ^ 2 = 0 := by
    intro s hs
    simp [lgN, halT s hs]
  have hTT_lg : ∑ s ∈ TT, ((lgN p (al s) : ℝ)) ^ 2 = ∑ s, ((lgN p (al s) : ℝ)) ^ 2 :=
    Finset.sum_subset (subset_univ _) (fun s _ hs => hlg0 s hs)
  have hTT_al : ∑ s ∈ TT, (al s : ℝ) = ∑ s, (al s : ℝ) :=
    Finset.sum_subset (subset_univ _) (fun s _ hs => by rw [halT s hs, Nat.cast_zero])
  have hTT_i : ∑ s ∈ TT, ∑ e' ∈ E, (i s e' : ℝ) = ∑ s, ∑ e' ∈ E, (i s e' : ℝ) :=
    Finset.sum_subset (subset_univ _) (fun s _ hs => by simp [hiT s hs])
  have S1 := Finset.sum_le_sum (fun s (_ : s ∈ (univ : Finset S)) => H1 s)
  have S2 := Finset.sum_le_sum (fun s (_ : s ∈ (univ : Finset S)) => H2 s)
  have S3 := Finset.sum_le_sum (fun s (_ : s ∈ (univ : Finset S)) => H3 s)
  rw [Finset.sum_sub_distrib, ← Finset.sum_mul] at S1 S2 S3
  have htotR : (∑ s, ((∑ x, a s x : ℕ) : ℝ)) + ∑ s, ((∑ e' ∈ E, i s e' : ℕ) : ℝ) =
      ∑ s, (ls s : ℝ) := by
    exact_mod_cast htot
  have hiR : ∑ s, ((∑ e' ∈ E, i s e' : ℕ) : ℝ) = ∑ s, ∑ e' ∈ E, (i s e' : ℝ) := by
    push_cast
    rfl
  have hi2R : (p : ℝ) * i2 ≤ ∑ s, (ls s : ℝ) := by exact_mod_cast hi2
  have hL0 : (0 : ℝ) ≤ ∑ s, (ls s : ℝ) := Finset.sum_nonneg (fun _ _ => Nat.cast_nonneg _)

  have hgp : 1 / (p : ℝ) ≤ gamP p := by
  …

The complete declaration runs to line 183 of Formalism/ThetaLogCoordinates/UniformThetaSubstitution/FrobeniusLiftNorms/ABArith.lean in the archive; the statement above is its full header.

Formalism.InvariantFactorPaths.G7.deLossdefUniformThetaSubstitution/StatementAB.lean:100Δ\Delta: the digit losses.
def deLoss {S : Type} [Fintype S] (p r0 r1 : ℕ) (TT : Finset S) (al ls : S → ℕ) : ℝ

Δ\Delta: the digit losses.

Full declaration with proof
def deLoss {S : Type} [Fintype S] (p r0 r1 : ℕ) (TT : Finset S) (al ls : S → ℕ) : ℝ :=
  ∑ s, ((r1 : ℝ) * lgN p (al s) + (r0 : ℝ) * r1 * lgN p (ls s)) + ∑ s ∈ TT, ((lgN p (al s) : ℝ)) ^ 2

our exposition The lemma supplies valuations of individual factorials. It does not identify which factorials occur in the theta coefficients; that is part of the archive’s local theorem on its theta kernels, which the exposition’s §III.5 writes out conditionally on the integrality of those kernels in the coordinates of the height-two logarithm (his hypothesis (B)). The three ingredients shown here, the minor lemmas, the Hasse product rule and the factorial count, are proved outright in the archive.

The minor congruence

One more local fact is used when a Frobenius orbit returns. Let AA be a commutative ring with an element π0\pi_0 satisfying π02=p\pi_0^2 = p, and put P=peP = p^e. Let M,N′M, N' be square matrices with MP≡N′M^P \equiv N' entrywise modulo pp, let NN be the inverse of N′N', and suppose all but the zeroth coordinates of a row vector uu are divisible by π0\pi_0, as is the zeroth coordinate of vv. Then π0\pi_0 divides ∑a(uM)a P (vN)a\sum_a (uM)_a^{\,P}\,(vN)_a. For p=3p = 3, π0=3\pi_0 = \sqrt3, M=N′=(1101)M = N' = \begin{pmatrix}1&1\\0&1\end{pmatrix}, u=(1,π0)u = (1, \pi_0) and v=(0,1)v = (0, 1), the sum is (1+π0)3−1=3π0+3π02+π03(1 + \pi_0)^3 - 1 = 3\pi_0 + 3\pi_0^2 + \pi_0^3, visibly divisible by π0\pi_0.

Formalism.MainNotions.ColumnSystems.Pf.key_pow_dvdtheoremCoarseMultiplicity/KeyMinorDvd.lean:11The congruence as a theorem, proved by passing to the quotient by π0\pi_0, where p=0p = 0, uu reduces to its zeroth coordinate and vv loses it. The estimate on the full lift requires many such congruences and their behaviour under differentiation.
theorem key_pow_dvd {A : Type} [CommRing A] (p : ℕ) (hp : p.Prime) (w : A) (hw : w ^ 2 = (p : A)) (k e : ℕ)
    (u v : Fin (k + 1) → A) (M N' N : Fin (k + 1) → Fin (k + 1) → A)
    (hMN : ∀ b a, ∃ T, M b a ^ (p ^ e) = N' b a + p * T)
    (hinv : ∀ b b', ∑ a, N' b a * N a b' = if b = b' then 1 else 0)
    (hu : ∀ b, b ≠ 0 → w ∣ u b) (hv0 : w ∣ v 0) :
    w ∣ ∑ a, (∑ b, u b * M b a) ^ (p ^ e) * (∑ b', v b' * N a b')

The congruence as a theorem, proved by passing to the quotient by π0\pi_0, where p=0p = 0, uu reduces to its zeroth coordinate and vv loses it. The estimate on the full lift requires many such congruences and their behaviour under differentiation.

Full declaration with proof
theorem key_pow_dvd {A : Type} [CommRing A] (p : ℕ) (hp : p.Prime) (w : A) (hw : w ^ 2 = (p : A)) (k e : ℕ)
    (u v : Fin (k + 1) → A) (M N' N : Fin (k + 1) → Fin (k + 1) → A)
    (hMN : ∀ b a, ∃ T, M b a ^ (p ^ e) = N' b a + p * T)
    (hinv : ∀ b b', ∑ a, N' b a * N a b' = if b = b' then 1 else 0)
    (hu : ∀ b, b ≠ 0 → w ∣ u b) (hv0 : w ∣ v 0) :
    w ∣ ∑ a, (∑ b, u b * M b a) ^ (p ^ e) * (∑ b', v b' * N a b') := by

  apply (Ideal.Quotient.eq_zero_iff_dvd w _).mp
  set φ := Ideal.Quotient.mk (Ideal.span {w}) with hφ
  have hw0 : φ w = 0 := (Ideal.Quotient.eq_zero_iff_dvd w w).mpr dvd_rfl
  have hp0 : φ (p : A) = 0 := by rw [← hw, map_pow, hw0, zero_pow two_ne_zero]
  have hu0 : ∀ b, b ≠ 0 → φ (u b) = 0 := fun b hb => (Ideal.Quotient.eq_zero_iff_dvd w _).mpr (hu b hb)
  have hv0' : φ (v 0) = 0 := (Ideal.Quotient.eq_zero_iff_dvd w _).mpr hv0
  have hrow : ∀ a, φ (∑ b, u b * M b a) = φ (u 0) * φ (M 0 a) := by
    intro a
    have hz : ∀ i : Fin k, φ (u i.succ) = 0 := fun i => hu0 _ (Fin.succ_ne_zero _)
    rw [map_sum, Fin.sum_univ_succ, map_mul]
    simp [hz]
  have hpow : ∀ a, φ (M 0 a) ^ (p ^ e) = φ (N' 0 a) := by
    intro a
    obtain ⟨T, hT⟩ := hMN 0 a
    rw [← map_pow, hT, map_add, map_mul, hp0, zero_mul, add_zero]
  have hδ : ∀ b', ∑ a, φ (N' 0 a) * φ (N a b') = if (0 : Fin (k + 1)) = b' then 1 else 0 := by
    intro b'
    have h := congrArg φ (hinv 0 b')
    rw [map_sum] at h
    simp_rw [map_mul] at h
    rw [h]
    split_ifs <;> simp
  rw [map_sum]
  simp_rw [map_mul, map_pow, hrow, mul_pow, hpow, map_sum, map_mul]
  have e : ∑ a, φ (u 0) ^ (p ^ e) * φ (N' 0 a) * ∑ b', φ (v b') * φ (N a b') =
      φ (u 0) ^ (p ^ e) * ∑ b', φ (v b') * ∑ a, φ (N' 0 a) * φ (N a b') := by
    simp_rw [Finset.mul_sum]
    rw [Finset.sum_comm]
    refine Finset.sum_congr rfl fun b' _ => Finset.sum_congr rfl fun a _ => ?_
    ring
  rw [e]
  simp_rw [hδ]
  simp [hv0']

The coefficient 2log⁡p2\log p, and the scales

For the coefficient field and a prime ideal p\mathfrak p over pp with ramification index epe_{\mathfrak p} and residue degree fpf_{\mathfrak p}, the normalised local weight is λp=log⁡N(p)/[L0:Q]\lambda_{\mathfrak p} = \log N(\mathfrak p)/[L_0 : \mathbb Q], and a local gain yy is measured in units 2λpepy2\lambda_{\mathfrak p} e_{\mathfrak p} y. Since ∑p∣pepfp=[L0:Q]\sum_{\mathfrak p \mid p} e_{\mathfrak p} f_{\mathfrak p} = [L_0 : \mathbb Q], one unit at every place over pp sums to 2log⁡p2\log p. The factor 22 is the squared-norm normalisation of chapter 9; at the ramified prime dd the splitting condition has half weight and gives log⁡d\log d. These are the coefficients c(r)=(1−χd(r))log⁡pc(r) = (1 - \chi_d(r))\log p of the table in chapter 11.

The choice of aa and ww. Let xx be the scale at which we want information about primes. Put b=exp⁡(xε)b = \exp(x^\varepsilon), w≈bw \approx b and a≈xba \approx xb. Then a/w≈xa/w \approx x, and the elementary identity

(aph−w)+  =  w(xph−1)+(x=a/w)\Big(\frac{a}{p^h} - w\Big)_+ \;=\; w\Big(\frac{x}{p^h} - 1\Big)_+ \qquad (x = a/w)

shows what has been gained. Only prime powers up to xx are involved at the places that carry the weight bb: the right side vanishes for ph≥xp^h \ge x. The factor (x/ph−1)+(x/p^h - 1)_+ is exactly the weight with which prime powers enter G(x)G(x): the kernel of chapter 2 was decided here. And rounding becomes invisible: each prime power below xx now contributes about bb times its ramp value, the bound is used only where its main term is positive (elsewhere one uses only that the exponent is not negative, which is the integrality of the entries), and after dividing the whole inequality by bb the loss terms are absorbed in the error of (M). This removes defect (D1).

Formalism.BasicNotions.ScalestructureLocalRingCardinality/DataParams₂.lean:9The scale record: x>1x > 1, 0<ε<1/520 < \varepsilon < 1/52, and a parameter J≥1J \ge 1; with L=xεL = x^\varepsilon, b=eLb = e^L, a=xba = xb, X′=exp⁡(xε/3)X' = \exp(x^{\varepsilon/3}), b′=a/X′b' = a/X' and δ1=x−ε/8\delta_1 = x^{-\varepsilon/8} defined from them.
structure Scale

The scale record: x>1x > 1, 0<ε<1/520 < \varepsilon < 1/52, and a parameter J≥1J \ge 1; with L=xεL = x^\varepsilon, b=eLb = e^L, a=xba = xb, X′=exp⁡(xε/3)X' = \exp(x^{\varepsilon/3}), b′=a/X′b' = a/X' and δ1=x−ε/8\delta_1 = x^{-\varepsilon/8} defined from them.

Full declaration with proof
structure Scale where
  x : ℝ
  eps : ℝ
  one_lt_alt : 1 < x
  eps_pos : 0 < eps
  eps_lt : eps < 1 / 52

  J : ℝ
  one_le_J : 1 ≤ J
Formalism.BasicNotions.Scale.bdefLocalRingCardinality/DataParams₂.lean:29b=exp⁡(xε)b = \exp(x^\varepsilon).
def b : ℝ

b=exp⁡(xε)b = \exp(x^\varepsilon).

Formalism.BasicNotions.Scale.adefLocalRingCardinality/DataParams₂.lean:31a=x ba = x\,b.
def a : ℝ

a=x ba = x\,b.

Formalism.BasicNotions.Scale.X'defLocalRingCardinality/DataParams₂.lean:33X′=exp⁡(xε/3)X' = \exp(x^{\varepsilon/3}): the second scale, at which the cells with tiny weights test primes (chapter 12).
def X' : ℝ

X′=exp⁡(xε/3)X' = \exp(x^{\varepsilon/3}): the second scale, at which the cells with tiny weights test primes (chapter 12).

Why bb must be exponentially large. To defeat rounding, a power of xx would do. Two other steps need more. There are 2n2n places and each needs a weight, but only some can be given the weight bb (the columns of the set T2T_2 of chapter 12); the others get very small weights w′w', so that they test primes at a scale a/w′≥13exp⁡(xε/3)a/w' \ge \tfrac13\exp(x^{\varepsilon/3}), where the distribution of primes in the relevant progressions is known unconditionally with a good error term. The weights are positive integers, so w′≥1w' \ge 1 forces a≥13exp⁡(xε/3)a \ge \tfrac13\exp(x^{\varepsilon/3}) and hence bb exponential in a power of xx. The size of bb also enters the control of denominators (chapter 14), where the available bound is at most b\sqrt b.

The global divisibility statement

What the archive proves globally is a link, per prime, between the von Mangoldt-weighted class sums at the places served by that prime and the gains collected along the chain, with the losses written out. We quote its shape; the exposition’s Part III, §III.6 states the passage to lattices in classical language and proves its elementary parts.

Formalism.MainNotions.LinkG_atdefSharpRestriction/GlobalTheoremInputs.lean:122For an inert prime pp below the second scale: every gain along the lifts is between 00 and 4∣T∣a/p4|T|a/p, and the sum over lifts and served places of the class sums minus the explicit loss loG\mathrm{loG}, minus mm times a second loss flG\mathrm{flG}, is at most the total gain minus a local index τ\tau. Together with conditions on orbits and on the local lattices.
def LinkG_at {D : D7} {L : SizeData₂ D} (X : G.Inst D L) (K : G.Consts) (C bo : ℝ) : Prop

For an inert prime pp below the second scale: every gain along the lifts is between 00 and 4∣T∣a/p4|T|a/p, and the sum over lifts and served places of the class sums minus the explicit loss loG\mathrm{loG}, minus mm times a second loss flG\mathrm{flG}, is at most the total gain minus a local index τ\tau. Together with conditions on orbits and on the local lattices.

Full declaration with proof
def LinkG_at {D : D7} {L : SizeData₂ D} (X : G.Inst D L) (K : G.Consts) (C bo : ℝ) : Prop :=
  (∀ u w, D.what₂.places.resChar w ≠ (D.mem u).A.T →
    DV.LocLe (D.plEq w) ⌊DV.ur D w (L.tau w)⌋₊ (L.NuLat u) (DV.MramL D u) ∧
    (L.lenMN u w : ℝ) ≤ (D.duS u : ℝ) * (L.tau w + L.io w) ∧
    (G.VV X K (G.aL L) (G.bL L) (D.what₂.places.resChar w) = ∅ → L.tau w = 0 ∧ L.io w = 0 ∧ L.lenMN u w = 0)) ∧
  (∀ p, ∀ t0 ∈ G.VV X K (G.aL L) (G.bL L) p,
    G.Sv X K (G.aL L) (G.bL L) p t0 ≤ 2 * (D.R.m : ℝ) * (G.Nv X p t0 : ℝ) * L.sc.a / p) ∧
  (∀ w, InertK D (D.what₂.places.resChar w) → (D.what₂.places.resChar w : ℝ) ≤ L.sc.X'' D.R.n →
    (∀ j ∈ SizeData₂.lifts D, 0 ≤ L.gain j w ∧
      L.gain j w ≤ 4 * (D.host.TT.card : ℝ) * L.sc.a / (D.what₂.places.resChar w : ℝ)) ∧
    (∑ j ∈ SizeData₂.lifts D, ∑ t ∈ L.TTw w,
        (L.vonMangoldtClassSum j t (D.what₂.places.resChar w) - loG L C bo (D.what₂.places.resChar w))) -
      (D.R.m : ℝ) * flG L C (D.what₂.places.resChar w) ≤
      ((∑ j ∈ SizeData₂.lifts D, L.gain j w) - L.tau w)) ∧
  G.ServedOrbitsContained X K (G.aL L) (G.bL L) ∧ G.MeanKappaBound X K
Formalism.MainNotions.LinkGdefSharpRestriction/GlobalTheoremInputs.lean:138The same for a family, with constants and a sequence δ(x)→0\delta(x) \to 0 absorbing the lower-order terms.
def LinkG {eps : ℝ} (Fm : FamP eps) : Prop

The same for a family, with constants and a sequence δ(x)→0\delta(x) \to 0 absorbing the lower-order terms.

Full declaration with proof
def LinkG {eps : ℝ} (Fm : FamP eps) : Prop :=
  ∃ (C x0 : ℝ) (δ : ℝ → ℝ), Filter.Tendsto δ Filter.atTop (nhds 0) ∧
    ∀ x ≥ x0, ∀ i : Fm.Ix x, LinkG_at (Fm.Gx x i) Fm.GK C ((Fm.L x i).sc.b ^ δ x)
What is proved, what is quoted (the exposition, Part III, §III.5–III.6)

Proved outright, in the archive and reproduced in the exposition: the Hasse product rule, the minor lemmas, the factorial count with its digit losses, the minor congruence, the identity (a/ph−w)+=w(x/ph−1)+(a/p^h - w)_+ = w(x/p^h - 1)_+. Written up in the exposition under hypothesis (B): the lower bound for the valuation of a product of minors applied to one theta kernel, for Frobenius orbits of length two (for longer orbits with a duality statement cited from the Lean). Quoted from the Lean: that the theta kernels satisfy (B), the frames and labels, the remaining primes, the eleven loss sums and their total bound, and the statement on valuations of the period pairing itself (his statement (Val)). Our file-level data cannot decide which of the small lemmas above lie on the dependency cone of riemannHypothesis; the exposition’s declaration-level check lists StarArith and the minor congruence key_pow_dvd among the statements that are used.