The Uniformity Theorem for p-adic Splitting Densities, Mapped
The Lean 4 formalization as an expandable graph — every node carries the formal statement and its mathematical translation. Companion to the expository account. Built July 2026.
The theorem
The factorization-density theorem for p-adic polynomials — conjectured by Bhargava, Cremona, Fisher, and Gajović; tame case proved by G–Wei–Yin (arXiv:2212.00294), wild case OPEN — approached by an independent ALGORITHMIC route and machine-checked in Lean. Certified unconditionally: for degree two, each of the three splitting types has one fixed rational function giving its density at every prime, including the wild prime 2. Certified conditionally for every fixed degree: at any prime whose counting data passes an explicit two-clause regularity gate, the density of every splitting type equals one fixed rational function of the residue-field size, the candidates summing to 1 identically. The amber panel below is the exact certification boundary.
The story
Take a monic polynomial of some fixed degree with coefficients in the p-adic integers $\mathbb{Z}_p$, each coefficient drawn digit-by-digit uniformly at random — the finite-depth truncations of this recipe are mutually consistent, and together they define the normalized Haar measure, the only probability model used anywhere on this page. Over the p-adic field the polynomial factors into irreducible pieces, and each piece is measured by two whole numbers whose product is its degree: its ramification index (how much finer the ladder of p-adic sizes becomes in the extension its root generates) and its residue degree (how much larger the finite field of remainders becomes). The multiset of these pairs is the polynomial's splitting type; for quadratics the three types are split, inert, and ramified. Each type is a measurable event, so it has a probability at each prime — its density — and the question is how that density varies with the prime.
A prime exceeding the degree is called tame here: it is then coprime to every ramification index that can occur at that degree. At tame primes the density calculus is classical: Hensel's lemma lifts factorizations of the reduction whenever the reduction has no repeated factors, counting over the residue field gives polynomial formulas, and tame ramification is classified by explicit weights, so each density is the value of a fixed rational function of the residue-field size. At a wild prime — one at most the degree — the polynomials that matter are exactly those whose reductions degenerate, Hensel separation fails there, and the geometric route behind the tame theorem also breaks (its symmetric-group-equivariant resolution needs a linearly reductive group, which fails in residue characteristic up to the degree). What remains is digit-by-digit analysis in which carries — overflow between digit positions — decide factorizations at depths that vary from polynomial to polynomial. From low-degree computations, Bhargava, Cremona, Fisher, and Gajović conjectured that the tame formulas persist at wild primes. G, Wei, and Yin (arXiv:2212.00294) proved the tame case, functional equation included, via Poincaré duality, and proposed a geometric route to the wild case; that construction does not hold at wild primes as stated, and the wild case is open. The development mapped here is an independent, algorithmic route toward it, machine-checked from the outset.
For degree two, the development proves the connection unconditionally: the ramified type has density $1/(q+1)$ and the split and inert types each $q/(2q+2)$, where $q$ is the residue-field size, at every prime — so at the wild prime 2 all three equal $1/3$. The same rational functions the tame computation produces at odd primes give the wild value; nothing new happens at 2 except the length of the road. This quadratic theorem, including the vanishing of the undecided remainder, carries a certificate resting only on Lean's three built-in logical axioms plus its standard mathematical library.
For higher degrees the development builds the same mechanism in full and certifies it conditionally. The Montes–Okutsu classification algorithm — read a Newton polygon, factor a residual polynomial over a growing finite field, recenter, repeat — organizes all polynomials into a tree, and the set of polynomials at any node is proved to be an explicit finite union of digit cylinders, so its measure is readable off pinned digits. Two finiteness results control the tree. First, only a bounded packet of a node's data (slope data, residual class, a bounded carry window) influences its subtree: the packet is the node's pattern (the development says species), the number of possible patterns is proved finite with an explicit bound at every degree, and at degree three the catalogue is machine-enumerated: exactly 53. Second, the carry interactions that make wild primes hard are computed once, inside a fixed quotient ring $\mathbb{F}[u]/(u^e - \bar z)$ — the carry algebra — rather than re-derived prime by prime. The transitions out of a node depend only on its pattern, through rational expressions in the residue-field size.
Counting then reduces to linear algebra: one linear relation per pattern, a Neumann series over depths, and a symbolic matrix inversion (determinant verified nonzero at the evaluation points used) produce one candidate rational function per splitting type, with the candidates summing to 1 identically; at degree three the full tables re-derived inside the development match the independently recorded values exactly, wild primes included. The capstone theorem then proves the squeeze: from a per-prime instance bundle — level-by-level decided counts, an error envelope that vanishes with depth, regularity data, and a bridge to genuine coefficient classes — the density of each type exists at every regular prime, equals the candidate value, and does so in three provably equivalent readings. Constructing those instance bundles from the classifier at every degree beyond the certified cases is the main remaining work, and the amber panel states exactly what stands proved, what is verified computationally, and what is open.
The formalization's contribution is a typed boundary: every assumption of the capstone is a named hypothesis in its formal statement, the proof assistant prints each theorem's axiom footprint (for the two capstones: exactly Lean's three built-in axioms), and each open item is a typed statement checkable by the same kernel the day a proof is supplied. Statements were accepted only after adversarial review in fresh contexts, with refuted formulations replaced and recorded.
The capstone, exactly
Fix a degree at least two. The theorem's premises are, in order: carrier structures packaging the counting apparatus (the parameters named C and KC in the formal text) and a kernel package (K7); a solve output (S) carrying one candidate rational function per splitting type; a ledger of typed statements over the proved corpora (KT); thirteen named propositional slots with their witnesses — these are the placeholder hypotheses discussed in the amber panel: typed positions whose intended mathematical content is not yet formulated, currently satisfiable trivially; and, THE LOAD-BEARING PREMISE, an instance bundle for every prime, packaging that prime's counting data (level-by-level decided counts, classifier-keyed and true-type density masses, an undecided-mass envelope), its regularity data, and its bridge to p-adic coefficient classes. Constructing these instance bundles from the classifier, at every degree beyond the certified cases, is the main open work of the development — this premise is where the remaining mathematics lives. The conclusion: there is a family assigning to each splitting type a rational function — exactly the solve's candidates — summing to 1 identically, such that at every prime whose instance passes the two-clause regularity gate: the decided count at every reading depth is trapped in the displayed two-sided bracket; the classifier-keyed density mass converges to the candidate value; the true-type density mass (connected through the verdict-soundness hypothesis of the ledger) converges to the same value; the density read directly from p-adic coefficient classes (invariant pairs read as ramification index and residue degree) converges to the same value; and the undecided envelope converges to zero. At a prime failing the gate, the theorem asserts nothing.
The Lean statement of Theorem U
theorem theoremU (n : ℕ) (hn : 2 ≤ n) (C : UCarriers n) (KC : KernelCarriers n C)
(K7 : Cl7Kernel n KC) (S : SolveData n)
(KT : UpstreamTyped n KC)
(rel1 rel2a rel2b rel2d rel2e rel3 : Prop)
(rs0Lump trackRule dnLattice : Prop)
(m1m5Echo x1aDict m4bConst jcInvHist : Prop)
(hrel1 : rel1) (hrel2a : rel2a) (hrel2b : rel2b) (hrel2d : rel2d)
(hrel2e : rel2e) (hrel3 : rel3)
(hrs0 : rs0Lump) (htrk : trackRule) (hdn : dnLattice)
(hm15 : m1m5Echo) (hx1a : x1aDict) (hm4b : m4bConst) (hjc : jcInvHist)
(inst : ∀ (p : ℕ) (hp : p.Prime), UInstance n C KC K7 S p hp) :
∃ R : SplittingType n → RatFunc ℚ,
R = S.R ∧
(∑ σ, R σ = 1) ∧
∀ (p : ℕ) (hp : p.Prime), RegP (inst p hp).D →
-- (U-n): the exported two-sided bracket
(∀ (σ : SplittingType n) (N : ℕ),
(evalℝ ⟨R⟩ σ p - (inst p hp).X.env N) * (p : ℝ) ^ (n * N)
≤ ((inst p hp).X.decided σ N : ℝ) ∧
((inst p hp).X.decided σ N : ℝ)
≤ evalℝ ⟨R⟩ σ p * (p : ℝ) ^ (n * N))
-- (i) the classifier-keyed density
∧ (∀ σ : SplittingType n,
Tendsto ((inst p hp).X.dmass σ) atTop (𝓝 (evalℝ ⟨R⟩ σ p)))
-- (ii) the true-type density (via verdict soundness)
∧ (∀ σ : SplittingType n,
Tendsto ((inst p hp).X.trueDmass σ) atTop (𝓝 (evalℝ ⟨R⟩ σ p)))
-- (ii-ℤ_p) the ℤ_p-read density (coefficient classes; (ramIdx, resDeg) pairs)
∧ (∀ σ : SplittingType n,
Tendsto (@ZpBridge.zpDmass n p ⟨hp⟩ _ (inst p hp).bridge σ) atTop
(𝓝 (evalℝ ⟨R⟩ σ p)))
-- (iii) the undecided complement has mass 0
∧ Tendsto (inst p hp).X.env atTop (𝓝 0)
lean/LeanUrat/MovesU/U10_theoremU.lean — axioms: propext, Classical.choice, Quot.sound (Lean core only)
The proof, stage by stage
1 The Okutsu–Montes classifier tree
The classification algorithm — Newton polygon, residual polynomial over a growing finite field, recenter, repeat — is formalized in full: polygons, residual polynomials, developments, and the tree of types. This subsystem carries the two unconditional density capstones: the complete degree-2 uniformity theorem at every prime (wild 2 included, undecided remainder proved vanishing), and an order-0 density theorem at general degree covering the stratum decided at the first level. Everything deeper at general degree feeds the conditional architecture of the later stages.
The classifier engine (OM) 2 cited axiom · 7 definition · 1 open · 5 proved · 5 conditional
The Montes algorithm as a Lean function: classify mod p^N, count fibers, and — conditional on the wild self-loop limit — resum the tower to a rational density and certify types
Hensel's lemma fails at wildly ramified primes, and the Okutsu–Montes algorithm is its replacement; this corpus turns that algorithm into a total Lean function that takes a monic polynomial known only mod $p^N$ and returns a finite tree shape, so $p$-adic factorization behavior becomes counting the fibers of a computable map on a finite set. The counting theory then delivers densities: the tame per-shape limits are proved outright, and — conditional on the wild self-loop limit hypothesis — the downstream identities follow by composition and by geometric-series summation of the wild tower (a cluster restarting inside itself) into one rational function of $q$. A separate faithfulness layer, resting on two cited Guardia–Montes–Nart theorems pinned down by axiom-free anchors and by counterexamples that derive False from mutated ramification data, certifies that a counted fiber factors over $\mathbb{Q}_p$ with the type its density is labeled by, while the density theorems themselves use no axioms beyond Lean's core.
Builds on: Interface, MontesAxiom, MontesV2, CountingModel, RatFn, L3, L4, L5fix
definition The lower Newton polygon, built as a maximum of chords
Building the hull as a max of supporting chords, rather than via mathlib's set-theoretic convex hull, is what makes vertices and slopes computable; an earlier min-of-lines version was concave — refuted by the three dots $(0,3),(1,0),(2,3)$ — and the max-over-valid-lines form here is the proved replacement.
For a nonempty finite set $S \subset \mathbb{N}^2$ of dots $(i,v)$ — coefficient index $i$ against $p$-adic valuation $v$ — the lower Newton polygon is $$\mathrm{np}_S(x) \;=\; \max\{\ell(x) : \ell \text{ valid}\},$$ where the candidate lines $\ell$ are the secants through pairs of dots of $S$ (with the horizontal line through a dot standing in for the degenerate pairs, so even a singleton $S$ has candidates), and a candidate is valid when it lies weakly below every dot of $S$. The horizontal line through a lowest dot is always valid, so the maximum exists; the resulting function is convex and lies weakly below every dot — the lower convex hull, but built as data, with its vertices and its sides' rational slopes and lattice endpoints extracted as finite lists.
The Lean statement
variable (S : Finset (ℕ × ℕ))
noncomputable def npHeight (hS : S.Nonempty) (x : ℚ) : ℚ :=
(validLines S).sup' (validLines_nonempty S hS) (fun PR => pairLine PR.1 PR.2 x)
lean/LeanUrat/OM/NewtonPolygon.lean — definition
definition The order-r type: what one node of the Montes tree knows
The size law is $d_r \le \mathrm{cs}$, not strict: at the generic root $d_r = n = \mathrm{cs}$, so $d_r < \mathrm{cs}$ would be false. It is carried as a hypothesis the recursion maintains, citing Guardia–Montes–Nart rather than posited as a free axiom.
An order-$r$ type packages the state of the Montes iteration after $r$ rounds: a tower of finite residue fields $F_0 \subseteq F_r$ with extension degree $\delta = [F_r : F_0]$, the order-$r$ lattice Newton polygon $N_r$, the residual polynomial $R_r \in F_r[Y]$ with residual degree $d_r = \deg R_r$, the degree $m_r$ of the current key polynomial, and the size $\mathrm{cs}$ of the cluster of roots the node governs — with the ties $\delta = [F_r : F_0]$, $d_r = \deg R_r$, and the size law $d_r \le \mathrm{cs}$ carried as part of the structure.
The Lean statement
structure OMType where
order : ℕ
F0 : Type
Fr : Type
[field_F0 : Field F0]
[finite_F0 : Finite F0]
[field_Fr : Field Fr]
[finite_Fr : Finite Fr]
[alg : Algebra F0 Fr]
δ : ℕ
Nr : L4.LatticePolygon
Rr : Fr[X]
dr : ℕ
keyDeg : ℕ
cs : ℕ
hResidueDeg : δ = Module.finrank F0 Fr
hResidualDeg : dr = Rr.natDegree
hDrLeCs : dr ≤ cs
lean/LeanUrat/OM/OMType.lean — structure
definition The phi-adic digit expansion is a bijection
This is the classifier's change of coordinates — each deeper Montes order reads the digits of this expansion — and the bijection requires $N \ge 1$: it fails at $N = 0$.
For a prime $p$ and level $N \ge 1$, over $R = \mathbb{Z}/p^N$ fix a monic $\varphi \in R[X]$ of degree $m$. Every monic $g \in R[X]$ of degree $km$ has a unique expansion $$g \;=\; \varphi^k + \sum_{j<k} b_j\,\varphi^j, \qquad \deg b_j < m,$$ and $g \mapsto (b_0, \dots, b_{k-1})$ is a bijection from the monic polynomials of degree $km$ over $R$ to $k$-tuples of digit polynomials; counting both sides gives $(p^N)^{km}$ either way.
The Lean statement
variable (p : ℕ) [hp : Fact p.Prime]
noncomputable def developEquiv (N m k : ℕ) (hN : 0 < N) (φ : (ZMod (p ^ N))[X])
(hφ : φ.Monic) (hm : φ.natDegree = m) (_hm0 : 0 < m) :
QuotientBox.monicBox p N (k * m) ≃ (Fin k → Polynomial.degreeLT (ZMod (p ^ N)) m)
lean/LeanUrat/OM/Development.lean — definition
definition Running Montes on a polynomial known only mod p^N
Every density in the project is by definition a count of this function's fibers; the faithfulness layer exists solely to tie its output shapes to $\mathbb{Q}_p$-factorizations.
For a prime $p$, level $N \ge 1$, and degree $n \ge 1$: given a monic degree-$n$ polynomial $f$ over $\mathbb{Z}/p^N$, the classifier iterates the Montes steps — Newton polygon of $f$, factorization of the residual polynomial over the residue field, one child per distinct residual factor, descent into repeated factors via the $\varphi$-adic digit expansion — under a decreasing degree budget that forces termination. It is a total function from the finite set of monic degree-$n$ polynomials mod $p^N$ to discrete tree shapes, so each fiber is a finite set that can be counted exactly.
The Lean statement
noncomputable def classify (p : ℕ) [Fact p.Prime] (n : ℕ) :
(N : ℕ) → QuotientBox.monicBox p N n → ClusterShape :=
fun N f => classifyAux p N n n f (rootCtx p N f) (clusterSize_rootCtx p N f)
lean/LeanUrat/OM/Classifier.lean — definition
definition One finite menu of shapes serves every prime
This single menu is the shared domain over which both the cited leaf-faithfulness axiom and the density theorems are stated.
For degree $n$, depth bound $D$, height bound $K$, and factorization type $\sigma$, the menu is a finite set of classifier output shapes keyed to $\sigma$: the order-0 leaves, the mixed-slope shapes, and the descend chains ending in ramified, inert, or two-sided-split leaves, together with the split-residual family — the one family that is empty at $p = 2$ and first appears at $p > 2$. No prime occurs in the definition: the same menu is used at every $p$.
The Lean statement
noncomputable def omMenu7 (n D K : ℕ) (σ : FactorizationType) : Finset ClusterShape :=
ChainMenu6.omMenu6 n D K σ ∪ splitUShapes n D K σ
theorem omMenu6_subset_omMenu7 (n D K : ℕ) (σ : FactorizationType) :
ChainMenu6.omMenu6 n D K σ ⊆ omMenu7 n D K σ
lean/LeanUrat/OM/ChainMenu7.lean — definition
definition What counts as a genuine p-adic factorization
Faithfulness theorems conclude by producing such a certificate, while the density computations never touch one — that separation is why the density theorems carry no axiom beyond Lean's core.
For a prime $p$, a certificate for a monic $f \in \mathbb{Z}_p[X]$ is a list of monic $g_1, \dots, g_k \in \mathbb{Z}_p[X]$ with $\prod_i g_i = f$, each $g_i$ irreducible over $\mathbb{Q}_p$ and each carrying the local-field data of $\mathbb{Q}_p[X]/(g_i)$; the certificate's type is the multiset $\{(e_i, f_i)\}$ of ramification indices $e_i$ and residue degrees $f_i$ read off from that data.
The Lean statement
structure QpFactorization (p : ℕ) [Fact p.Prime] (f : ℤ_[p][X]) where
factors : List (ℤ_[p][X])
prod_eq : factors.prod = f
monic : ∀ g ∈ factors, g.Monic
irred : ∀ g ∈ factors, Irreducible (g.map (algebraMap ℤ_[p] ℚ_[p]))
data : ∀ g ∈ factors, LocalFactorData p g
noncomputable def qpType {f : ℤ_[p][X]} (F : QpFactorization p f) : FactorizationType :=
⟨(F.factors.pmap (fun g hg => efOf p (F.data g hg)) (fun _ h => h) : List (ℕ × ℕ))⟩
lean/LeanUrat/OM/QpType.lean — structure
cited axiom Cited: the theorem of the index caps everything the classifier reads
Without the bulk hypothesis the bound is false — counterexample $g = x^n + p^N$, exactly the case the bulk hypothesis excludes.
For a prime $p$, level $N \ge 1$, and degree $n \ge 1$: call $g$ — monic of degree $n$ over $\mathbb{Z}/p^{N+1}$ — bulk when its discriminant satisfies $v_p(\mathrm{disc}\,g) < N$. For bulk $g$, every coefficient valuation the classifier consults (on the dots of its own hull, and on each side's columns up to the residual degree) is $< N$, so the classifier reads the same data one truncation level down. This is a read-set-restricted form of the Guardia–Montes–Nart theorem of the index, $\mathrm{ind}(f) \le v_p(\mathrm{disc}\,f)$ (arXiv:0807.2620, Thm 4.18 / Cor 4.19).
The Lean statement
axiom omReadValuation_lt_of_certLevel_fkeyed (p : ℕ) [Fact p.Prime] {n : ℕ} (N : ℕ) (hN : 0 < N)
(g : QuotientBox.monicBox p (N + 1) n)
(hbulk : PadicLift.zmodValuation p (N + 1) (g.1.discr) < N) :
GuardSuppR p N hN g ∧ GuardSideR p N hN g
lean/LeanUrat/OM/Classifier.lean — theorem
cited axiom Cited: menu fibers factor with exactly their keyed type
The statement is existence-only and scoped to menu fibers — no uniformity, rationality, measure, or density language appears in it — it is used only by the faithfulness theorems, never the density theorems, and its $(e,f)$ payload is corroborated by axiom-free anchors plus seven counterexamples that each derive False from a mutated $(e,f)$ value.
For every prime $p$, degree $n$, factorization type $\sigma$, shape $T$ in the $\sigma$-keyed menu, and monic $f \in \mathbb{Z}_p[X]$ of degree $n$ whose truncated digit data lies in the fiber of $T$: there exists a $\mathbb{Q}_p$-factorization certificate for $f$ of type exactly $\sigma$. Cited to Guardia–Montes–Nart Thm 1.15, Thm 1.19, and Cor 1.20 — the order-1 leaf dichotomy with its explicit ramification pair $(e, f)$ — together with the standard local-field structure theory the paper presupposes (Serre, Local Fields), which mathlib cannot yet supply.
The Lean statement
axiom om_leaf_faithful (p : ℕ) [Fact p.Prime] (n N : ℕ) (hN : 0 < N)
(σ : FactorizationType) (T : ClusterShape) (D K : ℕ)
(hT : T ∈ ChainMenu7.omMenu7 n D K σ)
(f : Polynomial ℤ_[p]) (hf : f.Monic) (hdeg : f.natDegree = n)
(hfib : fiberOf7 p n N hN T f hf hdeg) :
∃ F : QpType.QpFactorization p f, QpType.qpType p F = σ
lean/LeanUrat/OM/OmLeafFaithful.lean — theorem
proved Eisenstein polynomials are totally ramified — proved, not cited
Proved from mathlib alone, with no axioms beyond Lean's core, it forces the cited axiom's $(e,f)$ values at the wild stratum — so there the citation is checked by proof rather than trusted.
For a prime $p$ and a monic $g \in \mathbb{Z}_p[X]$, Eisenstein at $p$, with $\deg g > 0$: any local-field data bundle attached to $g$ has ramification index $e = \deg g$ and residue degree $f = 1$. This is the classical total ramification of Eisenstein polynomials, proved in exactly the vocabulary in which the cited leaf axiom states its conclusion.
The Lean statement
theorem ef_of_eisenstein {g : ℤ_[p][X]} (hg : g.Monic)
(hEis : g.IsEisensteinAt (maximalIdeal ℤ_[p])) (hdeg : 0 < g.natDegree)
(D : QpType.LocalFactorData p g) :
QpType.eOf p D = g.natDegree ∧ QpType.fOf p D = 1
lean/LeanUrat/OM/QpTypeEisenstein.lean — theorem
proved Swap the ramification data in the cited axiom and False follows
One of seven counterexamples — split-type, wrong-$e$, and inert/split swaps at successive fibers — that together pin both coordinates of the cited axiom's $(e,f)$ payload.
For a prime $p$ and the quadratic leaf case ($n = 2$): keep the leaf axiom's hypotheses verbatim but mutate its concluded type from $\{(2,1)\}$ (a ramified quadratic) to $\{(1,2)\}$ (an inert quadratic); then $\bot$ is derivable. The relevant fiber is nonempty, the mutated axiom would force a single factor carrying $(e,f) = (1,2)$, and the axiom-free Eisenstein anchor proves $(e,f) = (2,1)$ for the same factor.
The Lean statement
axiom om_leaf_faithful_MUTATED_efswap (p : ℕ) [Fact p.Prime] (n N : ℕ) (hN : 0 < N)
(σ : FactorizationType) (T : ClusterShape) (hT : T ∈ WildMenu.omMenuW n σ)
(f : Polynomial ℤ_[p]) (hf : f.Monic) (hdeg : f.natDegree = n)
(hfib : B.classify p n N (PadicLift.toBox p n N hN f hf hdeg) = T) :
∃ F : QpType.QpFactorization p f,
QpType.qpType p F = (⟨{((1 : ℕ), (2 : ℕ))}⟩ : FactorizationType)
theorem mutation_efswap_refuted : False
lean/LeanUrat/OM/QpTypeEisenstein.lean — countermodel
open Open: hull vertices are stable under harmless dot changes
The one unproved statement in this corpus, and no capstone depends on it: its only use would be a hull-invariance route that was bypassed. What remains open reduces to two list-adjacency facts about the vertices.
Let $S, S' \subset \mathbb{N}^2$ be finite and nonempty. If every Newton-polygon vertex of $S'$ is a dot of $S$, every dot of $S$ lies weakly above the lower hull of $S'$, and every abscissa occurring in $S$ occurs in $S'$, then $S$ and $S'$ have the same list of Newton-polygon vertices — a purely combinatorial statement about lower convex hulls of finite lattice dot sets, true but not yet proved here.
The Lean statement
theorem npVertices_stable_of_hull_preserved (S S' : Finset (ℕ × ℕ)) (hS : S.Nonempty) (hS' : S'.Nonempty)
(hpres : ∀ P ∈ NewtonPolygon.npVertices S' hS', P ∈ S)
(habove : ∀ P ∈ S, NewtonPolygon.npHeight S' hS' (P.1 : ℚ) ≤ (P.2 : ℚ))
(habs : ∀ P ∈ S, ∃ Q ∈ S', Q.1 = P.1) :
NewtonPolygon.npVertices S hS = NewtonPolygon.npVertices S' hS'
lean/LeanUrat/OM/Classifier.lean — lemma
conditional Per-shape counting limits assemble into one rational density
The implication itself is proved with no axioms beyond Lean's core — rationality needs no per-shape hypothesis at all, since every shape's closed value is proved rational — and specializing to the separable menu reproduces the unconditional order-0 capstone as a consistency check.
For degree $n \ge 2$, fix a finite menu $M$ of shapes and suppose, for each $T \in M$, the counting limit: writing $c_T(N)$ for the number of monic degree-$n$ polynomials mod $2^N$ that the classifier sends to $T$ (the formalization's real prime is $p = 2$), $$\frac{c_T(N)}{2^{nN}} \;\longrightarrow\; \mathrm{omCount}(T, 2) \qquad (N \to \infty),$$ the closed value the counting theory attaches to $T$. Then there are polynomials $\mathrm{num}, \mathrm{den}$ with $\mathrm{den}(q) \ne 0$ at every integer $q > 1$, such that $\sum_{T \in M} \mathrm{omCount}(T, q) = \mathrm{num}(q)/\mathrm{den}(q)$ for all such $q$, and the normalized menu totals $\sum_{T} c_T(N)/2^{nN}$ converge to $\mathrm{num}(2)/\mathrm{den}(2)$.
Hypotheses this rests on: h_node — for every menu shape T, the normalized classifier-fiber counts converge to the engine value omCount(T, 2); discharged unconditionally for the tame/separable shapes, open for the wild self-loop shapes
The Lean statement
theorem montes_allorders_of_hnode (n : ℕ) (σ : FactorizationType) (M : Finset ClusterShape)
(h_node : ∀ T ∈ M,
Filter.Tendsto
(fun N => M8.stratumCount (M9.rawCount n) T N / (M9.realP : ℚ) ^ (n * N))
Filter.atTop
(nhds (omCount T M9.realP))) :
∃ (num den : Polynomial ℚ), den ≠ 0 ∧
(∀ q' : ℕ, 1 < q' → den.eval (q' : ℚ) ≠ 0 ∧
(∑ T ∈ M, omCount T q') = num.eval (q' : ℚ) / den.eval (q' : ℚ)) ∧
Filter.Tendsto
(fun N => (∑ T ∈ M, M8.stratumCount (M9.rawCount n) T N)
/ (M9.realP : ℚ) ^ (n * N))
Filter.atTop
(nhds (num.eval (M9.realP : ℚ) / den.eval (M9.realP : ℚ)))
lean/LeanUrat/OM/MontesAllOrders.lean — theorem
conditional The full density theorem, conditional on one wild hypothesis
The wild hypothesis is stated at the aggregate-limit level on purpose: five finer per-depth count identities that would have implied it were each refuted by an exact counterexample, so the theorem assumes exactly what the numerical evidence supports and nothing stronger.
For degree $n \ge 2$ and a shape $T$, say the counting limit holds when the number of monic degree-$n$ polynomials mod $2^N$ classified to $T$, divided by $2^{nN}$, tends to the closed value $\mathrm{omCount}(T, 2)$ as $N \to \infty$. Fix a menu $M$ of shapes and a predicate marking its self-loop shapes. Given the counting limit for every non-self-loop shape of $M$ — supplied unconditionally by the proved tame theorems — and the counting limit for every self-loop shape — the single wild hypothesis, verified computationally by Monte-Carlo and PARI sampling but open in general — the menu density $q \mapsto \sum_{T \in M} \mathrm{omCount}(T, q)$ is one rational function $\mathrm{num}(q)/\mathrm{den}(q)$ with denominator nonvanishing at every integer $q > 1$, and the true normalized counts at $p = 2$ converge to $\mathrm{num}(2)/\mathrm{den}(2)$.
Hypotheses this rests on: hTame — per-shape counting limits for the non-self-loop shapes (discharged, with no axioms beyond Lean's core, for the separable and multi-slope menus); SelfLoopHNode — the aggregate wild self-loop counting limit (Monte-Carlo/PARI-confirmed, open)
The Lean statement
theorem density_eq_engine_conditional (n : ℕ) (σ : FactorizationType) (M : Finset ClusterShape)
(isSelfLoop : ClusterShape → Prop)
(hTame : ∀ T ∈ M, ¬ isSelfLoop T → hNodeLimit n T)
(hSelfLoop : SelfLoopHNode n isSelfLoop) :
∃ (num den : Polynomial ℚ), den ≠ 0 ∧
(∀ q' : ℕ, 1 < q' → den.eval (q' : ℚ) ≠ 0 ∧
(∑ T ∈ M, omCount T q') = num.eval (q' : ℚ) / den.eval (q' : ℚ)) ∧
Filter.Tendsto
(fun N => (∑ T ∈ M, M8.stratumCount (M9.rawCount n) T N) / (M9.realP : ℚ) ^ (n * N))
Filter.atTop
(nhds (num.eval (M9.realP : ℚ) / den.eval (M9.realP : ℚ)))
lean/LeanUrat/OM/ConditionalDensity.lean — theorem
conditional At tame primes, no wild hypothesis is left
This theorem locates the difficulty: at tame primes the density statement composes entirely from proved counting limits, so everything hard about the project lives at the wild primes.
For degree $n \ge 2$: suppose the menu $M$ contains no self-loop shape — automatic at a tame prime $p > n$, since a self-loop forces $p \mid e$ for some ramification index $e \le n$. Then the per-shape counting limits — for each shape $T \in M$, the number of monic degree-$n$ polynomials mod $2^N$ classified to $T$, over $2^{nN}$, tends to the closed value $\mathrm{omCount}(T, 2)$ — proved unconditionally in the tame case, already give the whole conclusion: $\sum_{T \in M} \mathrm{omCount}(T, q)$ is one rational function of $q$ with denominator nonvanishing at every integer $q > 1$, the true normalized counts converge to its value at $q = 2$, and the self-loop hypothesis is discharged vacuously.
Hypotheses this rests on: hNoSelfLoop — the menu has no self-loop shape (true at every tame prime p > n); hTame — the tame per-shape counting limits (discharged, with no axioms beyond Lean's core, for the separable order-0 shapes by a companion theorem in the same file)
The Lean statement
theorem density_eq_engine_tame (n : ℕ) (σ : FactorizationType) (M : Finset ClusterShape)
(isSelfLoop : ClusterShape → Prop)
(hNoSelfLoop : ∀ T, ¬ isSelfLoop T)
(hTame : ∀ T ∈ M, hNodeLimit n T) :
∃ (num den : Polynomial ℚ), den ≠ 0 ∧
(∀ q' : ℕ, 1 < q' → den.eval (q' : ℚ) ≠ 0 ∧
(∑ T ∈ M, omCount T q') = num.eval (q' : ℚ) / den.eval (q' : ℚ)) ∧
Filter.Tendsto
(fun N => (∑ T ∈ M, M8.stratumCount (M9.rawCount n) T N) / (M9.realP : ℚ) ^ (n * N))
Filter.atTop
(nhds (num.eval (M9.realP : ℚ) / den.eval (M9.realP : ℚ)))
lean/LeanUrat/OM/ConditionalDensity.lean — theorem
definition The one wild hypothesis, stated no stronger than the evidence
Five stronger per-depth count identities that would have implied this limit were each refuted with an exact counterexample — the tempting filtration counts a strictly larger, residue-blind event — which is why the hypothesis lives at the aggregate limit and nowhere finer.
For degree $n \ge 2$ and a shape $T$, the counting limit asserts that the number of monic degree-$n$ polynomials mod $2^N$ classified to $T$, divided by $2^{nN}$, converges to the closed value $\mathrm{omCount}(T, 2)$ as $N \to \infty$. The self-loop hypothesis asserts this limit for every self-loop shape — the wild shapes whose Montes tree re-enters the same cluster at ever greater depth.
The Lean statement
def hNodeLimit (n : ℕ) (T : ClusterShape) : Prop :=
Filter.Tendsto
(fun N => M8.stratumCount (M9.rawCount n) T N / (M9.realP : ℚ) ^ (n * N))
Filter.atTop
(nhds (omCount T M9.realP))
def SelfLoopHNode (n : ℕ) (isSelfLoop : ClusterShape → Prop) : Prop :=
∀ T : ClusterShape, isSelfLoop T → hNodeLimit n T
lean/LeanUrat/OM/ConditionalDensity.lean — definition
proved The wild self-loop tower resums as a geometric series
This resummation is the mechanism by which wildly ramified strata — an infinite tower of the same cluster restarting inside itself — still sum to a rational function of $q$; proved with no axioms beyond Lean's core, with the closed value equal to a computed number rather than a free constant.
For a self-loop cluster of size $s \ge 2$ over $q \ge 2$, let $r = q^{-w(s)}$ with $w(s) = s(s+1)/2 - 1$ be the per-level restart ratio — the weight with which the whole cluster reappears one level deeper. With depth-0 seed density $d_0$, the closed value $b = d_0\,(1-r)^{-1}$ is the unique solution of the self-consistency equation $$b \;=\; d_0 + r\,b$$ (the seed plus the same cluster restarted), and equals the limit of the partial sums $d_0 \sum_{k<d} r^k$. At $q = 2$, $s = 2$, $d_0 = 1/2$ it comes out to $2/3$ — exactly the value the counting theory computes.
The Lean statement
noncomputable def selfLoopFixpointValue (depth0 : ℚ) (s q : ℕ) : ℚ :=
depth0 * (MontesAxiom.countPivot s q)⁻¹
theorem selfLoopFixpoint_eq {s q : ℕ} (hq : 2 ≤ q) (hs : 2 ≤ s) (depth0 : ℚ) :
selfLoopFixpointValue depth0 s q
= depth0 + slExposedRatio s q * selfLoopFixpointValue depth0 s q
lean/LeanUrat/OM/SelfLoopFixpoint.lean — theorem
conditional Degree two at the wild prime: the full density tie, exhaustion proved
No axiom beyond Lean's core appears on any path here; the $q$-family here is the tree complete at $p = 2$ — the general-$p$ model with the extra split-residual family is treated separately — and the $\sigma$-keying of two counting fibers is definitional on the counting side rather than covered by the cited axiom.
Over the complete stratum tree for monic quadratics at $p = 2$ — both residue points, every depth, every leaf kind — and for each quadratic factorization type $\sigma$: (R) the closed density family is one rational function $\mathrm{num}(q)/\mathrm{den}(q)$ with denominator nonvanishing at every integer $q > 1$; (V) the limit, as the truncation level $N \to \infty$, of the decided counts — polynomials the classifier has resolved by level $N$, normalized by $2^{2N}$ — equals $\mathrm{num}(2)/\mathrm{den}(2)$, which is $1/3$ for each of the three types; (B) any number squeezed at every level between the decided count and the decided-plus-undecided count is that density, with the exhaustion — the undecided mass tends to $0$ — proved outright; and (P) $\mathrm{num}/\mathrm{den}$ is palindromic, conditional on an explicit tame functional-equation hypothesis.
Hypotheses this rests on: htameFE — a tame functional equation for the full model, gating ONLY the palindromy clause (P); clauses (R), (V), (B), including the exhaustion, are unconditional (palindromy was later placed outside the project's scope entirely)
The Lean statement
theorem montes_unconditional_n2_full (σ : FactorizationType) (hσ : σ.degree = 2)
(htameFE : TameFunctionalEquation realFW6 2 σ) :
(∃ (num den : Polynomial ℚ), den ≠ 0 ∧
(∀ q' : ℕ, 1 < q' → den.eval (q' : ℚ) ≠ 0 ∧
(∑ T ∈ shapesOf6 σ, C6 T q') = num.eval (q' : ℚ) / den.eval (q' : ℚ)) ∧
(realMW6.countingDensity σ = num.eval (M9.realP : ℚ) / den.eval (M9.realP : ℚ)) ∧
IsPalindromic num den) ∧
∀ d : ℚ, (∀ N : ℕ, 1 ≤ N →
realMW6.decidedCount σ N / (M9.realP : ℚ) ^ (2 * N) ≤ d ∧
d ≤ realMW6.decidedCount σ N / (M9.realP : ℚ) ^ (2 * N)
+ realMW6.undecidedCount N / (M9.realP : ℚ) ^ (2 * N)) →
d = realMW6.countingDensity σ
lean/LeanUrat/OM/SeriesAssembly.lean — theorem
conditional Every counted quadratic stratum factors as its label says
This is what upgrades the density's type labels from bookkeeping to arithmetic: the split families are proved with no axiom above the height budget and their fibers are proved empty below it, so the cited axiom carries exactly the ramified/inert leaf content and nothing more.
In the full degree-2 counting model at $p = 2$: whenever the truncated coefficients of a monic quadratic $f$ over $\mathbb{Z}_2$ lie in any counted fiber — an order-0 split or inert cell, or a depth-$k$ descend chain ending in a ramified, inert, or split leaf — $f$ admits a $\mathbb{Q}_2$-factorization certificate of exactly the type $\sigma$ that fiber contributes to in the density.
Hypotheses this rests on: om_leaf_faithful — the cited Guardia–Montes–Nart leaf axiom is in this theorem's axiom footprint (Lean core plus that axiom exactly, per the file's census); it enters only through the ramified and inert chain legs, on the translated polynomial
The Lean statement
theorem fullFiber_hasType {N : ℕ} (hN : 0 < N) {σ : FactorizationType} {F : W6Fiber}
(hOK : W6FiberOK F N σ)
{f : Polynomial ℤ_[M9.realP]} (hf : f.Monic) (hdeg : f.natDegree = 2)
(hfib : fiberPred F N
(PadicInt.toZModPow N (f.coeff 0), PadicInt.toZModPow N (f.coeff 1))) :
∃ Fc : QpType.QpFactorization M9.realP f, QpType.qpType M9.realP Fc = σ
lean/LeanUrat/OM/FullFaithful.lean — theorem
proved The split leaf is proved by Hensel lifting, at every prime
The split-residual family is the one new stratum family at $p > 2$ — its pool has size $(q-1)(q-2)/2$, empty at $q = 2$ — and proving its leaf outright keeps the cited axiom redundant on this whole family.
For every prime $p$: if a monic quadratic $g$ over $\mathbb{Z}_p$, read through its digits at heights $(2m, m)$, exhibits a residual pair with two distinct simple roots, then $g$ splits over $\mathbb{Q}_p$ into two linear factors — type $\{(1,1),(1,1)\}$. The proof Hensel-lifts each simple residual root of the rescaled polynomial and transports the resulting certificate back to $g$, with no axiom anywhere.
The Lean statement
theorem leafFiberU_split_hasType {m L₀ L₁ : ℕ}
(hL₀ : ChainMenuU.leafNeedU m ≤ L₀) (hL01 : L₀ ≤ L₁)
{g : ℤ_[p][X]} (hg : g.Monic) (hdeg : g.natDegree = 2)
(hfib : ChainMenuU.LeafPairU p m L₀ L₁
(PadicInt.toZModPow L₀ (g.coeff 0), PadicInt.toZModPow L₁ (g.coeff 1))) :
∃ F : QpType.QpFactorization p g, QpType.qpType p F = ChainMenu.splitType2
lean/LeanUrat/OM/QpTypeSplitU.lean — theorem
proved At every prime, each pair terminates or lands in a measured stall
This covering powers the unconditional bracket uniqueness of the all-primes capstone — the stall remainder at truncation level $N$ has mass at most $(\lfloor N/2 \rfloor + 1)\,p^{-(N-1)} \to 0$ — with no axioms beyond Lean's core.
For every prime $p$, all height bounds $L_0 \le L_1$, and every pair of coefficients (read mod $p^{L_0}$ and $p^{L_1}$) lying in the cluster over a residue point: either the pair realizes a terminating chain within budget — a descend prefix ending in one of the four leaf kinds (ramified, inert, two-sided split, or split-residual) — or it lies in an explicit stall stratum, where $p^{L_0 - 1}$ divides the constant coefficient. Proved by strong induction on the budget, uniformly in $p$: no case split between $p = 2$ and the odd primes.
The Lean statement
variable (p : ℕ) [hp : Fact p.Prime]
theorem cluster_coveringP :
∀ L₀ L₁ : ℕ, L₀ ≤ L₁ →
∀ a : ZMod (p ^ L₀) × ZMod (p ^ L₁),
ClusterPair p L₀ L₁ a →
(∃ ms leaf, (∀ m ∈ ms, 1 ≤ m) ∧ leafOK leaf ∧
2 * ms.sum + leafNeed leaf ≤ L₀ ∧ ChainPair p ms leaf L₀ L₁ a)
∨ (∃ ms m, (∀ x ∈ ms, 1 ≤ x) ∧ 1 ≤ m ∧
2 * ms.sum + leafNeedU m ≤ L₀ ∧ ChainPairU p ms m L₀ L₁ a)
∨ (∃ ms, (∀ m ∈ ms, 1 ≤ m) ∧ (ms ≠ [] → 2 * ms.sum + 2 ≤ L₀) ∧
StallPairP p ms L₀ L₁ a)
lean/LeanUrat/OM/UniformModelN2.lean — theorem
The order-0 and degree-2 capstones (OM/RealInstance) 5 definition · 10 proved · 5 conditional
Abstract density theorems brought to ground: exact values proved at every prime
This is where the whole project comes to a point: the abstract structures that say what a splitting-density theorem even asserts, the two goal theorems proved over them, and the real instances, checked in Lean, that keep those theorems honest. One route counts — normalized fiber counts of monic polynomials mod $p^N$ — and needs nothing beyond Lean's core axioms; an independent second route goes through the cited Denef–Igusa measure theory. The structures are deliberately weak, so all the content is forced into the instances — exact densities such as $1/4$, $1/8$, and $1/(p+1)$, proved at $p=2$, at wild ramification, and, for quadratics, at every prime at once by a single prime-free rational function — while what is not yet proved is named rather than hidden: palindromy rests on an open tame functional-equation hypothesis, and exhaustion of the undecided mass is proved only at $n=2$.
Builds on: OM, CountingModel, RatFn, L6M4, L7, PadicMeasure, MontesAxiom
definition What a density foundation provides
Every capstone is stated against this deliberately weak structure — anything substantive about a foundation must enter a theorem as an explicit hypothesis, never an axiom, and the identification of an instance's density with a limit of normalized $p$-adic coefficient counts is proved at the real instances, not here.
A density foundation assigns to each degree $n$, each factorization type $\sigma$ — a multiset of pairs $(e_i,f_i)$ of ramification indices and residue degrees with $\sum e_i f_i = n$ — and each residue cardinality $q$ a rational density $\rho(n,\sigma;q)\ge 0$, together with a finite menu of cluster-tree shapes for each $(n,\sigma)$, a volume $C_T(q)$ and a multiplicity polynomial $m_T$ for each shape $T$, tied together by the stratification identity $$\rho(n,\sigma;q)=\sum_{T\in\mathrm{menu}(n,\sigma)} m_T(q)\,C_T(q) \qquad (q>1,\ \deg\sigma=n).$$ Nothing requires $\rho$ to be a probability; the structure records only the cited measure-theoretic facts.
The Lean statement
structure DensityFoundation where
density : (n : ℕ) → FactorizationType → (q : ℕ) → ℚ
clusterVolume : ClusterShape → ℕ → ℚ
shapes : (n : ℕ) → FactorizationType → Finset ClusterShape
multiplicity : ClusterShape → Polynomial ℚ
decomposition : ∀ (n : ℕ) (σ : FactorizationType), σ.degree = n → ∀ q : ℕ, 1 < q →
density n σ q = ∑ T ∈ shapes n σ, (multiplicity T).eval (q : ℚ) * clusterVolume T q
density_nonneg : ∀ n σ q, 0 ≤ density n σ q
lean/LeanUrat/Interface.lean — structure
definition Montes data over a counting model
This structure is satisfiable by degenerate instances on purpose — non-vacuity is enforced by the value gates at the real instances, not by the definition. The coefficient $C(T,q')$ is left a free rational function rather than hard-coded, a hard-coded shape being contradicted by a numerical counterexample.
Fix a counting model of degree $n$ at residue cardinality $q$: a device that tracks, at each level $N$, how many monic degree-$n$ polynomials mod $q^N$ are decided for each factorization type, with normalized decided counts converging as $N\to\infty$. Montes data over it gives each type $\sigma$ a finite menu of cluster shapes, a level-$N$ stratum count $\#S_T^{(N)}$ for each shape $T$ partitioning the decided count, $$\mathrm{decided}_\sigma(N)=\sum_{T\in\mathrm{menu}(\sigma)}\#S_T^{(N)},$$ and a coefficient $C(T,q')$ — one fixed rational function of $q'$ with denominator nonvanishing for $q'>1$ — with $\#S_T^{(N)}/q^{nN}\to C(T,q)$ as $N\to\infty$.
The Lean statement
structure MontesDataV2 (q n : ℕ) (M : CountingModel q n) where
shapesOf : FactorizationType → Finset ClusterShape
stratumCount : ClusterShape → ℕ → ℚ
partition : ∀ (σ : FactorizationType) (N : ℕ),
M.decidedCount σ N = ∑ T ∈ shapesOf σ, stratumCount T N
C : ClusterShape → ℕ → ℚ
C_isRational : ∀ T : ClusterShape, IsRationalFn (fun q' => C T q')
stratum_tendsto_C : ∀ (σ : FactorizationType), ∀ T ∈ shapesOf σ,
Filter.Tendsto (fun N => stratumCount T N / (q : ℚ) ^ (n * N))
Filter.atTop (nhds (C T q))
lean/LeanUrat/MontesV2.lean — structure
definition When a rational function is palindromic
The palindromy clause carried by every capstone.
Call $R=\mathrm{num}/\mathrm{den}$ palindromic when $$R(1/x)=R(x)$$ at every $x\neq 0$ where both sides are defined. The functional equation, not coefficient reversal, is the faithful notion: reversing coefficient lists is blind to degree and wrongly rejects palindromic functions such as $t/(t^2+1)$, whose numerator and denominator have different reduced degrees.
The Lean statement
def IsPalindromic (num den : Polynomial ℚ) : Prop :=
∀ x : ℚ, x ≠ 0 → den.eval x ≠ 0 → den.eval x⁻¹ ≠ 0 →
num.eval x⁻¹ / den.eval x⁻¹ = num.eval x / den.eval x
lean/LeanUrat/Interface.lean — definition
definition The tame functional equation, as a hypothesis
As a global statement over arbitrary foundations this is false — a foundation with density $q$ would force $x^{-1}=x$ — so it enters as an explicit hypothesis rather than an axiom; its discharge at the real instance, via the cited Del Corso–Dvornicich functional equation, remains open pending exhaustiveness and the projective bridge.
For a density foundation $F$, a degree $n$, and a factorization type $\sigma$: there exist polynomials $\mathrm{num},\mathrm{den}$ with $\mathrm{den}\neq 0$ such that $F$'s density equals $\mathrm{num}(q)/\mathrm{den}(q)$ at every tame prime $q>n$, and $R=\mathrm{num}/\mathrm{den}$ is palindromic: $R(1/t)=R(t)$ wherever defined. The proofs use only that this holds at infinitely many primes — exactly what the identity theorem in $\mathbb{Q}(t)$ needs.
The Lean statement
def TameFunctionalEquation (F : DensityFoundation) (n : ℕ) (σ : FactorizationType) : Prop :=
∃ (num den : Polynomial ℚ), den ≠ 0 ∧
(∀ q : ℕ, q.Prime → n < q → F.density n σ q = num.eval (q : ℚ) / den.eval (q : ℚ)) ∧
IsPalindromic num den
lean/LeanUrat/Interface.lean — definition
definition The real order-0 foundation
The instance the canonical capstone fires through; its order-0 separable menu leaves every ramified type with an empty menu by construction.
For a degree $m$, a factorization type $\sigma$ of degree $m$, and a residue cardinality $q'$: the first non-trivial instance of the density structure. Its density is the menu sum $$\rho(m,\sigma;q')=\sum_{T\in\mathrm{menu}_0(m,\sigma)} c_T(q'),$$ where $\mathrm{menu}_0(m,\sigma)$ collects the order-0 separable cluster shapes of type $\sigma$ and $c_T$ is the proved engine evaluator — a residue-field choice count times a volume factor. The stratification identity is the multiplicity-times-volume splitting of this sum, and nonnegativity holds at every natural $q'$ because the choice counts are necklace counts, hence nonnegative integers.
The Lean statement
noncomputable def realF2 : DensityFoundation where
density := fun m σ q' => ∑ T ∈ OMCountV2.omMenu m σ, OMCountV2.omCount T q'
clusterVolume := fun T q' => OMCountV2.omVolume T q'
shapes := fun m σ => OMCountV2.omMenu m σ
multiplicity := fun T => OMCountV2.omMultiplicity T
decomposition := by … -- (proof field omitted)
density_nonneg := by … -- (proof field omitted)
lean/LeanUrat/OM/RealInstanceV2.lean — instance
proved The decided density is the sum of shape coefficients
The workhorse of the spine: the all-primes quadratic capstone fires it directly (it carries no palindromy), and every value gate reaches its instance through it.
For any counting model $M$ and any Montes data $D$ over it, the decided-limit density of a type $\sigma$ — the limit as $N\to\infty$ of $M$'s normalized decided counts — equals the finite sum $$\sum_{T\in\mathrm{menu}(\sigma)} C(T,q)$$ of $D$'s coefficients over $D$'s menu for $\sigma$, taken at the model's residue cardinality $q$. Only the partition law, the per-shape limits, and uniqueness of limits in $\mathbb{Q}$ are used; rationality of the coefficients never enters.
The Lean statement
variable {q n : ℕ} {M : CountingModel q n} (D : MontesDataV2 q n M)
theorem countingDensity_eq_sum_coeff (σ : FactorizationType) :
M.countingDensity σ = ∑ T ∈ D.shapesOf σ, D.C T q
lean/LeanUrat/MontesV2.lean — theorem
conditional The goal theorem by counting alone
The backbone of the counting route: it bypasses measure theory entirely, and everything it uses is a hypothesis or a proved theorem — no axioms beyond Lean's core.
Take a counting model $M$ at residue cardinality $q$, Montes data $D$ over it, a type $\sigma$ of degree $n$, and a foundation $F$ whose density agrees with the menu sum $g_\sigma(q')=\sum_{T\in\mathrm{menu}(\sigma)}C(T,q')$ of $D$'s coefficients at every $q'>1$; assume the tame functional equation for $F$. Then one rational function $\mathrm{num}/\mathrm{den}$, denominator nonvanishing for $q'>1$, represents $g_\sigma$ there, its value at $q$ is the decided-limit density of $M$, and it is palindromic — palindromy travels from the tame representative via the identity theorem in $\mathbb{Q}(t)$, using only that the tame primes are infinite in number.
Hypotheses this rests on: hbridge — the foundation's density coincides with the counting menu sum at every q' > 1 (discharged definitionally at the real instances); htameFE — the tame functional equation for F (feeds only the palindromy clause).
The Lean statement
theorem goal_theorem_montes
{q n : ℕ} (M : CountingModel q n) (D : MontesDataV2 q n M)
(σ : FactorizationType) (F : DensityFoundation) (hσ : σ.degree = n)
(hbridge : ∀ q' : ℕ, 1 < q' →
F.density n σ q' = ∑ T ∈ D.shapesOf σ, D.C T q')
(htameFE : TameFunctionalEquation F n σ) :
∃ (num den : Polynomial ℚ), den ≠ 0 ∧
(∀ q' : ℕ, 1 < q' → den.eval (q' : ℚ) ≠ 0 ∧
(∑ T ∈ D.shapesOf σ, D.C T q') = num.eval (q' : ℚ) / den.eval (q' : ℚ)) ∧
(1 < q → M.countingDensity σ = num.eval (q : ℚ) / den.eval (q : ℚ)) ∧
IsPalindromic num den
lean/LeanUrat/MontesV2.lean — theorem
conditional The goal theorem through p-adic measure
The independent second route: a statement about all bridged foundations at once — no constructed foundation is proved equal to the true $p$-adic Haar density, since mathlib has no $p$-adic Haar measure — kept alongside the counting route, which carries none of these measure axioms.
Fix a degree $n$ and a factorization type $\sigma$ of degree $n$. For every density foundation $F$ that carries an OM-bridge — its cluster volumes realized by the fixed $p$-adic Okutsu–Montes cluster measure — and satisfies the tame functional equation, $F$'s density $q\mapsto\rho(n,\sigma;q)$ is represented at every integer $q>1$, wild primes included, by a single palindromic rational function. Rationality comes out of the Denef–Igusa cell decomposition; it is derived, never assumed.
Hypotheses this rests on: htameFE — the tame functional equation for F; beyond Lean's core, the footprint also rests on the declared, cited axioms of the measure route: the Denef–Igusa cell recursion and the OM-tree measure interface (cluster measure, cells, descent).
The Lean statement
theorem goal_theorem
(F : DensityFoundation) (B : OMBridge F) (n : ℕ) (σ : FactorizationType) (hσ : σ.degree = n)
(htameFE : TameFunctionalEquation F n σ) :
∃ (num den : Polynomial ℚ), den ≠ 0 ∧
(∀ q : ℕ, 1 < q → den.eval (q : ℚ) ≠ 0 ∧
F.density n σ q = num.eval (q : ℚ) / den.eval (q : ℚ)) ∧
IsPalindromic num den
lean/LeanUrat/Goal.lean — theorem
proved An explicit witness inhabits the interface
The witness is deliberately trivial — identifying any foundation with the paper's real density would need the $p$-adic Haar measure mathlib lacks — and the same file builds a second witness with density $\equiv 1$ whose tame hypothesis is proved outright, so the spine theorem fires on it with no axioms beyond Lean's core.
There is a density foundation: take the density identically $0$, empty shape menus, and a fixed concrete cluster measure for the cluster volume. All structural fields hold at once, so the goal theorems' quantifier over foundations $F$ ranges over a nonempty type, and the recorded measure identities are jointly consistent.
The Lean statement
theorem DensityFoundation_nonempty : Nonempty DensityFoundation
lean/LeanUrat/Witness.lean — theorem
conditional The order-0 capstone at p = 2
The canonical capstone of the project — no axioms beyond Lean's core — and the value it pins down is the order-0 decided-stratum density: the tie to the full type density sits behind the exhaustive companion's open hypothesis.
For every $n>0$ and every type $\sigma$ of degree $n$, assume the tame functional equation for the real order-0 foundation. Then a single rational function $\mathrm{num}/\mathrm{den}$ does three things at once: (R) it represents the engine density $g_\sigma(q')=\sum_{T\in\mathrm{menu}_0(n,\sigma)}c_T(q')$ at every $q'>1$, where $\mathrm{menu}_0$ is the order-0 separable menu and $c_T$ the engine evaluator; (V) its value at $2$ is the decided-limit density of the real counting model at $p=2$ — the limit as $N\to\infty$ of normalized classifier-fiber counts of monic degree-$n$ polynomials mod $2^N$; (P) it is palindromic.
Hypotheses this rests on: htameFE — the tame functional equation for the real order-0 foundation (shown non-trivial by a gate, but not yet discharged); it feeds only the palindromy clause (P) — clauses (R) and (V) are independently provable without it.
The Lean statement
theorem montes_unconditional (n : ℕ) (hn : 0 < n) (σ : FactorizationType) (hσ : σ.degree = n)
(htameFE : TameFunctionalEquation realF2 n σ) :
∃ (num den : Polynomial ℚ), den ≠ 0 ∧
(∀ q' : ℕ, 1 < q' → den.eval (q' : ℚ) ≠ 0 ∧
(∑ T ∈ OMCountV2.omMenu n σ, OMCountV2.omCount T q') = num.eval (q' : ℚ) / den.eval (q' : ℚ)) ∧
((realM2 n hn).countingDensity σ = num.eval (M9.realP : ℚ) / den.eval (M9.realP : ℚ)) ∧
IsPalindromic num den
lean/LeanUrat/OM/RealInstanceV2.lean — theorem
conditional The order-0 capstone with the full-density bracket
The honest form of the full-density claim: the gap between the decided stratum and the full density is a named hypothesis rather than something papered over.
In the setting of the base capstone (degree $n>0$, type $\sigma$ of degree $n$, tame functional equation assumed), add one hypothesis: the normalized undecided mass drains, $\mathrm{undecided}_N/2^{nN}\to 0$, where $\mathrm{decided}_N$ and $\mathrm{undecided}_N$ are the model's level-$N$ decided count for $\sigma$ and undecided count. The conclusion then gains bracket uniqueness: any rational $d$ lying, for every $N\ge 1$, in the interval $$\big[\,\mathrm{decided}_N,\ \mathrm{decided}_N+\mathrm{undecided}_N\,\big]$$ (all counts normalized by $2^{nN}$) must equal the decided-limit density. Short of formalizing “the true factorization type over $\mathbb{Q}_p$”, this bracket is the only definable tie to the full density.
Hypotheses this rests on: htameFE — as in the base capstone; hExhaust — the normalized undecided mass tends to 0 (correct in shape and confirmed numerically, but OPEN: the order-0 classifier does not drain at any finite order; discharged unconditionally only in the n = 2 uniformity capstone).
The Lean statement
theorem montes_unconditional_exhaustive (n : ℕ) (hn : 0 < n) (σ : FactorizationType)
(hσ : σ.degree = n) (htameFE : TameFunctionalEquation realF2 n σ)
(hExhaust : Filter.Tendsto
(fun N => (realM2 n hn).undecidedCount N / (M9.realP : ℚ) ^ (n * N))
Filter.atTop (nhds 0)) :
(∃ (num den : Polynomial ℚ), den ≠ 0 ∧
(∀ q' : ℕ, 1 < q' → den.eval (q' : ℚ) ≠ 0 ∧
(∑ T ∈ OMCountV2.omMenu n σ, OMCountV2.omCount T q') = num.eval (q' : ℚ) / den.eval (q' : ℚ)) ∧
((realM2 n hn).countingDensity σ = num.eval (M9.realP : ℚ) / den.eval (M9.realP : ℚ)) ∧
IsPalindromic num den) ∧
∀ d : ℚ, (∀ N : ℕ, 1 ≤ N →
(realM2 n hn).decidedCount σ N / (M9.realP : ℚ) ^ (n * N) ≤ d ∧
d ≤ (realM2 n hn).decidedCount σ N / (M9.realP : ℚ) ^ (n * N)
+ (realM2 n hn).undecidedCount N / (M9.realP : ℚ) ^ (n * N)) →
d = (realM2 n hn).countingDensity σ
lean/LeanUrat/OM/RealInstanceV2.lean — theorem
proved Gate: the inert quadratic density is exactly 1/4
The value that makes the capstone non-vacuous — a strictly positive density obtained through the instance's partition and limit legs, not just its evaluator, and matched exactly by an external brute-force census.
At the real order-0 counting model at $p=2$ — the actual instance, not the free structure — the decided-limit density of the inert quadratic type (one irreducible factor, $e=1$, $f=2$) is exactly $1/4$: the limit as $N\to\infty$ of the normalized count of monic quadratics mod $2^N$ that the classifier decides inert.
The Lean statement
theorem gate_v2_countingDensity_inert2 :
(RealInstanceV2.realM2 2 (by norm_num)).countingDensity
(Order0.unramType 2 (Nat.Partition.indiscrete 2)) = 1 / 4
lean/LeanUrat/OM/RealInstanceV2Gates.lean — theorem
proved Gate: distinct types get distinct densities
Rules out a type-blind density: any $\sigma$-independent assignment would give these two types the same value.
At residue cardinality $q'=3$, the split quadratic type (two distinct linear factors, partition $1+1$) and the inert quadratic type (partition $2$) are distinct types whose menu-sum densities differ: $$\tfrac19\neq\tfrac13.$$ The density depends on the factorization type $\sigma$.
The Lean statement
theorem gate_v2_sigma_separation :
Order0.unramType 2 OMCountV2.lam11 ≠ Order0.unramType 2 OMCountV2.lam2
∧ (∑ T ∈ OMCountV2.omMenu 2 (Order0.unramType 2 OMCountV2.lam11),
OMCountV2.omCount T 3)
≠ (∑ T ∈ OMCountV2.omMenu 2 (Order0.unramType 2 OMCountV2.lam2),
OMCountV2.omCount T 3)
lean/LeanUrat/OM/RealInstanceV2Gates.lean — theorem
proved Order 0 sees no ramified types
The scope marker of the order-0 capstone: at order 0 the ramified types sit entirely in the undecided pool, and the formalization says so instead of silently claiming coverage.
The order-0 menu of the totally ramified quadratic type ($e=2$, $f=1$) is empty: no order-0 separable shape carries a ramified pair. The order-0 capstone therefore reports the value $0$ for this type — the density of its empty decided stratum, not a claim that the true wild density vanishes (the wild instance proves $1/8$ for this same type).
The Lean statement
def ramType2 : FactorizationType := ⟨{(2, 1)}⟩
theorem omMenu_ramified_empty : OMCountV2.omMenu 2 ramType2 = ∅
lean/LeanUrat/OM/RealInstanceV2Gates.lean — theorem
proved Gate: the tame hypothesis has real content
The positive value sits at a tame prime ($q=3$), inside the tame quantifier of the hypothesis, unlike the wild-$p=2$ values that lie outside it — so a zero function cannot satisfy the hypothesis.
$3$ is prime and tame for $n=2$, and the real foundation's density at the inert quadratic type at $q=3$ is $1/3>0$. Any witness of the tame functional equation must therefore represent a nonzero rational function: the degenerate $\mathrm{num}=0$ witness cannot discharge the capstone's palindromy clause.
The Lean statement
theorem gate_v2_htameFE_nontrivial :
Nat.Prime 3 ∧ 2 < 3 ∧
(0 : ℚ) < RealInstanceV2.realF2.density 2 (Order0.unramType 2 OMCountV2.lam2) 3
lean/LeanUrat/OM/RealInstanceV2Gates.lean — theorem
proved The order-0 density theorem at every prime
The uniformity content at order 0: the same rational function works at every prime and every degree, strengthening the $p=2$ instance, with a companion positivity gate at each prime.
For each prime $p$, each degree $n>0$, and each type $\sigma$: a single rational function, independent of $p$, represents the order-0 separable density $q'\mapsto\sum_{T\in\mathrm{menu}_0(n,\sigma)}c_T(q')$ at every $q'>1$ — with $\mathrm{menu}_0$ the order-0 separable menu and $c_T$ the engine evaluator — and the normalized count of monic degree-$n$ polynomials mod $p^N$ whose classifier lands on a menu shape, an honest finite fiber count, converges as $N\to\infty$ to that function's value at $p$.
The Lean statement
theorem montes_order0_density_general_prime (p : ℕ) [Fact p.Prime] (n : ℕ) (hn : 0 < n)
(σ : FactorizationType) :
∃ (num den : Polynomial ℚ), den ≠ 0 ∧
(∀ q' : ℕ, 1 < q' → den.eval (q' : ℚ) ≠ 0 ∧
(∑ T ∈ sepShapesOf n σ,
rootCount M7.cellsOfShapeWF M6.treeSize M7.cellsOfShapeWF_descend T q')
= num.eval (q' : ℚ) / den.eval (q' : ℚ)) ∧
Filter.Tendsto
(fun N =>
(∑ T ∈ sepShapesOf n σ,
(Nat.card {f : QuotientBox.monicBox p N n // B.classify p n N f = T} : ℚ))
/ (p : ℚ) ^ (n * N))
Filter.atTop
(nhds (num.eval (p : ℚ) / den.eval (p : ℚ)))
lean/LeanUrat/OM/Order0RealDensity.lean — theorem
conditional The first wild capstone: minimal-height ramified strata
The first wild content proved in the chain — no axioms beyond Lean's core — with its scope stated outright: minimal-height strata only (the full height-tower sum is blocked by the open self-loop resummation), constant-$e$ ramified types only, and no exhaustiveness claim.
For $n>0$ and $\sigma$ of degree $n$, assuming the tame functional equation for the wild foundation, one rational function represents the extended menu sum $\sum_T c_T(q')$ ($c_T$ the engine evaluator) at every $q'>1$, evaluates at $p=2$ to the decided-limit density of the wild counting model, and is palindromic — the same three clauses as the order-0 capstone, over a larger menu. The extension adjoins, for each ramified type $\sigma=\{(e,f_1),\dots,(e,f_k)\}$ of constant $e\ge 2$, one canonical wild stratum of minimal height: a single Newton-polygon side of slope $-1/e$ with separable, multiplicity-one residual factors. The ramified value obtained is the density of that one decided stratum — the leading term of the type's density, not the whole of it.
Hypotheses this rests on: htameFE — the tame functional equation for the wild foundation (feeds only the palindromy clause); the wild counting legs themselves are proved theorems, not hypotheses.
The Lean statement
theorem montes_unconditional_w (n : ℕ) (hn : 0 < n) (σ : FactorizationType) (hσ : σ.degree = n)
(htameFE : TameFunctionalEquation realFW n σ) :
∃ (num den : Polynomial ℚ), den ≠ 0 ∧
(∀ q' : ℕ, 1 < q' → den.eval (q' : ℚ) ≠ 0 ∧
(∑ T ∈ WildMenu.omMenuW n σ, OMCountV2.omCount T q') = num.eval (q' : ℚ) / den.eval (q' : ℚ)) ∧
((realMW n hn).countingDensity σ = num.eval (M9.realP : ℚ) / den.eval (M9.realP : ℚ)) ∧
IsPalindromic num den
lean/LeanUrat/OM/RealInstanceW.lean — theorem
proved Gate: the first wild density, exactly 1/8
The first strictly positive wild value in the chain, proved against the real instance through the wild counting leg rather than just the evaluator, and matched exactly by the external census.
At $p=2$ the totally ramified quadratic type ($e=2$, $f=1$) is wild — $p$ divides $e$ — and the decided-limit density of the wild counting model at this type is exactly $$\tfrac18=\frac{p-1}{p^3}\bigg|_{p=2},$$ the closed form $(p-1)/p^3$ for this stratum being proved at every prime $p$. Under the order-0 menu the same type's value was $0$.
The Lean statement
theorem gate_w1_countingDensity :
(RealInstanceW.realMW 2 (by norm_num)).countingDensity RealInstanceV2Gates.ramType2
= 1 / 8
lean/LeanUrat/OM/RealInstanceWGates.lean — theorem
proved Gate: wild types separate, and one stratum is truly empty
Type-dependence of the wild leg together with a scope point: the $0$ is the true emptiness of the canonical stratum at $p=2$, not a decoding artifact.
Two distinct degree-4 ramified types of constant $e=2$, namely $\sigma_A=\{(2,1),(2,1)\}$ and $\sigma_B=\{(2,2)\}$, receive different values at $p=2$: $0$ versus $1/256$. The $0$ is proved to be a pool-size effect — the stratum for $\sigma_A$ demands two distinct linear residual factors over $\mathbb{F}_2$, where only $p-1=1$ is available — not an artifact of a degenerate decoding.
The Lean statement
def sigmaA : FactorizationType := ⟨{(2, 1), (2, 1)}⟩
def sigmaB : FactorizationType := ⟨{(2, 2)}⟩
theorem gate_w2_wild_sigma_separation :
sigmaA ≠ sigmaB
∧ (∑ T ∈ WildMenu.omMenuW 4 sigmaA, OMCountV2.omCount T M9.realP)
≠ (∑ T ∈ WildMenu.omMenuW 4 sigmaB, OMCountV2.omCount T M9.realP)
lean/LeanUrat/OM/RealInstanceWGates.lean — theorem
proved Quadratics at every prime, one fixed formula
The paper's uniformity statement realized at $n=2$, hypothesis-free and with no axioms beyond Lean's core — exhaustion proved, no tame functional equation needed — with its scope stated: the fibers are digit-condition counting fibers, palindromy is deliberately out of scope (these monic uniform densities are not palindromic), and the values $1/3,1/3,1/3$ at $p=2$ and $1/4,3/8,3/8$ at $p=3$, each family summing to $1$, match an exact external census.
There are fixed polynomials in the variable $X$, with no prime appearing in them — $\mathrm{num}_\sigma/\mathrm{den}_\sigma = 1/(X+1)$ for the ramified quadratic type and $X/(2X+2)$ for both the inert and the split type — such that for every prime $p$, the wild $p=2$ included, and every degree-2 type $\sigma$: (R) the model's density family equals $\mathrm{num}_\sigma(q')/\mathrm{den}_\sigma(q')$ at every $q'>1$; (V) the decided-limit density of the complete $n=2$ stratum tree at $p$ is $\mathrm{num}_\sigma(p)/\mathrm{den}_\sigma(p)$ — that is, $1/(p+1)$ ramified and $p/(2(p+1))$ each for inert and split; (B) bracket uniqueness holds outright, the exhaustion being proved at every $p$ from the counting envelope $$\mathrm{undecided}_N/p^{2N}\le(\lfloor N/2\rfloor+1)\,p^{-(N-1)},$$ where $\mathrm{undecided}_N$ is the level-$N$ undecided count. The three densities sum to $1$ at every prime.
The Lean statement
variable (p : ℕ) [hp : Fact p.Prime]
theorem montes_uniform_n2 (σ : FactorizationType) (hσ : σ.degree = 2) :
(uniformDen σ ≠ 0 ∧
(∀ q' : ℕ, 1 < q' → (uniformDen σ).eval (q' : ℚ) ≠ 0 ∧
(∑ T ∈ shapesOfU σ, CU T q')
= (uniformNum σ).eval (q' : ℚ) / (uniformDen σ).eval (q' : ℚ)) ∧
((M7 p).countingDensity σ
= (uniformNum σ).eval ((p : ℕ) : ℚ) / (uniformDen σ).eval ((p : ℕ) : ℚ)
∧ (uniformDen σ).eval ((p : ℕ) : ℚ) ≠ 0)) ∧
∀ d : ℚ, (∀ N : ℕ, 1 ≤ N →
(M7 p).decidedCount σ N / (p : ℚ) ^ (2 * N) ≤ d ∧
d ≤ (M7 p).decidedCount σ N / (p : ℚ) ^ (2 * N)
+ (M7 p).undecidedCount N / (p : ℚ) ^ (2 * N)) →
d = (M7 p).countingDensity σ
lean/LeanUrat/OM/UniformCapstone.lean — theorem
2 Digit moves and the carry algebra
At a wild prime the classifier's higher-order steps mix coefficient digits through carries. These stages compute that mixing once, inside a fixed quotient ring, and prove transport theorems moving weights and residues level to level. The abstract engine is proved; identifying its stages with the classifier's actual reads at every degree is part of the open bridge work recorded in the amber panel, and the two hard-core corpora carry the still-open construction duties (two and nine named unproved statements respectively).
The residual and landing engine (Moves) 3 definition · 1 open · 15 proved · 1 conditional
One floor of the valuation tower: strata become triangular digit equations with exact density
This corpus is the engine of the wild (MacLane/Okutsu–Montes) side of the proof: the calculus of a single floor of a valuation tower over ℤ_p[X]. An abstract stage carries a monic key polynomial Φ, a valuation w, and a residual (initial-form) map R into Laurent polynomials over the current residue field; every polynomial then has a unique Φ-adic development f = Σ_j B_j Φ^j, and the stage laws say exactly how weights and digits sit in its slots. The payoff is the landing theorem: f lies in a given Newton-polygon stratum precisely when its development coefficients satisfy finitely many triangular digit equations — so that, granted coordinate presentations that are hypothesized here rather than constructed, a stratum cut by k equations has density exactly 1/p^k at every level, uniformly in the prime.
definition One level of the valuation tower, packaged with its laws
The single carrier every theorem in this corpus quantifies over; its realizer law is stated in coset form because the untwisted version, with the base unit hard-coded to 1, is false below the key threshold (refuted by finite-field computation).
For a prime $p$, a stage packages one level of a MacLane tower over $\mathbb{Z}_p[X]$. Numerical data: coprime $e,h\ge 1$ with a Bézout pair $es+ht=1$ (and $t=0$ when $e=1$). A monic key $\Phi$ of degree $\ge 1$. A weight $w:\mathbb{Z}_p[X]\to\mathbb{Z}$ that is a valuation on nonzero polynomials — $w(fg)=w(f)+w(g)$, $w(f+g)\ge\min(w(f),w(g))$, value group all of $\mathbb{Z}$, $w(\Phi)=h$ — related to the previous level's weight $w_{\mathrm{prev}}$ by the stretch $w(B)=e\,w_{\mathrm{prev}}(B)$ on coefficients $B$ (meaning $\deg B<\deg\Phi$), and obeying the attained-minimum law along the key: $w(f)=\min_j\big(w(B_j)+jh\big)$ over any development $f=\sum_j B_j\Phi^j$, with the minimum attained. Residue data: subfields $F_Q\le K$ of a fixed ambient finite field $F$ ($K$ the current residue field, $F_Q$ the base one), and a residual map $R:\mathbb{Z}_p[X]\to K[z^{\pm 1}]$ that is multiplicative, additive on weight ties that persist ($w(f)=w(g)=w(f+g)$ gives $R(f+g)=R(f)+R(g)$), drops the higher-weight summand ($w(f)<w(g)$ gives $R(f+g)=R(f)$), sends $\Phi$ to $z^s$, and sends each coefficient $B$ to a monomial $c\,z^{-t\,w_{\mathrm{prev}}(B)}$ with $c\in K^\times$. Realizers: every occurring coefficient weight $\nu$ is realized with digit scalars sweeping a full coset $F_Q^\times b$ of the base-field orbit, and every weight above $w_{\mathrm{prev}}(\Phi)$ with any prescribed scalar in $K^\times$.
The Lean statement
structure Stage (p : ℕ) [Fact p.Prime] (F : Type u) [Field F] [Finite F] where
e : ℕ
h : ℕ
s : ℤ
t : ℤ
he : 1 ≤ e
hh : 1 ≤ h
hcop : Nat.gcd e h = 1
hbez : (e : ℤ) * s + (h : ℤ) * t = 1
he1t : e = 1 → t = 0
Φ : Polynomial ℤ_[p]
hmonic : Φ.Monic
hdeg : 1 ≤ Φ.natDegree
w : Polynomial ℤ_[p] → ℤ
wPrev : Polynomial ℤ_[p] → ℤ
K : Subfield F
FQ : Subfield F
hFQ_le : FQ ≤ K
R : Polynomial ℤ_[p] → LaurentPolynomial ↥K
hwmul : ∀ f g, f ≠ 0 → g ≠ 0 → w (f * g) = w f + w g
hwult : ∀ f g, f ≠ 0 → g ≠ 0 → f + g ≠ 0 → min (w f) (w g) ≤ w (f + g)
hvalgrp : AddSubgroup.closure {n : ℤ | ∃ f g, f ≠ 0 ∧ g ≠ 0 ∧ w f - w g = n} = ⊤
hwΦ : w Φ = (h : ℤ)
hStretch : ∀ B, B ≠ 0 → inC Φ B → w B = (e : ℤ) * wPrev B
hR0 : R 0 = 0
hRne : ∀ f, f ≠ 0 → R f ≠ 0
hRmul : ∀ f g, f ≠ 0 → g ≠ 0 → R (f * g) = R f * R g
hRadd : ∀ f g, f ≠ 0 → g ≠ 0 → f + g ≠ 0 → w f = w g → w (f + g) = w f →
R (f + g) = R f + R g
hRlt : ∀ f g, f ≠ 0 → g ≠ 0 → f + g ≠ 0 → w f < w g → R (f + g) = R f
hRΦ : R Φ = LaurentPolynomial.T s
hK1 : K1At w Φ (w Φ)
hS5 : ∀ B, B ≠ 0 → inC Φ B →
∃ c : (↥K)ˣ,
R B = LaurentPolynomial.C (c : ↥K) * LaurentPolynomial.T (- t * wPrev B)
reps : List (Polynomial ℤ_[p])
hreps : ∀ ũ ∈ reps, ũ ≠ 0 ∧ inC Φ ũ
Tvec : List (Polynomial ℤ_[p] × ℤ)
hTvec : Tvec.map Prod.fst = reps
weightSet : Set ℤ
hWS : ∀ B, B ≠ 0 → inC Φ B → wPrev B ∈ weightSet
hS6a : ∀ ν : ℤ, ν ∈ weightSet → ∃ b : (↥K)ˣ, ∀ c : (↥K)ˣ, ((c : ↥K) : F) ∈ FQ →
∃ B, B ≠ 0 ∧ inC Φ B ∧ wPrev B = ν ∧
R B = LaurentPolynomial.C ((c * b : (↥K)ˣ) : ↥K) * LaurentPolynomial.T (- t * ν)
hS6b : ∀ (ν : ℤ) (a : (↥K)ˣ), wPrev Φ < ν →
∃ B, B ≠ 0 ∧ inC Φ B ∧ wPrev B = ν ∧
R B = LaurentPolynomial.C (a : ↥K) * LaurentPolynomial.T (- t * ν)
lean/LeanUrat/Moves/Defs.lean — structure
definition The invariant a stage carries up the tower
The base stage constructs this invariant and every transition transports it; the tower induction itself lives in the HC1 corpus, which depends on exactly this invariant.
For a prime $p$ and a stage over $\mathbb{Z}_p[X]$ with side data $(e,h)$, Bézout $es+ht=1$, key $\Phi$, weight $w$ with parent weight $w_{\mathrm{prev}}$, residue field $K$, and residual map $R$ into $K[z^{\pm1}]$, the inductive invariant has three layers. (i) Core laws: $w_{\mathrm{prev}}$ is multiplicative and ultrametric; $p$ occurs among the recorded representatives; strictness ($w(f+g)=w(f)$ whenever $w(f)<w(g)$); the jump law (equal weights whose sum's weight jumps force residual cancellation, $R(f)+R(g)=0$); the slope inequality $e\,w_{\mathrm{prev}}(\Phi)<h$; slot decomposition; and the coefficient-field laws. (ii) The unit law: the stage records a list of representative coefficients with integer exponents, and in the two-variable Laurent model $L=K[z^{\pm1}][T^{\pm1}]$ of the graded algebra, the product of their initial-form units to those exponents, times the initial form of $\Phi$ to the Bézout power $t$, equals the normalizing unit $T$ — an identity of actual units, not merely of classes. (iii) The localization law: the subring generated by initial forms of coefficients together with inverses of the representative units has degree-$0$ part exactly the constants $K$, and the variable $z$ itself — with scalar $1$ — is the value of an explicit weight-$0$ monomial $V^{-h}Y^{e}$ in a representative $V$ and the key $Y$.
The Lean statement
def TvecUnitLaw (σ : Stage p F) : Prop :=
∃ (uY : (LTwo ↥σ.K)ˣ) (ru : Fin σ.Tvec.length → (LTwo ↥σ.K)ˣ),
IsGrUnit σ σ.Φ uY ∧
(∀ i, IsGrUnit σ (σ.Tvec.get i).1 (ru i)) ∧
(∏ i, ru i ^ (σ.Tvec.get i).2) * uY ^ σ.t = locT ↥σ.K
def CoeffLocLaw (σ : Stage p F) : Prop :=
(∀ ℓ : LaurentPolynomial ↥σ.K, LaurentPolynomial.C ℓ ∈ σ.coeffLocSR →
∃ d : ↥σ.K, ℓ = LaurentPolynomial.C d)
∧ (∀ d : ↥σ.K, LaurentPolynomial.C (LaurentPolynomial.C d) ∈ σ.coeffLocSR)
∧ (∃ (zv : LVec σ) (u : (LTwo ↥σ.K)ˣ),
σ.lvecWeight zv = 0 ∧ IsLVecVal σ zv u ∧
(u : LTwo ↥σ.K) = LaurentPolynomial.C (zvar ↥σ.K))
structure StageCoreL (σ : Stage p F) : Prop where
core : StageCore σ
tvec_unit : TvecUnitLaw σ
coeff_loc : CoeffLocLaw σ
lean/LeanUrat/Moves/DefsL.lean — structure
definition The landing cylinder: a stratum carved out by a triangular carry chain
The shape that converts stratum membership into finitely many triangular digit equations; anchor exactness is not built into the cylinder but enters the two-sided landing theorem as an explicit hypothesis, without which that equivalence is false.
For a prime $p$, fix a stage over $\mathbb{Z}_p[X]$ with weight $w$, side data $(e,h)$ and Bézout datum $t$, and residual map $R$ into $K[z^{\pm1}]$ over the residue field $K$; an irreducible $\psi$ of degree $g$ over $K$; a vertex slot $\mu$; an anchor $a\in\mathbb{Z}$; and a digit pattern $(C_j)$ of polynomials of degree $<g$. Development data $B_0,\dots,B_{N-1}$ lands in the cylinder when: some $m_0$ equals the slot weight $w(B_\mu)+\mu\,ehg$ (with $B_\mu\ne 0$), no nonzero slot has $w(B_j)+j\,ehg$ below $m_0$, and every nonzero slot $j<\mu$ sits strictly above it; and the anchored slot terms $c_j=z^{\,j\hat m-a}\,R(B_j)$ at minimizing slots (with $\hat m=-thg$, and $c_j=0$ elsewhere) reproduce the pattern through a triangular carry chain — $\mathrm{carry}_0=0$ and $c_j+\mathrm{carry}_j=C_j+\psi\cdot\mathrm{carry}_{j+1}$ with $\deg C_j<\deg\psi$ — in which every carry from level $N$ on vanishes.
The Lean statement
def IsCarryChainL {K : Type*} [Field K] (ψ : Polynomial K) (c : ℕ → LaurentPolynomial K)
(Cdig : ℕ → Polynomial K) (carry : ℕ → LaurentPolynomial K) : Prop :=
carry 0 = 0 ∧
∀ j, (Cdig j).degree < ψ.degree ∧
c j + carry j = Polynomial.toLaurent (Cdig j) + Polynomial.toLaurent ψ * carry (j + 1)
def CarryTransportL {K : Type*} [Field K] (ψ : Polynomial K) (c : ℕ → LaurentPolynomial K)
(Cdig : ℕ → Polynomial K) (N : ℕ) : Prop :=
∃ carry : ℕ → LaurentPolynomial K,
IsCarryChainL ψ c Cdig carry ∧ ∀ j, N ≤ j → carry j = 0
def LandingCylinderL (σ : Stage p F) (ψ : Polynomial ↥σ.K) (g : ℕ) (μ : ℕ) (a : ℤ)
(Cdig : ℕ → Polynomial ↥σ.K) (B : ℕ → Polynomial ℤ_[p]) (N : ℕ) : Prop :=
∃ m₀ : ℤ,
B μ ≠ 0 ∧ σ.w (B μ) + (μ : ℤ) * ((σ.e : ℤ) * σ.h * g) = m₀ ∧
(∀ j, j < N → B j ≠ 0 → m₀ ≤ σ.w (B j) + (j : ℤ) * ((σ.e : ℤ) * σ.h * g)) ∧
(∀ j, j < μ → B j ≠ 0 → m₀ < σ.w (B j) + (j : ℤ) * ((σ.e : ℤ) * σ.h * g)) ∧
∃ cL : ℕ → LaurentPolynomial ↥σ.K,
(∀ j, j < N →
((B j ≠ 0 ∧ σ.w (B j) + (j : ℤ) * ((σ.e : ℤ) * σ.h * g) = m₀) →
cL j = LaurentPolynomial.T ((j : ℤ) * (- σ.t * σ.h * g) - a) * σ.R (B j)) ∧
(¬ (B j ≠ 0 ∧ σ.w (B j) + (j : ℤ) * ((σ.e : ℤ) * σ.h * g) = m₀) → cL j = 0)) ∧
(∀ j, N ≤ j → cL j = 0) ∧
CarryTransportL ψ cL Cdig N
lean/LeanUrat/Moves/DefsL.lean — definition
proved Every polynomial develops along a monic key
Stated over an arbitrary commutative ring, so the same fact serves both $\mathbb{Z}_p[X]$ and the finite digit boxes mod $p^N$.
Over any commutative ring $R$: if $\Phi\in R[X]$ is monic of degree $\ge 1$, then every $f\in R[X]$ can be written $$f=\sum_{j<N}B_j\,\Phi^{\,j},\qquad \deg B_j<\deg\Phi,\qquad B_j=0\ \text{for } j\ge N$$ — the $\Phi$-adic development of $f$.
The Lean statement
theorem L0_FactA_exists {R : Type*} [CommRing R] (Φ : Polynomial R) (hΦ : Φ.Monic)
(hd : 1 ≤ Φ.natDegree) (f : Polynomial R) :
∃ (B : ℕ → Polynomial R) (N : ℕ), IsDevelopment Φ f B N
lean/LeanUrat/Moves/L0_FactA_exists.lean — theorem
proved The development along a monic key is unique
Uniqueness is what makes “the digits of $f$” well defined: the landing theorems read weights and residuals off the slots without ever making a choice.
Over any commutative ring: two $\Phi$-adic developments of the same polynomial $f$ along the same monic key $\Phi$ — expressions $f=\sum_{j<N}B_j\Phi^j$ with $\deg B_j<\deg\Phi$ — agree in every slot, $B_j=B'_j$ for all $j$, whatever their recorded lengths.
The Lean statement
theorem L0_FactB_unique {R : Type*} [CommRing R] (Φ : Polynomial R) (hΦ : Φ.Monic) (f : Polynomial R) {B B' : ℕ → Polynomial R} {N N' : ℕ} (h : IsDevelopment Φ f B N) (h' : IsDevelopment Φ f B' N') : ∀ j, B j = B' j
lean/LeanUrat/Moves/L0_FactB_unique.lean — theorem
proved The Gauss valuation is multiplicative
The tower's ground floor: the first-level weight is built directly on this valuation.
For a prime $p$ and nonzero $f,g\in\mathbb{Z}_p[X]$, write $f=\sum_i a_iX^i$ and set $v(f)=\min_i v_p(a_i)$, the least $p$-adic valuation of a coefficient. Then $$v(fg)=v(f)+v(g)$$ — Gauss's lemma, said as a valuation.
The Lean statement
theorem L1_gaussVal_mul {p : ℕ} [Fact p.Prime] (f g : Polynomial ℤ_[p]) (hf : f ≠ 0) (hg : g ≠ 0) : gaussVal (f * g) = gaussVal f + gaussVal g
lean/LeanUrat/Moves/L1_gaussVal.lean — theorem
proved The first level of the tower is a genuine valuation
The MacLane base case that anchors the whole tower in an honest valuation, proved by a direct Cauchy-product-with-carries argument, with no graded-ring machinery.
For a prime $p$, let $\varphi\in\mathbb{Z}_p[X]$ be monic of degree $\ge 1$ and irreducible mod $p$, and let $e,h\ge 1$ be coprime. For $f=\sum_i a_i\varphi^i$ the $\varphi$-adic development and $v$ the Gauss valuation, set $$w(f)=\min_i\big(e\,v(a_i)+i\,h\big).$$ Then $w(fg)=w(f)+w(g)$ for all nonzero $f,g$.
The Lean statement
theorem L1_baseWeight_valuation {p : ℕ} [Fact p.Prime] (φ : Polynomial ℤ_[p]) (e h : ℕ) (hmon : φ.Monic) (hd : 1 ≤ φ.natDegree) (he : 1 ≤ e) (hh : 1 ≤ h) (hcop : Nat.gcd e h = 1) (hirred : Irreducible (φ.map (PadicInt.toZMod : ℤ_[p] →+* ZMod p))) (f g : Polynomial ℤ_[p]) (hf : f ≠ 0) (hg : g ≠ 0) : baseWeight φ e h (f * g) = baseWeight φ e h f + baseWeight φ e h g
lean/LeanUrat/Moves/L1_baseWeight_R3.lean — theorem
proved Residuals decompose slot by slot, and the key is transcendental degreewise
Graded additivity plus degreewise transcendence of the key: the two facts every landing and transition argument downstream transports.
For a prime $p$, suppose a stage over $\mathbb{Z}_p[X]$ has weight $w$ and residual map $R$ satisfying strictness ($w(f+g)=w(f)$ when $w(f)<w(g)$), the jump law (if $w(f)=w(g)$ but $w(f+g)>w(f)$ then $R(f)+R(g)=0$), and $R(-f)=-R(f)$. Then both halves of slot decomposition hold for developments along the key $\Phi$: (i) if every nonzero slot has total weight $\gamma$ and the sum stays at weight $\gamma$, the residual of the sum is the sum of the slot residuals; and (ii) a combination $\sum_j R(B_j)\,R(\Phi)^j$ whose nonzero terms all lie in one graded piece vanishes only termwise — degree by degree, the class of the key is transcendental over the coefficient classes.
The Lean statement
theorem L2_slotDecomp {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F] (σ : Stage p F) (hstrict : ∀ f g, f ≠ 0 → g ≠ 0 → σ.w f < σ.w g → σ.w (f + g) = σ.w f) (hjump : ∀ f g, f ≠ 0 → g ≠ 0 → f + g ≠ 0 → σ.w f = σ.w g → σ.w f < σ.w (f + g) → σ.R f + σ.R g = 0) (hneg : ∀ f, σ.R (-f) = - σ.R f) : SlotDecomp σ
lean/LeanUrat/Moves/L2_slotDecomp_R4.lean — theorem
proved Multiplying by a power of the key strides the residual
The workhorse computation: distinct slots land at distinct powers of $z$, which is what makes slot terms independent and feeds every realizer and landing argument.
For a prime $p$ and a stage over $\mathbb{Z}_p[X]$ with key $\Phi$, Bézout exponent $s$, and residual map $R$ into Laurent polynomials in $z$: for every nonzero coefficient $B$ (that is, $\deg B<\deg\Phi$) and every $j\ge 0$, $$R\big(B\cdot\Phi^{\,j}\big)=R(B)\cdot z^{\,sj}.$$
The Lean statement
theorem L2_strideRule {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F] (σ : Stage p F) (B : Polynomial ℤ_[p]) (hB : B ≠ 0) (hBc : inC σ.Φ B) (j : ℕ) : σ.R (B * σ.Φ ^ j) = σ.R B * LaurentPolynomial.T (σ.s * j)
lean/LeanUrat/Moves/L2_strideRule.lean — theorem
proved The residual map describes each graded piece completely
A complete structural identification of one graded piece; the scalar clause also yields weight preservation, which is what makes multiplication by a base-field lift an operator on the piece.
For a prime $p$, fix a stage over $\mathbb{Z}_p[X]$ satisfying the core laws — weight $w$, residual map $R$, key $\Phi$, base field $F_Q$ inside the residue field $K$ — and a weight $\gamma\in\mathbb{Z}$; work on the graded piece $\{f\ne 0: w(f)=\gamma\}$. Then: (1) $R$ is injective up to higher weight — $R(f)=R(f')$ forces $f=f'$ or $w(f-f')>\gamma$; (2) $R$ is additive whenever the sum stays at weight $\gamma$; (3) multiplying by a weight-$0$ coefficient lift $\hat u$ whose residual is a nonzero base-field constant $c\in F_Q$ preserves the piece and scales residuals by $c$ — an $F_Q$-linear operator on the piece; (4)+(5) the image of the piece under $R$ is exactly the nonzero part of the additive span of the slot images.
The Lean statement
theorem L2_P6i {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F] (σ : Stage p F) (hcore : StageCore σ) (γ : ℤ) : (∀ f f', f ≠ 0 → f' ≠ 0 → σ.w f = γ → σ.w f' = γ → σ.R f = σ.R f' → f - f' = 0 ∨ γ < σ.w (f - f')) ∧ (∀ f f', f ≠ 0 → f' ≠ 0 → f + f' ≠ 0 → σ.w f = γ → σ.w f' = γ → σ.w (f + f') = γ → σ.R (f + f') = σ.R f + σ.R f') ∧ (∀ (û : Polynomial ℤ_[p]) (c : ↥σ.FQ), û ≠ 0 → c ≠ 0 → inC σ.Φ û → σ.w û = 0 → σ.R û = LaurentPolynomial.C (Subfield.inclusion σ.hFQ_le c) * LaurentPolynomial.T (0 : ℤ) → ∀ f, f ≠ 0 → σ.w f = γ → σ.w (û * f) = γ ∧ σ.R (û * f) = LaurentPolynomial.C (Subfield.inclusion σ.hFQ_le c) * σ.R f) ∧ (∀ f, f ≠ 0 → σ.w f = γ → σ.R f ∈ AddSubgroup.closure (σ.slotImages γ)) ∧ (∀ x ∈ AddSubgroup.closure (σ.slotImages γ), x ≠ 0 → ∃ f, f ≠ 0 ∧ σ.w f = γ ∧ σ.R f = x)
lean/LeanUrat/Moves/L2_P6i_R5_final.lean — theorem
proved Weights read off the slots of a development at a lifted key
MacLane's key lemma at the lifted key — the formula that lets weights and residuals be read off development slots, and to which both directions of the landing theorem reduce.
For a prime $p$, work on a stage over $\mathbb{Z}_p[X]$ with side data $(e,h)$, Bézout $es+ht=1$, key $\Phi$, weight $w$, and parent weight $w_{\mathrm{prev}}$. Let $\psi\ne z$ be monic irreducible of degree $g$ over the residue field, and let $$\hat\Phi=\Phi^{eg}+\sum_{k<g}t_k\,\Phi^{ek}$$ be its standard lift: each $t_k$ is a coefficient realizer with $w_{\mathrm{prev}}(t_k)=h(g-k)$ whose residual places the $k$-th coefficient of $\psi$ at position $z^{-th(g-k)}$ (and $t_k=0$ when that coefficient vanishes). Then for every nonzero $f$ and every development $f=\sum_j B_j\hat\Phi^j$: $$w(f)=\min_j\big(w(B_j)+j\,ehg\big),$$ with the minimum attained at some nonzero slot.
The Lean statement
theorem L3_K1 {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F] (σ : Stage p F) (ψ : Polynomial ↥σ.K) (g : ℕ) (hg : ψ.natDegree = g) (hψ : Irreducible ψ) (hψz : ψ ≠ Polynomial.X) (hmon : ψ.Monic) (Φhat : Polynomial ℤ_[p]) (hlift : IsStandardLift σ ψ g Φhat) : K1At σ.w Φhat ((σ.e : ℤ) * σ.h * g)
lean/LeanUrat/Moves/L3_K1.lean — theorem
proved Digits multiply through division by the lifted key
One step of residue-field growth: this multiplication law is how the residue field extends by degree $g$ at each transition, and the transition construction in the HC1 corpus depends on it.
For a prime $p$, on a stage over $\mathbb{Z}_p[X]$ with side data $(e,h)$, key $\Phi$, weight $w$, and residue field $K$ inside the ambient finite field $F$: let $\psi\ne z$ be monic irreducible of degree $g$ over $K$ with standard lift $\hat\Phi$, and let $\bar z\in F$ be a root of $\psi$. Take nonzero $B,B''$ of degree $<eg\cdot\deg\Phi$ (the coefficient space of $\hat\Phi$) and divide: $B\,B''=Q\hat\Phi+R_{\mathrm{dev}}$ with $\deg R_{\mathrm{dev}}<eg\cdot\deg\Phi$. Then $R_{\mathrm{dev}}\ne 0$, weights add — $w(R_{\mathrm{dev}})=w(B)+w(B'')$ — and the digit at $\bar z$ (the residual evaluated at $z=\bar z$) multiplies: $\mathrm{dig}_{\bar z}(R_{\mathrm{dev}})=\mathrm{dig}_{\bar z}(B)\cdot\mathrm{dig}_{\bar z}(B'')$.
The Lean statement
theorem L3_DIV {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F] (σ : Stage p F) (ψ : Polynomial ↥σ.K) (g : ℕ) (hg : ψ.natDegree = g) (hψ : Irreducible ψ) (hψz : ψ ≠ Polynomial.X) (Φhat : Polynomial ℤ_[p]) (hlift : IsStandardLift σ ψ g Φhat) (zbar : Fˣ) (hzbar : Polynomial.eval₂ σ.K.subtype (zbar : F) ψ = 0) (B B'' : Polynomial ℤ_[p]) (hB : B ≠ 0) (hB'' : B'' ≠ 0) (hBd : B.natDegree < σ.e * g * σ.Φ.natDegree) (hB''d : B''.natDegree < σ.e * g * σ.Φ.natDegree) (Rdev Q : Polynomial ℤ_[p]) (hdiv : B * B'' = Q * Φhat + Rdev) (hRd : Rdev.natDegree < σ.e * g * σ.Φ.natDegree) : Rdev ≠ 0 ∧ σ.w Rdev = σ.w B + σ.w B'' ∧ σ.digPrime zbar Rdev = σ.digPrime zbar B * σ.digPrime zbar B''
lean/LeanUrat/Moves/L3_DIV.lean — theorem
proved Weights and realizer digits recur across a tower transition
The supply line that lets the tower induction climb one level, stated in coset form because the sharper version pinning the digit class to a fixed root monomial is false (refuted by explicit computation), with a companion variant free of the child stage to break a circularity in the induction.
For a prime $p$, let a transition go from a stage $\sigma$ over $\mathbb{Z}_p[X]$ — side data $(e,h)$, key $\Phi$, base field $F_Q$ — to a child stage $\sigma'$ with side data $(e',h')$ and Bézout datum $t'$, along a lifted key $\hat\Phi$ of degree $eg\cdot\deg\Phi$ (where $g$ is the degree of the residual polynomial being lifted). Then: (1) the parent-scale weights occurring on the child coefficient space $\{B:\deg B<\deg\hat\Phi\}$ are exactly the values $\gamma+jh$ with $\gamma$ an occurring parent coefficient weight and $0\le j<eg$; and (2) for each index $(\gamma,j)$ there is a single unit $d_0$ of the child residue field such that every base-field scalar $c\in F_Q^\times$ is realized: some $B$ in the child coefficient space has parent weight $\gamma+jh$, child weight $e'(\gamma+jh)$, and child residual the monomial $d\,z^{-t'(\gamma+jh)}$ with digit $d=c\cdot d_0$. The realizer digits of one index sweep exactly one coset of the base-field orbit.
The Lean statement
theorem L4_TRANSviii_a {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F] (σ σ' : Stage p F) (hcore : StageCoreL σ) (g : ℕ) (Φhat : Polynomial ℤ_[p]) (hΦdeg : Φhat.natDegree = σ.e * g * σ.Φ.natDegree) (e' h' : ℕ) (zbar : Fˣ) (htrans : TransitionCoreL σ σ' Φhat e' h' zbar) : (∀ W' : ℤ, (∃ B, B ≠ 0 ∧ inC Φhat B ∧ σ'.wPrev B = W') ↔ (∃ (γ : ℤ) (j : ℕ), (∃ C, C ≠ 0 ∧ inC σ.Φ C ∧ σ.w C = γ) ∧ j < σ.e * g ∧ W' = γ + (j : ℤ) * σ.h)) ∧ (∀ (γ : ℤ) (j : ℕ), (∃ C, C ≠ 0 ∧ inC σ.Φ C ∧ σ.w C = γ) → j < σ.e * g → ∃ d₀ : (↥σ'.K)ˣ, ∀ c : (↥σ'.K)ˣ, ((c : ↥σ'.K) : F) ∈ σ'.FQ → ∃ B, B ≠ 0 ∧ inC Φhat B ∧ σ'.wPrev B = γ + (j : ℤ) * σ.h ∧ σ'.w B = (σ'.e : ℤ) * (γ + (j : ℤ) * σ.h) ∧ ∃ d : (↥σ'.K)ˣ, σ'.R B = LaurentPolynomial.C (d : ↥σ'.K) * LaurentPolynomial.T (- σ'.t * (γ + (j : ℤ) * σ.h)) ∧ ((d : ↥σ'.K) : F) = ((c : ↥σ'.K) : F) * ((d₀ : ↥σ'.K) : F))
lean/LeanUrat/Moves/L4_TRANSviii_a_R5_final.lean — theorem
proved Stratum membership equals landing-cylinder membership
The capstone of the corpus, proved in both directions: stratum membership becomes digit equations on development data, with the anchor-exactness hypothesis needed — a countermodel that shifts the anchor and re-develops kills the pin-free version — and the argument running entirely at the abstract stage laws.
For a prime $p$, on a stage over $\mathbb{Z}_p[X]$ with side data $(e,h)$, weight $w$, and residual map $R$ into $K[z^{\pm1}]$ over the residue field $K$: let $\psi\ne z$ be monic irreducible of degree $g$ over $K$ with standard lift $\hat\Phi$; let $f\ne 0$ have $\hat\Phi$-adic development $(B_j)_{j<N}$; fix a slot $\mu<N$, an anchor $a\in\mathbb{Z}$, and a digit pattern $(C_j)$; and assume the anchor-exactness pin $X\nmid\sum_{j<N}C_j\psi^j$ — the pattern's total has nonzero constant coefficient. Then $f$ lies in the $(\mu,a,(C_j))$-stratum — meaning $R(f)=z^a\,P$ for a polynomial $P$ with $P(0)\ne 0$ whose $\psi$-adic development has digits exactly $(C_j)$, zero below slot $\mu$ and nonzero at $\mu$ — if and only if $(B_j)$ lies in the landing cylinder: the minimum of the slot weights $w(B_j)+j\,ehg$ is attained at $\mu$ and strictly avoided by every earlier slot, and the anchored slot terms reproduce $(C_j)$ through the terminating carry chain.
The Lean statement
theorem L5_landTwoSided {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F] (σ : Stage p F) (hcore : StageCore σ) (ψ : Polynomial ↥σ.K) (g : ℕ) (hg : ψ.natDegree = g) (hgpos : 1 ≤ g) (hmon : ψ.Monic) (hψ : Irreducible ψ) (hψz : ψ ≠ Polynomial.X) (Φhat : Polynomial ℤ_[p]) (hlift : IsStandardLift σ ψ g Φhat) (μ : ℕ) (f : Polynomial ℤ_[p]) (hf : f ≠ 0) (B : ℕ → Polynomial ℤ_[p]) (N : ℕ) (hμN : μ < N) (hdev : IsDevelopment Φhat f B N) (a : ℤ) (Cdig : ℕ → Polynomial ↥σ.K) (hexact : ¬ Polynomial.X ∣ ∑ j ∈ Finset.range N, Cdig j * ψ ^ j) : StratumData σ ψ μ a Cdig N f ↔ LandingCylinderL σ ψ g μ a Cdig B N
lean/LeanUrat/Moves/L5_landTwoSided_repair.lean — theorem
proved Slot data determines the residual
Polynomials with the same digit data are residually indistinguishable — the determinacy behind measure exactness — and tying the key to the stage is essential, since the untied version is false.
For a prime $p$, on a stage over $\mathbb{Z}_p[X]$ with weight $w$ and residual map $R$: let $\hat\Phi$ be the standard lift of a monic irreducible $\psi\ne z$ over the residue field, and suppose the attained-minimum law holds at $\hat\Phi$ (the weight of any development is the least slot weight, and it is attained). If nonzero $f,f'$ have developments $(B_j)_{j<N}$ and $(B'_j)_{j<N}$ along $\hat\Phi$ with $R(B_j)=R(B'_j)$ and $w(B_j)=w(B'_j)$ for every $j<N$, then $R(f)=R(f')$.
The Lean statement
theorem L5_landTransport {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F] (σ : Stage p F) (hcore : StageCore σ) (ψ : Polynomial ↥σ.K) (g : ℕ) (hg : ψ.natDegree = g) (hgpos : 1 ≤ g) (hmon : ψ.Monic) (hψ : Irreducible ψ) (hψz : ψ ≠ Polynomial.X) (Φhat : Polynomial ℤ_[p]) (hlift : IsStandardLift σ ψ g Φhat) (hK1 : K1At σ.w Φhat (σ.w Φhat)) (f f' : Polynomial ℤ_[p]) (hf : f ≠ 0) (hf' : f' ≠ 0) (B B' : ℕ → Polynomial ℤ_[p]) (N : ℕ) (hd : IsDevelopment Φhat f B N) (hd' : IsDevelopment Φhat f' B' N) (hslotR : ∀ j, j < N → σ.R (B j) = σ.R (B' j)) (hslotw : ∀ j, j < N → σ.w (B j) = σ.w (B' j)) : σ.R f = σ.R f'
lean/LeanUrat/Moves/L5_landTransport_R4.lean — theorem
open Transport fails when the key is not tied to the stage
A false statement recorded as a countermodel: dropping the standard-lift and attained-minimum hypotheses makes transport fail, which is why the proved transport theorem ties the key to the stage. The countermodel is an analysis in the intended base-stage model rather than a compiled disproof.
For a prime $p$, the same transport statement with $\hat\Phi$ an arbitrary development key — no standard-lift hypothesis and no attained-minimum law tying it to the stage's weight $w$ and residual map $R$ — is false in the intended base-stage model: for $\hat\Phi=1+X$, $f=p+X$, $f'=p^2+X$, all slot residuals and slot weights agree, yet $R(f)\ne R(f')$. The minimal-weight block cancels residually, and the residual is read off sub-leading data that the slots do not pin.
The Lean statement
theorem L5_landTransport {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F] (σ : Stage p F) (Φhat : Polynomial ℤ_[p]) (f f' : Polynomial ℤ_[p]) (hf : f ≠ 0) (hf' : f' ≠ 0) (B B' : ℕ → Polynomial ℤ_[p]) (N : ℕ) (hd : IsDevelopment Φhat f B N) (hd' : IsDevelopment Φhat f' B' N) (hslotR : ∀ j, j < N → σ.R (B j) = σ.R (B' j)) (hslotw : ∀ j, j < N → σ.w (B j) = σ.w (B' j)) : σ.R f = σ.R f'
lean/LeanUrat/Moves/L5_landTransport_R3.lean — countermodel
proved Reduction of a development fails at level zero
The corrected statement, valid only for $M\ge 1$, is the reduction theorem.
It is false that for every prime $p$, monic key $\hat\Phi$ over $\mathbb{Z}_p$, development $f=\sum_j B_j\hat\Phi^j$, and every level $M\ge 0$, coefficientwise reduction mod $p^M$ is again a development: at $M=0$ the target $\mathbb{Z}/p^0$ is the zero ring, every reduced polynomial vanishes, and the degree condition $\deg B_j<\deg\hat\Phi$ cannot hold. Witness, compiled: $\hat\Phi=X$, $f=1$ over $\mathbb{Z}_2$.
The Lean statement
theorem L6_moveReduceCommute_statement_false :
¬ (∀ (p : ℕ) [Fact p.Prime] (Φhat f : Polynomial ℤ_[p]), Φhat.Monic →
∀ (B : ℕ → Polynomial ℤ_[p]) (N M : ℕ), IsDevelopment Φhat f B N →
IsDevelopment (Φhat.map (PadicInt.toZModPow M)) (f.map (PadicInt.toZModPow M))
(fun j => (B j).map (PadicInt.toZModPow M)) N)
lean/LeanUrat/Moves/L6_moveReduceCommute_R3.lean — countermodel
proved Reduction mod p^M carries developments to developments
The bridge from $p$-adic development data to the finite digit boxes mod $p^M$ where the counting happens; the level bound $M\ge 1$ is necessary, since $M=0$ collapses to the zero ring.
For a prime $p$ and every $M\ge 1$: if $f=\sum_{j<N}B_j\hat\Phi^j$ is a development along a monic key $\hat\Phi$ over $\mathbb{Z}_p$ (each $\deg B_j<\deg\hat\Phi$), then reducing $f$, $\hat\Phi$, and every $B_j$ coefficientwise mod $p^M$ yields a development of the reduced $f$ along the reduced key, with the same slots and the same length.
The Lean statement
theorem L6_moveReduceCommute {p : ℕ} [Fact p.Prime] (Φhat f : Polynomial ℤ_[p]) (hmon : Φhat.Monic) (B : ℕ → Polynomial ℤ_[p]) (N M : ℕ) (hM : 1 ≤ M) (hdev : IsDevelopment Φhat f B N) : IsDevelopment (Φhat.map (PadicInt.toZModPow M)) (f.map (PadicInt.toZModPow M)) (fun j => (B j).map (PadicInt.toZModPow M)) N
lean/LeanUrat/Moves/L6_moveReduceCommute_R4.lean — theorem
conditional The stratum density is the same at every level: 1/p^k
The counting endpoint: it uses the two-sided landing theorem, and the two densities agree conditional on the coordinate-presentation hypotheses — surjective codes onto the digit boxes that present the stratum and the landing cylinder, assumed here rather than constructed — so this is the shape of measure exactness rather than its full derivation.
For a prime $p$, fix a stage over $\mathbb{Z}_p[X]$, an irreducible $\psi$ over its residue field, and a stratum: a vertex slot $\mu$, an anchor $a$, and a digit pattern $(C_j)$ with the anchor-exactness pin $X\nmid\sum_j C_j\psi^j$; let $D$ be the degree budget. Suppose at two levels $N,M\ge 1$ we are handed coordinate presentations: surjective codes from polynomials of degree $<D$ onto the digit boxes $(\mathbb{Z}/p)^{DN}$ and $(\mathbb{Z}/p)^{DM}$ under which the stratum is presented, coordinate changes $\Theta$, and digit systems pinning exactly $k$ coordinates each, whose solution sets present the landing cylinder and reject the coordinates of the zero polynomial. Then the two densities agree: $$\frac{\#\{\text{stratum solutions at level }N\}}{p^{DN}}=\frac{\#\{\text{stratum solutions at level }M\}}{p^{DM}}$$ — the stratum has one exact measure, $1/p^k$, however deep it is read.
Hypotheses this rests on: The jet-coordinate presentations are taken as named hypotheses rather than constructed: hcodeN/hcodeM (surjective coefficient codes onto the digit boxes) and hstratN/hstratM (the codes present the stratum); hcylN/hcylM with hENk/hEMk (digit systems pinning exactly k coordinates whose solution sets present the landing cylinder through the coordinate changes Θ); hzsolN/hzsolM (the digit systems reject the zero polynomial's coordinates); and hexact (the anchor-exactness pin on the digit pattern).
The Lean statement
theorem L6_measureExact {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F] (σ : Stage p F) (hcore : StageCore σ) (ψ : Polynomial ↥σ.K) (g : ℕ) (hg : ψ.natDegree = g) (hgpos : 1 ≤ g) (hmon : ψ.Monic) (hψ : Irreducible ψ) (hψz : ψ ≠ Polynomial.X) (Φhat : Polynomial ℤ_[p]) (hlift : IsStandardLift σ ψ g Φhat) (μ : ℕ) (a : ℤ) (Cdig : ℕ → Polynomial ↥σ.K) (Nslots : ℕ) (hμN : μ < Nslots) (hexact : ¬ Polynomial.X ∣ ∑ j ∈ Finset.range Nslots, Cdig j * ψ ^ j) (D k : ℕ) (hD : D = Φhat.natDegree * Nslots) (N M : ℕ) (hN : 1 ≤ N) (hM : 1 ≤ M) (hkN : k ≤ D * N) (hkM : k ≤ D * M) (stratN : (Fin (D * N) → ZMod p) → Prop) (stratM : (Fin (D * M) → ZMod p) → Prop) (codeN : Polynomial ℤ_[p] → (Fin (D * N) → ZMod p)) (codeM : Polynomial ℤ_[p] → (Fin (D * M) → ZMod p)) (hcodeN : ∀ x, ∃ f, f.natDegree < D ∧ codeN f = x) (hcodeM : ∀ x, ∃ f, f.natDegree < D ∧ codeM f = x) (hstratN : ∀ f : Polynomial ℤ_[p], f.natDegree < D → (stratN (codeN f) ↔ (f ≠ 0 ∧ StratumData σ ψ μ a Cdig Nslots f))) (hstratM : ∀ f : Polynomial ℤ_[p], f.natDegree < D → (stratM (codeM f) ↔ (f ≠ 0 ∧ StratumData σ ψ μ a Cdig Nslots f))) (ΘN : (Fin (D * N) → ZMod p) ≃ (Fin (D * N) → ZMod p)) (ΘM : (Fin (D * M) → ZMod p) ≃ (Fin (D * M) → ZMod p)) (EN : DigitSystem (D * N) (ZMod p)) (EM : DigitSystem (D * M) (ZMod p)) (hENk : EN.numPinned = k) (hEMk : EM.numPinned = k) (hcylN : ∀ (f : Polynomial ℤ_[p]) (B : ℕ → Polynomial ℤ_[p]), f.natDegree < D → f ≠ 0 → IsDevelopment Φhat f B Nslots → (EN.IsSolution (ΘN (codeN f)) ↔ LandingCylinderL σ ψ g μ a Cdig B Nslots)) (hcylM : ∀ (f : Polynomial ℤ_[p]) (B : ℕ → Polynomial ℤ_[p]), f.natDegree < D → f ≠ 0 → IsDevelopment Φhat f B Nslots → (EM.IsSolution (ΘM (codeM f)) ↔ LandingCylinderL σ ψ g μ a Cdig B Nslots)) (hzN : ∀ f : Polynomial ℤ_[p], f.natDegree < D → f = 0 → ¬ stratN (codeN f)) (hzM : ∀ f : Polynomial ℤ_[p], f.natDegree < D → f = 0 → ¬ stratM (codeM f)) (hzsolN : ∀ f : Polynomial ℤ_[p], f.natDegree < D → f = 0 → ¬ EN.IsSolution (ΘN (codeN f))) (hzsolM : ∀ f : Polynomial ℤ_[p], f.natDegree < D → f = 0 → ¬ EM.IsSolution (ΘM (codeM f))) : (Nat.card {x // stratN x} : ℚ) / (p : ℚ) ^ (D * N) = (Nat.card {x // stratM x} : ℚ) / (p : ℚ) ^ (D * M)
lean/LeanUrat/Moves/L6_measureExact_R4.lean — theorem
proved k digit equations leave exactly p^(nN-k) points
The last arithmetic step: once the landing theorems turn a stratum into $k$ triangular digit equations, its density is a power of $1/p$ — the uniformity in the prime the whole project is after.
For a prime $p$ and naturals $n,N,k$ with $k\le nN$: if the solution set of a stratum on the digit box $(\mathbb{Z}/p^N)^n$ is in bijection with $(\mathbb{Z}/p)^{nN-k}$ — the shape cut out by $k$ unitriangular digit equations, each pinning one digit as a function of strictly earlier ones — then its cardinality is exactly $p^{\,nN-k}$.
The Lean statement
theorem L6_ledgerCount {p : ℕ} [Fact p.Prime] (n N k : ℕ) (stratum : (Fin n → ZMod (p ^ N)) → Prop) (e : {x // stratum x} ≃ (Fin (n * N - k) → ZMod p)) : Nat.card {x // stratum x} = p ^ (n * N - k)
lean/LeanUrat/Moves/L6_ledgerCount.lean — theorem
Coordinates, masses, Theorem C (MovesC) 4 definition · 9 proved · 6 conditional
Each read cuts exactly its nominal volume; the cuts multiply into Theorem C's exact box identity
Truncate a monic degree-$n$ polynomial over $\mathbb{Z}_p$ at $N$ base-$p$ digits per coefficient and it becomes a point of the finite box $\mathbb{F}_p^{nN}$; the Okutsu–Montes classifier's successive Newton-polygon reads carve this box into strata, and MovesC proves Theorem C, the exact counting identity for that carving. Each read cuts its state cylinder by exactly $p^{-m^*}$ for $m^*$ the read's fresh codimension, the classifier's coordinate moves are unitriangular bijections that cannot distort a count, and the cuts multiply into the division-free identity $\#S(H,Z)\cdot p^{\sum m^* + \mathrm{pins}(Z)} = p^{nN}$ for the locus $S(H,Z)$ of polynomials following read history $H$ and landing in the splitting condition $Z$. The theorems about a real history are proved from Lean's core axioms but stay conditional on a hypothesized jet-presentation structure, and constructing that structure from the actual classifier — the graded-ring bridge — is the one open input.
Builds on: Moves
definition The coefficient box, and loci as triangular digit systems
Every counting statement in the corpus is an identity between masses of loci, and codimension always means the number of pinned coordinates.
For a prime $p$, degree $n \ge 1$, and digit cutoff $N \ge 1$, write $m = nN$ and let the box $\mathbb{F}_p^{\,m}$ record the first $N$ base-$p$ digits of each of the $n$ coefficients of a monic degree-$n$ polynomial over $\mathbb{Z}_p$, coordinates listed in a fixed solving order $\prec$ (digit level ascending; within a level, top coefficient first). A locus $D$ is a triangular digit system on this box: some coordinates are pinned, each to a value computed from strictly $\prec$-earlier coordinates alone, and the rest are free. Its solution set is a cylinder, and its mass is the count $$\mathrm{mass}(D) = \#\{x \in \mathbb{F}_p^{\,m} : x \text{ solves } D\}.$$
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime]
abbrev Locus (p m : ℕ) : Type := DigitSystem m (ZMod p)
noncomputable def Locus.mass {p m : ℕ} (D : Locus p m) : ℕ :=
Nat.card {x : Fin m → ZMod p // D.IsSolution x}
lean/LeanUrat/MovesC/Defs.lean — definition
definition A fresh clause: a support, a codimension, and an exact count
Counting uses nothing but support, codimension, and the count law, so no clause can smuggle in an unstated pin address — and an unsatisfiable clause cannot even be instantiated, because its count law already fails.
For a prime $p$ and dimension $m$, a fresh clause on the box $\mathbb{F}_p^{\,m}$ consists of three data: a support $S$ (the set of coordinates it may read — dependence on anything else is forbidden by the structure itself), a codimension $a$, and the exact-count law $$\#\{y \text{ supported on } S : y \text{ satisfies the clause}\}\cdot p^{a} = p^{|S|},$$ which says the clause cuts exactly the fraction $p^{-a}$ — no division, no inequality. The fresh data of one classifier read is a finite list of such clauses with pairwise disjoint supports, of total codimension $m^* = \sum a$.
The Lean statement
structure LevelClause (p m : ℕ) where
support : Finset (Fin m)
codim : ℕ
sat : (Fin m → ZMod p) → Prop
dep : ∀ x y : Fin m → ZMod p, (∀ c ∈ support, x c = y c) → (sat x ↔ sat y)
count : Nat.card {y : Fin m → ZMod p // sat y ∧ ∀ c ∉ support, y c = 0} * p ^ codim
= p ^ support.card
structure FreshData (p m : ℕ) where
clauses : List (LevelClause p m)
disj : clauses.Pairwise (fun c₁ c₂ => Disjoint c₁.support c₂.support)
def FreshData.mstar {p m : ℕ} (fd : FreshData p m) : ℕ :=
(fd.clauses.map LevelClause.codim).sum
lean/LeanUrat/MovesC/Defs.lean — structure
definition Which read may follow which: admissible transitions and realizable histories
Dropping the strict above-the-line condition admits an explicit history with nominal fresh volume $2^{-6}$ whose stratum contains no points at all — this definition is what fences that out.
For a newly appended read $\nu$ and the standing node $\nu_p$ of a read history over a finite residue field $F$, $\nu$ is admissible after $\nu_p$ when three conditions hold, each checkable from the recorded data alone: if the new Newton side ends strictly left of the standing vertex, its extended line passes strictly below the old vertex height; if the new side reaches the vertex, its leading pattern digit equals the transported vertex value in the residue field; and the new side lies strictly above the old line at every span slot left of the vertex, with equality at the vertex when the side reaches it. A history is realizable when every consecutive pair of its nodes is admissible. Theorem C quantifies over realizable histories only: a history failing any of the three conditions has empty stratum and is never produced by the classifier.
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
def TransitionAdmissible (νp ν : Node p F) : Prop :=
(ν.s0 + ν.wSide < νp.μ →
ν.line.at (νp.μ * νp.childWidth) < νp.line.at (νp.μ * νp.childWidth)) ∧
(ν.s0 + ν.wSide = νp.μ →
((ν.pat (ν.wSide / ν.e) : ↥ν.σ.K) : F) = νp.vtx) ∧
(∀ j : ℕ, ν.s0 ≤ j → j ≤ ν.s0 + ν.wSide → j < νp.μ →
νp.line.at (j * νp.childWidth) < ν.line.at (j * νp.childWidth)) ∧
(ν.s0 + ν.wSide = νp.μ →
ν.line.at (νp.μ * νp.childWidth) = νp.line.at (νp.μ * νp.childWidth))
def Realizable (H : History p F) : Prop :=
∀ (i : ℕ) (hi : i + 1 < H.nodes.length),
TransitionAdmissible (H.nodes[i]'(by omega)) (H.nodes[i+1]'hi)
lean/LeanUrat/MovesC/Defs.lean — definition
definition The jet presentation: everything Theorem C assumes about a history
Every downstream theorem holds for every bundle satisfying these laws; what is open is building the bundle from the actual classifier — the graded-ring bridge — together with two height-function identities that remain unproven.
For a prime $p$, degree $n$, digit cutoff $N \geq 1$, and box dimension $m = nN$, a jet presentation of a read history $H$ is a bundle of data on the box $\mathbb{F}_p^{\,m}$, each piece tied to the recorded nodes: a $\prec$-sorted coordinate chart; coherence and realizability of $H$; state cylinders $\Sigma_i$ with $\Sigma_0$ the full box; per-read fresh clause data and unitriangular moves $\Theta_i$; the recorded key polynomials with their landing certificates; and a presentation predicate '$x$ is the frame-$i$ digit vector of the polynomial $f$' — the base-$p$ digits themselves at frame $0$, defined for every monic degree-$n$ polynomial, intertwined by the moves, and depending only on the relevant block of $f$'s development along the current key. Two laws carry the counting: the stratum recursion $$\Sigma_{i+1} = \Theta_i^{-1}\bigl(\Sigma_i \cap \mathrm{stratum}_i\bigr),$$ where on $\Sigma_i$ the stratum condition is exactly read $i$'s fresh clauses, and the zero-downset invariant — a coordinate is pinned precisely when its height is at most the cumulative Newton floor, interior pins being zeros. Finally, every fresh clause is forced to be either a strip (one coordinate, codimension $1$, a zero, never at a value slot) or a value clause (the full level set of one recorded span slot, codimension equal to its size), and the total $m^*$ must equal the band count computed from the node geometry.
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
structure JetSetup (H : History p F) (n N m : ℕ) where
hm : m = n * N
hN : 1 ≤ N
coordOf : Fin m → Coord
coordOf_sorted : ∀ j j' : Fin m, j < j' ↔ CoordPrec (coordOf j) (coordOf j')
coordOf_lt : ∀ j : Fin m, (coordOf j).1 < N ∧ (coordOf j).2 < n
coherent : HistoryCoherent H
realizable : Realizable H
root_height : ∀ (hj : 0 < H.nodes.length) (b : ℕ),
b < (H.nodes[0]'hj).μ * (H.nodes[0]'hj).childWidth → 1 ≤ (H.nodes[0]'hj).line.at b
Sigma : ℕ → Locus p m
init : ∀ c : Fin m, (Sigma 0).pinned c = false
fresh : ℕ → FreshData p m
Theta : ℕ → ((Fin m → ZMod p) → (Fin m → ZMod p))
Theta_uni : ∀ i : ℕ, IsUnitriangular (Theta i)
keys : ℕ → Polynomial ℤ_[p]
keys_mid : ∀ (i : ℕ) (hi : i + 1 < H.nodes.length), keys i = (H.nodes[i+1]'hi).σ.Φ
landing : ∀ (i : ℕ) (hi : i < H.nodes.length), LandingKey (H.nodes[i]'hi) (keys i)
pres : ℕ → (Fin m → ZMod p) → Polynomial ℤ_[p] → Prop
pres_zero : ∀ (x : Fin m → ZMod p) (f : Polynomial ℤ_[p]),
pres 0 x f ↔ ∀ j : Fin m, x j = baseDigit p (coordOf j).1 (f.coeff (coordOf j).2)
pres_total : ∀ i : ℕ, i ≤ H.nodes.length → ∀ f : Polynomial ℤ_[p],
f.Monic → f.natDegree = n → ∃ x, pres i x f
pres_theta : ∀ i : ℕ, i < H.nodes.length →
∀ (x : Fin m → ZMod p) (f : Polynomial ℤ_[p]), pres (i+1) x f → pres i (Theta i x) f
pres_block : ∀ i : ℕ, i < H.nodes.length →
∀ (f f' : Polynomial ℤ_[p]) (x x' : Fin m → ZMod p), pres (i+1) x f → pres (i+1) x' f' →
∀ (B B' : ℕ → Polynomial ℤ_[p]) (Nd Nd' : ℕ),
IsDevelopment (keys i) f B Nd → IsDevelopment (keys i) f' B' Nd' →
∀ c : Fin m,
B ((coordOf c).2 / (keys i).natDegree) = B' ((coordOf c).2 / (keys i).natDegree) →
x c = x' c
stratum : ℕ → (Fin m → ZMod p) → Prop
recursion : ∀ i : ℕ, i < H.nodes.length → ∀ x : Fin m → ZMod p,
(Sigma (i+1)).IsSolution x ↔ ((Sigma i).IsSolution (Theta i x) ∧ stratum i (Theta i x))
inh_implied : ∀ i : ℕ, i < H.nodes.length → ∀ y : Fin m → ZMod p,
(Sigma i).IsSolution y → (stratum i y ↔ (fresh i).sat y)
zc : ∀ (i : ℕ) (hi : i < H.nodes.length),
ZCData (Sigma (i+1)) coordOf (H.htH (i+1)) (H.floorH (i+1))
((H.nodes[i]'hi).μ * (H.nodes[i]'hi).childWidth)
fresh_band : ∀ (i : ℕ) (hi : i < H.nodes.length), ∀ cl ∈ (fresh i).clauses,
∀ c ∈ cl.support, inFreshBand H n coordOf i (H.nodes[i]'hi) c
fresh_cover : ∀ (i : ℕ) (hi : i < H.nodes.length), ∀ c : Fin m,
inFreshBand H n coordOf i (H.nodes[i]'hi) c → ∃ cl ∈ (fresh i).clauses, c ∈ cl.support
fresh_assembled : ∀ (i : ℕ) (hi : i < H.nodes.length), ∀ cl ∈ (fresh i).clauses,
(∃ c : Fin m, cl.support = {c} ∧ cl.codim = 1 ∧ (∀ x, (cl.sat x ↔ x c = 0)) ∧
¬ IsValueCoord H coordOf i (H.nodes[i]'hi) c) ∨
(IsValueSupport H coordOf i (H.nodes[i]'hi) cl.support ∧
cl.codim = cl.support.card ∧
∃ (T : TypObject p m cl.support (Fin cl.codim → ZMod p)) (v : Fin cl.codim → ZMod p),
∀ x, (cl.sat x ↔ T.φ x = v))
mstar_eq : ∀ (i : ℕ) (hi : i < H.nodes.length),
(fresh i).mstar = Nat.card {c : Fin m // inFreshBand H n coordOf i (H.nodes[i]'hi) c}
lean/LeanUrat/MovesC/Defs.lean — structure
proved The mass of a digit system is p to the number of free coordinates
The base law: every density computation in the corpus reduces to pin bookkeeping through this identity.
For a prime $p$, a triangular digit system $D$ on $m$ coordinates over $\mathbb{F}_p$ with $k$ pinned coordinates has exactly $$\mathrm{mass}(D) = p^{\,m-k}$$ solutions in the box: choose the free coordinates at will, and each pin is forced in the solving order.
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime]
theorem C0_digitSystemMass {m : ℕ} (D : Locus p m) : D.mass = p ^ (m - D.numPinned)
lean/LeanUrat/MovesC/C0_digitSystemMass.lean — theorem
proved Pinned or free is a property of the cylinder, not of its equations
Codimension bookkeeping is well-defined coordinate by coordinate, so systems transported through moves can be compared pin by pin.
For a prime $p$, if two triangular digit systems $D, D'$ on the same $m$-coordinate box over $\mathbb{F}_p$ have identical solution sets, then each coordinate is pinned in $D$ if and only if it is pinned in $D'$. In particular the codimension — the pin count — is an invariant of the cylinder rather than of the equations presenting it.
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime]
theorem C0_pinStatus {m : ℕ} (D D' : Locus p m) (h : ∀ x, D.IsSolution x ↔ D'.IsSolution x) : ∀ j : Fin m, D.pinned j = D'.pinned j
lean/LeanUrat/MovesC/C0_pinStatus.lean — theorem
proved Unitriangular moves permute the box
The classifier's coordinate moves — its division-and-carry bookkeeping — have this shape, so they preserve every count.
For a prime $p$, call a self-map $\Theta$ of $\mathbb{F}_p^{\,m}$ unitriangular for the solving order $\prec$ when $$(\Theta x)_i = x_i + \varphi_i(x_j : j \prec i),$$ each correction $\varphi_i$ reading only strictly earlier coordinates. Every unitriangular map is a bijection of the box: invert coordinate by coordinate in the solving order.
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime]
theorem C0_unitriBij {m : ℕ} {Θ : (Fin m → ZMod p) → (Fin m → ZMod p)} (h : IsUnitriangular Θ) : Function.Bijective Θ
lean/LeanUrat/MovesC/C0_unitriBij.lean — theorem
proved Pulling a digit system back along a move keeps every pin
Changing frames along a move distorts neither mass nor codimension; the transported system is constructed explicitly.
For a prime $p$ and dimension $m$, given a triangular digit system $D$ on $\mathbb{F}_p^{\,m}$ and a unitriangular move $\Theta$, the pullback $\{x : \Theta x \text{ solves } D\}$ is again the solution set of a triangular digit system $D'$, and $D'$ pins the same coordinates as $D$.
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime]
theorem C0_pinTransport {m : ℕ} (D : Locus p m) {Θ : (Fin m → ZMod p) → (Fin m → ZMod p)} (h : IsUnitriangular Θ) : ∃ D' : Locus p m, (∀ x, D'.IsSolution x ↔ D.IsSolution (Θ x)) ∧ ∀ j : Fin m, D'.pinned j = D.pinned j
lean/LeanUrat/MovesC/C0_pinTransport.lean — theorem
conditional All fibers of a supported homomorphism have equal size
The counting content of a value clause: fixing a graded digit cuts exactly the reciprocal of its alphabet, which is why level-set constraints contribute exact codimension.
For a prime $p$ and dimension $m$, let $S$ be a set of coordinates and $\varphi \colon \mathbb{F}_p^{\,m} \to \alpha$ an additive homomorphism onto a finite abelian group $\alpha$ that reads only the coordinates in $S$. Then every fiber is a coset of the kernel, so for each value $v \in \alpha$ $$\#\{y \text{ supported on } S : \varphi(y) = v\}\cdot |\alpha| = p^{|S|}.$$
Hypotheses this rests on: TypObject T — hypothesizes an additive surjection reading only the level set S; machine-checked for every such T, but the instance tying it to a real fresh digit (the graded-piece map of the classifier) awaits the unbuilt graded-ring bridge.
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime]
theorem C1_TYP_fiberCount {m : ℕ} {S : Finset (Fin m)} {α : Type*} [AddCommGroup α] [Fintype α] (T : TypObject p m S α) (v : α) : Nat.card {y : Fin m → ZMod p // T.φ y = v ∧ ∀ c ∉ S, y c = 0} * Nat.card α = p ^ S.card
lean/LeanUrat/MovesC/C1_TYP_fiberCount.lean — theorem
proved Clauses with disjoint supports cut by exactly the product
Disjoint supports make the conditional factors multiply exactly, division-free; the one-read exactness theorem runs on this.
For a prime $p$ and dimension $m$, let one read's fresh data be finitely many clauses on the box $\mathbb{F}_p^{\,m}$ with pairwise disjoint supports, each cutting exactly $p^{-a}$ among the assignments on its own support. Then the joint cut of the whole box is exactly the product of the individual cuts: $$\#\{x \in \mathbb{F}_p^{\,m} : x \text{ satisfies every clause}\}\cdot p^{m^*} = p^{m}, \qquad m^* = \sum a.$$
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime]
theorem C1_clausesCount {m : ℕ} (fd : FreshData p m) : Nat.card {x : Fin m → ZMod p // fd.sat x} * p ^ fd.mstar = p ^ m
lean/LeanUrat/MovesC/C1_clausesCount.lean — theorem
conditional Fresh clauses touch only coordinates still free on the cylinder
Fresh content sits strictly above the cumulative Newton floor, and the zero-downset invariant turns ‘above the floor’ into ‘unpinned’, so no read charges a coordinate an earlier read already pinned.
In any jet presentation $J$ of a read history $H$ over a prime $p$, for each read index $i$, every coordinate in the support of a fresh clause of read $i$ is free — unpinned — on the state cylinder $\Sigma_i$ entering that read.
Hypotheses this rests on: JetSetup J — the hypothesized jet presentation of the history (sorted chart, state cylinders, fresh data, unitriangular moves, presentation spine, exact-downset invariant, fresh-band laws); machine-checked for every such bundle, but constructing one for a real classifier history is the declared open boundary (the unbuilt graded-ring bridge).
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
theorem C2_freshFree {n N m : ℕ} {H : History p F} (J : JetSetup H n N m) (i : ℕ) (hi : i < H.nodes.length) : ∀ cl ∈ (J.fresh i).clauses, ∀ c ∈ cl.support, (J.Sigma i).pinned c = false
lean/LeanUrat/MovesC/C2_freshFree.lean — theorem
proved The newest Newton line dominates every earlier one on its interior
Coherence alone does not give this: the strict above-the-line clause of realizability supplies the inequality, and without it the empty-stratum history is a counterexample.
Let $H$ be a coherent, realizable read history over a prime $p$ and finite residue field $F$, fix a read index $i$, and write $\mathrm{line}_j$ for the Newton line recorded at read $j$. For $j \leq i$ and every base index $b < \mu_i\, w_i$ (with $w_i = \mathrm{childWidth}_i$ and $\mu_i$ read $i$'s multiplicity) in read $i$'s factor interior — the $\mu_i w_i$ interior coordinates — the earlier line lies below the current one: $$\mathrm{line}_j(b) \leq \mathrm{line}_i(b).$$ Consequently, on each factor interior the cumulative floor of all recorded lines equals the current line.
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
theorem C3_lineDom (H : History p F) (hcoh : HistoryCoherent H) (hreal : Realizable H) (i : ℕ) (hi : i < H.nodes.length) (j : ℕ) (hij : j ≤ i) (b : ℕ) (hb : b < (H.nodes[i]'hi).μ * (H.nodes[i]'hi).childWidth) : (H.nodes[j]'(by omega)).line.at b ≤ (H.nodes[i]'hi).line.at b
lean/LeanUrat/MovesC/C3_lineDom.lean — theorem
proved Stripping the exact power of ψ leaves a nonzero remainder mod ψ
The theorem does not claim the transported vertex value itself is nonzero: that would require the identification $K(\bar z) \cong K[z]/(\psi)$, which is outside this corpus.
Let $\psi$ be a monic polynomial of positive degree over a field $K$, and let $R$ have $\psi$-adic order exactly $\mu$, meaning $\psi^{\mu} \mid R$ but $\psi^{\mu+1} \nmid R$. Then $$\bigl(R/\psi^{\mu}\bigr) \bmod \psi \neq 0.$$
The Lean statement
theorem C3_vtxPolyNe {K : Type*} [Field K] (ψ Ranch : Polynomial K) (μ : ℕ) (hmonic : ψ.Monic) (hdeg : 0 < ψ.natDegree) (hord : OrdPsiPoly ψ Ranch μ) : (Ranch /ₘ ψ ^ μ) %ₘ ψ ≠ 0
lean/LeanUrat/MovesC/C3_vtxPolyNe.lean — theorem
proved One read cuts its cylinder by exactly its nominal volume
The per-read engine of the whole corpus: solve the cylinder onto its free coordinates and run the disjoint-clause product law inside them.
For a prime $p$ and dimension $m$, let $\Sigma$ be a state cylinder on $\mathbb{F}_p^{\,m}$ (a triangular digit system) and let fresh data with pairwise disjoint supports constrain only coordinates free on $\Sigma$. Then the cut is exact: $$\#\{x : x \text{ solves } \Sigma \text{ and satisfies every fresh clause}\}\cdot p^{m^*} = \mathrm{mass}(\Sigma),$$ where $m^*$ is the total fresh codimension — the conditional volume $p^{-m^*}$ holds as an equality, not a bound.
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime]
theorem C4_conditionalMass {m : ℕ} (Sigma : Locus p m) (fd : FreshData p m) (hfree : ∀ cl ∈ fd.clauses, ∀ c ∈ cl.support, Sigma.pinned c = false) : Nat.card {x : Fin m → ZMod p // Sigma.IsSolution x ∧ fd.sat x} * p ^ fd.mstar = Sigma.mass
lean/LeanUrat/MovesC/C4_conditionalMass.lean — theorem
conditional Each read divides the surviving mass by exactly its fresh count
Move bijectivity transports the count, the stratum recursion reduces read $i$ to its fresh clauses on the cylinder, and the one-read exactness fires.
In any jet presentation $J$ of a read history $H$ over a prime $p$, the state cylinders $\Sigma_i$ obey the exact recursion $$\mathrm{mass}(\Sigma_{i+1})\cdot p^{\,m^*(\nu_i)} = \mathrm{mass}(\Sigma_i),$$ where $m^*(\nu_i)$ is the total fresh codimension of the $i$-th read $\nu_i$.
Hypotheses this rests on: JetSetup J — the hypothesized jet presentation of the history; machine-checked for every such bundle, but constructing one for a real classifier history is the declared open boundary (the unbuilt graded-ring bridge).
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
theorem C4_stepMass {n N m : ℕ} {H : History p F} (J : JetSetup H n N m) (i : ℕ) (hi : i < H.nodes.length) : (J.Sigma (i+1)).mass * p ^ (J.fresh i).mstar = (J.Sigma i).mass
lean/LeanUrat/MovesC/C4_stepMass.lean — theorem
conditional After k reads the cylinder's codimension is the sum of the fresh counts
The division-free running total behind Theorem C(b): the product of the reads' nominal volumes is realized exactly on the state cylinder.
For a prime $p$, in any jet presentation $J$ of a read history $H$ on the $m$-coordinate box $\mathbb{F}_p^{\,m}$, with state cylinders $\Sigma_i$ and reads $\nu_i$ of fresh codimension $m^*(\nu_i)$: after the first $k$ reads, $$\mathrm{mass}(\Sigma_k) = p^{\,m - \sum_{i<k} m^*(\nu_i)}.$$
Hypotheses this rests on: JetSetup J — the hypothesized jet presentation of the history; machine-checked for every such bundle, but constructing one for a real classifier history is the declared open boundary (the unbuilt graded-ring bridge).
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
theorem C5_massCodim {n N m : ℕ} {H : History p F} (J : JetSetup H n N m) (k : ℕ) (hk : k ≤ H.nodes.length) : (J.Sigma k).mass = p ^ (m - (Finset.range k).sum (fun i => (J.fresh i).mstar))
lean/LeanUrat/MovesC/C5_massCodim.lean — theorem
proved The terminal condition cuts exactly its own volume
The last factor of Theorem C(b): the splitting condition imposed after the final read contributes exactly its nominal volume on the final cylinder.
For a prime $p$ and dimension $m$, if a terminal digit system $Z$ on $\mathbb{F}_p^{\,m}$ pins only coordinates that are free on the cylinder $\Sigma$, then $$\#\{x : x \text{ solves both } \Sigma \text{ and } Z\}\cdot p^{\#\mathrm{pins}(Z)} = \mathrm{mass}(\Sigma).$$
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime]
theorem C6_transportedAdmissible {m : ℕ} (Sigma Z : Locus p m) (hZ : AdmissibleZ Sigma Z) : Nat.card {x : Fin m → ZMod p // Sigma.IsSolution x ∧ Z.IsSolution x} * p ^ Z.numPinned = Sigma.mass
lean/LeanUrat/MovesC/C6_transportedAdmissible.lean — theorem
conditional Theorem C(a): the classifier locus is the moved copy of the final locus
Because the locus is defined by an existential chain over the recorded moves — no images, no cylinders — its equality with the transported final locus is a theorem with content, not a definition unwinding.
For a prime $p$, fix a jet presentation $J$ of a history $H$ with $k$ reads, and a terminal system $Z$ pinning only coordinates free on the final cylinder $\Sigma_k$. Define the classifier locus $S(H,Z)$ without mentioning the cylinders: a frame-$0$ digit vector $x$ lies in $S(H,Z)$ iff it carries a chain $y_0 = x$, $y_i = \Theta_i(y_{i+1})$ through the recorded moves $\Theta_i$ in which each $y_i$ satisfies the fresh clauses of the $i$-th read and $y_k$ solves $Z$. Then the composite move $\Psi_H = \Theta_0 \circ \cdots \circ \Theta_{k-1}$ is a bijection of the box, $$S(H,Z) = \Psi_H\bigl(\{x : x \text{ solves } \Sigma_k \text{ and } Z\}\bigr),$$ and in particular the two sets are equinumerous.
Hypotheses this rests on: JetSetup J — the hypothesized jet presentation of the history; machine-checked for every such bundle, but constructing one for a real classifier history is the declared open boundary (the unbuilt graded-ring bridge). AdmissibleZ — the terminal system pins only coordinates free on the final cylinder (a genuine mathematical hypothesis of Theorem C, not a deferral).
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
theorem C6_thmC_a {n N m : ℕ} {H : History p F} (J : JetSetup H n N m) (Z : Locus p m) (hZ : AdmissibleZ (J.Sigma H.nodes.length) Z) : Function.Bijective (J.Psi H.nodes.length) ∧ J.SHZ Z = (J.Psi H.nodes.length) '' {x : Fin m → ZMod p | (J.Sigma H.nodes.length).IsSolution x ∧ Z.IsSolution x} ∧ Nat.card (J.SHZ Z) = Nat.card {x : Fin m → ZMod p // (J.Sigma H.nodes.length).IsSolution x ∧ Z.IsSolution x}
lean/LeanUrat/MovesC/C6_thmC_a.lean — theorem
conditional Theorem C(b): the stratum count times p to the total pins fills the box
The exact mass formula used downstream, assembled from part (a), the terminal cut, and the mass recursion.
For a prime $p$, degree $n$, and digit cutoff $N \ge 1$, let $J$ be a jet presentation of a history $H$ with $k$ reads $\nu_0, \dots, \nu_{k-1}$, and let $Z$ be a terminal system pinning only coordinates free on the final cylinder. For the classifier locus $S(H,Z)$ — the frame-$0$ digit vectors following every read's fresh clauses through the recorded moves and landing in $Z$ — $$\#S(H,Z)\cdot p^{\,\sum_{i<k} m^*(\nu_i)\,+\,\#\mathrm{pins}(Z)} = p^{\,nN},$$ where $m^*(\nu_i)$ is read $\nu_i$'s total fresh codimension: the history stratum fills exactly the fraction $p^{-\sum m^* - \#\mathrm{pins}(Z)}$ of the coefficient box, as an identity between integers. The jet presentation ties each $m^*(\nu_i)$ to the geometric fresh-band count of its node, so the exponent measures the intended splitting arithmetic, not an artifact of the presentation.
Hypotheses this rests on: JetSetup J — the hypothesized jet presentation of the history; machine-checked for every such bundle, but constructing one for a real classifier history is the declared open boundary (the unbuilt graded-ring bridge). AdmissibleZ — the terminal system pins only coordinates free on the final cylinder (a genuine mathematical hypothesis of Theorem C, not a deferral).
The Lean statement
-- section variables: {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
theorem C6_thmC_b {n N m : ℕ} {H : History p F} (J : JetSetup H n N m) (Z : Locus p m) (hZ : AdmissibleZ (J.Sigma H.nodes.length) Z) : Nat.card (J.SHZ Z) * p ^ totalPins J Z = boxMass p m
lean/LeanUrat/MovesC/C6_thmC_b.lean — theorem
Base relations (MovesRBase) 9 definition · 7 proved · 1 conditional
One ambient Witt ring: base rings nest, and base change is index multiplication
Every coefficient ring in the tower is a subring of one ambient ring, W(F̄_p), the p-typical Witt vectors of an algebraic closure of F_p. Inside it, F_m is the fixed field of the m-th Frobenius iterate — with p^m elements, a theorem here rather than a convention — and O_m := W(F_m) is a subring, so base rings nest as set inclusions and unramified base change becomes arithmetic of indices: the degree-δ′ extension of O_m is O_{m·δ′}, composing base changes multiplies indices, and the nesting, composition, chain, and residue-size laws (q_{mδ′} = q_m^{δ′}) are all proved here over Lean's core axioms. The corpus also states, without proving, the one substantive law about alphabets under re-basing (EQ-2); that law is open, and its single consequence here is proved conditionally on it.
definition One ambient ring, fixed once: Witt vectors over the closure
The design decision everything else rests on: with one ambient ring, nested base changes compose as subrings rather than up to isomorphism, uniformly in the prime p.
For a prime $p$, fix an algebraic closure $\bar{\mathbb{F}}_p$ of the field $\mathbb{F}_p$ with $p$ elements, and form the ring of $p$-typical Witt vectors $W(\bar{\mathbb{F}}_p)$ — concretely, the completed ring of integers of the maximal unramified extension of $\mathbb{Q}_p$. Every coefficient ring in this corpus is a subring of this one ring.
The Lean statement
variable (p : ℕ) [hp : Fact p.Prime]
abbrev Kbar := AlgebraicClosure (ZMod p)
abbrev Wbar := WittVector p (Kbar p)
lean/LeanUrat/MovesRBase/Defs.lean — definition
definition The subfield with p^m elements, pinned inside the closure
Realizes the residue field of every unramified extension as a concrete subfield of one closure, so the whole lattice of residue fields is set inclusion.
For a prime $p$, an algebraic closure $\bar{\mathbb{F}}_p$ of $\mathbb{F}_p$, and each integer $m \ge 1$, let $F_m$ be the subfield of $\bar{\mathbb{F}}_p$ fixed by the $m$-th iterate of the Frobenius $x \mapsto x^p$; that is, $F_m = \{x \in \bar{\mathbb{F}}_p : x^{p^m} = x\}$. It is the unique subfield with $p^m$ elements — a count established by a separate theorem below, not written into the definition.
The Lean statement
noncomputable def Fsub (m : ℕ+) : Subfield (Kbar p) :=
RingHom.eqLocusField (iterateFrobenius (Kbar p) p (m : ℕ)) (RingHom.id _)
lean/LeanUrat/MovesRBase/Defs.lean — definition
definition The unramified coefficient ring O_m = W(F_m)
The central object: the base ring over which the tower induction's polynomials live, with no per-pair embedding choices anywhere.
For a prime $p$ and integer $m \ge 1$, with $F_m \subseteq \bar{\mathbb{F}}_p$ the subfield with $p^m$ elements, set $\mathcal{O}_m := W(F_m)$, the image inside $W(\bar{\mathbb{F}}_p)$ of the Witt functor applied to the inclusion $F_m \hookrightarrow \bar{\mathbb{F}}_p$. Abstractly this is the ring of integers of the degree-$m$ unramified extension of $\mathbb{Q}_p$; here it is a subring, so towers of base rings nest as set inclusions.
The Lean statement
noncomputable def O (m : ℕ+) : Subring (Wbar p) :=
(WittVector.map (Subfield.subtype (Fsub p m))).range
lean/LeanUrat/MovesRBase/Defs.lean — definition
definition Base change by decree: multiply the index
The convention that turns the recursion's base-change bookkeeping into arithmetic of indices; its laws are the one-line theorems below.
For a prime $p$ and integers $m, \delta, \delta' \ge 1$, define the degree-$\delta'$ unramified base change of $\mathcal{O}_m = W(F_m)$ to be $\mathcal{O}_{m\delta'}$. Indices are absolute, so the composition rule $(\mathcal{O}_\delta)_{\delta'} = \mathcal{O}_{\delta\delta'}$ holds by definition — never an identification up to isomorphism.
The Lean statement
noncomputable def relExt (m δ' : ℕ+) : Subring (Wbar p) := O p (m * δ')
lean/LeanUrat/MovesRBase/Defs.lean — definition
definition Cylinders: fix the first N Witt digits of the coefficients
The basic event of the whole enterprise: splitting densities are normalized counts of these level-N boxes.
For a prime $p$, an index $m \ge 1$, a degree $n \ge 0$, a level $N \ge 0$, and a tuple $g = (g_1, \ldots, g_n)$ of elements of $\mathcal{O}_m = W(F_m)$ — the coefficients of a monic degree-$n$ polynomial — the level-$N$ cylinder at $g$ is the set of tuples agreeing with $g$ in their first $N$ Witt coordinates. Because $F_m$ is perfect, this is exactly the congruence class of $g$ modulo $p^N$.
The Lean statement
def cyl (m : ℕ+) {n : ℕ} (N : ℕ) (g : Fin n → ↥(O p m)) : Set (Fin n → ↥(O p m)) :=
{h | ∀ (j : Fin n) (i : ℕ), i < N → ((h j : Wbar p)).coeff i = ((g j : Wbar p)).coeff i}
lean/LeanUrat/MovesRBase/Defs.lean — definition
proved The Witt construction respects composition
The nesting theorem for the rings O_m uses this to push subfield inclusions through the Witt functor.
For a prime $p$, commutative rings $R, S, T$, and ring homomorphisms $f : R \to S$ and $g : S \to T$, applying the $p$-typical Witt functor twice is the same as applying it once to the composite: $W(g)(W(f)(x)) = W(g \circ f)(x)$ for every Witt vector $x$ over $R$.
The Lean statement
theorem map_comp {R S T : Type*} [CommRing R] [CommRing S] [CommRing T]
(g : S →+* T) (f : R →+* S) (x : WittVector p R) :
WittVector.map g (WittVector.map f x) = WittVector.map (g.comp f) x
lean/LeanUrat/MovesRBase/MapComp.lean — lemma
proved Subfields nest along divisibility
The residue-field half of the nesting; the ring-level inclusion is one functoriality step away.
For a prime $p$ and integers $d, m \ge 1$ with $d \mid m$: then $F_d \subseteq F_m$ inside $\bar{\mathbb{F}}_p$, where $F_k$ is the fixed field of the $k$-th Frobenius iterate — any $x$ with $x^{p^d} = x$ also satisfies $x^{p^m} = x$, by iterating the relation $m/d$ times.
The Lean statement
theorem Fsub_le {d m : ℕ+} (h : d ∣ m) : Fsub p d ≤ Fsub p m
lean/LeanUrat/MovesRBase/U2_Fsub_le.lean — theorem
proved The Witt rings nest with their residue fields
The workhorse inclusion: every base-change step of the tower recursion rides on this one containment.
For a prime $p$ and integers $d, m \ge 1$ with $d \mid m$: then $W(F_d) \subseteq W(F_m)$ inside $W(\bar{\mathbb{F}}_p)$, where $F_d \subseteq F_m$ are the subfields with $p^d$ and $p^m$ elements. Once the subfields nest, the Witt rings nest as subrings — the substantive content behind the base-change convention.
The Lean statement
theorem O_le {d m : ℕ+} (h : d ∣ m) : O p d ≤ O p m
lean/LeanUrat/MovesRBase/U3_O_le.lean — theorem
proved Composing base changes multiplies degrees
With its companion facts — the convention is a definitional equality, and each ring sits inside its own base change — this makes iterated base change pure bookkeeping.
For a prime $p$ and integers $m, \delta', \delta'' \ge 1$: base-changing $\mathcal{O}_m$ by degree $\delta'$ and then by degree $\delta''$ equals base-changing once by degree $\delta'\delta''$. Under the absolute-index convention $(\mathcal{O}_m)_{\delta'} = \mathcal{O}_{m\delta'}$, this is the associativity of index multiplication.
The Lean statement
theorem relExt_relExt (m δ' δ'' : ℕ+) :
relExt p (m * δ') δ'' = relExt p m (δ' * δ'')
lean/LeanUrat/MovesRBase/U4_relExt_comp.lean — theorem
proved How the residue-field size grows under base change
The density formulas substitute q = p^δ into one fixed rational function; this identity is how that argument moves along the tower.
For a prime $p$ and integers $m, \delta' \ge 1$, write $q_m := p^m$ for the size of the residue field $F_m$ (the subfield with $p^m$ elements). Then $q_{m\delta'} = q_m^{\delta'}$: extending the base ring by degree $\delta'$ raises $q$ to the $\delta'$-th power.
The Lean statement
theorem qq_mul (m δ' : ℕ+) : qq p (m * δ') = qq p m ^ (δ' : ℕ)
lean/LeanUrat/MovesRBase/U5_qq_mul.lean — theorem
proved The fixed field really has p^m elements
Upgrades F_m from 'a fixed field' to THE subfield of order p^m — the cardinality is proved, not decreed.
For a prime $p$ and integer $m \ge 1$: $|F_m| = p^m$, where $F_m$ is the fixed field of the $m$-th Frobenius iterate — the finite field with $p^m$ elements. Indeed $F_m$ is the root set of $X^{p^m} - X$, a separable polynomial, which therefore has $p^m$ distinct roots in the algebraically closed field.
The Lean statement
theorem Fsub_card (m : ℕ+) : Nat.card ↥(Fsub p m) = p ^ (m : ℕ)
lean/LeanUrat/MovesRBase/U6_Fsub_card.lean — theorem
proved The two-step subring chain under a new branch
Two applications of the nesting theorem, packaged as the ring-side witness for the recursion clause of the tower induction.
For a prime $p$ and integers $m, \delta, \delta'' \ge 1$, the chain $W(F_m) \subseteq W(F_{m\delta}) \subseteq W(F_{m\delta\delta''})$ holds inside $W(\bar{\mathbb{F}}_p)$, where $F_k$ is the subfield with $p^k$ elements: a branch of relative degree $\delta''$ born at accumulated level $m\delta$ lands in the ring the recursion predicts.
The Lean statement
theorem O_chain (m δrel δ'' : ℕ+) :
O p m ≤ O p (m * δrel) ∧ O p (m * δrel) ≤ O p (m * δrel * δ'')
lean/LeanUrat/MovesRBase/U41_O_chain.lean — theorem
definition Species letters are finite syntax
Vocabulary only: this structure types the re-basing law below and is never instantiated in this corpus.
A species letter — the label classifying local behavior at a tower position — is purely syntactic data: a stage tuple $(e, h, g, \mu)$ of numerical invariants together with side/lattice and polygon-convention data, and a letter is determined by these data alone, never by the size of the residue field. Each level $\delta \ge 1$ carries a finite menu of realized letters.
The Lean statement
structure SpeciesSyntax where
Letter : Type
shape : Letter → ℕ × ℕ × ℕ × ℕ
SideData : Type
side : Letter → SideData
PolyConv : Type
poly : Letter → PolyConv
letter_det : Function.Injective (fun l => (shape l, side l, poly l))
menu : ℕ+ → Finset Letter
lean/LeanUrat/MovesRBase/Defs.lean — structure
definition Alphabets: additive spans of the slot maps, of size a power of p
The structure the re-basing law speaks about; like the species letters, it is never constructed in this corpus.
For a prime $p$, at each position class $x$ and level $\delta \ge 1$, alphabet data consists of an $F_{p^\delta}$-module carrier, a family of slot maps into it, the alphabet $\mathbb{A}_\delta(x)$ defined as the additive span of the slot maps' ranges, a dimension $a_\delta(x)$ with $|\mathbb{A}_\delta(x)| = p^{a_\delta(x)}$, and the species letter realized at each level. The cardinality identity is a field of the structure — part of what it means to be alphabet data, not a theorem proved here.
The Lean statement
structure AlphabetData (Sp : SpeciesSyntax) where
Pos : Type
posNe : Nonempty Pos
Carrier : ℕ+ → Pos → Type
[carrierGrp : ∀ δ x, AddCommGroup (Carrier δ x)]
[carrierMod : ∀ δ x, Module ↥(Fsub p δ) (Carrier δ x)]
SlotDom : ℕ+ → Pos → Type
[slotDomGrp : ∀ δ x, AddCommGroup (SlotDom δ x)]
[slotDomMod : ∀ δ x, Module ↥(Fsub p δ) (SlotDom δ x)]
slotMap : ∀ δ x, SlotDom δ x → Carrier δ x
alpha : ∀ δ x, Set (Carrier δ x)
alpha_attain : ∀ δ x,
alpha δ x = ↑(AddSubgroup.closure (Set.range (slotMap δ x)))
aDim : ℕ+ → Pos → ℕ
card_eq : ∀ δ x, Nat.card (alpha δ x) = p ^ aDim δ x
posLetter : ℕ+ → Pos → Sp.Letter
lean/LeanUrat/MovesRBase/Defs.lean — structure
definition Stable positions: where the letter survives re-basing
The domain restriction that keeps the re-basing law honest: it is asserted only where comparison across levels means anything.
For a level $\delta \ge 1$, a position class $x$ is $\delta$-stable when its realized species letter at level $\delta$ equals its letter at level $1$: the classifying label persists under re-basing. Positions that split under base change fail this and are excluded from the domain of the re-basing law.
The Lean statement
def AlphabetData.Stable {Sp} (AD : AlphabetData p Sp) (δ : ℕ+) (x : AD.Pos) : Prop :=
AD.posLetter δ x = AD.posLetter 1 x
lean/LeanUrat/MovesRBase/Defs.lean — definition
definition The re-basing law EQ-2: stated, and open
Naming the open law instead of assuming it silently is what lets the one conditional consequence below say what it depends on.
For a prime $p$ and level $\delta \ge 1$, the law (EQ-2) asserts: at every $\delta$-stable position, the re-based slot maps are $F_{p^\delta}$-linear and the alphabet dimension scales linearly, $a_\delta = \delta \cdot a_1$ (with $a_\delta$ the dimension at level $\delta$). It is stated here as a named proposition only: the law is open, proved nowhere in the repository, and every result using it must carry it as an explicit hypothesis.
The Lean statement
def EQ2law {Sp} (AD : AlphabetData p Sp) : Prop :=
∀ (δ : ℕ+) (x : AD.Pos), AlphabetData.Stable p AD δ x →
IsLinearMap ↥(Fsub p δ) (AD.slotMap δ x) ∧
AD.aDim δ x = (δ : ℕ) * AD.aDim 1 x
lean/LeanUrat/MovesRBase/Defs.lean — definition
conditional Alphabet sizes under re-basing, granted EQ-2
The implication itself is proved with no axioms beyond Lean's core; what stays open is the antecedent EQ-2.
For a prime $p$, level $\delta \ge 1$, and position class $x$, assume the open law (EQ-2). Then at every $\delta$-stable position the alphabet size obeys $|\mathbb{A}_\delta| = q_\delta^{\,a} = |\mathbb{A}_1|^{\delta}$, where $q_\delta = p^\delta$, $\mathbb{A}_\delta$ is the level-$\delta$ alphabet, and $a = a_1(x)$ is its dimension at level one — the cardinality identity used in the density bookkeeping.
Hypotheses this rests on: h : EQ2law — the open re-basing law (EQ-2): linearity of the re-based slot maps together with linear scaling of the dimension, hypothesized here and discharged nowhere in the repository. In addition, the carrier structure's own cardinality field (|𝔸_δ| = p^{a_δ}) enters as data of the structure, not as a proved fact.
The Lean statement
theorem EQ2law_card {Sp} (AD : AlphabetData p Sp) (h : EQ2law p AD) :
∀ (δ : ℕ+) (x : AD.Pos), AlphabetData.Stable p AD δ x →
Nat.card (AD.alpha δ x) = qq p δ ^ AD.aDim 1 x ∧
Nat.card (AD.alpha δ x) = Nat.card (AD.alpha 1 x) ^ (δ : ℕ)
lean/LeanUrat/MovesRBase/U12_EQ2law_card.lean — theorem
The graded-ring bridge (MovesGr) 3 definition · 3 open · 10 proved · 4 conditional
The genuine graded ring behind the stage residual: its laws become theorems, conditional on a model still to be built
The tower formalization equips each stage of the Okutsu–Montes tower with a ‘graded residual’, but defines it backwards from the stage's residual map — so any law stated through it risks being true by construction rather than by mathematics. This corpus builds the object that definition ought to describe — the associated graded ring of the stage's own valuation on $\mathbb{Z}_p[X]$, its localization at the homogeneous initial forms of the key and representative polynomials, a degree-one normalizing unit, and a structure isomorphism onto two-variable Laurent polynomials — and proves the residual laws (multiplicativity, rank-one normalization, and the defining identity) as theorems, conditional on a bundled model the corpus never constructs. Each of the three routes to such a model — base stage, transition, recentering — could hold only vacuously as stated, so the corpus proves those refutations and keeps them beside the honestly derivable fragments, and one of the graded-ring structure's laws (addition in the graded ring is componentwise) is itself forced by a countermodel that breaks the domain criterion without it.
Builds on: Moves
definition Side valuations and their associated graded rings
Everything in this corpus grows out of the stage's own valuation $w$, never out of its residual map — the reversal of that arrow is the point.
For a prime $p$, a *side valuation* on $A=\mathbb{Z}_p[X]$ is a map $w\colon A\to\mathbb{Z}\cup\{\infty\}$, finite away from $0$ and infinite at $0$, with $w(-f)=w(f)$, the ultrametric bound $\min(w(f),w(g))\le w(f+g)$, submultiplicativity $w(f)+w(g)\le w(fg)$, monotonicity under scalars $w(cf)\ge w(f)$ for $c\in\mathbb{Z}_p$, and $w(1)=0$. It filters $A$ by $A_{\ge\gamma}=\{f: w(f)\ge\gamma\}\supseteq A_{>\gamma}$; the graded pieces $\mathrm{gr}_\gamma=A_{\ge\gamma}/A_{>\gamma}$ sum to the associated graded $\mathrm{gr}_w(A)=\bigoplus_{\gamma\in\mathbb{Z}}\mathrm{gr}_\gamma$, multiplication in $A$ induces piece products $\mathrm{gr}_\gamma\times\mathrm{gr}_\delta\to\mathrm{gr}_{\gamma+\delta}$ (well defined by submultiplicativity), and each nonzero $f$ has an initial form $[f]\in\mathrm{gr}_{w(f)}$ — its class in its own weight. Every stage valuation of the Okutsu–Montes tower is such a $w$, indeed with equality $w(fg)=w(f)+w(g)$; the definition asks only for the inequality.
The Lean statement
structure SideVal (p : ℕ) [Fact p.Prime] where
w : Polynomial ℤ_[p] → WithTop ℤ
w_zero : w 0 = ⊤
w_ne_top : ∀ f, f ≠ 0 → w f ≠ ⊤
w_neg : ∀ f, w (-f) = w f
w_add : ∀ f g, min (w f) (w g) ≤ w (f + g)
w_smul : ∀ (c : ℤ_[p]) f, w f ≤ w (Polynomial.C c * f)
w_mul : ∀ f g, w f + w g ≤ w (f * g)
w_one : w 1 = 0
lean/LeanUrat/MovesGr/Defs.lean — structure
definition What a genuine ring structure on the associated graded must satisfy
The componentwise-addition law earns its keep: without it the structure admits a ring with zero divisors even when $w$ is additive, and the domain criterion fails — see the countermodel card.
For a prime $p$ and a side valuation $w$ on $A=\mathbb{Z}_p[X]$, a *graded ring structure* on the associated graded $\mathrm{gr}_w(A)$ is a commutative ring structure subject to five laws: addition is the componentwise addition of the direct sum; on homogeneous elements the product is the piece product induced from $A$; the unit is the initial form $[1]$; the initial form is multiplicative, $[fg]=[f]\,[g]$ for $f,g\neq 0$ (equivalently, $w$ is additive: $w(fg)=w(f)+w(g)$); and the tie law holds — if $w(f)<w(g)$ then $[f+g]=[f]$, the summand of strictly smaller weight deciding the initial form of a sum. Throughout, the degree of a homogeneous class is its weight under $w$, not its polynomial degree.
The Lean statement
structure GradedRingStr {p : ℕ} [Fact p.Prime] (S : SideVal p) where
ring : CommRing S.Gr
add_def : ∀ (x y : S.Gr) (γ : ℤ), (letI := ring; x + y) γ = x γ + y γ
mul_of : letI := ring; ∀ (γ δ : ℤ) (x : S.grPiece γ) (y : S.grPiece δ),
DirectSum.of _ γ x * DirectSum.of _ δ y = DirectSum.of _ (γ + δ) (S.pmul γ δ x y)
one_def : letI := ring; (1 : S.Gr) = S.initialForm 1
if_mul : letI := ring; ∀ f g : Polynomial ℤ_[p], f ≠ 0 → g ≠ 0 →
S.initialForm (f * g) = S.initialForm f * S.initialForm g
if_add_lt : ∀ f g : Polynomial ℤ_[p], f ≠ 0 → g ≠ 0 → f + g ≠ 0 →
S.deg f < S.deg g → S.initialForm (f + g) = S.initialForm f
lean/LeanUrat/MovesGr/Defs.lean — structure
definition The genuine graded model of a tower stage
Two caveats to retain: the identification of the degree-zero part with $K[z^{\pm1}]$ is hard-coded into the codomain of $\Theta$ rather than proved, and no stage is ever shown to admit such a model — the three planned constructions hold only vacuously as stated (see the refutation cards).
For a prime $p$, fix a stage $\sigma$ of the Okutsu–Montes tower, with valuation $w_\sigma$ on $A=\mathbb{Z}_p[X]$, key polynomial $\Phi$, residue field $K$, and residual map $R$ into $K[z^{\pm1}]$, the Laurent polynomials over $K$. A *genuine model* of $\sigma$ bundles: a side valuation agreeing with $w_\sigma$ on nonzero polynomials; a graded ring structure on $\mathrm{gr}_{w_\sigma}(A)$; the localization $L$ of that graded ring at the multiplicative set generated by the initial forms of $\sigma$'s representatives and of $\Phi$; a distinguished unit $T\in L^\times$; a ring isomorphism $\Theta\colon L\cong K[z^{\pm1}][T^{\pm1}]$ carrying $T$ to the outer Laurent variable; and the discharge identity $$\Theta(\iota[f])=C(R(f))\cdot T^{\,w_\sigma(f)}\qquad(f\neq 0),$$ with $\iota$ the localization map, $[f]$ the initial form, and $C$ the embedding of $K[z^{\pm1}]$ as $T$-constants — so residual data is computed from the genuine initial form, never read backwards from $R$.
The Lean statement
structure GenuineStageModel (σ : Stage p F) where
S : SideVal p
hSw : ∀ f, f ≠ 0 → S.w f = (σ.w f : WithTop ℤ)
Rg : GradedRingStr S
homMon : letI := Rg.ring; Submonoid S.Gr
homMon_gen : letI := Rg.ring;
homMon = Submonoid.closure
((fun ũ => S.initialForm ũ) '' {ũ | ũ ∈ σ.reps} ∪ {S.initialForm σ.Φ})
Lo : Type
Loring : CommRing Lo
alg : letI := Rg.ring; Algebra S.Gr Lo
isLoc : letI := Rg.ring; letI := alg; IsLocalization homMon Lo
Tunit : letI := Loring; Loˣ
Θ : letI := Loring; Lo ≃+* LExt ↥σ.K
hT : letI := Loring; Θ (Tunit : Lo) = (LeanUrat.Moves.locT ↥σ.K : LeanUrat.Moves.LTwo ↥σ.K)
discharge : letI := Rg.ring; letI := alg; ∀ f : Polynomial ℤ_[p], f ≠ 0 →
Θ (algebraMap S.Gr Lo (S.initialForm f)) = σ.grRes f
lean/LeanUrat/MovesGr/Defs.lean — structure
proved The product of classes is the class of the product
Multiplication upstairs comes from the ambient ring and owes nothing to the residual map — the provenance the whole corpus exists to establish.
For a prime $p$, a side valuation $w$ on $A=\mathbb{Z}_p[X]$, and weights $\gamma,\delta\in\mathbb{Z}$: for $a$ with $w(a)\ge\gamma$ and $b$ with $w(b)\ge\delta$, the piece product of their classes is the class of their product, $[a]\cdot[b]=[ab]$ in $\mathrm{gr}_{\gamma+\delta}$. Multiplication in the associated graded is the multiplication of $A$, pushed through the two quotients — the identity holds by unfolding the definitions.
The Lean statement
theorem L0_pmul_mk (S : SideVal p) (γ δ : ℤ) (a : S.ge γ) (b : S.ge δ) : S.pmul γ δ (Submodule.Quotient.mk a) (Submodule.Quotient.mk b) = Submodule.Quotient.mk (S.mulToGe γ δ a b)
lean/LeanUrat/MovesGr/L0_pmul_mk.lean — theorem
proved The initial form of a nonzero polynomial is nonzero
The non-degeneracy underneath everything else: it keeps the graded pieces, the domain criterion, and the localization from collapsing into statements about zero.
For a prime $p$ and a side valuation $w$ on $A=\mathbb{Z}_p[X]$: if $f\neq 0$, its initial form $[f]$ — the class of $f$ in $\mathrm{gr}_{w(f)}=A_{\ge w(f)}/A_{>w(f)}$ — does not vanish: $f$ has weight exactly $w(f)$, so it cannot lie in the strictly-higher-weight part.
The Lean statement
theorem L0_initialForm_ne_zero (S : SideVal p) {f : Polynomial ℤ_[p]} (hf : f ≠ 0) : S.initialForm f ≠ 0
lean/LeanUrat/MovesGr/L0_initialForm_ne_zero.lean — theorem
proved The graded ring exists whenever the weight is a valuation
The construction capstone: every stage valuation is additive, so its graded ring exists — inhabiting the structure, with componentwise addition holding by construction for the direct-sum ring.
For a prime $p$: if a side valuation $w$ on $A=\mathbb{Z}_p[X]$ is additive on nonzero elements — $w(fg)=w(f)+w(g)$ — then $\mathrm{gr}_w(A)$ carries a graded ring structure in the sense above. The proof assembles a graded monoid on the direct sum from the piece products; associativity, commutativity, the unit law, multiplicativity of the initial form, and the tie law all descend from the corresponding identities in $A$.
The Lean statement
theorem L1_gradedRingStr_exists (S : SideVal p) (hval : ∀ f g, f ≠ 0 → g ≠ 0 → S.w (f * g) = S.w f + S.w g) : Nonempty (GradedRingStr S)
lean/LeanUrat/MovesGr/L1_gradedRingStr_exists_2.lean — theorem
proved The associated graded is a domain exactly when the weight is a valuation
The reverse implication is what fails without the componentwise-addition law — the neighboring countermodel is why that law belongs to the structure.
For a prime $p$ and a side valuation $w$ on $A=\mathbb{Z}_p[X]$, under any graded ring structure on $\mathrm{gr}_w(A)$: $\mathrm{gr}_w(A)$ is an integral domain if and only if $w(fg)=w(f)+w(g)$ for all nonzero $f,g$. The forward implication is free — additivity of $w$ follows from the structure alone, since multiplicativity of the initial form puts $[f]\,[g]$ in degree $w(f)+w(g)$ while $[fg]$ is nonzero in degree $w(fg)$, no domain hypothesis needed. The reverse is the graded leading-term argument: the top-degree component of a product of nonzero elements is the piece product of their top classes, which additivity keeps nonzero.
The Lean statement
theorem L1_gr_domain_iff_val (S : SideVal p) (Rg : GradedRingStr S) : (letI := Rg.ring; IsDomain S.Gr) ↔ (∀ f g, f ≠ 0 → g ≠ 0 → S.w (f * g) = S.w f + S.w g)
lean/LeanUrat/MovesGr/L1_gr_domain_iff_val_v3.lean — theorem
open Why the weaker structure breaks the domain criterion
This countermodel is why the componentwise-addition law is required; with that law, the criterion is proved in full in the domain-criterion card.
For a prime $p$ and a side valuation $w$ on $A=\mathbb{Z}_p[X]$: drop the componentwise-addition law, so a ring structure on $\mathrm{gr}_w(A)$ need not tie its addition to the direct sum's; then ‘$w$ additive $\Rightarrow$ $\mathrm{gr}_w(A)$ a domain’ is false. Let $R_0$ be the genuine graded ring on $\mathrm{gr}_w(A)$ (direct-sum addition, piece products); the product ring $R_0\times R_0$ has zero divisors — $(1,0)\cdot(0,1)=0$ — yet transporting its ring structure along a bijection fixing every homogeneous element satisfies all the remaining laws, since each of them speaks only of homogeneous elements. So the forward implication and nontriviality still hold, while the reverse implication fails once the componentwise-addition law is dropped.
The Lean statement
theorem L1_gr_domain_iff_val (S : SideVal p) (Rg : GradedRingStr S) : (letI := Rg.ring; IsDomain S.Gr) ↔ (∀ f g, f ≠ 0 → g ≠ 0 → S.w (f * g) = S.w f + S.w g)
lean/LeanUrat/MovesGr/L1_gr_domain_iff_val_v2.lean — countermodel
proved The degree-zero part of the associated graded is a subring
This degree-zero floor is the coefficient ring over which the localization layer and the residue-field constants live.
For a prime $p$ and a side valuation $w$ on $A=\mathbb{Z}_p[X]$, under any graded ring structure on $\mathrm{gr}_w(A)$: the elements supported purely in degree $0$ form a subring — products stay in degree $0+0=0$ by the piece-product law, the unit $[1]$ sits in degree $0$ because $w(1)=0$, and closure under addition, zero, and negation is the componentwise-addition law at work.
The Lean statement
theorem L2_degZero_subring (S : SideVal p) (Rg : GradedRingStr S) : letI := Rg.ring; ∃ (R0 : Subring S.Gr), ∀ x : S.Gr, x ∈ R0 ↔ (∀ γ ≠ (0:ℤ), (x γ : S.grPiece γ) = 0)
lean/LeanUrat/MovesGr/L2_degZero_subring_v2.lean — theorem
proved Localizations of the graded ring exist
Generic existence only — the degree-zero, homogeneity, and structure-isomorphism statements are separate results, and this one must not be cited in their place.
For a prime $p$, a side valuation $w$ on $A=\mathbb{Z}_p[X]$ under any graded ring structure, and any multiplicative subset $M$ of $\mathrm{gr}_w(A)$: there is a commutative ring $L$, an algebra structure on $L$ over $\mathrm{gr}_w(A)$, and a proof that $L$ is the localization at $M$: the standard localization, nothing more.
The Lean statement
theorem L2_loc_exists (S : SideVal p) (Rg : GradedRingStr S) (M : letI := Rg.ring; Submonoid S.Gr) : letI := Rg.ring; ∃ (L : Type) (_ : CommRing L) (_ : Algebra S.Gr L), IsLocalization M L
lean/LeanUrat/MovesGr/L2_loc_exists.lean — theorem
conditional The localizing multiplicative set is homogeneous
So the model's localization inverts only single-degree elements: it is the homogeneous localization of the graded ring.
For a prime $p$ and a stage $\sigma$ of the Okutsu–Montes tower with a genuine model: every element of the multiplicative set generated by the initial forms of $\sigma$'s representatives and of its key polynomial is homogeneous — a single class sitting in a single degree. The generators are single-degree by construction, and the piece-product law keeps products single-degree.
Hypotheses this rests on: GenuineStageModel σ — the bundled genuine graded model of the stage (including the $L_0\cong K[z^{\pm1}]$ fiat); no inhabitant is constructed anywhere in this corpus.
The Lean statement
theorem L2_homMon_homogeneous (σ : Stage p F) (M : GenuineStageModel σ) : letI := M.Rg.ring; ∀ x ∈ M.homMon, ∃ (γ : ℤ) (c : M.S.grPiece γ), x = DirectSum.of _ γ c
lean/LeanUrat/MovesGr/L2_homMon_homogeneous.lean — theorem
open Degree zero of the coefficient localization is the residue field (one clause of three proved)
Clauses (ii) and (iii) need a fact none of the hypotheses supply — that the representative weights generate the parent value group — so they wait on richer stage data, not on a better proof.
For a prime $p$ and a stage $\sigma$ of the Okutsu–Montes tower with residue field $K$, work in $K[z^{\pm1}][T^{\pm1}]$ — Laurent polynomials in an inner variable $z$ and an outer variable $T$ — and let $B$ be the subring generated by the graded residuals of $\sigma$'s nonzero coefficients together with the inverses of its representative units. Three clauses: (i) every element of $B$ of degree $0$ in $T$ is a constant from $K$; (ii) conversely, every constant from $K$ lies in $B$; (iii) $z$ itself is the value of an explicit weight-zero monomial in the representative and key units. Clause (i) is proved by a weight-detecting evaluation $z\mapsto z^{e}$, $T\mapsto z^{t}$ (integers $e,t$ attached to the stage) under which every generator becomes a constant in the inner variable; clauses (ii) and (iii) are open.
The Lean statement
theorem L2_coeffLoc (σ : Stage p F) (M : GenuineStageModel σ) : CoeffLocLaw σ
lean/LeanUrat/MovesGr/L2_coeffLoc_v2.lean — theorem
conditional The residual map is the initial form normalized by the degree-one unit
Falls out of the model's bundled discharge identity by a single computation with the unit $T$ — the normalization half of the residual laws.
For a prime $p$ and a stage $\sigma$ of the Okutsu–Montes tower with a genuine model — valuation $w_\sigma$, residual map $R$ into $K[z^{\pm1}]$ over the residue field $K$, localization map $\iota$, structure isomorphism $\Theta$, degree-one unit $T$ — every nonzero $f$ satisfies $$\Theta(\iota[f])\cdot T^{-w_\sigma(f)}=C(R(f)),$$ where $[f]$ is the initial form of $f$ and $C$ embeds $K[z^{\pm1}]$ as $T$-constants: the stage residual is the genuine initial form, transported by $\Theta$ and stripped of its weight.
Hypotheses this rests on: GenuineStageModel σ — the bundled genuine graded model of the stage (including the $L_0\cong K[z^{\pm1}]$ fiat); no inhabitant is constructed anywhere in this corpus.
The Lean statement
theorem L3_rank1_residual (σ : Stage p F) (M : GenuineStageModel σ) (f : Polynomial ℤ_[p]) (hf : f ≠ 0) : letI := M.Rg.ring; letI := M.Loring; letI := M.alg; M.Θ (algebraMap M.S.Gr M.Lo (M.S.initialForm f)) * LaurentPolynomial.T (- σ.w f) = LaurentPolynomial.C (σ.R f)
lean/LeanUrat/MovesGr/L3_rank1_residual.lean — theorem
conditional Multiplicativity of the residual map becomes a theorem
A law the formal tower postulates for $R$ is recovered here as a consequence of the graded structure, without ever invoking that postulate.
For a prime $p$ and a stage $\sigma$ of the Okutsu–Montes tower with a genuine model, residual map $R$: $R(fg)=R(f)\,R(g)$ for all nonzero $f,g\in\mathbb{Z}_p[X]$. The proof transports multiplicativity of the genuine initial form through the localization and the structure isomorphism $\Theta$, cancels the unit $T^{\,w_\sigma(f)+w_\sigma(g)}$ — $w_\sigma$ the stage valuation, $T$ the degree-one unit — and finishes with injectivity of the constant embedding.
Hypotheses this rests on: GenuineStageModel σ — the bundled genuine graded model of the stage (including the $L_0\cong K[z^{\pm1}]$ fiat); no inhabitant is constructed anywhere in this corpus.
The Lean statement
theorem L3_residual_mul (σ : Stage p F) (M : GenuineStageModel σ) (f g : Polynomial ℤ_[p]) (hf : f ≠ 0) (hg : g ≠ 0) : σ.R (f * g) = σ.R f * σ.R g
lean/LeanUrat/MovesGr/L3_residual_mul.lean — theorem
conditional The formally defined graded residual equals the genuine initial form
In the model the identity is a one-line read-off of the bundled discharge identity, so its entire force sits in constructing the model — which remains open (the three refutation cards say why the planned routes fail).
For a prime $p$ and a stage $\sigma$ of the Okutsu–Montes tower with a genuine model, for every nonzero $f$: $$C(R(f))\cdot T^{\,w_\sigma(f)}=\Theta(\iota[f]).$$ The left side is the graded residual exactly as the tower formalization defines it — backwards, from the residual map $R$ and the valuation $w_\sigma$, with $C$ embedding the residue-field Laurent polynomials as $T$-constants. The right side is the genuine initial form $[f]$, pushed into the localization by $\iota$ and read through the structure isomorphism $\Theta$. This is the identity whose absence made the residual layer a definition rather than a theorem.
Hypotheses this rests on: GenuineStageModel σ — the bundled genuine graded model of the stage (including the $L_0\cong K[z^{\pm1}]$ fiat); no inhabitant is constructed anywhere in this corpus.
The Lean statement
theorem L4_grRes_eq_genuine (σ : Stage p F) (M : GenuineStageModel σ) (f : Polynomial ℤ_[p]) (hf : f ≠ 0) : letI := M.Rg.ring; letI := M.Loring; letI := M.alg; σ.grRes f = M.Θ (algebraMap M.S.Gr M.Lo (M.S.initialForm f))
lean/LeanUrat/MovesGr/L4_grRes_eq_genuine.lean — theorem
open A genuine model implies the full stage laws — proved in part
Most of the open laws are provably beyond the present hypotheses — the model cannot see the stage's parent valuation, T-vector exponents, or representative list, each of which can be varied without disturbing any assumption — so the claim awaits a stronger statement, not a longer proof.
For a prime $p$ and a stage $\sigma$ of the Okutsu–Montes tower: claim — $\sigma$ carrying a genuine graded model satisfies the complete package of stage laws — eleven core laws, the unit product law for the T-vector (the stage's recorded list of polynomial–exponent pairs whose residual units should multiply out to the degree-one unit $T$), and the coefficient-localization law. Proved here: the strict additive tie, the valuation-jump law, negation-invariance of the residual, the additive half of the slot decomposition, and the coefficient-supply clause. Open: the parent-valuation laws, the representative-list laws, the T-vector laws, and the remaining localization clauses.
The Lean statement
theorem L4_genuine_imp_stageCoreL (σ : Stage p F) (M : GenuineStageModel σ) : StageCoreL σ
lean/LeanUrat/MovesGr/L4_genuine_imp_stageCoreL_v2.lean — theorem
proved No stage satisfies the planned base-stage hypothesis
So the base-stage construction of a genuine model — which would discharge the conditionality of every result here — remains open, pending a faithful restatement of the base data.
For a prime $p$ and a stage $\sigma$ of the Okutsu–Montes tower: the intended base case of the tower induction assumed a stage whose parent valuation $w_{\mathrm{prev}}$ vanishes identically; no such stage exists. Every stage carries a law supplying a coefficient of parent weight $w_{\mathrm{prev}}(\Phi)+1$, with $\Phi$ the key polynomial — contradicting constancy at $0$. The planned base-existence statement is therefore provable only vacuously, and proving it would establish nothing.
The Lean statement
theorem baseStage_hbase_empty (σ : Stage p F) (hbase : σ.wPrev = fun _ => (0 : ℤ)) : False
lean/LeanUrat/MovesGr/HeldUnits_certs.lean — countermodel
proved The planned stage-transition statement can hold only vacuously
The stage-to-stage induction step is unprovable as stated; a faithful restatement must carry the positivity and transition hypotheses the tower construction actually provides.
For a prime $p$ and stages $\sigma,\sigma'$ of the Okutsu–Montes tower: a stage-transition record from $\sigma$ to $\sigma'$ with child ramification index $e'=0$ is self-contradictory — it forces the child stage's own ramification index $e$ to be $0$, against the law $e\ge 1$ that every stage carries. Since the planned transition-existence statement quantifies over arbitrary $e'$ with no positivity hypothesis, it could be proved only if no stage had a genuine model at all.
The Lean statement
theorem transitionCoreL_e0_false (σ σ' : Stage p F) (Φhat : Polynomial ℤ_[p]) (h' : ℕ) (zbar : Fˣ) (ht : TransitionCoreL σ σ' Φhat 0 h' zbar) : False
lean/LeanUrat/MovesGr/HeldUnits_certs.lean — countermodel
proved The planned recentering transport can hold only vacuously
Proved by exhibiting the representative-stripped clone; the repair is to pin the child's representative data inside the recentering relation itself.
The planned statement — a recentering of a stage with a genuine model (the same stage re-expressed around a translated center) again has a genuine model and satisfies the stage laws — cannot hold except vacuously. The recentering relation never constrains the child's representative list, so the statement applies equally to a clone of the child with its representatives deleted, which recenters identically; that clone violates the non-empty-representatives law. Formally: from the planned statement one derives that no recentering parent has a genuine model at all.
The Lean statement
theorem recTRANSRS_only_vacuous (H : ∀ (σ σ' : Stage p F), GenuineStageModel σ → ∀ (cc : ↥σ.K) (tt : Polynomial ℤ_[p]), IsRecentering σ σ' cc tt → Nonempty (GenuineStageModel σ') ∧ StageCoreL σ') (σ σ' : Stage p F) (M : GenuineStageModel σ) (cc : ↥σ.K) (tt : Polynomial ℤ_[p]) (hrec : IsRecentering σ σ' cc tt) : False
lean/LeanUrat/MovesGr/HeldUnits_L5_cert.lean — countermodel
proved What the stage laws prove of the T-vector unit law
Draws the boundary of the T-vector unit law: unit-ness of every factor is proved, while the product law stays open for want of exponent data the stage laws do not carry.
For a prime $p$ and a stage $\sigma$ of the Okutsu–Montes tower: from the stage laws alone, with no genuine model assumed, the graded residual of the key polynomial, and of every entry of $\sigma$'s T-vector (its recorded list of polynomial–exponent pairs), is a unit of $K[z^{\pm1}][T^{\pm1}]$ — Laurent polynomials over the residue field $K$ in an inner variable $z$ and an outer variable $T$. The remaining product law $\prod_i u_i^{a_i}\cdot Y^{\,t}=T$ — with $u_i$ the unit of the $i$-th entry, $Y$ the unit of the key, and $a_i,t$ the T-vector's integer exponents — is not derivable: the stage laws leave those exponents entirely free.
The Lean statement
theorem tvec_units_fragment (σ : Stage p F) : ∃ (uY : (LTwo ↥σ.K)ˣ) (ru : Fin σ.Tvec.length → (LTwo ↥σ.K)ˣ), IsGrUnit σ σ.Φ uY ∧ ∀ i, IsGrUnit σ (σ.Tvec.get i).1 (ru i)
lean/LeanUrat/MovesGr/HeldUnits_certs.lean — theorem
Hard core 1: the tower and carry algebra (HC1) 5 definition · 2 open · 11 proved · 2 conditional
The Montes tower and its carry arithmetic: wild primes counted digit by digit
At a wildly ramified prime, splitting behaviour is resolved one residue digit at a time, by climbing a Montes-style tower of augmented valuations in which each stage is a Newton-polygon read of the one before. This corpus builds that tower in Lean — base stage, increment step, recentering step, every move carrying its own witness, with a countermodel showing the increment step's growth guard $e\,g > 1$ cannot be dropped — together with the carry algebra $F[u]/(u^e - \bar z)$ that makes higher-digit residue arithmetic exact, depositing explicit carries when digits multiply. On top sit the height and staircase combinatorics and the exact stratum count — each level pins the predicted number of base-$p$ digits, so wild-prime densities are exact powers of $p$ — both conditional on the tower's recorded Newton-polygon side-line data (a hypothesis stated here and never discharged in this corpus); the corpus also exports the abstract carrier contract used by the density-assembly corpora, whose concrete instantiation stays open (two of its statement shapes are false, each with a counterexample), and the vertex-pin theorem used by the run-level classifier, substantive only on its recentering-shaped reads.
Builds on: Moves, MovesC, MovesGr, HC2
definition The carry algebra: multiplying digits deposits explicit carries
Every deep-level residue computation in the tower is bookkept here, with the whole wild-carry phenomenon concentrated in the single cocycle $\varepsilon$.
Fix a field $F$, an integer $e \ge 1$, and a unit $\bar z \in F^\times$. The carry algebra is the space $\mathcal D = \{x : \mathbb Z/e \to F\}$ with pointwise addition and the twisted convolution $(x \star y)(\tau) = \sum_{\rho \in \mathbb Z/e} x(\rho)\, y(\tau-\rho)\, \bar z^{\,\varepsilon(\rho,\,\tau-\rho)}$, where the carry exponent $\varepsilon(\rho,\sigma)$ is $1$ exactly when the representatives overflow ($\rho+\sigma \ge e$ in $\{0,\dots,e-1\}$) and $0$ otherwise. Writing $u_\rho c$ for the function supported at $\rho$ with value $c$, the product law is $u_\rho c \cdot u_\sigma c' = u_{\rho+\sigma}\big(c\,c'\,\bar z^{\,\varepsilon(\rho,\sigma)}\big)$: digits multiply into the expected slot, and an overflow deposits one factor of $\bar z$. A carry-ring pack is a commutative ring structure on $\mathcal D$ with exactly this product and unit $u_0 1$ — a hands-on model of $F[u]/(u^e - \bar z)$.
The Lean statement
def CarryAlg (F : Type u) (e : ℕ) : Type u := ZMod e → F
def carryExp (ρ σ : ZMod e) : ℕ := if e ≤ ρ.val + σ.val then 1 else 0
noncomputable def cmul [NeZero e] (zbar : Fˣ) (x y : CarryAlg F e) : CarryAlg F e :=
fun τ => ∑ ρ : ZMod e, x ρ * y (τ - ρ) * (zbar : F) ^ carryExp ρ (τ - ρ)
noncomputable def dOf (ρ : ZMod e) (c : F) : CarryAlg F e := Pi.single ρ c
structure CarryRingPack (F : Type u) [Field F] (e : ℕ) [NeZero e] (zbar : Fˣ) where
ring : CommRing (CarryAlg F e)
mul_def : ∀ x y : CarryAlg F e, (letI := ring; x * y) = cmul zbar x y
add_def : ∀ (x y : CarryAlg F e) (τ : ZMod e), (letI := ring; x + y) τ = x τ + y τ
one_def : (letI := ring; (1 : CarryAlg F e)) = dOf 0 1
lean/LeanUrat/HC1/DefsD.lean — definition
definition Reading a residual as a carry-algebra digit
The bridge from valuation-theoretic residues to positional digits; the multiplicativity theorem below is about this map.
For a prime $p$, a valuation stage $\sigma$ carries a residual map $R$ sending a $p$-adic polynomial $B$ in general position to a Laurent monomial $c\,z^k$ over the stage's residue field. Given a unit $\bar z$ in that field (the read's root) and an exponent $e_b \ge 1$, the digit map reads the monomial into the carry algebra: if $R(B) = c\,z^k$ is a monomial unit, then $\operatorname{dig}(B) = u_{k \bmod e_b}\!\big(c\,\bar z^{\,(k - (k \bmod e_b))/e_b}\big)$, where $u_\rho a$ denotes the carry-algebra element supported at $\rho$ with value $a$ — the digit occupies slot $k \bmod e_b$, and the overflow of $k$ past that slot folds into the coefficient as a power of $\bar z$; if $R(B)$ is not a monomial unit, $\operatorname{dig}(B) = 0$.
The Lean statement
noncomputable def _root_.LeanUrat.Moves.Stage.digD {p : ℕ} [Fact p.Prime]
{F : Type u} [Field F] [Finite F] (σ : Stage p F) (zbar : Fˣ) (e_b : ℕ) [NeZero e_b]
(B : Polynomial ℤ_[p]) : CarryAlg F e_b :=
open scoped Classical in
if h : IsMonomialUnit (σ.R B) then
dOf ((h.choose_spec.choose : ℤ) : ZMod e_b)
(((h.choose : ↥σ.K) : F) *
((zbar ^ ((h.choose_spec.choose -
(((h.choose_spec.choose : ℤ) : ZMod e_b)).val) / (e_b : ℤ)) : Fˣ) : F))
else 0
lean/LeanUrat/HC1/DefsD.lean — definition
definition A tower of valuation stages, each move carrying its witness
The formal counterpart of an Okutsu–Montes chain of augmented valuations; the three existence theorems below show every legal move has a witness.
For a prime $p$, a tower is a finite chain of valuation stages $\sigma_0,\dots,\sigma_K$ on $\mathbb Z_p[x]$, with residue fields inside a fixed finite field of characteristic $p$. The base stage is the Gauss valuation with uniformizer $p$; each later stage arises from its predecessor by a witnessed move: an increment — a legal Newton-polygon read, recorded as a monic irreducible $\psi \ne X$ of degree $g$ over the residue field with root $\bar z$, a standard lift $\hat\Phi$ to $\mathbb Z_p[x]$, coprime new invariants $(e',h')$, and the child's transition and stage laws — or a recentering, a change of center at the same level. From the invariants come the level slopes $\kappa_k = h_k/(e_0\cdots e_k)$, the coordinates $c$ addressing basis monomials $m_c = p^{l}\prod_r \Phi_r^{s_r}$ (the $\Phi_r$ being the level keys), and the height $\operatorname{ht}(c) = l + \sum_r s_r\kappa_r$.
The Lean statement
inductive MoveWitness (σ σ' : Stage p F) : Type u
| inc (ψ : Polynomial ↥σ.K) (g : ℕ) (Φhat : Polynomial ℤ_[p]) (e' h' : ℕ) (zbar : Fˣ)
(hyp : TransHyp σ ψ g Φhat e' h' zbar)
(core : TransitionCoreL σ σ' Φhat e' h' zbar)
(core' : StageCoreL σ') : MoveWitness σ σ'
| recenter (cc : ↥σ.K) (tt : Polynomial ℤ_[p])
(core : IsRecenteringCore σ σ' cc tt)
(core' : StageCoreL σ') : MoveWitness σ σ'
structure Tower (p : ℕ) [Fact p.Prime] (F : Type u) [Field F] [Finite F] where
K : ℕ
stg : Fin (K + 1) → Stage p F
base : IsBaseStage (stg 0) ∧ StageCoreL (stg 0)
move : ∀ k : Fin K, MoveWitness (stg k.castSucc) (stg k.succ)
hcharF : CharP F p
lean/LeanUrat/HC1/DefsTower.lean — structure
definition The side-line record a tower must carry (undischarged hypothesis)
Every combinatorial theorem below takes this record as an explicit hypothesis, and nothing in this corpus discharges it — results gated on it are conditional.
Realizability data for a tower assigns to each read $k$ a side line $L_k$ (an affine function recording that read's Newton-polygon side), a window with left slot $s_0$ and width, an order $\mu_k$, a vertex height $u^*_k$, and an interior end, subject to five laws: the slope law — $L_k$ falls per fine slot by the level slope $\kappa_k = h_k/(e_0\cdots e_k)$; the vertex tie — $L_k$ passes through the window's right endpoint at height $u^*_k$; the strictly steeper chain — $L_m$ is strictly shallower than $L_k$ for $m < k$; vertex-entry domination — $L_m \le L_k$ at each interior end for $m \le k$; and window nesting — each read's window sits inside the previous one's.
The Lean statement
structure TowerRealizable (T : Tower p F) where
line : ℕ → MovesC.Line
s0 : ℕ → ℕ
wSide : ℕ → ℕ
mu : ℕ → ℕ
ustar : ℕ → ℚ
interiorEnd : ℕ → ℕ
slope_law : ∀ k : Fin (T.K + 1), (line k.val).slope * (T.frameWidth k.val : ℚ) = T.kappa k
vertex_tie : ∀ k : Fin (T.K + 1),
(line k.val).at ((s0 k.val + wSide k.val) * T.frameWidth k.val) = ustar k.val
steeper : ∀ k : Fin (T.K + 1), ∀ m, m < k.val → (line m).slope < (line k.val).slope
vertex_entry : ∀ k : Fin (T.K + 1), ∀ m, m ≤ k.val →
(line m).at (interiorEnd k.val) ≤ (line k.val).at (interiorEnd k.val)
window : ∀ k : ℕ, k < T.K → s0 (k + 1) + wSide (k + 1) ≤ mu k
lean/LeanUrat/HC1/DefsCar.lean — structure
definition The carrier contract: what the density pipeline asks of a tower
The density-assembly corpora assume this contract rather than assert it; producing an actual instance from a tower is the open obligation recorded below.
A carrier pack abstracts what the density computation needs from a tower: a graded carrier (the graded object of a valuation) together with histories, coordinates, and digits, and the functions on them — height, block, level sets, slot coefficients, alphabet dimension, side lines, block edges, interior ends, windows, monomials, and floors. Over a pack, four statement shapes — the height/slot-minimum/level-locality/staircase laws, the typicality laws (additivity and alphabet count), line domination, and graded additivity — form the contract, and a final implication shape says the target density law follows once every pack satisfies it.
The Lean statement
structure CarrierPackR (p : ℕ) [Fact p.Prime] where
G : GradedCarrierR p
Hist : Type
Coord : Type
Digit : Type
[digitAdd : AddCommGroup Digit]
kIdx : Hist → ℕ
ht : Hist → Coord → ℚ
blk : Hist → Coord → ℕ
lvl : Hist → ℕ → ℚ → Set Coord
slotCoeff : Hist → ℕ → (Coord → Digit) → G.Coeff
aDim : Hist → ℕ → ℚ → ℕ
lines : Hist → ℕ → MovesC.Line
blockEdge : Hist → ℕ → ℕ
interiorEnd : Hist → ℕ → ℕ
window : Hist → ℕ → Prop
mono : Hist → Coord → G.Coeff
floorB : Hist → ℕ → ℚ
def REL1Pack (p : ℕ) [Fact p.Prime] (K : CarrierPackR p) : Prop :=
LSTStmt' p K ∧ TYPStmt' p K ∧ DOMStmt' p K ∧ SecB1Stmt' p K
def EQ2lawIfREL1' (p : ℕ) [Fact p.Prime] (EQ2law : Prop) : Prop :=
(∀ K : CarrierPackR p, REL1Pack p K) → EQ2law
lean/LeanUrat/HC1/R1_LSTStmt.lean — structure
proved The carry algebra is exactly F[u]/(u^e − z̄)
The hand-built convolution model is the intended quotient ring, so every digit computation downstream is a computation in $F[u]/(u^e - \bar z)$.
For a field $F$, an integer $e \ge 1$, and a unit $\bar z \in F^\times$, and every carry-ring pack — every commutative ring structure on the digit functions $\mathcal D = \{\mathbb Z/e \to F\}$ whose product is the twisted convolution with twist $\bar z$ — there is a ring isomorphism $\Theta : \mathcal D \xrightarrow{\ \sim\ } F[u]/(u^e - \bar z)$ with $\Theta(u_\rho c) = c\,u^{\rho}$, where $u_\rho c$ is the digit function supported at $\rho$ with value $c$ and $u$ is the class of $X$ in the quotient.
The Lean statement
theorem D4_carryAdjoinRoot {F : Type*} [Field F] {e : ℕ} [NeZero e] {zbar : Fˣ}
(P : CarryRingPack F e zbar) :
∃ Θ : (letI := P.ring;
CarryAlg F e ≃+* AdjoinRoot (Polynomial.X ^ e - Polynomial.C ((zbar : F)))),
∀ (ρ : ZMod e) (c : F),
Θ (dOf ρ c) = algebraMap F _ c *
AdjoinRoot.root (Polynomial.X ^ e - Polynomial.C ((zbar : F))) ^ ρ.val
lean/LeanUrat/HC1/D4_carryAdjoinRoot.lean — theorem
proved Digits multiply, up to carries
The engine of the carry calculus: digit multiplicativity holds for the twisted carry product with explicit anchor bookkeeping — the untwisted product fails it.
For a prime $p$, let $\sigma$ be a stage satisfying its core laws, with key $\Phi$ and ramification index $e$; let $\psi$ be a monic irreducible of degree $g$ over the residue field, $\psi \ne X$, with root $\bar z$, and let $\hat\Phi$ be a standard lift. Take nonzero $p$-adic polynomials $B, B''$ of degree less than $e\,g\deg\Phi$ and divide: $B\,B'' = Q\,\hat\Phi + R_{\mathrm{dev}}$ with $\deg R_{\mathrm{dev}} < e\,g\deg\Phi$. If the three residuals are monomial units with anchors adding — $R(B) = c_B z^{k_B}$, $R(B'') = c_{B''} z^{k_{B''}}$, $R(R_{\mathrm{dev}}) = c_R z^{k_B + k_{B''}}$ — then $\operatorname{dig}(R_{\mathrm{dev}}) = \operatorname{dig}(B) \star \operatorname{dig}(B'')$, with $\star$ the carry-algebra product: multiplying residues and reducing modulo the key is carry multiplication.
The Lean statement
theorem D7_digD_mul {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(σ : Stage p F) (hσ : StageCoreL σ) (ψ : Polynomial ↥σ.K) (g : ℕ)
(hg : ψ.natDegree = g) (hψ : Irreducible ψ) (hψz : ψ ≠ Polynomial.X)
(Φhat : Polynomial ℤ_[p]) (hlift : IsStandardLift σ ψ g Φhat)
(zbar : Fˣ) (hzbar : Polynomial.eval₂ σ.K.subtype ((zbar : Fˣ) : F) ψ = 0)
(e_b : ℕ) [NeZero e_b]
(B B'' Rdev Q : Polynomial ℤ_[p]) (hB : B ≠ 0) (hB'' : B'' ≠ 0)
(hBd : B.natDegree < σ.e * g * σ.Φ.natDegree)
(hB''d : B''.natDegree < σ.e * g * σ.Φ.natDegree)
(hdiv : B * B'' = Q * Φhat + Rdev)
(hRd : Rdev.natDegree < σ.e * g * σ.Φ.natDegree)
(cB cB'' cR : (↥σ.K)ˣ) (kB kB'' : ℤ)
(h5B : σ.R B = LaurentPolynomial.C (cB : ↥σ.K) * LaurentPolynomial.T kB)
(h5B'' : σ.R B'' = LaurentPolynomial.C (cB'' : ↥σ.K) * LaurentPolynomial.T kB'')
(h5R : σ.R Rdev = LaurentPolynomial.C (cR : ↥σ.K) * LaurentPolynomial.T (kB + kB'')) :
σ.digD zbar e_b Rdev = cmul zbar (σ.digD zbar e_b B) (σ.digD zbar e_b B'')
lean/LeanUrat/HC1/D7_digD_mul.lean — theorem
proved Base stages exist: the induction starts
The base case of the tower induction, anchored to the Gauss valuation rather than a degenerate stand-in.
For a prime $p$, given a monic $\varphi \in \mathbb Z_p[x]$ whose reduction mod $p$ is irreducible with a root $z_0$ in the ambient finite field, and coprime integers $e, h \ge 1$, there is a base stage with invariants $(e,h)$: its parent valuation is the Gauss valuation, its uniformizer is represented by $p$, its residue field is the base field, and all the core stage laws hold.
The Lean statement
theorem T1_baseStage {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(e h : ℕ) (bdata : BaseReadData p F e h) :
∃ σ : Stage p F, IsBaseStage σ ∧ StageCoreL σ ∧ σ.e = e ∧ σ.h = h
lean/LeanUrat/HC1/T1_baseStage.lean — theorem
proved Every legal read produces a child stage
The constructive heart of the corpus — the entire child stage (valuation, residual laws, digit frame) is built outright — and its guard $e\,g > 1$ is not removable, by the countermodel in the next node.
Let $\sigma$ be a stage satisfying its core laws, with ramification index $e$ and weight $w$. Given a legal read — a monic irreducible $\psi$ of degree $g$ over the residue field, $\psi \ne X$, with root $\bar z$; a standard lift $\hat\Phi$; coprime $e', h' \ge 1$ with the steepness $h' > e'\,w(\hat\Phi)$ — and the growth guard $e\,g > 1$, there exists a child stage $\sigma'$ realizing the transition laws and satisfying the core laws, whose residue field is generated over $\sigma$'s by $\bar z$ and whose invariants are $(e', h')$.
The Lean statement
theorem S9_transStage {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(σ : Stage p F) (hσ : StageCoreL σ) {ψ : Polynomial ↥σ.K} {g : ℕ}
{Φhat : Polynomial ℤ_[p]} {e' h' : ℕ} {zbar : Fˣ}
(th : TransHyp σ ψ g Φhat e' h' zbar) (hEG : 1 < σ.e * g) :
∃ σ' : Stage p F, TransitionCoreL σ σ' Φhat e' h' zbar ∧ StageCoreL σ' ∧
σ'.K = σ.nextField zbar ∧ σ'.e = e' ∧ σ'.h = h'
lean/LeanUrat/HC1/S9_transStage.lean — theorem
proved Drop the growth guard and the induction step turns false
Why the guard is necessary: at $e\,g = 1$ no child stage exists, so this corner is handled by the separate recentering move.
Under the legal-read hypotheses of the induction step, but at the corner $e\,g = 1$ ($e$ the stage's ramification index, $g$ the degree of the read polynomial), no child stage realizing the recorded transition laws can exist: the record pits the parent key $\Phi$ against the child key $\hat\Phi$ and forces $\deg\Phi < \deg\hat\Phi = e\,g\deg\Phi$, absurd when $e\,g = 1$. This boundary belongs to a different species of move — recentering — with its own theorem.
The Lean statement
theorem S9_ungated_corner_refuted {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(σ : Stage p F) {ψ : Polynomial ↥σ.K} {g : ℕ}
{Φhat : Polynomial ℤ_[p]} {e' h' : ℕ} {zbar : Fˣ}
(th : TransHyp σ ψ g Φhat e' h' zbar) (hcorner : σ.e * g = 1) :
¬ ∃ σ' : Stage p F, TransitionCoreL σ σ' Φhat e' h' zbar ∧ StageCoreL σ' ∧
σ'.K = σ.nextField zbar ∧ σ'.e = e' ∧ σ'.h = h'
lean/LeanUrat/HC1/S9_transStage.lean — countermodel
proved Recentering: the move that covers e·g = 1
Fills the $e\,g = 1$ corner where the increment step is impossible; together with the base and increment theorems, every tower move is inhabited.
For a prime $p$, suppose the stage $\sigma$ has ramification index $e = 1$, and $c \ne 0$ is an element of its residue field realized at key weight: some nonzero $t \in \mathbb Z_p[x]$ lies in the key's coefficient class, has weight $w(t) = w(\Phi)$ equal to that of the stage key $\Phi$ under the stage weight $w$, and has residual the constant $c$. Then a recentered stage $\sigma'$ exists, with such a $t$ witnessing the recentering laws, and $\sigma'$ satisfies the core stage laws.
The Lean statement
theorem S10_recStage {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(σ : Stage p F) (hσ : StageCoreL σ) (he1 : σ.e = 1)
(cc : ↥σ.K) (hcc : cc ≠ 0)
(hlift : ∃ tt : Polynomial ℤ_[p], tt ≠ 0 ∧ inC σ.Φ tt ∧ σ.w tt = σ.w σ.Φ ∧
σ.R tt = LaurentPolynomial.C cc * LaurentPolynomial.T 0) :
∃ (σ' : Stage p F) (tt : Polynomial ℤ_[p]),
IsRecenteringCore σ σ' cc tt ∧ StageCoreL σ'
lean/LeanUrat/HC1/S10_recStage.lean — theorem
proved Every stage of every tower obeys the stage laws
The spine every downstream tower theorem stands on; since each move carries its own witness this is largely projection — the substance lives in the base, increment, and recentering existence theorems.
In any tower, every stage satisfies the core laws, and each move's bookkeeping holds as recorded: after an increment read with root $\bar z$ and invariants $(e', h')$, the child's residue field is the parent's extended by $\bar z$ and its invariants are $(e', h')$; after a recentering, the residue field is unchanged and the ramification index is $1$.
The Lean statement
theorem S11_towerSpine {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(T : Tower p F) :
(∀ k : Fin (T.K + 1), StageCoreL (T.stg k)) ∧
(∀ k : Fin T.K,
match T.move k with
| .inc _ _ _ e' h' zbar _ _ _ =>
(T.stg k.succ).K = (T.stg k.castSucc).nextField zbar ∧
(T.stg k.succ).e = e' ∧ (T.stg k.succ).h = h'
| .recenter _ _ _ _ =>
(T.stg k.succ).e = 1 ∧ (T.stg k.succ).K = (T.stg k.castSucc).K)
lean/LeanUrat/HC1/S11_towerSpine.lean — theorem
conditional Heights, slot minima, and the staircase floor of a tower
The dictionary between tower coordinates and valuations that all the counting runs on; clause (iv) is stated for the step-floor because the raw-line version fails.
For a prime $p$, assume the tower's side-line record. Write $m_c = p^{l}\prod_r \Phi_r^{s_r}$ for the basis monomial of a coordinate $c$ (the $\Phi_r$ being the level keys) and $\operatorname{ht}(c) = l + \sum_r s_r\kappa_r$ for its height, with $\kappa_r$ the level slopes. Then: (i) for every coordinate with nonzero monomial, the top-stage weight is the total stretch times the height, $w_{\mathrm{top}}(m_c) = \mathrm{STR}\cdot\operatorname{ht}(c)$, where $\mathrm{STR} = e_0\cdots e_K$ is the product of the ramification indices; (ii) a nonzero digit vector supported in a single block has slot coefficient of valuation exactly the minimal height over its support, attained at a supporting coordinate; (iii) if two digit vectors on a block agree on the $\gamma'$-level set and both vanish below height $\gamma'$, their slot coefficients have the same graded class at $\gamma'$; (iv) on interior blocks the floor is constant — one value per block; (v) any level strictly above a block's floor misses the floor set entirely.
Hypotheses this rests on: TowerRealizable — the recorded side-line/window data of the tower (slope law, vertex-height tie, strictly steeper chain, vertex-entry domination, window nesting); carried as an explicit hypothesis structure and never discharged inside this corpus (its per-instance discharge is classifier-side work).
The Lean statement
theorem C1_LST {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(T : Tower p F) (rl : TowerRealizable T) :
(∀ c : T.Coord, c.MonoNZ →
(((T.stg (Fin.last T.K)).w (T.mono c) : ℤ) : ℚ) = (T.strTop : ℚ) * T.ht c) ∧
(∀ (b : ℕ) (y : T.Coord → ↥(T.stg 0).FQ), (Function.support y).Finite →
(∀ c, y c ≠ 0 → T.blk c = b) → T.slotCoeff b y ≠ 0 →
∃ c₀, y c₀ ≠ 0 ∧ T.wQ (T.slotCoeff b y) = (T.ht c₀ : WithTop ℚ) ∧
∀ c, y c ≠ 0 → T.ht c₀ ≤ T.ht c) ∧
(∀ (b : ℕ) (γ' : ℚ) (x y : T.Coord → ↥(T.stg 0).FQ),
(Function.support x).Finite → (Function.support y).Finite →
(∀ c ∈ T.levelSet b γ', x c = y c) →
(∀ c, T.blk c = b → T.ht c < γ' → x c = 0) →
(∀ c, T.blk c = b → T.ht c < γ' → y c = 0) →
T.inGr γ' (T.slotCoeff b x) = T.inGr γ' (T.slotCoeff b y)) ∧
(∀ b, rl.interiorB b → ∀ c : T.Coord, T.blk c = b → rl.floorS c = rl.floorB b) ∧
(∀ (b : ℕ) (γ' : ℚ), rl.interiorB b → rl.floorB b < γ' →
T.levelSet b γ' ∩ {c | T.blk c = b ∧ T.ht c ≤ rl.floorB b} = ∅)
lean/LeanUrat/HC1/C1_LST.lean — theorem
conditional A landing stratum has exactly the predicted measure
The measure-theoretic payoff of the tower — each level pins the predicted number of base-$p$ digits, which is why wild-prime densities are exact powers of $p$ — conditional on the listed coding inputs.
For a prime $p$, fix a tower level and a move at it: a monic irreducible $\psi$ of order $\mu$ and a transported digit pattern $(C_j)_{j<N_0}$ with cutoff $N_0 > \mu$, anchor-exact in the sense that $X \nmid \sum_{j<N_0} C_j\,\psi^j$. Code $p$-adic polynomials of degree $< D$ (where $D$ is the lift degree times $N_0$) by $D\cdot N$ base-$p$ digits, $N \ge 1$ a digit depth. Suppose a unitriangular change of digit coordinates $\Theta$ and a digit system $E$ pinning exactly $k$ rows cut out, after $\Theta$, precisely the stratum's landing cylinder, with $0$ not a solution. Then the count is exact: $\#\{\text{codes in the stratum}\}\cdot p^{k} = p^{DN}$ — the stratum has normalized density exactly $p^{-k}$.
Hypotheses this rests on: hexact — the stratum's transported digit pattern is anchor-exact (not divisible by X), threaded verbatim from the landing lemma; hzsol — the zero polynomial is not a solution of the pinned digit system; hcore — the full stage-core laws at the level stage (dischargeable from the tower spine, carried explicitly rather than taken); plus the certified coding inputs (unitriangular coordinate change, digit system with exactly k pinned rows cutting out the landing cylinder).
The Lean statement
theorem S17_levelMeasureExact {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F] (T : Tower p F) (k : Fin T.K) (lm : LevelMove T k) (hcore : StageCore (T.stg k.castSucc)) (hg : lm.ψ.natDegree = lm.g) (hgpos : 1 ≤ lm.g) (hmon : lm.ψ.Monic) (hψ : Irreducible lm.ψ) (hψz : lm.ψ ≠ Polynomial.X) (Φhat : Polynomial ℤ_[p]) (hlift : IsStandardLift (T.stg k.castSucc) lm.ψ lm.g Φhat) (hμN : lm.μ < lm.N) (hexact : ¬ Polynomial.X ∣ ∑ j ∈ Finset.range lm.N, lm.Cdig j * lm.ψ ^ j) (D ktot N : ℕ) (hD : D = Φhat.natDegree * lm.N) (hN : 1 ≤ N) (hkN : ktot ≤ D * N) (strat : (Fin (D * N) → ZMod p) → Prop) (code : Polynomial ℤ_[p] → (Fin (D * N) → ZMod p)) (hcode : ∀ x, ∃ f : Polynomial ℤ_[p], f.natDegree < D ∧ code f = x) (hstrat : ∀ f : Polynomial ℤ_[p], f.natDegree < D → (strat (code f) ↔ (f ≠ 0 ∧ StratumData (T.stg k.castSucc) lm.ψ lm.μ lm.a lm.Cdig lm.N f))) (hz : ∀ f : Polynomial ℤ_[p], f.natDegree < D → f = 0 → ¬ strat (code f)) (Θ : (Fin (D * N) → ZMod p) ≃ (Fin (D * N) → ZMod p)) (hΘ : LeanUrat.MovesC.IsUnitriangular fun x => Θ x) (E : DigitSystem (D * N) (ZMod p)) (hEk : E.numPinned = ktot) (hzsol : ¬ E.IsSolution (Θ (code 0))) (hcyl : ∀ (f : Polynomial ℤ_[p]) (B : ℕ → Polynomial ℤ_[p]), f.natDegree < D → f ≠ 0 → IsDevelopment Φhat f B lm.N → (E.IsSolution (Θ (code f)) ↔ LandingCylinderL (T.stg k.castSucc) lm.ψ lm.g lm.μ lm.a lm.Cdig B lm.N)) : Nat.card {x : Fin (D * N) → ZMod p // strat x} * p ^ ktot = p ^ (D * N)
lean/LeanUrat/HC1/S17_levelMeasureExact.lean — theorem
open How many digit values a level realizes (open: wrongly quantified)
The correct quantification is over height-alignment classes, not level-set coordinates, as the next node makes precise.
For a prime $p$, as stated: on a nonempty level set of a tower, (1) the alphabet — the group of graded classes reachable by digit vectors supported on that level — has cardinality $p^{d}$ for the recorded dimension $d$; (2) the alphabet is as large as the top residue field if and only if every level-set coordinate contributes a nonzero class; (3) if some coordinate contributes nothing, then $d$ is strictly less than $\log_p$ of the top residue field's size. Part (1) is proved separately; parts (2)–(3) quantify over the wrong index set — see the next node — so the statement is not provable as written and stays open.
The Lean statement
theorem C6_alphabetCard {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(T : Tower p F) (b : ℕ) (γ : ℚ) (hne : (T.levelSet b γ).Nonempty) :
Nat.card ↥(T.alphabet b γ) = p ^ T.aDim b γ ∧
(Nat.card ↥(T.alphabet b γ) = Nat.card ↥(T.stg (Fin.last T.K)).K ↔
∀ c : ↥(T.levelSet b γ), ∃ y : ↥(T.stg 0).FQ,
T.typComposite b γ (Pi.single c y) ≠ 0) ∧
((∃ c : ↥(T.levelSet b γ), ∀ y : ↥(T.stg 0).FQ,
T.typComposite b γ (Pi.single c y) = 0) →
T.aDim b γ < Nat.log p (Nat.card ↥(T.stg (Fin.last T.K)).K))
lean/LeanUrat/HC1/C6_alphabetCard.lean — theorem
proved Why the alphabet count fails as written
Certifies that the mis-quantification, not the tower, is at fault: the as-written statement forces alphabet-fullness on every nonempty level set, which real towers refute.
Two proved facts locate the error. Every coordinate of a nonempty level set automatically realizes a nonzero graded class (level-set membership forces attainability by weight detection), so the right-hand side of part (2) above is a theorem and the hypothesis of part (3) can never hold. The statement as written would therefore force the alphabet to fill the whole top residue field on every nonempty level set — and concrete towers with strictly smaller alphabets refute that. The correct statement must quantify over the alignment class of heights, not over level-set coordinates.
The Lean statement
theorem C6_forces_unconditional_fullness (T : Tower p F) (b : ℕ) (γ : ℚ)
(hC6 : Nat.card ↥(T.alphabet b γ) = p ^ T.aDim b γ ∧
(Nat.card ↥(T.alphabet b γ) = Nat.card ↥(T.stg (Fin.last T.K)).K ↔
∀ c : ↥(T.levelSet b γ), ∃ y : ↥(T.stg 0).FQ,
T.typComposite b γ (Pi.single c y) ≠ 0) ∧
((∃ c : ↥(T.levelSet b γ), ∀ y : ↥(T.stg 0).FQ,
T.typComposite b γ (Pi.single c y) = 0) →
T.aDim b γ < Nat.log p (Nat.card ↥(T.stg (Fin.last T.K)).K))) :
Nat.card ↥(T.alphabet b γ) = Nat.card ↥(T.stg (Fin.last T.K)).K
theorem C6_conjunct2_rhs_always (T : Tower p F) (b : ℕ) (γ : ℚ) :
∀ c : ↥(T.levelSet b γ), ∃ y : ↥(T.stg 0).FQ,
T.typComposite b γ (Pi.single c y) ≠ 0
lean/LeanUrat/HC1/ScratchC6.lean — countermodel
open The concrete tower should instantiate the carrier contract (open)
Until this instance exists, the density-assembly corpora use the carrier contract as a hypothesis rather than a theorem.
The instantiation obligation: every tower with a side-line record should yield a carrier pack whose graded pieces agree with the tower's own and which satisfies the exported height, typicality, and domination laws. This is open: two quantifier-scope errors in the abstract statement shapes — each pinned down by a counterexample showing the abstraction, not the tower, is at fault — make the instance unprovable as written, and repairing them would change stated theorems, so it stays open.
The Lean statement
theorem R6_carrierInstance {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(T : Tower p F) (rl : TowerRealizable T) :
∃ K : CarrierPackR p,
(∀ γ : ℚ, K.G.Gr γ = T.grQ γ) ∧
LSTStmt' p K ∧ TYPStmt' p K ∧ DOMStmt' p K
lean/LeanUrat/HC1/R6_carrierInstance.lean — theorem
proved The vertex of a development sits on the recorded line
Used by the run-level classifier; its substance is the recentering-shaped reads, since for steep reads the recorded-run hypotheses are contradictory (next node), so the theorem holds there only vacuously.
For a recorded run of reads on $f$ and any non-recentering read $i$ of order $\mu$: in every development $f = \sum_j B_j\,\hat\Phi^j$ along the next key $\hat\Phi$ with cutoff beyond $\mu$, the vertex coefficient $B_\mu$ is nonzero, and its weight at the child stage equals the frame stretch times the recorded side line's value at the vertex slot $\mu\cdot(\text{child width})$ — the development's Newton-polygon vertex lands on the recorded line.
The Lean statement
theorem V9_K1nonrec {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
{n : ℕ} {f : Polynomial ℤ_[p]} {H : History p F}
(h : ReadsOf p F n f H) (i : ℕ) (hi1 : i + 1 < H.nodes.length)
(hsp : (H.nodes[i]'(by omega)).species ≠ ReadSpecies.recentering)
(B : ℕ → Polynomial ℤ_[p]) (Nd : ℕ)
(hdev : IsDevelopment (H.nodes[i+1]'hi1).σ.Φ f B Nd)
(hNd : (H.nodes[i]'(by omega)).μ < Nd) :
B ((H.nodes[i]'(by omega)).μ) ≠ 0 ∧
(((H.nodes[i+1]'hi1).σ.w (B ((H.nodes[i]'(by omega)).μ)) : ℚ))
= (H.strFrame (i+1) : ℚ) *
(H.nodes[i]'(by omega)).line.at
((H.nodes[i]'(by omega)).μ * (H.nodes[i]'(by omega)).childWidth)
lean/LeanUrat/HC1/V9_K1nonrec.lean — theorem
proved Recorded steep reads are contradictory
This is what empties the vertex-pin theorem's steep reads; the repair — re-keying the recorded child at the regraded side value — would change a stated theorem, so it is not applied here.
Take stages $\sigma, \sigma'$ and steep read data: new invariants $e^\star, h^\star$ with $e^\star h < h^\star$ ($h$ the parent's slope numerator) and $e^\star g \ge 2$ ($g$ the degree of the read polynomial), the child key equal to the read's lift, the ramification tie $e_{\sigma'} = e^\star$, the parent-weight tie, the slot-minimum weight law, and the Bézout ties. Together these prove False: two of the child's own laws weigh $\Phi^{e^\star g}$ differently ($\Phi$ the child key), forcing $h^\star = (e^\star)^2 g\,h$ and hence $e^\star = 1$, after which two renderings of the key's residual clash. So a steep increment cannot be recorded, and any theorem quantifying over recorded steep reads is vacuous on that range.
The Lean statement
theorem V10_readTransition_incompatible {p : ℕ} [Fact p.Prime] {F : Type*} [Field F]
[Finite F] (σ σ' : Stage p F) (estar hstar : ℕ) (sstar tstar : ℤ) (g : ℕ)
(ψ : Polynomial ↥σ.K) (Φhat : Polynomial ℤ_[p])
(hsteep : (estar : ℤ) * (σ.h : ℤ) < (hstar : ℤ))
(hEG : 2 ≤ estar * g)
(hcop : Nat.gcd estar hstar = 1)
(hbez : (estar : ℤ) * sstar + (hstar : ℤ) * tstar = 1)
(he1t : estar = 1 → tstar = 0)
(hψ0 : ψ.coeff 0 ≠ 0)
(hlift : IsReadLift σ ψ g estar hstar Φhat)
(hkey : σ'.Φ = Φhat) (hce : σ'.e = estar) (hcw : ∀ x, σ'.wPrev x = σ.w x)
(hslot : IsSlotMinWeight σ'.w Φhat estar hstar σ.w)
(hs_tie : σ'.s = sstar) (ht_tie : σ'.t = tstar) : False
lean/LeanUrat/HC1/V10_transportWindow.lean — countermodel
proved The carry algebra, checked over the field with four elements
A worked instance confirming the abstract carry apparatus produces the right numbers on a concrete field.
Over $\mathbb F_4$ with exponent $e = 2$ there is a unit $\bar z$ with $\bar z^2 = \bar z + 1$ such that in every carry-ring pack, writing $u_\rho c$ for the digit supported at $\rho$ with value $c$: $u_1 1 \cdot u_1 1 = u_0\,\bar z$ (a carry, depositing the twist), $u_1 c \cdot u_0 c' = u_1(c\,c')$ (no carry), and the carry exponent $\varepsilon$ ($1$ on overflow, $0$ otherwise) satisfies the cocycle identity $\varepsilon(\rho,\sigma) + \varepsilon(\rho+\sigma,\tau) = \varepsilon(\sigma,\tau) + \varepsilon(\rho,\sigma+\tau)$.
The Lean statement
theorem G2_carryGate :
∃ zbar : (GaloisField 2 2)ˣ,
((zbar : GaloisField 2 2) ^ 2 = (zbar : GaloisField 2 2) + 1) ∧
∀ P : CarryRingPack (GaloisField 2 2) 2 zbar,
(letI := P.ring;
dOf (1 : ZMod 2) (1 : GaloisField 2 2) * dOf 1 1
= dOf 0 ((zbar : GaloisField 2 2))) ∧
(∀ c c' : GaloisField 2 2, letI := P.ring;
dOf (1 : ZMod 2) c * dOf 0 c' = dOf 1 (c * c')) ∧
(∀ ρ σ τ : ZMod 2,
carryExp ρ σ + carryExp (ρ + σ) τ = carryExp σ τ + carryExp ρ (σ + τ))
lean/LeanUrat/HC1/G2_carryGate.lean — theorem
Hard core 2: the existence bridge (HC2) 4 definition · 3 open · 8 proved · 5 conditional
What a classifier run is, and how a graded seed grows into the jet package the counting pipeline uses
HC2 is the hinge between the Newton-polygon classifier's combinatorics and the graded presentation ring. In one direction it pins down, in fully explicit polynomial terms, what it means for a recorded tower of polygon reads to be an actual run of the classifier on a monic $f$ over $\mathbb{Z}_p$, and proves the laws such runs obey — key towers exist, lifts are canonical, residue roots normalize under Galois, and normalized classes are rigid. In the other direction it shows that a small graded seed — the one fragment the graded-ring corpus HC1 must still supply — generates the entire jet-presentation package the density-counting corpus depends on, with every unproved ingredient carried as a named hypothesis quantified over by every downstream result rather than as an axiom, checked by concrete computations at $p = 2$ and $p = 3$ (including a recomputation of the classical $1/4$ inert density).
Builds on: MovesC, Moves, MovesD, HC1
definition When a recorded tower is a run on f
Every structural law in this corpus is stated for runs in this sense, and the definition is not assumed non-vacuous but checked so on a concrete quadratic below.
Fix a prime $p$, a degree $n \ge 2$, and a finite residue field $F$. A history is a tower of recorded Newton-polygon reads: node $i$ carries a key polynomial $\Phi_i$ over $\mathbb{Z}_p$ with a stage weight $w$ and residual map $R$, a side of slope $h/e$ with total weight $\gamma$, a digit pattern $\mathrm{pat}$, a residual order $\mu$, a residue root $\bar z$, and a lift. Such a history is a run on a monic $f$ of degree $n$ over $\mathbb{Z}_p$ when the record is internally coherent, and at every read the $\Phi_i$-adic expansion $f = \sum_j B_j \Phi_i^{\,j}$ realizes everything recorded: the side is a true supporting line of the expansion's polygon — $e\,w(B_j) + jh \ge \gamma$ for every nonzero $B_j$, with equality exactly at the slots $j = s_0 + ek$ (starting at the recorded slot $s_0$, stepping by $e$) where the pattern digit $\mathrm{pat}(k)$ is nonzero; at each such slot the residual of $B_j$ is the recorded monomial unit with scalar $\mathrm{pat}(k)$; the frame residual of $f$ has the recorded anchor and order $\mu$; the landing law holds at a designated next key, which at every interior read is the recorded child key; the lift is the one the canonical policy dictates and the residue root is the canonical root; and the $\mu$-th coefficient of $f$'s expansion in the next key has residue digit equal to the recorded transported vertex value.
The Lean statement
def ReadsOf (p : ℕ) [Fact p.Prime] (F : Type*) [Field F] [Finite F] (n : ℕ)
(f : Polynomial ℤ_[p]) (H : History p F) : Prop :=
f.Monic ∧ f.natDegree = n ∧ HistoryCoherent H ∧
∀ (i : ℕ) (hi : i < H.nodes.length),
∃ (B : ℕ → Polynomial ℤ_[p]) (Nd : ℕ) (Φnext : Polynomial ℤ_[p]),
IsDevelopment (H.nodes[i]'hi).σ.Φ f B Nd ∧
(∀ hi1 : i + 1 < H.nodes.length, Φnext = (H.nodes[i+1]'hi1).σ.Φ) ∧
SideReads (H.nodes[i]'hi) B Nd Φnext
lean/LeanUrat/HC2/Defs.lean — definition
definition The graded seed: the data the presentation ring must supply
Supplying one seed per class and level is the single input still owed by the graded-ring corpus HC1 (the hypothesis SEED-EXIST); the seed laws hold only with the chart-coverage guard (the box-size proviso), a stronger unguarded version being false — refuted by a counterexample.
For a prime $p$, a history $H$, and a box of $n$ coefficient positions by $N$ $p$-adic levels, a graded seed is a family of presentation predicates $\mathrm{pres}_i(x, f)$ relating a polynomial $f$ to a digit vector $x \in \mathbb{F}_p^{nN}$, one per read $i$, such that: the level-$0$ presentation reads off the base-$p$ digits of $f$'s coefficients; every monic degree-$n$ polynomial is presentable at every stage; consecutive presentations differ by a unitriangular change of digits $\Theta_i$; the presentation at read $i$ sees a coordinate only through the block of the $i$-th key's expansion it lives in; each recorded exact-valuation support $S$ attains all $p^{|S|}$ digit assignments; and the seed laws hold — a valuation clause $w(B_j) \ge \beta$ on a coefficient of the key expansion is, whenever the chart records the entire zero system below the threshold (the box-size proviso), the vanishing of the chart digits of height below $\beta$; values on supports are attained with the right count; the transports $\Theta_i$ act literally on valuation content; and the root read pins no exact-valuation coordinate inside its factor. This is the fragment of the jet package HC2 cannot manufacture itself; everything else it builds.
The Lean statement
structure PresentSeed (p : ℕ) [Fact p.Prime] (F : Type*) [Field F] [Finite F]
(H : History p F) (n N : ℕ) (keys : ℕ → Polynomial ℤ_[p]) where
pres : ℕ → (Fin (n * N) → ZMod p) → Polynomial ℤ_[p] → Prop
pres_zero : ∀ (x : Fin (n * N) → ZMod p) (f : Polynomial ℤ_[p]), pres 0 x f ↔
∀ j : Fin (n * N), x j = baseDigit p (boxChart n N j).1 (f.coeff (boxChart n N j).2)
pres_total : ∀ i : ℕ, i ≤ H.nodes.length → ∀ f : Polynomial ℤ_[p],
f.Monic → f.natDegree = n → ∃ x, pres i x f
Theta : ℕ → ((Fin (n * N) → ZMod p) → (Fin (n * N) → ZMod p))
Theta_uni : ∀ i : ℕ, IsUnitriangular (Theta i)
pres_theta : ∀ i : ℕ, i < H.nodes.length →
∀ (x : Fin (n * N) → ZMod p) (f : Polynomial ℤ_[p]), pres (i+1) x f → pres i (Theta i x) f
pres_block : ∀ i : ℕ, i < H.nodes.length →
∀ (f f' : Polynomial ℤ_[p]) (x x' : Fin (n * N) → ZMod p),
pres (i+1) x f → pres (i+1) x' f' →
∀ (B B' : ℕ → Polynomial ℤ_[p]) (Nd Nd' : ℕ),
IsDevelopment (keys i) f B Nd → IsDevelopment (keys i) f' B' Nd' →
∀ c : Fin (n * N),
B ((boxChart n N c).2 / (keys i).natDegree) = B' ((boxChart n N c).2 / (keys i).natDegree) →
x c = x' c
typObj : ∀ (i : ℕ) (hi : i < H.nodes.length) (S : Finset (Fin (n * N))),
IsValueSupport H (boxChart n N) i (H.nodes[i]'hi) S →
TypObject p (n * N) S (Fin S.card → ZMod p)
zcSeed : ZCSeedLaws H (boxChart n N) pres Theta keys
lean/LeanUrat/HC2/Defs.lean — structure
definition Two named hypotheses, never axioms: stage transition and uniqueness
Stage transition is used by the open lift-swap theorem; uniqueness as stated is refuted by a counterexample and used by nothing, so its correct form is not yet settled.
For a prime $p$ and finite residue field $F$: this corpus adds no axioms, and its two unproved obligations are named hypotheses that every downstream result quantifies over explicitly. Stage transition: given a lawful stage $\sigma$, a monic irreducible residual factor $\psi \ne X$ of degree $g \ge 1$ with root $\bar z$, a coprime side pair $(e', h')$ with normalized Bézout coefficients, and a lift $\hat\Phi$ of $\psi$ meeting the augmentation threshold, there is a successor stage with key $\hat\Phi$ satisfying the recorded transition laws. Uniqueness: within a fixed factorization shape, any two members of the shape's normalized prefix set whose invariant data are Galois-conjugate have equal invariant data.
The Lean statement
def StageTransHyp (p : ℕ) [Fact p.Prime] (F : Type*) [Field F] [Finite F] : Prop :=
∀ (σ : Stage p F), StageCoreL σ →
∀ (ψ : Polynomial ↥σ.K) (g : ℕ), ψ.Monic → ψ.natDegree = g → Irreducible ψ →
ψ ≠ Polynomial.X → 1 ≤ g →
∀ (zbar : Fˣ), Polynomial.eval₂ σ.K.subtype ((zbar : Fˣ) : F) ψ = 0 →
∀ (e' h' : ℕ) (s' t' : ℤ), 1 ≤ e' → 1 ≤ h' → Nat.gcd e' h' = 1 →
(e' : ℤ) * s' + (h' : ℤ) * t' = 1 → 0 ≤ t' ∧ t' < (e' : ℤ) →
∀ (Φhat : Polynomial ℤ_[p]), IsReadLift σ ψ g e' h' Φhat →
IAug σ Φhat e' h' →
∃ σ' : Stage p F, σ'.Φ = Φhat ∧ σ'.e = e' ∧ σ'.h = h' ∧ σ'.s = s' ∧ σ'.t = t' ∧
TransitionCoreL σ σ' Φhat e' h' zbar ∧ StageCoreL σ'
def OmUniqHyp {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(n : ℕ) (pol : CanonPolicy p F) (P : Shape n) : Prop :=
∀ H H' : History p F, H ∈ PrefSet n pol P → H' ∈ PrefSet n pol P →
EtaGalEq (etaData (P : ShapePrefix) H) (etaData (P : ShapePrefix) H') →
etaData (P : ShapePrefix) H = etaData (P : ShapePrefix) H'
lean/LeanUrat/HC2/Defs.lean — definition
definition The canonical lifting policy
Every normalized class in the pipeline is defined relative to this one policy, and its well-definedness on coherent realizable histories is a theorem of this corpus, not an assumption.
Fix a prime $p$ and a finite residue field $F$. The classifier runs with one lift rule. At a recentering node $\nu$ with key $\Phi$, stage weight $w$, and residual map $R$, a legal lift is a nonzero polynomial $t$ over $\mathbb{Z}_p$ in the key's coefficient class with $w(t) = w(\Phi)$ and residual the constant monomial at the recorded center. The canonical policy chooses, via the axiom of choice, some legal lift when one exists and $0$ otherwise; it is blind — it reads only the node's stage and center, never the lift being replaced. Any two legal lifts of the same node yield identical graded data, masses, counts, and downstream values, so the choice function could later be replaced by an explicit formula without changing any downstream result.
The Lean statement
def RecenterLiftSpec {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(ν : Node p F) (tL : Polynomial ℤ_[p]) : Prop :=
inC ν.σ.Φ tL ∧ tL ≠ 0 ∧ ν.σ.w tL = ν.σ.w ν.σ.Φ ∧
ν.σ.R tL = LaurentPolynomial.C ν.center * LaurentPolynomial.T 0
noncomputable def polOM (p : ℕ) [Fact p.Prime] (F : Type*) [Field F] [Finite F] :
CanonPolicy p F where
liftOf ν := if h : ∃ tL, RecenterLiftSpec ν tL then h.choose else 0
blind := by
intro ν t
rfl
lean/LeanUrat/HC2/Defs.lean — definition
conditional A graded seed generates the full jet package
The corpus's main theorem: the seed's short list of laws expands into all twenty-nine fields of the package the counting pipeline uses; the result is conditional on the named hypotheses in its gate and on two open lemmas — the zero-set induction step and a level-set no-straddle lemma.
For a prime $p$, degree $n \ge 2$, and level $N \ge 1$, let $H$ be a history over $\mathbb{Z}_p$ with a lawful key tower and $S$ a graded seed on the $n \times N$ box. If $H$ is coherent, realizable, confined to the degree-$n$ box, satisfies the root-shape law, and each read's fresh clauses are unpinned on the prior state, then the full jet-presentation package for $H$ exists: a chain of digit systems on the box, starting from the full box, with fresh clauses at each read (coordinate strips plus value clauses) obeying the band, cover, assembly, multiplicity, recursion, and zero-set laws the counting engine uses.
Hypotheses this rests on: hkeys — a lawful key tower (dischargeable from a run); S — the graded seed (HC1's open deliverable); hcoh/hreal/hbox — coherence, realizability, and box confinement; hd4 — the root read's shape law; hunp — fresh supports unpinned at each step (whose discharge is the open zero-set geometry). The compiled proof additionally consumes two still-open lemmas (the zero-set induction step and a level-set no-straddle lemma), so its footprint records unproved dependencies (Lean's sorryAx marker).
The Lean statement
theorem jetSetup_of_seed {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
{n N : ℕ} {H : History p F} {keys : ℕ → Polynomial ℤ_[p]}
(hkeys : KeysLawful H keys) (S : PresentSeed p F H n N keys) (hN : 1 ≤ N)
(hcoh : HistoryCoherent H) (hreal : Realizable H) (hbox : InBox n H)
(hd4 : RootD4 H) (vOf : VOf p (n * N)) (hunp : SeedFreshUnpinned H n N S vOf) :
Nonempty (JetSetup H n N (n * N))
lean/LeanUrat/HC2/U13_assembly.lean — theorem
conditional Every box level above the threshold is presentable
This is the presentability statement the density-counting corpus requires, reduced to the graded-seed hypothesis SEED-EXIST together with the normalization, root-shape, and unpinned conditions, and inheriting the two open zero-set lemmas through the assembly theorem.
For a prime $p$, fix a factorization shape $P$ of degree $n \ge 2$. Assume SEED-EXIST: for every class in $P$'s normalized prefix set and every box level $N$ at or above $P$'s threshold level, a lawful key tower and a graded seed exist. Assume also that presentation classes are normalized, the root-shape law, and the unpinned condition. Then $P$ is presentable at every such level $N$: a presented family exists, one jet package per class together with the normalization data. The reduction is the content here; the graded seed (SEED-EXIST) is HC1's open deliverable, and the normalization, root-shape, and unpinned conditions are carried as explicit hypotheses.
Hypotheses this rests on: hseed — SEED-EXIST, the frozen statement of HC1's deliverable (a key tower plus a graded seed for each class and level); hnorm — normalization of presentation classes (its discharge from the policy is still open, so consumers carry it explicitly); hd4 — the root-shape law for each class; hunp — the per-step unpinned condition. Inherits the unproved-dependency marker (sorryAx) through the assembly theorem's open dependency cone.
The Lean statement
theorem present_exist_of_seeds {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
{n : ℕ} {P : Shape n}
(hseed : ∀ (i : PrefIdx n (polOM p F) P) (N : ℕ), P.NP (polOM p F) ≤ N →
∃ keys : ℕ → Polynomial ℤ_[p], KeysLawful (reprOf i) keys ∧
Nonempty (PresentSeed p F (reprOf i) n N keys))
(hnorm : PresentNorm n (polOM p F) P)
(hd4 : ∀ i : PrefIdx n (polOM p F) P, RootD4 (reprOf i))
(hunp : ∀ (i : PrefIdx n (polOM p F) P) (N : ℕ) (keys : ℕ → Polynomial ℤ_[p])
(S : PresentSeed p F (reprOf i) n N keys) (vOf : VOf p (n * N)),
SeedFreshUnpinned (reprOf i) n N S vOf) :
∀ N : ℕ, P.NP (polOM p F) ≤ N →
Nonempty (Presented p F n N (n * N) (polOM p F) P)
lean/LeanUrat/HC2/U15_presentExist.lean — theorem
conditional The threshold object, assembled
A direct composition of presentability with the counting corpus's threshold constructor, building the input object that corpus takes.
For a prime $p$, degree $n \ge 2$, and shape $P$: under the same hypotheses as presentability, $P$'s threshold object exists — jet presentations at every box level $N$ at or above $P$'s threshold level, bundled by choice over that range of levels into the single object the density-counting pipeline takes as input.
Hypotheses this rests on: The same four hypotheses as presentability (hseed, hnorm, hd4, hunp), threaded through, with the same inherited unproved dependencies.
The Lean statement
theorem threshold_of_seeds {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
{n : ℕ} {P : Shape n}
(hseed : ∀ (i : PrefIdx n (polOM p F) P) (N : ℕ), P.NP (polOM p F) ≤ N →
∃ keys : ℕ → Polynomial ℤ_[p], KeysLawful (reprOf i) keys ∧
Nonempty (PresentSeed p F (reprOf i) n N keys))
(hnorm : PresentNorm n (polOM p F) P)
(hd4 : ∀ i : PrefIdx n (polOM p F) P, RootD4 (reprOf i))
(hunp : ∀ (i : PrefIdx n (polOM p F) P) (N : ℕ) (keys : ℕ → Polynomial ℤ_[p])
(S : PresentSeed p F (reprOf i) n N keys) (vOf : VOf p (n * N)),
SeedFreshUnpinned (reprOf i) n N S vOf) :
Nonempty (Threshold p F n (polOM p F) P)
lean/LeanUrat/HC2/U16_threshold.lean — theorem
conditional The recursion law of the digit-system chain
The hard kernel of the chain construction: the recursion holds only with the fresh-support transport stated here and the unpinned proviso; a counterexample refutes the naive unconditioned form.
For a prime $p$, degree $n \ge 2$, level $N$, a history $H$, and a graded seed on the $n \times N$ box, write $\Sigma_i$ for the digit system built from the seed after the first $i$ reads and $\Theta_i$ for the seed's digit transport at read $i$. For each read $i$ of the history, provided read $i$'s fresh supports are unpinned on the prior state, a digit vector $x$ solves $\Sigma_{i+1}$ if and only if $\Theta_i(x)$ solves $\Sigma_i$ and lies in read $i$'s fresh stratum (the strip-plus-value clauses that read contributes). At $i = 0$ the proviso is free: nothing is pinned before the root read.
Hypotheses this rests on: hunp — read i's fresh supports carry no pin of the prior state; genuinely needed: the unconditioned form was refuted by a compiled counterexample on junk histories and retired, and discharging the condition at each i > 0 is exactly the open zero-set geometry.
The Lean statement
theorem mkSigma_recursion {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(H : History p F) (n N : ℕ) {keys : ℕ → Polynomial ℤ_[p]}
(S : PresentSeed p F H n N keys) (vOf : VOf p (n * N))
(hunp : SeedFreshUnpinned H n N S vOf)
(i : ℕ) (hi : i < H.nodes.length) :
∀ x : Fin (n * N) → ZMod p,
(mkSigma H n N S vOf (i+1)).IsSolution x ↔
((mkSigma H n N S vOf i).IsSolution (S.Theta i x) ∧
mkStratum H n N S vOf i (S.Theta i x))
lean/LeanUrat/HC2/U7_sigmaRec.lean — theorem
proved Every run carries a lawful key tower
The run hypothesis cannot be weakened to coherence alone: that weaker claim is false, refuted by the countermodel below.
For a prime $p$, finite residue field $F$, degree $n \ge 2$, and monic $f$ over $\mathbb{Z}_p$: if a history $H$ is a classifier run on $f$, then a key family $(\mathrm{keys}_i)$ exists that agrees with the recorded child key at every interior read and satisfies the recorded landing law at every read, the final one included; the keys are extracted from the run's own designated next-key witnesses.
The Lean statement
theorem keys_exist_of_run {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
{n : ℕ} {f : Polynomial ℤ_[p]} {H : History p F}
(h : ReadsOf p F n f H) :
∃ keys : ℕ → Polynomial ℤ_[p], KeysLawful H keys
lean/LeanUrat/HC2/U1_keysExist.lean — theorem
conditional The canonical policy is total on coherent histories
This guarantees the policy definition never silently falls into its default-$0$ branch on the histories the pipeline actually uses.
For a prime $p$ and finite residue field $F$, let $H$ be coherent and realizable. At every recentering node of $H$ a legal lift in the sense of the canonical policy's specification exists — assuming the eligibility triple (unramified frame, nonzero recorded center, augmentation threshold) at the final read only; interior reads inherit it from coherence. Hence the policy's choice is well-defined and meets its specification at every such node. Each leg of the triple is necessary: for each, a legal coherent history exists on which dropping that leg leaves no lift; and for runs the final landing law supplies the triple, so runs need no extra hypothesis.
Hypotheses this rests on: helig — the eligibility triple, required at the final read only; the guard is not dead weight (its necessity is machine-checked in the same file, the unguarded statement being refuted by a compiled obstruction), and it is discharged automatically for runs.
The Lean statement
theorem polOM_total {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
{H : History p F} (hcoh : HistoryCoherent H) (hreal : Realizable H)
(i : ℕ) (hi : i < H.nodes.length)
(hrec : (H.nodes[i]'hi).species = ReadSpecies.recentering)
(helig : i + 1 = H.nodes.length → D10Eligible (H.nodes[i]'hi)) :
∃ tL : Polynomial ℤ_[p], RecenterLiftSpec (H.nodes[i]'hi) tL
lean/LeanUrat/HC2/U25_polTotal.lean — theorem
proved Residue roots normalize under Galois
One of the two halves of the normalization totality that presentation classes rest on; the other half, swapping lifts to the canonical policy, is still open.
For a prime $p$, finite residue field $F$, degree $n \ge 2$, and shape $P$: every coherent, realizable, in-box history $H$ matching $P$ has a Galois class-mate — a field automorphism $\varphi$ of $F$ and a history $H'$ matching $P$, all of whose residue roots are the canonical ones, whose invariant data at every read is the $\varphi$-transport of $H$'s (in particular Galois-equal to it), and which is again coherent, realizable, and in-box; if $H$ was canonical for the lifting policy, so is $H'$.
The Lean statement
theorem galois_normalize {n : ℕ} {P : Shape n} (H : History p F)
(hm : (P : ShapePrefix).MatchesHist H) (hcoh : HistoryCoherent H)
(hreal : Realizable H) (hbox : InBox n H) :
∃ (φ : F ≃+* F) (H' : History p F),
(P : ShapePrefix).MatchesHist H' ∧
(∀ (r : ℕ) (hr : r < H'.nodes.length),
(((H'.nodes[r]'hr).zbar : Fˣ) : F) = canonRoot (H'.nodes[r]'hr)) ∧
(∀ r : Fin (P : ShapePrefix).reads.length,
((etaData (P : ShapePrefix) H' r).1
= fun k => φ ((etaData (P : ShapePrefix) H r).1 k)) ∧
((etaData (P : ShapePrefix) H' r).2
= fun k => φ ((etaData (P : ShapePrefix) H r).2 k))) ∧
EtaGalEq (etaData (P : ShapePrefix) H) (etaData (P : ShapePrefix) H') ∧
HistoryCoherent H' ∧ Realizable H' ∧ InBox n H' ∧
((polOM p F).IsCanon H → (polOM p F).IsCanon H')
lean/LeanUrat/HC2/U17b_galois.lean — theorem
proved Normalized classes are rigid under Galois transport
The Galois-transport hypothesis is necessary: the unguarded statement and an adjacency-guarded weakening are both false, each refuted by a counterexample; the transport-keyed form is what the argument supports.
For a prime $p$, finite residue field $F$, degree $n \ge 2$, and shape $P$: take two histories in $P$'s normalized prefix set related by a full-history Galois transport — an automorphism $\varphi$ of $F$ fixing the base frame field pointwise and carrying one history's residue roots, residual-factor images, and side digits onto the other's. Then their invariant data are equal. The mechanism: least-root normalization pins the residue root at every read, coherence propagates the base-fixedness of $\varphi$ up the tower of frame fields, so every recorded value is $\varphi$-fixed and the transport collapses to the identity.
The Lean statement
theorem presentNorm_unique {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
{n : ℕ} {P : Shape n} :
∀ H H' : History p F,
H ∈ PrefSet n (polOM p F) P → H' ∈ PrefSet n (polOM p F) P →
(∃ φ : F ≃+* F, HistGalTransport φ H H') →
etaData (P : ShapePrefix) H = etaData (P : ShapePrefix) H'
lean/LeanUrat/HC2/U18_unique.lean — theorem
open Swapping lifts to the canonical policy (open)
Open, and it also assumes the stage-transition hypothesis, so normalization totality — which depends on it — is conditional both on this theorem and on that hypothesis.
For a prime $p$, finite residue field $F$, degree $n \ge 2$, and shape $P$: assume the stage-transition hypothesis. Then every realizable member $H$ of $P$'s policy-free prefix set should have a class-mate $H'$: the same shape match, equal invariant data, canonical for the canonical lifting policy, and again coherent, realizable, and in-box. In words: recorded lifts can be exchanged for the canonical ones without disturbing any recorded class data. This is open.
The Lean statement
theorem lift_swap {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
{n : ℕ} {P : Shape n} (hst : StageTransHyp p F)
(H : History p F) (hH : H ∈ PrefSetAny n P) :
∃ H' : History p F,
(P : ShapePrefix).MatchesHist H' ∧
etaData (P : ShapePrefix) H' = etaData (P : ShapePrefix) H ∧
(polOM p F).IsCanon H' ∧
HistoryCoherent H' ∧ Realizable H' ∧ InBox n H' := by
sorry
lean/LeanUrat/HC2/U17a_liftSwap.lean — theorem
open The zero-set induction step (open)
The zero-set field of the jet package flows through this step, so it is the hole that keeps the seed-to-jet assembly conditional.
For a prime $p$, finite residue field $F$, degree $n \ge 2$, level $N \ge 1$, a history $H$, and a graded seed $S$ on the $n \times N$ box: the open inductive step of the zero-set invariant. If, after reads $0, \dots, i$, the digit system's zero sets are downsets at the recorded heights, its pins are confined, and interior coordinates vanish, then the same holds after read $i+1$ — the transported pins stay literal at the new frame's heights, the fresh cuts are exact, and the new read's interior coordinates solve to zero. It splits into four legs (transport, fresh exactness, interior zeros, confinement) plus their assembly; interior zeros is the blocking leg, and without the seed's transport-literality law the assembled statement is false for a bad seed — which is why that law lives in the seed rather than being assumed here.
The Lean statement
theorem zc_step {n N : ℕ} {H : History p F} {keys : ℕ → Polynomial ℤ_[p]}
(S : PresentSeed p F H n N keys) (vOf : VOf p (n * N))
(hcoh : HistoryCoherent H) (hreal : Realizable H) (hbox : InBox n H) (hN : 1 ≤ N)
(i : ℕ) (hi1 : i + 1 < H.nodes.length)
(ih : ZCData (mkSigma H n N S vOf (i+1)) (boxChart n N) (H.htH (i+1)) (H.floorH (i+1))
((H.nodes[i]'(by omega)).μ * (H.nodes[i]'(by omega)).childWidth)) :
ZCData (mkSigma H n N S vOf (i+2)) (boxChart n N) (H.htH (i+2)) (H.floorH (i+2))
((H.nodes[i+1]'hi1).μ * (H.nodes[i+1]'hi1).childWidth) := by
sorry
lean/LeanUrat/HC2/U10_zcStep.lean — theorem
open Vertex heredity along a run (open)
The derivation reduces, via the run predicate's vertex read-off clause, to a single residue identity; the open part is the recorded-versus-constructed residue mismatch.
For a prime $p$, finite residue field $F$, degree $n \ge 2$, and monic $f$ over $\mathbb{Z}_p$: at consecutive reads of a run $H$ on $f$ where the child's window reaches the parent's standing vertex — $s_0' + w' = \mu$, with $s_0'$ the child's starting slot, $w'$ its side width, and $\mu$ the parent's residual order — the child's leading pattern digit, mapped into $F$, should equal the parent's recorded transported vertex value. What remains open is a single residue identity about the recorded child's digit frame, provably not derivable from the recorded class alone (a twist symmetry produces two records with the same class and different residues); it must come instead from HC1's constructed histories or from an upstream definition that pins the digit frame.
The Lean statement
theorem readsOf_HV {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
{n : ℕ} {f : Polynomial ℤ_[p]} {H : History p F}
(h : ReadsOf p F n f H) (i : ℕ) (hi1 : i + 1 < H.nodes.length)
(hadj : (H.nodes[i+1]'hi1).s0 + (H.nodes[i+1]'hi1).wSide
= (H.nodes[i]'(by omega)).μ) :
(((H.nodes[i+1]'hi1).pat ((H.nodes[i+1]'hi1).wSide / (H.nodes[i+1]'hi1).e)
: ↥(H.nodes[i+1]'hi1).σ.K) : F)
= (H.nodes[i]'(by omega)).vtx := by
lean/LeanUrat/HC2/U21_HV.lean — theorem
proved The vertex pin at consecutive reads (vacuous in the steep case)
Proved, but with a vacuity disclosure: for a non-recentering parent whose side denominator $e$ and residual degree $g$ satisfy $eg \ge 2$, the recorded transition data is inconsistent — the coherence definition's read-pair keying makes steep runs unrecordable — so on that range the theorem holds vacuously and must not be cited as transport mathematics; only the recentering-parent and $g = 1$ cases are substantive.
For a prime $p$, finite residue field $F$, degree $n \ge 2$, and monic $f$ over $\mathbb{Z}_p$: at consecutive reads $(i, i+1)$ of a run on $f$, take any expansion of $f$ in the child key extending past the parent's residual order $\mu$: the coefficient at slot $\mu$ is nonzero, and its weight in the child frame equals the frame stretch times the value of the parent's side line at the vertex base $\mu \cdot (\text{child width})$. This is the single transport law that all three cross-frame vertex-transport results use.
The Lean statement
theorem K1_readVertexPin {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
{n : ℕ} {f : Polynomial ℤ_[p]} {H : History p F}
(h : ReadsOf p F n f H) (i : ℕ) (hi1 : i + 1 < H.nodes.length)
(B : ℕ → Polynomial ℤ_[p]) (Nd : ℕ)
(hdev : IsDevelopment (H.nodes[i+1]'hi1).σ.Φ f B Nd)
(hNd : (H.nodes[i]'(by omega)).μ < Nd) :
B ((H.nodes[i]'(by omega)).μ) ≠ 0 ∧
(((H.nodes[i+1]'hi1).σ.w (B ((H.nodes[i]'(by omega)).μ)) : ℚ))
= (H.strFrame (i+1) : ℚ) *
(H.nodes[i]'(by omega)).line.at
((H.nodes[i]'(by omega)).μ * (H.nodes[i]'(by omega)).childWidth)
lean/LeanUrat/HC2/K1_vertexPin.lean — theorem
proved A concrete run at p = 2: the run predicate is inhabited
The witness discharges every clause of the run predicate, including the vertex read-off clause.
The run predicate is not vacuous. Over $\mathbb{Z}_2$, with residues in $\mathrm{GF}(4)$, the one-node history recording the root-only inert read in degree $n = 2$ (residual degree $g = 2$, residual order $\mu = 1$) is a classifier run on the concrete monic quadratic $f = X^2 + 2X + 4$: all six per-read clauses hold, including the landing law at the key $X^2 + 2X + 4$ and the vertex read-off.
The Lean statement
theorem gate_readsOf_inert2 :
∃ (H₀ : History 2 F4) (f : Polynomial ℤ_[2]),
H₀.nodes.length = 1 ∧
(∀ h0 : 0 < H₀.nodes.length,
(H₀.nodes[0]'h0).species = ReadSpecies.root ∧
(H₀.nodes[0]'h0).g = 2 ∧ (H₀.nodes[0]'h0).μ = 1) ∧
ReadsOf 2 F4 2 f H₀
lean/LeanUrat/HC2/U31_gateReadsOf.lean — theorem
proved The 1/4 inert density, recomputed through the bridge
The seed and jet package here are constructed concretely, with no seed hypothesis; the version quantified over all $N$ is false, refuted at $N = 2$.
At the smallest admissible box, $2 \times 1$: the root-only inert history at $p = 2$ over $\mathrm{GF}(4)$ carries a lawful key tower, an explicit graded seed, and an explicit jet package with total pin count $2$ and stratum mass satisfying $\mathrm{mass} \cdot 2^2 = 2^{2 \cdot 1}$ — that is, the bridge's counting machinery reproduces the independently known $1/4$ density of the inert stratum at $n = 2$. The restriction to box level $N = 1$ is forced: the version quantified over all $N \ge 1$ is false at $N = 2$, because the pin count depends on the box size.
The Lean statement
theorem gate_order0_inert :
∃ (H₀ : History 2 F4) (keys : ℕ → Polynomial ℤ_[2]),
KeysLawful H₀ keys ∧
H₀.nodes.length = 1 ∧
(∀ h0 : 0 < H₀.nodes.length,
(H₀.nodes[0]'h0).species = ReadSpecies.root ∧
(H₀.nodes[0]'h0).g = 2 ∧ (H₀.nodes[0]'h0).μ = 1) ∧
∃ (S : PresentSeed 2 F4 H₀ 2 1 keys) (J : JetSetup H₀ 2 1 (2 * 1)),
totalPins J (topLocus 2 (2 * 1)) = 2 ∧
Nat.card (J.SHZ (topLocus 2 (2 * 1))) * 2 ^ 2 = 2 ^ (2 * 1)
lean/LeanUrat/HC2/U27_gateInert.lean — theorem
proved Inert and split strata get different masses at p = 3
The second-prime companion to the $p = 2$ density check: it rules out a counting apparatus that is consistent but constant.
At $p = 3$ over $\mathrm{GF}(9)$, for every box level $N \ge 1$ there are concrete one-node root histories — inert ($g = 2$) and split ($g = 1$), both of residual order $\mu = 1$ — with explicit jet packages on the $2 \times N$ box whose stratum masses differ: $3^{2N - d_{\mathrm{in}}} \ne 3^{2N - d_{\mathrm{sp}}}$, where $d_{\mathrm{in}} > d_{\mathrm{sp}}$ count the coordinates each history pins. The counting data separates factorization types.
The Lean statement
theorem gate_order0_sep (N : ℕ) (hN : 1 ≤ N) :
∃ (Hin Hsp : History 3 F9)
(Jin : JetSetup Hin 2 N (2 * N)) (Jsp : JetSetup Hsp 2 N (2 * N)),
Hin.nodes.length = 1 ∧ Hsp.nodes.length = 1 ∧
(∀ h0 : 0 < Hin.nodes.length,
(Hin.nodes[0]'h0).species = ReadSpecies.root ∧
(Hin.nodes[0]'h0).g = 2 ∧ (Hin.nodes[0]'h0).μ = 1) ∧
(∀ h0 : 0 < Hsp.nodes.length,
(Hsp.nodes[0]'h0).species = ReadSpecies.root ∧
(Hsp.nodes[0]'h0).g = 1 ∧ (Hsp.nodes[0]'h0).μ = 1) ∧
Nat.card (Jin.SHZ (topLocus 3 (2 * N)))
≠ Nat.card (Jsp.SHZ (topLocus 3 (2 * N)))
lean/LeanUrat/HC2/U28_gateSep.lean — theorem
proved Coherence alone does not give a key tower: the counterexample
The refutation mechanism is complete, but the concrete recentering-ended history it fires on is supplied by HC1's child-stage construction, so this is conditional on that inhabitation rather than an absolute counterexample.
For a prime $p$ and finite residue field $F$: the claim that every coherent history admits a lawful key tower is false. Take any coherent history whose last node is a recentering read and zero out that node's lift: coherence survives (a surgery lemma), yet no key can satisfy the landing law at the final read (uniformly in the key), refuting the claim. The moral: the landing law at the final read is a property of runs on an actual polynomial, not of coherent records — which is why the surviving key-tower theorem is stated for runs.
The Lean statement
theorem retiredKeysExist_false_of_witness {p : ℕ} [Fact p.Prime] {F : Type*} [Field F]
[Finite F] (Hw : History p F) (hcoh : HistoryCoherent Hw)
(hrec : (Hw.nodes[Hw.nodes.length - 1]'(U1neg.last_lt Hw)).species
= ReadSpecies.recentering) :
¬ RetiredKeysExistStmt p F
lean/LeanUrat/HC2/U1_negWitness.lean — countermodel
3 A finite alphabet of patterns
Only a bounded packet of a node's data — slope data, residual class, a bounded carry window — influences its subtree; the packet is the node's pattern (species). The number of patterns is proved finite with an explicit bound at every degree; at degree three the catalogue is machine-enumerated (exactly 53) and its closure under every transition is verified by exhaustive computation. Connecting every real classifier run to catalogue walks at every degree rides the same open bridge as the previous stage.
The species alphabet (MovesSp) 5 definition · 12 proved · 2 conditional
One finite alphabet of tree-reading states, the same for every prime — exactly 53 letters at degree 3
One read of the canonical p-adic factorization tree records heights, digit values, and lifts, but almost all of that can be forgotten; what survives is a species, a small value-free bookkeeping tuple. This corpus proves the species form a finite alphabet with an explicit bound in which no prime appears — so one alphabet serves every $p$ at once — whose successor graph becomes a DAG once self-loops are collapsed (every collapsed reading has at most $6n^2$ letters), pinned exactly at degrees $1$ and $3$ (one letter; $53$ letters with their complete successor menus) by exhaustive kernel computation. The theorems tying the alphabet back to the actual tree make their dependencies explicit: the per-read engine laws enter as named hypotheses, conditional until the tree-computation corpus MovesD discharges them, with a real-carrier instantiation and a degree-2 witness ruling out vacuity.
Builds on: Moves, MovesD, MovesT, MovesC
definition What one tree read keeps
Every finiteness, DAG, and catalogue theorem in this corpus quantifies over these tuples, and since no field sees $p$, whatever holds of them holds for all primes at once.
A species is what one read of the canonical factorization tree retains: a position tag (root, post-increment, or post-recentering), the key degree $D$, the pool residue degree $w$, the window width $W$, the stride $e$, the raw left endpoint $s_0'$, the normalized side length $\ell$, the census anchor $a = \lfloor s_0'/e \rfloor$, the digit count $d$ with slot set $\{a, \dots, a+\ell\}$, the residual partition $\lambda = \{(g^{(i)}, \mu^{(i)})\}$ — a multiset pairing each residual factor's degree with its multiplicity — an optional selected pair $(g, \mu) \in \lambda$, and the compositions of the window's two flanks, the stretches left and right of the read side. Heights, depths, digit values, and lifts are deliberately dropped: every field is bounded natural-number data, and none can mention the prime.
The Lean statement
structure Species where
tag : Tag
D : ℕ -- current key degree
w : ℕ -- pool residue degree
W : ℕ -- window width
e : ℕ -- stride e = e_read
s0 : ℕ -- raw left endpoint s₀′
ell : ℕ -- normalized side length ℓ = w′/e = deg R_anch
a : ℕ -- CENSUS anchor ⌊s₀′/e⌋
d : ℕ -- digit count = #slots
slots : Finset ℕ -- census slot set {p̂_k}
lam : Multiset (ℕ × ℕ) -- residual partition λ = {(g⁽ⁱ⁾, μ⁽ⁱ⁾)}
sel : Option (ℕ × ℕ) -- selection (g, μ) ∈ λ, or ⊥ = none
lflank : List ℕ -- left flank composition (composition of span s₀′)
rflank : List ℕ -- right flank composition (span W − s₀′ − w′)
deriving DecidableEq
lean/LeanUrat/MovesSp/Defs.lean — structure
definition Growing the catalogue from root letters
The corpus's central object: prime-independence needs no lemma, because the same inductively generated catalogue is, by its type, the alphabet at every prime.
For a degree $n \ge 1$: the degree-$n$ catalogue $\mathcal{S}_n^{\mathrm{raw}}$ is the smallest set of species containing every coherent, budget-admissible root letter — root tag, key degree $1$, pool degree $1$, window $n$ — and closed under one successor step: a species with key degree $D$, pool degree $w$, stride $e$, and selected pair $(g, \mu)$ may be followed by one with key degree $egD$, pool degree $gw$, window $\mu$, and tag determined by whether $eg \ge 2$, provided the successor is again coherent and budget-admissible. Coherence is the geometric bookkeeping — flanks fill the window, anchor matches position, slots and residual degrees add up, and a species selects nothing exactly when its window is $1$; the budget caps every field by $n$. No prime enters the definition.
The Lean statement
def SuccStep (n : ℕ) (s s' : Species) : Prop :=
StageLaws s s' ∧ Coherent s' ∧ Budget n s'
inductive InCatalogue (n : ℕ) : Species → Prop
| root {s} : RootAdmissible n s → InCatalogue n s
| step {s s'} : InCatalogue n s → SuccStep n s s' → InCatalogue n s'
def SnRaw (n : ℕ) : Set Species := {s | InCatalogue n s}
lean/LeanUrat/MovesSp/Defs.lean — definition
definition An abstract canonical tree, specified law by law
All the conditionality of the completeness theorems is concentrated here — each law is an obligation for the tree-computation corpus (MovesD) to discharge, and the verdict law is deliberately weak, its full content recorded separately as the strong verdict pin.
For a prime $p$ and a monic polynomial $f$ over $\mathbb{Z}_p$ of degree $n \ge 1$: the hypotheses bundle specifying an abstract canonical factorization tree of $f$ — a nonempty type of branches, each carrying a word length in $\mathbb{N} \cup \{\infty\}$ and one species per read, subject to the engine laws: the first read is a root-admissible letter, consecutive reads obey the stage recursion, every read is coherent and within budget, the word closes at its first read with window $W = 1$, and every branch whose word is finite and nonempty carries some verdict. Infinite branches are admitted: length $\infty$, catalogued read by read.
The Lean statement
structure CanTreeModel (n p : ℕ) [Fact p.Prime] (f : Polynomial ℤ_[p]) where
Branch : Type
hTotal : Nonempty Branch
len : Branch → ℕ∞
hN1 : n = 1 → ∀ η, 0 < len η
datum : Branch → ℕ → Species
hRoot : ∀ η, 0 < len η →
RootStage n (datum η 0) ∧ Coherent (datum η 0) ∧ Budget n (datum η 0)
hStage : ∀ η (r : ℕ), (r + 1 : ℕ∞) < len η →
StageLaws (datum η r) (datum η (r + 1))
hCoh : ∀ η (r : ℕ), (r : ℕ∞) < len η →
Coherent (datum η r) ∧ Budget n (datum η r)
hHalt : ∀ η (r : ℕ), (r : ℕ∞) < len η → (datum η r).W = 1 →
len η = (r + 1 : ℕ∞)
verdict : Branch → Option Verdict
hVerdictPin : ∀ η (m : ℕ), len η = (m : ℕ∞) → 0 < m → (verdict η).isSome
lean/LeanUrat/MovesSp/Defs.lean — structure
definition Collapsing runs of repeated letters
Self-looping is the one way a walk can run arbitrarily long; every length bound in the corpus is stated for the collapsed word this operation produces.
The run-collapse of a list of species keeps one letter from each maximal run of equal consecutive letters: empty and singleton lists are unchanged, and in $s :: s' :: r$ the head $s$ is dropped precisely when $s = s'$. This strikes the depth direction of a self-loop while preserving the sequence of distinct states visited.
The Lean statement
def collapseRuns : List Species → List Species
| [] => []
| [s] => [s]
| s :: s' :: rest =>
if s = s' then collapseRuns (s' :: rest)
else s :: collapseRuns (s' :: rest)
lean/LeanUrat/MovesSp/Defs.lean — definition
proved Finitely many species at every degree, with an explicit bound
The uniformity cornerstone: one fixed finite alphabet of tower behaviors covers all primes simultaneously, so densities can be organized by finitely many species patterns.
For every $n \ge 1$ the catalogue $\mathcal{S}_n^{\mathrm{raw}}$ — the species reachable from degree-$n$ root letters — is finite, and $|\mathcal{S}_n^{\mathrm{raw}}| \le (n+2)^{n^2+3n+12}$. The bound is deliberately crude: each coherent, admissible species injects into the vectors of length $n^2 + 3n + 12$ with entries in $\{0, \dots, n+1\}$. No field of a species mentions a prime, so this single finite alphabet serves every $p$ — the independence is carried by the type, not by a clause.
The Lean statement
theorem SP_FIN (n : ℕ) (hn : 1 ≤ n) : (SnRaw n).Finite ∧
Nat.card (SnRaw n) ≤ (n+2)^(n^2 + 3*n + 12)
lean/LeanUrat/MovesSp/SP2_finThm.lean — theorem
proved One computed list catches every admissible species
The bridge behind the exact degree-1 and degree-3 catalogues: 567 candidate tuples at $n = 3$, all decided in the kernel, with native_decide banned corpus-wide.
For a degree $n \ge 1$: an explicitly computed finite list of species — each field ranging over the bounds the budget forces, with the anchor and slot set computed from the other fields — contains every coherent, budget-admissible species at level $n$. Every claim of the form “for all species” thereby becomes a finite scan.
The Lean statement
theorem speciesEnum_complete {n : ℕ} {s : Species} (hc : Coherent s)
(hb : Budget n s) : s ∈ speciesEnum n
lean/LeanUrat/MovesSp/SP2_speciesEnum.lean — theorem
proved Collapsed walks stop within 6n² letters
However deep a branch recenters, it passes through at most $6n^2$ distinct species — the finiteness input for counting entrance shapes and collapsed words downstream.
For a degree $n \ge 1$, take any walk through the degree-$n$ catalogue in which consecutive letters differ (a collapsed walk). A rank — the key degree $D$, the tag, $n - W$ for window $W$, and a non-fullness bit, packed lexicographically into a natural number below $6n^2$ — strictly increases along it. So the successor graph with self-loops struck is a DAG, and every collapsed walk has length at most $6n^2$.
The Lean statement
theorem SP_DAG_walk {n} (hn : 1 ≤ n) {l : List Species}
(h : CollapsedWalk n l) : l.length ≤ 6 * n^2
lean/LeanUrat/MovesSp/SP4_dagWalk.lean — theorem
proved Which letters can follow themselves
Isolates the one direction in which a reading can stall — the wild recentering spin — which is exactly what run-collapse removes before the $6n^2$ bound applies.
For a degree $n \ge 1$ and a species $s$ in the degree-$n$ catalogue, $s$ lies in its own successor menu if and only if it is post-recentering with stride $e = 1$ and selection $(g, \mu) = (1, W)$: a linear residual factor whose multiplicity fills the entire window $W$. Any other selection strictly increases the key degree, so no other letter can repeat.
The Lean statement
theorem selfloop_iff {n : ℕ} {s : Species} (hs : InCatalogue n s) :
s ∈ Succ n s ↔ (s.tag = .postRec ∧ s.e = 1 ∧ s.sel = some (1, s.W))
lean/LeanUrat/MovesSp/SP4_selfloopChar.lean — theorem
conditional Every read of every branch lands in the catalogue
The theorem connecting tree to alphabet; its substance is conditional on the engine laws holding for the real tree, and the instantiation and non-vacuity cards show how far that is discharged.
For every prime $p$, every monic degree-$n$ polynomial $f$ over $\mathbb{Z}_p$, and every model of its canonical tree satisfying the engine laws: at every branch $\eta$ and every read $r$ before the word's end, the species retained at read $r$ belongs to $\mathcal{S}_n^{\mathrm{raw}}$, the degree-$n$ catalogue. The proof is a closure induction — the root law places read $0$ in the catalogue, and the stage, coherence, and budget laws assemble exactly the catalogue's successor step for each later read; the assembly is derived, never assumed.
Hypotheses this rests on: hRoot / hStage / hCoh / hHalt — the interface's per-read engine laws (the root read is root-admissible; consecutive reads obey the raw stage recursion; coherence and budgets hold at every read; the word halts at its first W = 1 read) — are consumed as hypotheses and cited to the tree-computation corpus (MovesD), where they remain open engine obligations. hVerdictPin — the weak verdict pin (every finitely-ended nonempty word carries some verdict) — is a deliberately weak named carrier of the halting-rule residual, unused by this proof but part of the quantified interface.
The Lean statement
theorem SP_COMP (n p : ℕ) [Fact p.Prime] (f : Polynomial ℤ_[p])
(hf : f.Monic) (hdeg : f.natDegree = n) (M : CanTreeModel n p f)
(η : M.Branch) (r : ℕ) (hr : (r : ℕ∞) < M.len η) :
InCatalogue n (M.datum η r)
lean/LeanUrat/MovesSp/SP3_compMember.lean — theorem
conditional Catalogue membership on the real tree carrier
Everything the built tree's vocabulary can express is discharged — nonemptiness included, via the proved root law — and what stays conditional is exactly the one named readout premise.
For a prime $p$, a degree $n \ge 1$, and a monic degree-$n$ polynomial $f$ over $\mathbb{Z}_p$: the membership theorem restated where it matters — branches are the realized chains of the constructed tree model at a point of the coefficient box, and the root's presence is a proved law of that model rather than a hypothesis. Given a species readout — the single remaining premise, supplying each read's retained species together with the engine laws restated on this carrier — every read of every realized chain lands in $\mathcal{S}_n^{\mathrm{raw}}$, the degree-$n$ catalogue. The abstract membership theorem could be satisfied by models unrelated to the actual tree; on the real carrier, all remaining conditionality sits in that one named premise.
Hypotheses this rests on: SpeciesReadout T x — the one named interface premise: a per-read retained-species readout of the built canonical tree, with each engine law restated at the realized carrier. The built vocabulary cannot yet express the datum map itself: the residual partition needs the full residual factorization, and each read's window width is the parent read's μ threaded along the chain.
The Lean statement
theorem SP_COMP_ofTreeModel (f : Polynomial ℤ_[p])
(hf : f.Monic) (hdeg : f.natDegree = n)
(T : TreeModel p F n N m pol) (x : Box p m) (R : SpeciesReadout T x)
(o : Option (History p F)) (ho : T.mem o x)
(r : ℕ) (hr : (r : ℕ∞) < R.lenOf o) :
InCatalogue n (R.datumOf o r)
lean/LeanUrat/MovesSp/SP8_instantiation.lean — theorem
proved A three-read witness at degree 2
Guards against the cheapest reading of the completeness theorems: a zero-read model does still satisfy the tree-model hypotheses — a residual weakness stated rather than hidden — but this witness shows the theorems bite on a branch with real content.
At $n = 2$, $p = 2$, $f = (x-1)^2$ there is a canonical-tree model whose single branch reads three letters: word length $3$, first read a root-stage letter, every read inside $\mathcal{S}_2^{\mathrm{raw}}$ (the degree-$2$ catalogue) via the membership theorem. The three-letter word is transported from an explicitly built toy tree branch, and every tree-model law is checked by computation on the actual letters — nothing fires vacuously.
The Lean statement
theorem SP_COMP_nonvacuous_at_n2 :
∃ (M : CanTreeModel 2 2 f₂) (η : M.Branch),
M.len η = 3 ∧
M.datum η 0 = wordHead ∧ RootStage 2 (M.datum η 0) ∧
(∀ r : ℕ, (r : ℕ∞) < M.len η → InCatalogue 2 (M.datum η r))
lean/LeanUrat/MovesSp/SP8_instantiation.lean — theorem
definition The full verdict demand, written down
Types the missing halting content by name — the weak verdict law fixes neither which verdict, nor where the rule fires, nor any detection cap — so the gap is a declared object rather than an implicit one.
For a prime $p$, a monic degree-$n$ polynomial $f$ over $\mathbb{Z}_p$, and a canonical-tree model $M$ of $f$: the model's verdict law asks only that a finite nonempty word carry some verdict; this structure records what a faithful verdict model must actually provide — a halting rule $\tau$ from species to a fixed verdict alphabet, computed from cell data alone, never from $f$; a dictionary onto the bare verdict labels; the exactly-one-verdict law (a word of length $r+1$ carries precisely the $\tau$-verdict of its closing read $r$, while infinite branches carry none); and a uniform cap, so that the verdict is determined by the word's first $\mathrm{cap}$ letters. Strong-implies-weak is proved, so everything that uses the weak law still holds, and a strong pin is exhibited on the degree-2 witness.
The Lean statement
structure StrongVerdictPin {f : Polynomial ℤ_[p]} (M : CanTreeModel n p f) where
tauV : Species → MovesT.Vd
dict : MovesT.Vd → Verdict
htau : ∀ η (r : ℕ), M.len η = ((r + 1 : ℕ) : ℕ∞) →
M.verdict η = some (dict (tauV (M.datum η r)))
hinf : ∀ η, M.len η = ⊤ → M.verdict η = none
cap : ℕ
hcap : ∀ η η', M.len η = M.len η' →
(∀ r : ℕ, r < cap → M.datum η r = M.datum η' r) →
M.verdict η = M.verdict η'
theorem StrongVerdictPin.weak {f : Polynomial ℤ_[p]} {M : CanTreeModel n p f}
(S : StrongVerdictPin M) :
∀ η (k : ℕ), M.len η = (k : ℕ∞) → 0 < k → (M.verdict η).isSome
lean/LeanUrat/MovesSp/SP8_instantiation.lean — structure
proved The degree-3 alphabet has exactly 53 letters
The exact alphabet the degree-3 density computation uses, decided in the kernel with native_decide banned.
A species lies in $\mathcal{S}_3^{\mathrm{raw}}$ if and only if it is one of $53$ explicitly listed, pairwise distinct letters: $21$ root letters, $21 + 6$ post-recentering letters at windows $3$ and $2$, and $5$ terminal letters ($53 = 21 + 21 + 6 + 1 + 4$, the count checked in a companion kernel computation). Forward: closure induction, with kernel scans certifying that root admissibility yields exactly the $21$ root letters and that no successor step leaves the list. Backward: each letter is reached from a root letter along a kernel-computed path.
The Lean statement
theorem SnRaw3_eq : ∀ s, InCatalogue 3 s ↔ s ∈ catalogue3
lean/LeanUrat/MovesSp/SP6_catalogueEq.lean — theorem
proved The degree-3 edge table is exact
Upgrades a computed $53 \times 53$ edge table to a statement about all species, so the degree-3 walk combinatorics downstream can treat the menus as exhaustive.
For each letter $s$ of the $53$-letter degree-$3$ catalogue and for every species $s'$ whatsoever — not merely the catalogued ones — $s'$ is a legal successor of $s$ if and only if $s'$ appears in the recorded menu of $s$. The successor graph at degree $3$ is thus known edge-exactly: no edge is missing, and none leads off the table.
The Lean statement
theorem menu3_exact_global (s : Species) (hs : s ∈ catalogue3)
(s' : Species) : SuccStep 3 s s' ↔ s' ∈ menuMap3 s
lean/LeanUrat/MovesSp/SP6_menuMap.lean — theorem
proved Exactly two self-loops at degree 3
Only two states let a degree-3 branch spin to arbitrary depth; every other edge in the catalogued graph moves strictly forward.
Filtering the $53$ degree-$3$ letters for those that may succeed themselves leaves exactly two — the window-$3$ loop and the window-$2$ loop, both post-recentering — just as the general characterization predicts: stride $1$, selected multiplicity equal to the window.
The Lean statement
theorem loops3 : catalogue3.filter (fun s => succStepB 3 s s) =
[loopQ3, loopQ23]
lean/LeanUrat/MovesSp/SP6_selfloops.lean — theorem
proved Degree 1 is a one-letter alphabet
The degenerate base case that makes the degree-1 packaging exact: a length-1 catalogue word with an empty move word.
$\mathcal{S}_1^{\mathrm{raw}}$ contains exactly one species: the confirming root letter with key degree, pool degree, and window all equal to $1$, selecting nothing — window $1$ triggers the terminal rule. Degree $1$ admits no moves at all: the catalogue word is this single letter, and the move word is empty.
The Lean statement
theorem SnRaw1_eq : ∀ s, InCatalogue 1 s ↔ s = confirmingRoot1
lean/LeanUrat/MovesSp/SP6_n1singleton.lean — theorem
proved The recorded thresholds for the six multi-side letters
The six values are data — a finite computation at $p = 3$ plus one recorded prediction — deliberately kept as a table, with no formalized claim that actual polynomials attain them.
A partial table assigns to each of the six designated multi-side letters of the degree-$3$ catalogue its threshold $N_3^*$ — the value $7$ for one letter and $6$ for the other five — and is undefined off those six. The theorem certifies exactly that the table reads back these values, and nothing more.
The Lean statement
theorem nstar_values : Nstar3six msQ3R1 = some 7 ∧
Nstar3six msQ3R2 = some 6 ∧ Nstar3six msQ3R3 = some 6 ∧
Nstar3six msQ3R4a = some 6 ∧ Nstar3six msQ3R4b = some 6 ∧
Nstar3six msQ3R4c = some 6
lean/LeanUrat/MovesSp/SP6_NstarValues.lean — theorem
proved Which letters need a larger residue field
Pins exactly which species patterns the smallest primes rule out, while the necessary-not-sufficient caveat keeps the lists from being over-read as realizability claims.
Filter the $53$ degree-$3$ letters for those whose residual partition contains at least two (respectively at least three) linear factors — factors that would need as many distinct nonzero roots in the residue field. The filters return exactly the recorded lists of $11$ and $2$ letters. Passing this field-size test is necessary for a letter to occur at a given prime, never sufficient.
The Lean statement
theorem exclusion_lists_pinned :
catalogue3.filter (fun s => decide (2 ≤ linCount s)) = fieldSizeExcluded2 ∧
catalogue3.filter (fun s => decide (3 ≤ linCount s)) = fieldSizeExcluded3
lean/LeanUrat/MovesSp/SP6_exclusionLists.lean — theorem
proved The anchored residual is blind to coordinate shifts
The link to the parent moves corpus: it reuses that corpus's anchored-residual predicate outright, tying the species bookkeeping's two coordinate systems to the carry-algebra development.
For a field $K$, a Laurent polynomial $x$ over $K$, a polynomial $R$ over $K$, and integers $a, \sigma$: say $x$ has anchored residual $R$ at anchor $a$ when $x = z^a R(z)$ with $R(0) \ne 0$ — the anchoring strips off the exact power of $z$. Then $z^{\sigma} x$ has the same anchored residual $R$ at anchor $a + \sigma$. So the relabeling $p \mapsto p + \sigma$ between the census and geometric coordinate systems moves only the anchor: the residual partition $\lambda$, the selection, and the side length $\ell = \deg R$ never see $\sigma$.
The Lean statement
theorem hasAnchorK_T_mul {K : Type*} [Field K] (x : LaurentPolynomial K)
(a σ : ℤ) (R : Polynomial K) (h : Moves.HasAnchorK x a R) :
Moves.HasAnchorK (LaurentPolynomial.T σ * x) (a + σ) R
lean/LeanUrat/MovesSp/SP1_shAnchorInv.lean — theorem
4 Mass laws on branches
The fraction of polynomials whose classifier run follows a given branch is governed by power-of-q weights read off the patterns along the branch, summed over the branch tree of the polynomial's factors. A first per-factor version of the law was refuted by a checked counterexample and rebuilt on the branch-tree architecture; the corrected law is proved in its abstract form, and its instances are verified computationally, the largest check being a 404,128,692-box partition census with zero double counts and zero orphans.
Shapes, charts and mass laws (MovesD) 7 definition · 5 proved · 8 conditional
Each shape's mass is one monomial C·p^(−A′), class count and exponent read off the shape alone
MovesD is the counting engine of the proof: it takes a shape — the discrete skeleton of one run of the p-adic factorization classifier, recording at each step the Newton-polygon side, the chosen factor's degree and multiplicity, and the window of coefficient digits in play — and proves that the degree-n coefficient boxes mod p^N realizing that shape are governed by a single monomial, mass C·p^(−A′), with the class count C and the exponent A′ computed from the shape alone and frozen once the precision N passes an explicit threshold. Its own work is to show that all classes of one shape share one exponent, and that C obeys a bound M·p^W whose selection factor M is prime-free (the seed of uniformity in p), while the per-class count is carried out in the jet coordinates of MovesC (its Theorem C(b)) over the stage vocabulary of Moves. Three inputs remain conditional: the jet charts and dictionary pin from the presentation corpus HC2, the canonical-policy pin to be completed by the carry-algebra corpus HC1, and the tree hypotheses used by the assembly corpus MovesT.
Builds on: MovesC, Moves
definition What a shape is: twelve laws certify the classifier's skeleton
Well-formedness is built into the very notion of shape: every quantifier in this corpus ranges over certified shapes only, so the counting laws never meet a malformed encoding.
For a degree $n \ge 2$ and reads indexed by $r \ge 0$: a shape-prefix is a finite list of reads, one per classifier step, each keeping only the step's discrete data: its species (root, increment, or recentering), the Newton-polygon side in lowest terms $(e,h)$, the chosen factor's degree $g$ and its multiplicity $\mu$ in the anchor polynomial, an anchor offset $a$, the window $(s_0, w_{\mathrm{side}})$ in the coefficient box, the frame width $D$, an intercept $u^*$, the side weight $\gamma$, the residue-pool degree $w$, and a flag recording whether the side's top slot is the box's monic lead. Twelve laws certify a prefix: the root species occurs at read $0$ and only there, and its side fits the degree-$n$ box, $s_0 + w_{\mathrm{side}} \le n$; windows nest down the tower, $s_0^{(r+1)} + w_{\mathrm{side}}^{(r+1)} \le \mu_r$; each side has integer length, $e_r \mid w_{\mathrm{side},r}$, and its factor fits, $g_r\,\mu_r \le \ell_r$ with $\ell_r = w_{\mathrm{side},r}/e_r$ the normalized side length; frame widths compound, $D_0 = 1$ and $D_{r+1} = e_r g_r D_r$, and residue degrees likewise, $w_0 = 1$ and $w_{r+1} = w_r g_r$; the monic flag holds exactly at a root read whose side spans the whole box; the weight matches the geometry, $\gamma_r = e_r(\mathrm{STR}_r\, u^*_r) + (s_0 + w_{\mathrm{side}})_r\, h_r$ with stretch $\mathrm{STR}_r = \prod_{m<r} e_m$; and the anchor obeys Bézout, $e_r a_r = s_{0,r} - t^B(e_r,h_r)\,\gamma_r$, where $t^B(e,h)$ is the unique $t \in [0,e)$ with $t h \equiv 1 \pmod{e}$. A shape of degree $n$ is a prefix together with its certificate.
The Lean statement
structure ShapeWF (n : ℕ) (P : ShapePrefix) : Prop where
species_iff : ∀ (r : ℕ) (hr : r < P.reads.length),
(P.reads[r]'hr).species = ReadSpecies.root ↔ r = 0
root_box : ∀ h0 : 0 < P.reads.length, (P.reads[0]'h0).s0 + (P.reads[0]'h0).wSide ≤ n
window : ∀ (r : ℕ) (hr : r + 1 < P.reads.length),
(P.reads[r+1]'hr).s0 + (P.reads[r+1]'hr).wSide ≤ (P.reads[r]'(by omega)).μ
gmu : ∀ (r : ℕ) (hr : r < P.reads.length),
(P.reads[r]'hr).g * (P.reads[r]'hr).μ ≤ (P.reads[r]'hr).len
edvd : ∀ (r : ℕ) (hr : r < P.reads.length), (P.reads[r]'hr).e ∣ (P.reads[r]'hr).wSide
dchain0 : ∀ h0 : 0 < P.reads.length, (P.reads[0]'h0).Dwidth = 1
dchain : ∀ (r : ℕ) (hr : r + 1 < P.reads.length),
(P.reads[r+1]'hr).Dwidth = (P.reads[r]'(by omega)).childWidthS
monic : P.MonicTie n
w0 : ∀ h0 : 0 < P.reads.length, (P.reads[0]'h0).w = 1
wchain : ∀ (r : ℕ) (hr : r + 1 < P.reads.length),
(P.reads[r+1]'hr).w = (P.reads[r]'(by omega)).w * (P.reads[r]'(by omega)).g
gamTie : ∀ (r : ℕ) (hr : r < P.reads.length),
(((P.reads[r]'hr).gam : ℤ) : ℚ)
= ((P.reads[r]'hr).e : ℚ) * ((P.strS r : ℚ) * (P.reads[r]'hr).ustar)
+ ((((P.reads[r]'hr).s0 + (P.reads[r]'hr).wSide) : ℕ) : ℚ) * ((P.reads[r]'hr).h : ℚ)
anchorTie : ∀ (r : ℕ) (hr : r < P.reads.length),
((P.reads[r]'hr).e : ℤ) * (P.reads[r]'hr).a
= ((P.reads[r]'hr).s0 : ℤ) - bezT (P.reads[r]'hr).e (P.reads[r]'hr).h * (P.reads[r]'hr).gam
abbrev Shape (n : ℕ) : Type := {P : ShapePrefix // ShapeWF n P}
lean/LeanUrat/MovesD/Defs.lean — structure
definition The class count C: how many value-prefixes a shape realizes
$C_{\hat P}(p)$ is the numerator of the shape's density monomial — the one quantity the mass law and the uniform bound are both about.
For a prime $p$, degree $n \ge 2$, a shape $\hat P$ of degree $n$, and the ambient finite field $F$: a history — a chain of concrete classifier steps — matches $\hat P$ when its nodes agree with $\hat P$'s reads on every retained field. The prefix set $\mathrm{Pref}(\hat P)$ collects the matching histories that are coherent, realizable, confined to the degree-$n$ coefficient box, and canonically presented (the policy's canonical lifts and the canonical residue root at every read). Each history has $\eta$-class data: per read, the tuple of its side digits and the coefficient tuple of its chosen factor $\psi$, all valued in $F$; two histories are in the same class when these tuples agree. The class count is $C_{\hat P}(p) := \#\{\eta\text{-classes of } \mathrm{Pref}(\hat P)\}$, and $C := 1$ for the empty shape, whose one prefix is the empty chain.
The Lean statement
def PrefSet (n : ℕ) (pol : CanonPolicy p F) (P : Shape n) : Set (History p F) :=
{H | (P : ShapePrefix).MatchesHist H ∧ HistoryCoherent H ∧ Realizable H ∧
InBox n H ∧ pol.IsCanonPres H}
abbrev PrefIdx (n : ℕ) (pol : CanonPolicy p F) (P : Shape n) : Type _ :=
↥(etaData (P : ShapePrefix) '' PrefSet n pol P)
noncomputable def Shape.CD {n : ℕ} (P : Shape n) (pol : CanonPolicy p F) : ℕ :=
if (P : ShapePrefix).reads = [] then 1 else Nat.card (PrefIdx n pol P)
lean/LeanUrat/MovesD/Defs.lean — definition
definition What the counting assumes: one jet chart per class, plus a dictionary pin
The open surface of the corpus sits in these two fields — the jet charts and the dictionary pin, both to be supplied by the presentation corpus HC2; everything else downstream is constructed or proved from them.
For a prime $p$, degree $n \ge 2$, level $N \ge 1$, and a shape $\hat P$ of degree $n$: a presentation of $\hat P$ at level $N$ assigns to each $\eta$-class (a realized pattern of per-read side digits and factor coefficients, as in the class count) a jet chart for a chosen representative history — the coordinate system in which MovesC's box-counting theorem C(b) counts that class's locus — together with a dictionary pin: every policy-free realizable prefix is Galois-conjugate to some normalized class, and Galois-related normalized classes coincide. From a presentation one builds the class fiber $S(\eta,\top) \subseteq (\mathbb{Z}/p)^m$, the representative's locus in the full box of $m = nN$ base-$p$ digits; the event $S(\hat P,\top) = \bigcup_\eta S(\eta,\top)$ (the whole box when $\hat P$ is empty); and the multiplicity $\mathrm{mult}(x) = \#\{\eta : x \in S(\eta,\top)\}$ (identically $1$ on the empty shape). A threshold datum is a presentation at every level $N \ge N(\hat P)$.
The Lean statement
structure Presented (p : ℕ) [Fact p.Prime] (F : Type*) [Field F] [Finite F]
(n N m : ℕ) (pol : CanonPolicy p F) (P : Shape n) where
jet : (i : PrefIdx n pol P) → JetSetup (reprOf i) n N m
hnorm : PresentNorm n pol P
structure Threshold (p : ℕ) [Fact p.Prime] (F : Type*) [Field F] [Finite F]
(n : ℕ) (pol : CanonPolicy p F) (P : Shape n) where
jets : ∀ N : ℕ, P.NP pol ≤ N → Presented p F n N (n * N) pol P
def Presented.fiber (S : Presented p F n N m pol P) (i : PrefIdx n pol P) :
Set (Box p m) := (S.jet i).SHZ (topLocus p m)
def Presented.event (S : Presented p F n N m pol P) : Set (Box p m) :=
if (P : ShapePrefix).reads = [] then Set.univ else ⋃ i, S.fiber i
noncomputable def Presented.mult (S : Presented p F n N m pol P) (x : Box p m) : ℕ :=
if (P : ShapePrefix).reads = [] then 1
else Nat.card {i : PrefIdx n pol P // x ∈ S.fiber i}
lean/LeanUrat/MovesD/Defs.lean — structure
definition The exponent A′ and the threshold N(P̂): which digits a shape pins
$A'$ is the exponent of the shape's density monomial; that it is level-free (the stabilization theorem) is what lets one formula serve every precision.
For a shape $\hat P$ of degree $n \ge 2$ at level $N \ge 1$: the exponent $A(\hat P, n, N)$ counts the lattice points $(\text{level},\text{position}) \in [0,N) \times [0,n)$ lying, for some read, in that read's fresh band — the block of coefficient digits the classifier pins at that read — reconstructed from shape data alone through the shape's lines, staircases, cumulative floors, and rim thresholds. An a-priori bound $N_{\mathrm{shape}}$ dominates all constrained levels, and $A'(\hat P, n) := A(\hat P, n, N_{\mathrm{shape}})$ is the stabilized, level-free exponent. The threshold is $N(\hat P) := 1 + (\text{largest constrained level})$ when the shape has at least one class, and $:= 1$ otherwise.
The Lean statement
noncomputable def ShapePrefix.A (P : ShapePrefix) (n N : ℕ) : ℕ :=
(Finset.range P.reads.length).sum (fun r =>
((Finset.range N ×ˢ Finset.range n).filter (fun c => P.bandS n r c)).card)
noncomputable def ShapePrefix.Nshape (P : ShapePrefix) : ℕ :=
1 + ((List.range P.reads.length).map (fun r => ⌈(P.lineS r).intercept⌉.toNat)).foldr max 0
noncomputable def ShapePrefix.A' (P : ShapePrefix) (n : ℕ) : ℕ := P.A n (P.Nshape)
noncomputable def Shape.NP {n : ℕ} (P : Shape n) (pol : CanonPolicy p F) : ℕ :=
if Nonempty (PrefIdx n pol P) then (P : ShapePrefix).NPband n else 1
lean/LeanUrat/MovesD/Defs.lean — definition
conditional The mass law: one monomial counts a shape at every fine enough level
The corpus's output, handed to the tree-assembly corpus MovesT: conditional on the presentation data, every stabilization hypothesis is discharged internally.
Fix a prime $p$, a degree $n \ge 2$, a certified nonempty shape $\hat P$ of degree $n$, and presentation data at every level $N \ge N(\hat P)$ (its threshold). Write $S(\eta,\top)$ for the fiber of a class $\eta$ — the coefficient boxes mod $p^N$ that realize $\hat P$ in class $\eta$, cut out by that class's jet chart — and $S(\hat P,\top) = \bigcup_\eta S(\eta,\top)$ for the event. Then for every such $N$: $\big(\sum_{\eta} \#S(\eta,\top)\big)\, p^{A'(\hat P,n)} = C_{\hat P}(p)\, p^{nN}$, the sum law, an exact equality; and $\#S(\hat P,\top)\, p^{A'(\hat P,n)} \le C_{\hat P}(p)\, p^{nN}$, the event bound. These are the division-free forms of $\sum_\eta \mu(S(\eta,\top)) = C_{\hat P}(p)\,p^{-A'}$ and $\mu(S(\hat P,\top)) \le C_{\hat P}(p)\,p^{-A'}$: one monomial in $p$, with the class count $C_{\hat P}(p)$ and the exponent $A'$ both read off the shape, governs the shape's mass at all sufficiently fine precisions. A shape with no classes has both sides zero, and a companion theorem builds the threshold datum from bare existence of a presentation at each level.
Hypotheses this rests on: T : Threshold — presentation data (a jet chart per class + the dictionary pin) at every level N ≥ N(P̂); constructing this for the real classifier is the open HC-2 seam (the witness theorem reduces it to the existence hypothesis hex, PRESENT-EXIST, consumed only there). NP-ID (typed in NPv_npid.lean): that the formalized threshold coincides with the source note's own max-over-classes threshold is a declared open identification, deferred to the tree-assembly stage — the theorem's range is exact as stated; its identification with the note's range is the open claim.
The Lean statement
theorem D4R4_all (hne : (P : ShapePrefix).reads ≠ []) (T : Threshold p F n pol P) :
∀ (N : ℕ) (hNP : P.NP pol ≤ N),
((∑ᶠ i : PrefIdx n pol P, Nat.card ↥((T.jets N hNP).fiber i))
* p ^ ((P : ShapePrefix).A' n) = P.CD pol * p ^ (n * N)) ∧
(Nat.card ↥(T.jets N hNP).event * p ^ ((P : ShapePrefix).A' n)
≤ P.CD pol * p ^ (n * N))
theorem TW_threshold_witness
(hex : ∀ N : ℕ, P.NP pol ≤ N → Nonempty (Presented p F n N (n * N) pol P)) :
Nonempty (Threshold p F n pol P)
lean/LeanUrat/MovesD/D4R4all_wrapper.lean — theorem
conditional Every class fiber has exactly p^(nN−A′) points
The heart of the counting, and the point where MovesC's engine is spent: equal fibers from the jet charts, one shared exponent from the shape.
For a prime $p$, degree $n \ge 2$, and a certified nonempty shape $\hat P$ of degree $n$: at any level $N$ where the exponent has stabilized — $A(\hat P,n,N) = A'(\hat P,n)$, automatic once $N \ge N(\hat P)$ — and for any presentation of $\hat P$, the class fibers $S(\eta,\top)$ (each class's locus in the box of $nN$ digits) satisfy $\big(\sum_{\eta} \#S(\eta,\top)\big)\, p^{A'} = \#\{\eta\text{-classes}\}\cdot p^{nN}$. The proof is per class: MovesC's Theorem C(b) gives $\#S(\eta,\top)\cdot p^{\#\mathrm{pins}(\eta)} = p^{nN}$, with $\#\mathrm{pins}(\eta)$ the number of digits that class's jet chart pins, and the exponent transport identifies $\#\mathrm{pins}(\eta) = A'$ for every class — so each fiber has exactly $p^{nN-A'}$ points, and no disjointness of fibers is used anywhere.
Hypotheses this rests on: S : Presented — a jet chart per class plus the dictionary pin (the HC-2 seam data); hA — ledger stabilization at level N, discharged internally by the threshold theorems whenever N ≥ N(P̂); hne — nonempty shape (the empty shape has its own separately proved law).
The Lean statement
theorem D4R1_SUM (hne : (P : ShapePrefix).reads ≠ []) (N : ℕ)
(hA : (P : ShapePrefix).A n N = (P : ShapePrefix).A' n)
(S : Presented p F n N m pol P) :
(∑ᶠ i : PrefIdx n pol P, Nat.card ↥(S.fiber i)) * p ^ ((P : ShapePrefix).A' n)
= Nat.card (PrefIdx n pol P) * p ^ (n * N)
lean/LeanUrat/MovesD/D10_sumLaw.lean — theorem
conditional The event bound: the union counts no more than the sum
The subadditivity half of the mass law; its nonemptiness hypothesis is no convenience — on the empty shape the event is the full box while the sum vanishes, and that failure is itself proved.
For a prime $p$, degree $n \ge 2$, a certified nonempty shape $\hat P$ of degree $n$, presentation data, and a stabilized level $N \ge N(\hat P)$: $\#S(\hat P,\top)\cdot p^{A'} \le \#\{\eta\text{-classes}\}\cdot p^{nN}$, where $S(\hat P,\top) = \bigcup_\eta S(\eta,\top)$ is the event and $A'$ the shape's stabilized exponent. Every event point lies in at least one fiber, so counting the incidence set $\{(x,\eta) : x \in S(\eta,\top)\}$ two ways gives $\#S(\hat P,\top) \le \sum_x \mathrm{mult}(x) = \sum_\eta \#S(\eta,\top)$, and the sum law finishes.
Hypotheses this rests on: Same as the sum law: S : Presented (HC-2 seam data), hA (discharged internally past the threshold), hne (nonempty shape).
The Lean statement
theorem D4R1_EV (hne : (P : ShapePrefix).reads ≠ []) (N : ℕ)
(hA : (P : ShapePrefix).A n N = (P : ShapePrefix).A' n)
(S : Presented p F n N m pol P) :
Nat.card ↥S.event * p ^ ((P : ShapePrefix).A' n)
≤ Nat.card (PrefIdx n pol P) * p ^ (n * N)
lean/LeanUrat/MovesD/D12_evBound.lean — theorem
conditional Exactness means multiplicity one on the event
Reduces exactness of the density formula to multiplicity one on the event — precisely the statement the tree-assembly corpus MovesT must supply.
For a prime $p$, degree $n \ge 2$, a certified nonempty shape $\hat P$ of degree $n$, presentation data, and a stabilized level $N \ge N(\hat P)$: equality holds in the event bound exactly when every event point lies in just one fiber: $\#S(\hat P,\top)\, p^{A'} = C_{\hat P}(p)\, p^{nN}$ if and only if $\mathrm{mult}(x) = 1$ for every $x \in S(\hat P,\top)$, where $\mathrm{mult}(x)$ counts the classes $\eta$ with $x \in S(\eta,\top)$. The criterion is pointwise at each finite level — no measure-zero exception appears or is needed.
Hypotheses this rests on: Same as the sum law: S : Presented (HC-2 seam data), hA (discharged internally past the threshold), hne (nonempty shape).
The Lean statement
theorem D4R1_EV_iff (hne : (P : ShapePrefix).reads ≠ []) (N : ℕ)
(hA : (P : ShapePrefix).A n N = (P : ShapePrefix).A' n)
(S : Presented p F n N m pol P) :
(Nat.card ↥S.event * p ^ ((P : ShapePrefix).A' n)
= Nat.card (PrefIdx n pol P) * p ^ (n * N))
↔ (∀ x ∈ S.event, S.mult x = 1)
lean/LeanUrat/MovesD/D13_evIff.lean — theorem
proved Digits and ranks determine the class: an injection with no hypotheses
The combinatorial core of the class-count bound, assembled from proved auxiliaries: digits lie in the pool, frame fields equal the pool, ranks are bounded and injective.
For a prime $p$, the ambient finite field $F$, a shape $\hat P$, and each read $r$: a class's $d_r$ counted side digits provably lie in the pool $\mathbb{A}_r = \{x \in F : x^{p^{w_r}} = x\}$ — $w_r$ the read's residue-pool degree — a set of at most $p^{w_r}$ elements; and its chosen degree-$g_r$ factor $\psi$ of the anchor polynomial has a rank $s_r < \bar m_r$, its position among the eligible factors in a fixed lexicographic order. The encoding $\eta \mapsto \big((\text{side digits}), (\text{ranks})\big) \in \prod_r \mathbb{A}_r^{d_r} \times \prod_r \{0,\dots,\bar m_r - 1\}$ is injective on $\eta$-classes, with no hypotheses. For the empty shape the target is the empty product, a single point — matching its class count $C_\varnothing = 1$.
The Lean statement
theorem encIdx_inj :
Function.Injective (encIdx : PrefIdx n pol P → EncTargetP p F (P : ShapePrefix))
theorem encTargetP_empty (hP : (P : ShapePrefix).reads = []) :
Nat.card (EncTargetP p F (P : ShapePrefix)) = 1
lean/LeanUrat/MovesD/E9_encInj.lean — theorem
conditional The class count is at most M·p^W, with M prime-free
The seed of uniformity in $p$: the numerator of every density monomial is bounded by shape data whose selection factor is prime-free, which is what lets a single rational function of $q$ serve all primes.
For a prime $p$, degree $n \ge 2$, and every certified shape $\hat P$ of degree $n$: $C_{\hat P}(p) \le M(\hat P)\, p^{W(\hat P)}$, and $M(\hat P) \le n^{|\hat P|}$. Here $W(\hat P) = \sum_r w_r d_r$ weights the $d_r$ counted side digits of read $r$ by its residue-pool degree $w_r$; $M(\hat P) = \prod_r \lfloor \ell_r/(g_r\mu_r) \rfloor$ bounds the factor selections, with $\ell_r$, $g_r$, $\mu_r$ the read's normalized side length, factor degree, and multiplicity; and $|\hat P|$ is the number of reads. The second inequality contains no $p$. Proof: classes inject into the encoding target (the encoding injection), whose cardinality is at most $M\, p^W$; on the empty shape both sides are $1$.
Hypotheses this rests on: hnorm : PresentNorm — the typed two-sided dictionary between the note's raw classes and the normalized presentation classes (totality up to Galois conjugacy + uniqueness); an open obligation to be supplied by the presentation corpus (HC2). The injection itself is hypothesis-free.
The Lean statement
theorem D4R2'_full (hnorm : PresentNorm n pol P) :
P.CD pol ≤ (P : ShapePrefix).Mfac * p ^ (P : ShapePrefix).W ∧
(P : ShapePrefix).Mfac ≤ n ^ (P : ShapePrefix).reads.length
lean/LeanUrat/MovesD/W3_coarseBound.lean — theorem
conditional All classes of one shape pin the same number of digits
The geometric hinge of the corpus: a long chain of proved band identities — lines, staircases, floors, rims, each replicated on the shape side — collapses into one equality between history data and shape data.
For a degree $n \ge 2$, level $N \ge 1$, a shape $\hat P$ of degree $n$, and every presented $\eta$-class: the number of digits pinned by that class's jet chart at the full box equals $A(\hat P, n, N)$, a quantity computed from the shape alone. The pin count is a priori data of the class's history; the theorem transports it read by read, matching the jet chart's fresh bands against the bands reconstructed from shape data on the $N \times n$ grid of (level, position). Hence all classes of one shape share one exponent — the mechanism that turns per-class counting into an exact sum law.
Hypotheses this rests on: S : Presented — the per-class jet charts (the HC-2 seam data); nothing else is assumed.
The Lean statement
theorem L9_A (S : Presented p F n N m pol P) (i : PrefIdx n pol P) :
totalPins (S.jet i) (topLocus p m) = (P : ShapePrefix).A n N
lean/LeanUrat/MovesD/D9_L9.lean — theorem
proved Past the threshold the exponent stops moving
Lets the mass law discharge its own stabilization hypothesis — the capstone quantifies over $N \ge N(\hat P)$ and needs nothing from outside (the stabilization law is scoped to shapes with at least one class; the capstone's empty branch never uses it).
For a shape $\hat P$ of degree $n \ge 2$ and level $N \ge 1$: $1 \le N(\hat P) \le N_{\mathrm{shape}}(\hat P)$, and on shapes with at least one class, $A(\hat P, n, N) = A'(\hat P, n)$ for every $N \ge N(\hat P)$: every band-constrained level lies below the threshold, so raising the precision past $N(\hat P)$ pins no new digits. Proved outright from the definitions.
The Lean statement
theorem NP_pos : 1 ≤ P.NP pol
theorem NP_le_Nshape : P.NP pol ≤ (P : ShapePrefix).Nshape
theorem NP_stab [Nonempty (PrefIdx n pol P)] :
∀ N : ℕ, P.NP pol ≤ N → (P : ShapePrefix).A n N = (P : ShapePrefix).A' n
lean/LeanUrat/MovesD/NPu_threshold.lean — theorem
conditional Certification loses nothing: real histories pass all twelve laws
The guard against silent universe loss: quantifying over certified shapes is quantifying over all matched coherent in-box histories, up to two named encoding hypotheses rather than a silent assumption.
For a prime $p$ and degree $n \ge 2$: suppose a shape $\hat P$ agrees field-by-field with an actual classifier history on all retained data, and the history is coherent and confined to the degree-$n$ box. Then $\hat P$ satisfies all twelve certificate laws, granted two named encoding hypotheses: (hmt0) the root read's monic flag is set exactly when its side spans the whole box, and (hw0) the root frame field has exactly $p$ elements. Restricting the theory to certified shapes therefore discards no realizable history — conditional only on those two hypotheses.
Hypotheses this rests on: hmt0 (ENC-MONIC): the root read's monic flag holds iff its side spans the full degree-n box — the one genuinely encoding-level clause of the monic tie; hw0 (ROOT-POOL): the root frame field has exactly p elements. Both are named, ledgered encoding hypotheses.
The Lean statement
theorem ShapeWF_of_matches {Q : ShapePrefix} {H : History p F} (hM : Q.MatchesHist H)
(hcoh : HistoryCoherent H) (hbox : InBox n H)
(hmt0 : ∀ h0 : 0 < Q.reads.length,
((Q.reads[0]'h0).monicTop = true ↔ (Q.reads[0]'h0).s0 + (Q.reads[0]'h0).wSide = n))
(hw0 : ∀ hj : 0 < H.nodes.length, Nat.card ↥((H.nodes[0]'hj).σ.K) = p) :
ShapeWF n Q
lean/LeanUrat/MovesD/SW1_shapeWF.lean — theorem
conditional Normalized classes are exactly Galois classes
The class construction is faithful as a full bijection, not an inequality: normalized classes match Galois classes, conditional on the dictionary pin.
For a prime $p$, a shape $\hat P$, and the ambient finite field $F$: under the dictionary pin, the normalized class count equals the number of classes of the policy-free realizable prefix set modulo the Galois relation — two histories related when a field automorphism of $F$ carries the per-read class data (side digits and factor coefficients) of one to the other. So $C_{\hat P}(p)$ is the source note's count of realized value-prefixes with conjugate presentations identified: normalization neither merges distinct classes (the pin's uniqueness half) nor misses any (its totality half).
Hypotheses this rests on: hnorm : PresentNorm — the typed dictionary pin (Galois totality + uniqueness of normalized classes), to be supplied by the presentation corpus (HC2); the full bijection is proved, no inequality fallback.
The Lean statement
theorem card_classes_abs (hnorm : PresentNorm n pol P) :
Nat.card (PrefIdx n pol P) = Nat.card (Quotient (etaGalSetoid (p := p) (F := F) n P))
lean/LeanUrat/MovesD/F2_absCount.lean — theorem
proved The note's two worked shapes, recomputed exactly
A concrete test of the entire shape-side definition stack: the source note's hand-computed values come back exactly from the formal definitions, verified computationally.
The two concrete shapes fixed in the source note are certified, and their invariants compute by exhaustive computation to the recorded values. For $\hat P^*$ (degree $3$: a root read followed by a recentering) the certificate holds, with digit weight $W = 7$, selection bound $M = 1$, level bound $N_{\mathrm{shape}} = 5$, stabilized exponent $A' = 11$, and band threshold $5$. For $\hat P_0$ (degree $4$: a single root read) the certificate holds and $A' = 14$.
The Lean statement
theorem PhatStar_wf : ShapeWF 3 PhatStar
theorem PhatStar_W : PhatStar.W = 7
theorem PhatStar_Mfac : PhatStar.Mfac = 1
theorem PhatStar_Nshape : PhatStar.Nshape = 5
theorem PhatStar_A' : PhatStar.A' 3 = 11
theorem PhatStar_NPband : PhatStar.NPband 3 = 5
theorem Phat0_wf : ShapeWF 4 Phat0
theorem Phat0_A' : Phat0.A' 4 = 14
lean/LeanUrat/MovesD/G1_gates.lean — theorem
proved The certificate says no: malformed shapes provably refused
The negative half of the certificate's story: junk encodings are excluded by proof, not by convention.
Three malformed read-records from the source note are proved not well-formed: a root side of width $10$ inside a degree-$3$ box breaks the box law; a record claiming the monic lead while its side spans only $2$ of the $3$ slots breaks the monic-slot tie; a root read carrying residue-pool degree $2$ breaks the law $w_0 = 1$. Two further malformed candidates fail earlier still: their read data cannot even be assembled, so well-formedness is never reached.
The Lean statement
theorem advI_not_wf : ¬ ShapeWF 3 ⟨[advI]⟩
theorem advII_not_wf : ¬ ShapeWF 3 ⟨[advII]⟩
theorem advVI_not_wf : ¬ ShapeWF 4 ⟨[advVI]⟩
lean/LeanUrat/MovesD/G1_gates.lean — countermodel
definition Five laws pin the canonical lift policy
The pin specifies the canonical lift rule as far as the exported vocabulary can express; the remaining slot-selection law — which weight-correct, residual-correct realizer is the canonical one — is a named open obligation of the carry-algebra corpus HC1, so until it lands a compatible non-canonical realizer could also satisfy the pin.
For a lift policy and a recentering node $\nu$ — with side $(e,h)$ in lowest terms, factor degree $g$, and side weight $\gamma$: the counting theorems quantify over any blind, deterministic lift policy, and a pin fixes which one is the note's canonical policy. A pin for a policy is a predicate — ‘$t$ realizes the canonical offset lift at the node $\nu$’, its exact formula deferred to the carry-algebra corpus HC1 — subject to five laws: a realizer exists at every recentering node; realizers are nonzero; a realizer's monomial support lies in a single arithmetic progression of stride $e$ and length $g$, anchored in the Bézout-forced congruence class $j_0 \equiv t^B(e,h)\,\gamma \pmod{e}$, with $t^B(e,h)$ the unique $t \in [0,e)$ with $t h \equiv 1 \pmod{e}$, as in the shape certificate; each node has exactly one realizer; and at a recentering the realizer lies in the frame's coefficient space, carries the key weight, and has top graded residual equal to the recorded center. Any policy admitting a pin therefore lifts each recentering by a nonzero center realizer.
The Lean statement
structure OffsetPPin {p : ℕ} [Fact p.Prime] {F : Type*} [Field F] [Finite F]
(pol : CanonPolicy p F) where
Realizes : Node p F → Polynomial ℤ_[p] → Prop
total : ∀ ν : Node p F, ν.species = ReadSpecies.recentering → Realizes ν (pol.liftOf ν)
realizes_ne_zero : ∀ (ν : Node p F) (t : Polynomial ℤ_[p]), Realizes ν t → t ≠ 0
support_forced : ∀ (ν : Node p F) (t : Polynomial ℤ_[p]), Realizes ν t →
∃ j₀ : ℕ, (j₀ : ℤ) % (ν.e : ℤ) = (bezT ν.e ν.h * ν.gam) % (ν.e : ℤ) ∧
∀ j ∈ t.support, ∃ k : ℕ, k < ν.g ∧ j = j₀ + k * ν.e
realizes_unique : ∀ (ν : Node p F) (t t' : Polynomial ℤ_[p]),
Realizes ν t → Realizes ν t' → t = t'
digits_prescribed : ∀ (ν : Node p F) (t : Polynomial ℤ_[p]), Realizes ν t →
ν.species = ReadSpecies.recentering →
inC ν.σ.Φ t ∧ ν.σ.w t = ν.σ.w ν.σ.Φ ∧
ν.σ.R t = LaurentPolynomial.C ν.center * LaurentPolynomial.T 0
lean/LeanUrat/MovesD/PolPin.lean — structure
proved Degenerate policies admit no pin: three refutations
Wrong-valued and degenerate policies are excluded by the pin's laws themselves — each attempted bypass of the specification ends as a proved refutation.
For a prime $p$: three refutations, each verified computationally, guard the pin against degenerate readings: the realizer predicate cannot be plain nonzeroness, since the uniqueness law would then force $1 = X$ in $\mathbb{Z}_p[X]$; a policy whose lift at even one recentering node has the wrong top graded residual (not the recorded center) admits no pin; and likewise when the lift carries the wrong weight.
The Lean statement
theorem OffsetPPin.not_realizes_bare_ne_zero {pol : CanonPolicy p F}
(pin : OffsetPPin pol) (ν : Node p F) :
pin.Realizes ν ≠ fun t : Polynomial ℤ_[p] => t ≠ 0
theorem OffsetPPin.no_pin_of_wrong_value {pol : CanonPolicy p F} (ν : Node p F)
(hν : ν.species = ReadSpecies.recentering)
(hwrong : ν.σ.R (pol.liftOf ν)
≠ LaurentPolynomial.C ν.center * LaurentPolynomial.T 0) :
IsEmpty (OffsetPPin pol)
theorem OffsetPPin.no_pin_of_wrong_weight {pol : CanonPolicy p F} (ν : Node p F)
(hν : ν.species = ReadSpecies.recentering)
(hwrong : ν.σ.w (pol.liftOf ν) ≠ ν.σ.w ν.σ.Φ) :
IsEmpty (OffsetPPin pol)
lean/LeanUrat/MovesD/PolPin.lean — countermodel
definition Stated, not proved: the numeric predictions owed by the classifier
These predictions are stated but unproved; their discharge depends on the classifier corpora HC1 and HC2.
For the degree-$3$ shape $\hat P^*$ (the computed shape above), a prime $p$, and level $N$: named target statements over $\hat P^*$, stated here and deliberately left open: $C_{\hat P^*}(2) = 3$; $C_{\hat P^*}(3) = 48$; multiplicity identically $1$ on the event; and the four recorded finite-level counts $\#S(\hat P^*,\top) = C_{\hat P^*}(p)\,p^{3N-11}$ at $(p,N,\text{count}) = (2,6,384),\ (2,7,3072),\ (3,5,3888),\ (3,6,104976)$. Each is a statement about realized prefix sets under the pinned canonical policy — class-count semantics, not closed shape arithmetic — so none can be proved from shape data alone.
The Lean statement
def Gate_CD_q2 (pol : CanonPolicy 2 F) : Prop :=
PhatStarShape.CD pol = 3
def Gate_CD_q3 (pol : CanonPolicy 3 F) : Prop :=
PhatStarShape.CD pol = 48
def Gate_multOne {p : ℕ} [Fact p.Prime] {N m : ℕ} {pol : CanonPolicy p F}
(S : Presented p F 3 N m pol PhatStarShape) : Prop :=
∀ x ∈ S.event, S.mult x = 1
def Gate_eventCount {p : ℕ} [Fact p.Prime] {N m : ℕ} {pol : CanonPolicy p F}
(S : Presented p F 3 N m pol PhatStarShape) (count : ℕ) : Prop :=
Nat.card ↥S.event = count
lean/LeanUrat/MovesD/G2_gatesClassifier.lean — definition
definition The canonical tree: structural half present, semantic half absent
The boundary with the tree-assembly corpus MovesT: only the structural counting half is defined here; the cylinder law and representative independence are stated but neither used nor proved, and the semantic layer (child eligibility, verdicts) is left open.
For a coefficient box $f$ and a class $\eta$: a structural model of the canonical tree $T_{\mathrm{can}}(f)$ gives a membership relation between (possibly empty) history chains and boxes in which the empty chain belongs to every box's tree, membership of an extended chain factors through a child relation, and every member is coherent, realizable, and canonically presented. Two further properties are declared but neither used nor proved here: the cylinder law, $S(\eta,\top) = \{f : \eta \in T_{\mathrm{can}}(f)\}$ — a class's fiber is the set of boxes whose tree contains it — and representative independence, that two histories in one class present the same fiber under any jet charts. The tree's semantic layer (child eligibility, verdicts) is deliberately absent.
The Lean statement
structure TreeModel (p : ℕ) [Fact p.Prime] (F : Type*) [Field F] [Finite F]
(n N m : ℕ) (pol : CanonPolicy p F) where
mem : Option (History p F) → Box p m → Prop
child : Option (History p F) → Node p F → Box p m → Prop
root_mem : ∀ x : Box p m, mem none x
mem_single : ∀ (ν : Node p F)
(h1 : ([ν] : List (Node p F)) ≠ [] ∧
∀ (j : ℕ) (hj : j < ([ν] : List (Node p F)).length),
((([ν] : List (Node p F))[j]'hj).species = ReadSpecies.root ↔ j = 0))
(x : Box p m),
mem (some ⟨[ν], h1.1, h1.2⟩) x ↔ child none ν x
mem_snoc : ∀ (H : History p F) (ν : Node p F) (hν : ν.species ≠ ReadSpecies.root)
(x : Box p m),
mem (some (H.snoc ν hν)) x ↔ (mem (some H) x ∧ child (some H) ν x)
mem_realizable : ∀ (H : History p F) (x : Box p m), mem (some H) x →
HistoryCoherent H ∧ Realizable H ∧ pol.IsCanonPres H
def D4R_CYL {n N m : ℕ} {pol : CanonPolicy p F} {P : Shape n}
(S : Presented p F n N m pol P) (T : TreeModel p F n N m pol) : Prop :=
∀ (i : PrefIdx n pol P) (x : Box p m), x ∈ S.fiber i ↔ T.mem (some (reprOf i)) x
def ClassFiberWelldef (p : ℕ) [Fact p.Prime] (F : Type*) [Field F] [Finite F]
(n N m : ℕ) (pol : CanonPolicy p F) (P : Shape n) : Prop :=
∀ (H H' : History p F), H ∈ PrefSet n pol P → H' ∈ PrefSet n pol P →
etaData (P : ShapePrefix) H = etaData (P : ShapePrefix) H' →
∀ (J : JetSetup H n N m) (J' : JetSetup H' n N m),
J.SHZ (topLocus p m) = J'.SHZ (topLocus p m)
lean/LeanUrat/MovesD/Defs.lean — structure
5 Transfer-matrix assembly
Densities assemble by a first-split recursion: condition on the root of the classifier tree, and each child poses the same counting problem at smaller degree with pattern-indexed weights. The depth-by-depth mass vector obeys a fixed linear recursion — a transfer operator with rational-function entries — proved as the abstract counting law and verified exactly at degree 3 through depth 2 against brute-force counts. Six named unproved statements remain in this corpus, each with a written record.
The branch tree and transfer recursion (MovesT) 3 definition · 3 open · 9 proved · 5 conditional
Every decided polynomial grows exactly one verdict tree; conditional on the assumed per-site pricing and sibling laws, its fiber weighs an exact power of p
A $p$-adic polynomial gives up its factorization gradually, branch by branch, and MovesT distills each complete discovery into a finite verdict tree, proving unconditionally that every decided polynomial grows exactly one such tree. The payoff is pricing — the polynomials growing a fixed tree form a set of mass an exact power of $p$, charging each site once (the root split, each unbranched segment, each branch point) — but it is conditional throughout: the per-site laws enter as assumed data, one clause of the root split is open (to be discharged by the HC2 corpus), and the dictionary theorem trading per-tree masses back for the per-class masses of the density tables needs further named class-system hypotheses. Everything is exported as one bundle of named propositions recording what is proved and what is open, and the countermodels stay in plain view: sibling independence is extra content (not derivable from the cell data), and two toy obligations are false at their fixed tables.
Builds on: MovesD, MovesC, Moves, MovesS, MovesSp, HC2
definition A verdict tree records how one factorization is discovered
Densities are assembled tree by tree, so every counting theorem in this corpus quantifies over these objects.
For a prime $p$ and a finite residue field $F$, a verdict tree is a finite set of nonempty branch histories — chains of factorization-discovery reads — closed under nonempty prefixes, dressed with three decorations: a multiset of root verdicts, each a pair $(e,f)$ of ramification index $e$ and residue degree $f$, here a singleton $\{(e,f)\}=\{(1,g)\}$ recording an unramified (Hensel) factor of residue degree $g\ge 1$; a verdict on exactly the maximal chains, the leaves; and a marking of some leaves as non-split. It is the complete combinatorial record of how one $p$-adic polynomial's factorization is discovered, one chain per branch.
The Lean statement
structure VTree (p : ℕ) [Fact p.Prime] (F : Type*) [Field F] [Finite F] where
chains : Set (History p F)
hfin : chains.Finite
hne_nodes : ∀ H ∈ chains, H.nodes ≠ []
hclosed : ∀ H ∈ chains, ∀ H' : History p F,
H'.IsPrefixOf H → H'.nodes ≠ [] → H' ∈ chains
henV : Multiset Vd
hhen : ∀ v ∈ henV, ∃ g : ℕ, 1 ≤ g ∧ v.1 = {(1, g)}
leafV : History p F → Option Vd
hleaf : ∀ H, (leafV H).isSome ↔ (H ∈ chains ∧ IsMaximalIn chains H)
nsLeaf : History p F → Prop
hns_leaf : ∀ H, nsLeaf H → H ∈ chains ∧ IsMaximalIn chains H
lean/LeanUrat/MovesT/Defs.lean — structure
definition Which polynomials grow a given tree
Its six clauses are the graph-equality form of “the canonical tree of $x$ is $\mathrm{Tr}$”, and the uniqueness and mass theorems take them apart one at a time.
Fix a prime $p$, degree $n\ge 2$, a counting model $T$, a verdict tree $\mathrm{Tr}$, a chart $\chi$ placing the $n$ coefficients inside an $m$-coordinate digit box over $\mathbb{Z}/p$ ($m\ge 1$), and a digit vector $x$ in that box. The tree $\mathrm{Tr}$ fibers $x$ when six clauses hold: the chains of $\mathrm{Tr}$ are exactly the nonempty branch histories realized at $x$, pruned at the first halt; each leaf carries the right verdict — its branch halted with an irreducible factor, or it is a marked non-split halt; the root payload equals the unramified part read from $x$; no non-leaf has halted; the products $e\cdot f$ over all verdict entries $(e,f)$ (ramification index times residue degree) sum to $n$; and the root branches match the repeated irreducible factors of $x$ mod $p$, degree for degree. Say $x$ is decided when some verdict tree fibers it; the fiber $\{x : \mathrm{Tr}\text{ fibers }x\}$ is the set whose mass every pricing theorem below computes.
The Lean statement
def VTree.fiberAt (Tr : VTree p F) (T : TreeModel p F n N m pol)
(χ : Fin n → Fin m) (x : Box p m) : Prop :=
(∀ H : History p F, H ∈ Tr.chains ↔ (H.nodes ≠ [] ∧ PrunedMem T H x)) ∧
(∀ H ∈ Tr.chains, IsMaximalIn Tr.chains H →
((IrrHalts H ∧ ¬ Tr.nsLeaf H ∧ Tr.leafV H = some (irrVerdictOf H)) ∨
(NsHalts T (some H) x ∧ ¬ IrrHalts H ∧ Tr.nsLeaf H ∧
Tr.leafV H = some (nsVerdictOf H)))) ∧
Tr.henV = henPayload χ x ∧
(∀ H ∈ Tr.chains, ¬ IsMaximalIn Tr.chains H →
¬ IrrHalts H ∧ ¬ NsHalts T (some H) x) ∧
((Tr.typemult.map fun ef => ef.1 * ef.2).sum = n) ∧
(Tr.heads.val.map Tr.trackDeg
= ((UniqueFactorizationMonoid.normalizedFactors (redPoly χ x)).toFinset.filter
(fun ψ => 2 ≤ Multiset.count ψ
(UniqueFactorizationMonoid.normalizedFactors (redPoly χ x)))).val.map
(fun ψ => Multiset.count ψ
(UniqueFactorizationMonoid.normalizedFactors (redPoly χ x))
* ψ.natDegree))
def Decided (T : TreeModel p F n N m pol) (χ : Fin n → Fin m) (x : Box p m) : Prop :=
∃ Tr : VTree p F, Tr.fiberAt T χ x
lean/LeanUrat/MovesT/Defs.lean — definition
proved Every decided polynomial grows exactly one tree
This makes every tree-indexed sum well-posed; the class-tree partition and the dictionary sum both rest on it.
For a prime $p$, degree $n\ge 2$, a counting model $T$ with chart $\chi$, and a digit vector $x$: if $x$ is decided — some finite verdict tree fibers it — then the tree fibering $x$ is unique up to extensional equality: same chains, same root payload, same leaf verdicts and non-split marks. So $x \mapsto$ its canonical tree is a well-defined map on the decided set, obtained with no choice principle beyond the deciding witness and no counting hypotheses at all.
The Lean statement
theorem oneF (T : TreeModel p F n N m pol) (χ : Fin n → Fin m) (x : Box p m)
(hx : Decided T χ x) :
∃ Tr : VTree p F, Tr.fiberAt T χ x ∧
∀ Tr' : VTree p F, Tr'.fiberAt T χ x → VTree.ext Tr Tr'
lean/LeanUrat/MovesT/F1_oneF.lean — theorem
proved Distinct trees have disjoint fibers
Uniqueness is read off the fiber clauses alone, which is why the one-tree theorem needs no choice principle and no counting.
For a prime $p$, a counting model $T$ with chart $\chi$, and a digit vector $x$: if two verdict trees $\mathrm{Tr},\mathrm{Tr}'$ fiber $x$, they agree extensionally — equal chain sets, equal root payloads, and equal leaf verdicts and non-split marks on every chain. Fibers of extensionally distinct trees are therefore disjoint, and the tree fibers partition the decided set.
The Lean statement
theorem tree_fiber_disjoint (Tr Tr' : VTree p F) (T : TreeModel p F n N m pol)
(χ : Fin n → Fin m) (x : Box p m)
(h : Tr.fiberAt T χ x) (h' : Tr'.fiberAt T χ x) :
Tr.chains = Tr'.chains ∧ Tr.henV = Tr'.henV ∧
∀ H ∈ Tr.chains, Tr.leafV H = Tr'.leafV H ∧ (Tr.nsLeaf H ↔ Tr'.nsLeaf H)
lean/LeanUrat/MovesT/E9_fiberDisjoint.lean — theorem
proved Crossing one site divides the mass by an exact power of p
The one-step engine of the whole pricing recursion; every application must first build the per-site data bundle, whose per-site laws are assumed data for the classifier corpora to discharge.
For a prime $p$, a counting model $T$, a verdict tree $\mathrm{Tr}$, and a chain $H\in\mathrm{Tr}$ whose site data — entrance event, state event, fresh coordinates, site exponent $e_H$ — is recorded in the per-site data bundle: for every event $E$ that is a spectator of the fresh coordinates (membership in $E$ never depends on them), $$\#(\text{state}\cap E)\cdot p^{e_H} = \#(\text{entrance}\cap E).$$ Crossing the site divides the conditional mass by exactly $p^{e_H}$, uniformly in $E$ — and that uniformity is what lets the tree recursion condition on everything decided elsewhere in the tree.
The Lean statement
theorem fiber_seg_step (T : TreeModel p F n N m pol)
(CA : CellData p F n N m pol T) (Tr : VTree p F) (χ : Fin n → Fin m)
(L : SiteLedger Tr T CA χ) (H : History p F) (hH : H ∈ Tr.chains)
(E : Set (Box p m)) (hspec : SpectatorFor (L.freshCoords H) E) :
Nat.card ↥(stateEvent T (some H) ∩ E) * p ^ L.siteExp H
= Nat.card ↥(entEvent T χ (L.parentSt H) ∩ E)
lean/LeanUrat/MovesT/E6_segStep.lean — theorem
proved The multi-branch pricing law already follows from the per-site data bundle
It locates the strength of the multi-branch pricing hypothesis: not beside the per-site data bundle but inside it.
For a prime $p$: at a site where the tree splits into $j\ge 2$ branches with side exponents $e_1,\dots,e_j$, any per-site data bundle satisfying its own stated laws — the exact per-site cell tie, freshness, spectator, and side-exponent laws — already forces the multi-branch pricing law $$\#(\text{site cell event})\cdot p^{\sum_j e_j} = \#(\text{entrance event})$$ at that site. The pricing hypothesis the tree-mass theorems carry explicitly is thus no assumption beyond that bundle: its content sits inside the still-open discharge of the bundle's own laws.
The Lean statement
theorem presents_imply_jcMultiAt (T : TreeModel p F n N m pol)
(CA : CellData p F n N m pol T) (Tr : VTree p F) (χ : Fin n → Fin m)
(L : SiteLedger Tr T CA χ) (H : History p F) (hH : H ∈ Tr.chains)
(h2 : 2 ≤ L.sides H) :
JCmultiAt T CA χ (L.parentSt H) H.lastNode (L.splitAt H hH h2)
lean/LeanUrat/MovesT/E6_segStep.lean — theorem
open The fiber factors along the root's tracks
Everything except the hD4R0K clause is proved — roster completeness follows from (U) and (R) — and this one admission is what every downstream mass theorem inherits.
For a prime $p$ and a verdict tree $\mathrm{Tr}$ over a counting model $T$ with chart $\chi$: suppose $\mathrm{Tr}$ is realizable and its fiber lies in the root cell $R_g=\{x : \bar f_x = g\}$ — digit vectors $x$ whose reduction $\bar f_x$ mod $p$ is $g$ — with the chains of $\mathrm{Tr}$ sorted into $t$ tracks, one per repeated factor of $g$. Writing $E_i$ for the event that track $i$'s subtree is realized as specified, and with $n$ the number of coefficients and $p^m$ the size of the digit box, $$\#\{x:\mathrm{Tr}\text{ fibers }x\}\cdot(\#R_g)^t\cdot p^n = p^m\cdot\prod_{i=1}^{t}\#(R_g\cap E_i):$$ conditionally on the root cell the $t$ track events are independent, and the fiber's mass is the product of the per-track masses.
Hypotheses this rests on: hD4R0K (a single unproved goal, isolated inside the proof, to be discharged by the HC2 corpus): (U) two realized root children at one root-cell point sharing a track coincide, and (R) a realized root child's track is a repeated (multiplicity ≥ 2) factor of the point's reduction; plus the explicit hypotheses hsib (the sibling count law), a full cell assignment with child covering, and the root/reduction cell laws.
The Lean statement
theorem fiber_root_split (Tr : VTree p F) (T : TreeModel p F n N m pol)
(χ : Fin n → Fin m) (trackOf : Node p F → Polynomial (ZMod p))
(CA : CellAssign p F n N m pol T χ trackOf)
(hχ : Function.Injective χ) (hrc : RootCellsOf T CA.toCellData χ)
(hred : RedCellPartition T CA.toCellData χ trackOf)
(hsib : SibCount T CA.toCellData χ) (hreal : Realizes T χ Tr)
(g : Fin n → ZMod p) (htracks : RootSplitData Tr g)
(hcr : ∀ i, ChildRoot none (htracks.headOf i))
(hfib : ∀ x, Tr.fiberAt T χ x → x ∈ rootCell χ g) :
Nat.card ↥{x | Tr.fiberAt T χ x}
* (Nat.card ↥(rootCell χ g)) ^ htracks.t * p ^ n
= p ^ m * ∏ i : Fin htracks.t,
Nat.card ↥(rootCell χ g ∩ trackEvent Tr T htracks i (hcr i))
-- the single fenced admission inside the proof (the corpus's one assembly sorry):
have hD4R0K :
(∀ y ∈ rootCell χ g, ∀ ν ν' : Node p F, T.child none ν y →
T.child none ν' y → trackOf ν = trackOf ν' → ν = ν') ∧
(∀ y ∈ rootCell χ g, ∀ ν : Node p F, T.child none ν y →
2 ≤ Multiset.count (trackOf ν)
(UniqueFactorizationMonoid.normalizedFactors (redPoly χ y))) := by
sorry
lean/LeanUrat/MovesT/E5_rootSplit.lean — theorem
conditional A tree's fiber weighs an exact power of p, site by site
The central pricing theorem, built from the root clause and the per-site recursion; a naive keying of sites collapses distinct sibling reads (refuted by a countermodel), forcing the refined per-site keying used here.
For a prime $p$ and a verdict tree $\mathrm{Tr}$ over a counting model $T$ with chart $\chi$: the number of digit vectors growing $\mathrm{Tr}$, times $p$ raised to $n$ plus the sum of the site exponents $e_H$ over all sites $H$ of the tree, equals the size $p^m$ of the digit box ($n$ = the number of coefficients, $m$ = the number of digit coordinates): $$\#\{x:\mathrm{Tr}\text{ fibers }x\}\cdot p^{\,n+\sum_H e_H} = p^m.$$ Equivalently the fiber has mass exactly $p^{-(n+\sum_H e_H)}$, every site charged exactly once, the root included — the mass of a factorization type is read straight off its tree. This is the law TREE-EXP.
Hypotheses this rests on: hD4R0K (inherited via the root clause — the corpus's single unproved admission); hjcm — the multi-branch pricing law at every multi-side site (its content is derivable from the ledger's stated faces — see the ledger lemma above); hsib and hsibT — the global and per-site sibling-independence counting laws (genuinely extra content: refuted at the bare cell-data layer by the compiled countermodel); L and sc — a site ledger and tree scaffold whose law fields (the exact per-site cell tie among them) are assumed data, to be discharged by the HC2 corpus.
The Lean statement
theorem treeExp (Tr : VTree p F) (T : TreeModel p F n N m pol)
(χ : Fin n → Fin m) (trackOf : Node p F → Polynomial (ZMod p))
(CA : CellAssign p F n N m pol T χ trackOf)
(hχ : Function.Injective χ) (hrc : RootCellsOf T CA.toCellData χ)
(hred : RedCellPartition T CA.toCellData χ trackOf)
(hsib : SibCount T CA.toCellData χ) (hreal : Realizes T χ Tr)
(L : SiteLedger Tr T CA.toCellData χ)
(sc : TreeScaffold Tr T CA.toCellData χ L trackOf)
(hjcm : ∀ H (hH : H ∈ multiSites Tr T CA.toCellData χ L) (h2 : 2 ≤ L.sides H),
JCmultiAt T CA.toCellData χ (L.parentSt H) H.lastNode (L.splitAt H hH.1 h2))
(hsibT : ∀ H (hH : H ∈ Tr.chains),
2 ≤ (CA.toCellData.branchSetOf (L.cellAt H)).card →
SibCountAt T CA.toCellData χ (L.parentSt H) H.lastNode (L.cellAt H)
(sc.splitFrame H hH).S)
(hdet : ∀ H ∈ Tr.chains, ¬ Tr.nsLeaf H) :
Nat.card ↥{x | Tr.fiberAt T χ x}
* p ^ (n + ∑ H ∈ Tr.hfin.toFinset, L.siteExp H)
= p ^ m
lean/LeanUrat/MovesT/E8_treeExp.lean — theorem
conditional The mass identity at working precision
This identity feeds the density value at each finite level; what happens across levels is the separate open statement in the next card.
For a prime $p$, degree $n\ge 2$, level $N\ge 1$, and a verdict tree $\mathrm{Tr}$: at the working level $m = nN$ — $N$ digits for each of the $n$ coefficients — the mass law reads $$\#\{x:\mathrm{Tr}\text{ fibers }x\}\cdot p^{A(\mathrm{Tr})} = p^{nN},\qquad A(\mathrm{Tr}) := n+\sum_H e_H,$$ with $e_H$ the site exponent at site $H$: at level $N$ the factorization type of $\mathrm{Tr}$ has density exactly $p^{-A(\mathrm{Tr})}$. The identity carries no threshold on $N$.
Hypotheses this rests on: Identical to TREE-EXP (this is TREE-EXP specialized to m = n·N): the inherited hD4R0K admission, the hjcm multi-branch pricing law, the hsib/hsibT sibling counting laws, plus the assumed site-ledger and scaffold law fields, to be discharged by the HC2 corpus.
The Lean statement
theorem treeN (Tr : VTree p F) (T : TreeModel p F n N (n * N) pol)
(χ : Fin n → Fin (n * N)) (trackOf : Node p F → Polynomial (ZMod p))
(CA : CellAssign p F n N (n * N) pol T χ trackOf)
(hχ : Function.Injective χ) (hrc : RootCellsOf T CA.toCellData χ)
(hred : RedCellPartition T CA.toCellData χ trackOf)
(hreal : Realizes T χ Tr)
(hdet : ∀ H ∈ Tr.chains, ¬ Tr.nsLeaf H)
(hsib : SibCount T CA.toCellData χ)
(L : SiteLedger Tr T CA.toCellData χ)
(sc : TreeScaffold Tr T CA.toCellData χ L trackOf)
(hjcm : ∀ H (hH : H ∈ multiSites Tr T CA.toCellData χ L) (h2 : 2 ≤ L.sides H),
JCmultiAt T CA.toCellData χ (L.parentSt H) H.lastNode (L.splitAt H hH.1 h2))
(hsibT : ∀ H (hH : H ∈ Tr.chains),
2 ≤ (CA.toCellData.branchSetOf (L.cellAt H)).card →
SibCountAt T CA.toCellData χ (L.parentSt H) H.lastNode (L.cellAt H)
(sc.splitFrame H hH).S) :
Nat.card ↥{x : Box p (n * N) | Tr.fiberAt T χ x} * p ^ AofTr Tr L
= p ^ (n * N)
lean/LeanUrat/MovesT/E11_treeN.lean — theorem
open Stability of the fiber up the precision tower
The mass identity alone says nothing across levels, so this statement is exported separately; nothing downstream depends on its proof.
For a prime $p$, degree $n\ge 2$, and a verdict tree $\mathrm{Tr}$: run the counting models in a tower indexed by the precision level $N$. For every $N$ above the tree's threshold and every working level $N' \ge N$, whether a digit vector $x$ lies in the fiber of $\mathrm{Tr}$ depends only on the first $nN$ digit coordinates of $x$ (the $N$-digit truncation of each of the $n$ coefficients) — so the fiber is an exact union of level-$N$ residue classes and the level-$N$ mass identity persists up the tower. Stated in full; not yet proved.
Hypotheses this rests on: An unproved goal, to be discharged by the HC2 corpus: the discharge needs exact level-N realization, cap-cylinder, and joint-cell-level laws that are open content of that corpus; the list of premises is itself part of the disclosed open content.
The Lean statement
def TreeNStable {N₀ : ℕ}
(Tat : ∀ N', N₀ ≤ N' → TreeModel p F n N' (n * N') pol)
(χat : ∀ N', Fin n → Fin (n * N')) (Tr : VTree p F) : Prop :=
∀ N : ℕ, Tr.thr n ≤ N →
∀ (N' : ℕ) (h' : N₀ ≤ N'), N ≤ N' →
∀ x x' : Box p (n * N'),
(∀ c : Fin (n * N'), (c : ℕ) < n * N → x c = x' c) →
(Tr.fiberAt (Tat N' h') (χat N') x ↔ Tr.fiberAt (Tat N' h') (χat N') x')
theorem treeN_stable (pol : CanonPolicy p F) {N₀ : ℕ}
(Tat : ∀ N', N₀ ≤ N' → TreeModel p F n N' (n * N') pol)
(χat : ∀ N', Fin n → Fin (n * N'))
(trackOf : Node p F → Polynomial (ZMod p))
(hcov : KBTotTower pol Tat χat trackOf)
(Tr : VTree p F)
(hdet : ∀ H ∈ Tr.chains, ¬ Tr.nsLeaf H)
(hreal : ∀ N' (h' : N₀ ≤ N'), Realizes (Tat N' h') (χat N') Tr) :
TreeNStable Tat χat Tr
lean/LeanUrat/MovesT/E11_treeN.lean — theorem
conditional Class masses are chain-weighted sums of tree masses
Deliberately stated on the decided set: that the undecided set has mass zero is a separate conditional claim, not smuggled in here.
For a prime $p$ and a branch shape $\hat P$: let $\eta$ run over the enumerated branch classes of shape $\hat P$. On the decided set, $$\sum_{\eta}\#\{x \in \mathrm{fiber}(\eta) : \eta\text{ pre-halts},\ x\text{ decided}\} \;=\; \sum_{T\in\mathcal T} c_{\hat P}(T)\,\#\{x : T\text{ fibers }x\},$$ where $\eta$ pre-halts when no proper prefix of its representative has halted, $\mathcal T$ is a finite menu of trees partitioning the decided set, and $c_{\hat P}(T)$ counts the chains of tree $T$ with shape $\hat P$. The per-class masses of the density tables are thus chain-count-weighted sums of per-tree masses.
Hypotheses this rests on: hcyl — each enumerated class is the cylinder of its representative (proved on paper; the Lean proof belongs to the tree/presentation corpus); hph — pre-halting is class data (to be discharged by HC2); hwd/heta/hib — class-fiber well-definedness, locality, and box laws; hsep — same-class chains on a menu tree coincide; hpart — the finite tree menu partitions the decided set.
The Lean statement
theorem preHalt_dict_sum {P : Shape n} (S : Presented p F n N m pol P)
(T : TreeModel p F n N m pol) (χ : Fin n → Fin m)
(hcyl : D4R_CYL S T) (hwd : ClassFiberWelldef p F n N m pol P)
(heta : EtaLoc T P) (hib : InBoxOfMem T n)
(hph : PreHaltClassData (P := P) pol)
(𝒯 : Finset (VTree p F))
(hsep : ∀ Tr ∈ 𝒯, ∀ H H', H ∈ VTree.chains Tr → H' ∈ VTree.chains Tr →
H ∈ PrefSet n pol P → H' ∈ PrefSet n pol P →
(∃ i : PrefIdx n pol P, SameClass i H ∧ SameClass i H') → H = H')
(hpart : PartitionsDecided 𝒯 T χ) :
∑ᶠ i : PrefIdx n pol P,
Nat.card ↥{x | x ∈ S.fiber i ∧ PreHalt (reprOf i) ∧ Decided T χ x}
= ∑ Tr ∈ 𝒯, Tr.chainCount n P * Nat.card ↥{x | Tr.fiberAt T χ x}
lean/LeanUrat/MovesT/F3_dictSum.lean — theorem
proved A chain survives pruning iff no ancestor has halted
The bridge between the model-relative pruned tree and the purely syntactic pre-halt predicate; every trade of chains against enumerated classes routes through it.
For a prime $p$, a counting model $T$, a nonempty branch history $H$, and a digit vector $x$ at which $H$ is realized: $H$ survives pruning at $x$ if and only if no proper nonempty prefix of $H$ has halted — the chains of the canonical tree are exactly the realized histories all of whose ancestors are still running. Pruning, a priori model-relative, is a purely combinatorial condition on the history.
The Lean statement
theorem preHalt_prunedMem (T : TreeModel p F n N m pol) (H : History p F)
(hne : H.nodes ≠ []) (x : Box p m) (hmem : T.mem (some H) x) :
PrunedMem T H x ↔ PreHalt H
lean/LeanUrat/MovesT/F0_preHalt.lean — lemma
proved Which digits matter depends only on the shape
The threshold hypothesis is needed: below the Newton-band bound the identity fails, witnessed by a countermodel.
For a prime $p$ and level $N\ge 1$: fix a branch class with representative $\eta$ of shape $\hat P$, and a jet presenting it at level $N$ at least the Newton-band threshold of $\hat P$. Then the set of digit levels the transported system reads equals the band grid computed from $\hat P$ alone: which digits matter is shape data, not class data, so per-class read thresholds are computable from shapes.
The Lean statement
theorem np_id {P : Shape n} (i : PrefIdx n pol P)
(hNP : (P : ShapePrefix).NPband n ≤ N)
(J : JetSetup (reprOf i) n N m) :
transportedLevels J (topLocus p m) = bandLevels (P : ShapePrefix) n
lean/LeanUrat/MovesT/D7_npid.lean — theorem
conditional Every canonical tree is realized inside the class enumeration
The rep-normalization premise is necessary, not decorative: a realized chain differing from its class representative breaks the graph equality (a countermodel witnesses this).
For a prime $p$, a counting model $T$ with chart $\chi$, and a digit vector $x$: if $x$ is decided, some class-labelled tree — a finite prefix-closed set of addresses in the countable enumeration of shapes and classes — has its associated verdict tree fibering $x$. The canonical tree of every decided polynomial therefore lives inside the class enumeration, turning the sum over trees into a sum over an enumerable index set.
Hypotheses this rests on: Five class-system laws supplied by the presentation corpus (HC-2): hrep — representative choice is coherent under class prefixes; hri — representatives are injective keys; hpr — a representative's prefixes are representatives; hcov — every realized chain is classified; hnorm — realized chains ARE their canonical representatives (rep-normalization).
The Lean statement
theorem fibOf_partition (hrep : PrefixCoherentRepr n pol)
(hri : ReprInj n pol) (hpr : RepPrefixClosed n pol)
(T : TreeModel p F n N m pol)
(hcov : ClassCover T) (hnorm : RepNorm T)
(χ : Fin n → Fin m) (x : Box p m)
(hx : Decided T χ x) :
∃ (ct : ClassTree n (F := F) pol) (hreg : LeafReg ct),
(fibOf hrep hri hpr ct hreg).fiberAt T χ x
lean/LeanUrat/MovesT/D11_fibOf.lean — theorem
proved A countermodel: sibling independence is not free
This countermodel is why every mass theorem above carries sibling independence as an explicit hypothesis: the law can be assumed and later discharged by the classifier corpora, never derived here.
There is a two-branch counting model over the prime $p=2$, with an explicit finite cell table, in which the global sibling-independence counting law fails: at a cell whose event is the full $4$-point box, two branches share the continuation event $\{x_0=1\}$ (first digit coordinate equal to $1$) of size $2$, and the law would force $2\cdot 4 = 2\cdot 2$. Sibling independence is therefore not a theorem of the bare cell-data hypotheses — it is extra content, carried as an explicit hypothesis wherever it is used.
The Lean statement
theorem sib_falsifier : ∃ (T : TreeModel 2 (ZMod 2) 2 1 2 polTriv)
(CA : CellData 2 (ZMod 2) 2 1 2 polTriv T), ¬ SibCount T CA toyχ2
lean/LeanUrat/MovesT/S2_sibFalse.lean — countermodel
conditional The one-tree theorem on a fully specified toy instance
A fixed one-tree menu fails: off the all-zero stratum the deciding witness is the empty-chains tree, not the menu tree.
In a fully specified toy instance — $p=2$, quadratics, a $9$-coordinate digit box with explicit node and cell tables — every decided digit vector has exactly one verdict tree up to extensional equality: the one-tree-per-polynomial statement, instantiated at toy scale.
Hypotheses this rests on: Rides on the axiom footprint of the toy carrier's single admitted realizability field (next card); none of this unit's own reasoning is admitted.
The Lean statement
theorem toy_oneF : ∀ x, ToyDecided x →
∃ Tr : VTree 2 (ZMod 2), toyFiber Tr x ∧
∀ Tr' : VTree 2 (ZMod 2), toyFiber Tr' x → VTree.ext Tr Tr'
lean/LeanUrat/MovesT/G2_toyOneF.lean — theorem
open The toy model's realizability obligation is false at its tables
False at the tables (a countermodel), not merely unproved; the twin toy carrier carries the same false obligation.
In the fixed toy model (prime $p=2$, quadratics), the TreeModel structure requires a proof that every branch history it realizes is coherent, realizable, and canonically presented. This field is admitted without proof, and it is false at the fixed tables: the toy's head transition has $e\cdot g = 1$ (ramification index $e$ times residue degree $g$), and a degree argument shows a coherent transition child at $e\cdot g = 1$ would force the leaf stage's key polynomial to have degree both equal to and strictly greater than the base's — for every choice of leaf stage. No re-specification of the leaf stage can discharge it; only revising the toy tables can.
Hypotheses this rests on: An admitted unproved obligation, shown false at the fixed toy tables (2026-07-30 record): discharge requires revising the tables at the blueprint level, a decision reserved for the project lead.
The Lean statement
-- interface field (MovesD/Defs.lean, structure TreeModel):
mem_realizable : ∀ (H : History p F) (x : Box p m), mem (some H) x →
HistoryCoherent H ∧ Realizable H ∧ pol.IsCanonPres H
-- admitted at the pinned toy carrier (G1_toyGate.lean):
noncomputable def toyModel : TreeModel 2 (ZMod 2) 2 3 9 polTriv where
...
mem_realizable := by sorry
lean/LeanUrat/MovesT/G1_toyGate.lean — countermodel
proved Exact prices with growing exponents force density zero
Only the analysis leg; its two companion legs — pricing and growth — are stated as open, so this alone does not force non-split density to zero.
For a prime $p$: if a sequence of cap masses $\mu_{\mathrm{cap}}(M)$ (indexed by $M\in\mathbb{N}$) prices as exact reciprocal powers $\mu_{\mathrm{cap}}(M) = p^{-Z(M)}$ with exponents $Z(M)\in\mathbb{N}$, the exponents grow $Z(M)\to\infty$, and $\mu_{\mathrm{cap}}(M)\to\mu_{\mathrm{class}}$, then $\mu_{\mathrm{class}} = 0$. This is the analysis leg of a three-way split showing that non-split halting classes contribute density zero; the pricing and growth legs are open, to come from the classifier corpora.
The Lean statement
theorem nsNull_of_pricing_growth (μcap : ℕ → ℝ) (μclass : ℝ) (Z : ℕ → ℕ)
(hprice : ∀ M : ℕ, μcap M = ((p : ℝ) ^ (Z M : ℕ))⁻¹)
(hgrow : Filter.Tendsto Z Filter.atTop Filter.atTop)
(hcont : Filter.Tendsto μcap Filter.atTop (nhds μclass)) :
μclass = 0
lean/LeanUrat/MovesT/Defs.lean — theorem
proved A non-split leaf traps the whole fiber in a null class
An inclusion, not a count: the stronger counting form is false (refuted by a countermodel); only this inclusion feeds the vanishing argument.
For a prime $p$, a counting model $T$ with chart $\chi$, and a verdict tree $\mathrm{Tr}$: if $H$ is a marked non-split leaf of $\mathrm{Tr}$, then the fiber of $\mathrm{Tr}$ is contained in the non-split halting class of $H$. Once non-split classes are known to carry density zero, trees with such a leaf contribute nothing to the density.
The Lean statement
theorem ns_tree_bound (Tr : VTree p F) (T : TreeModel p F n N m pol)
(χ : Fin n → Fin m) (H : History p F) (hns : H ∈ Tr.chains ∧ Tr.nsLeaf H) :
{x | Tr.fiberAt T χ x} ⊆ nsClass T H
lean/LeanUrat/MovesT/C8_nsTreeBound.lean — lemma
definition The package this corpus exports to the density assembly
The single node other corpora import; its tree-count leg pairs the proved finite-level mass identity with the open cross-level stability, so the package claims no more than is proved.
A single named bundle collects, as propositions, everything the density assembly uses from this corpus: the finite-level tree mass law, the non-split vanishing statement, the tree-count law — carrying both the finite-level mass identity, which is proved, and the cross-level stability, which is open, so the bundle never claims more than is proved — one tree per polynomial, the sibling law, the cap laws, and the tower-keyed verdict-model premise, all instantiated at this corpus's values. “The package holds” is, by definition, the conjunction of its thirteen legs.
The Lean statement
structure RS1GivenPackage where
tree_exp_fin : Prop
tree_exp_ns : Prop
tree_n : Prop
one_f : Prop
sib : Prop
tb_cap : Prop
vp : Prop
pci : Prop
rel2_a : Prop
rel2_b : Prop
rel2_c : Prop
rel2_d : Prop
rel2_e : Prop
def rs1GivenOfMovesT (T : TreeModel p F n N m pol)
(χ : Fin n → Fin m) (trackOf : Node p F → Polynomial (ZMod p))
(CA : CellAssign p F n N m pol T χ trackOf)
{N₀ : ℕ} (Tat : ∀ N', N₀ ≤ N' → TreeModel p F n N' (n * N') pol)
(χat : ∀ N', Fin n → Fin (n * N'))
(CAat : ∀ N' h,
CellAssign p F n N' (n * N') pol (Tat N' h) (χat N') trackOf)
(rel2_a rel2_b rel2_c rel2_d rel2_e : Prop) : RS1GivenPackage :=
{ tree_exp_fin := TreeExpFin T χ trackOf CA,
tree_exp_ns := TreeExpNs (n := n) pol,
tree_n := TreeNStmt (n := n) pol ∧ TreeNStableStmt (n := n) pol,
one_f := OneFStmt T χ,
sib := SibCount T CA.toCellData χ,
tb_cap := TBCapPinned (n := n) pol m ∧ NsAmendedPair (n := n) pol,
vp := VPPinned pol Tat χat trackOf CAat,
pci := PCI T CA.toCellData χ,
rel2_a := rel2_a, rel2_b := rel2_b, rel2_c := rel2_c,
rel2_d := rel2_d, rel2_e := rel2_e }
def RS1GivenHolds (Pi' : RS1GivenPackage) : Prop :=
Pi'.tree_exp_fin ∧ Pi'.tree_exp_ns ∧ Pi'.tree_n ∧ Pi'.one_f ∧ Pi'.sib ∧
Pi'.tb_cap ∧ Pi'.vp ∧ Pi'.pci ∧
Pi'.rel2_a ∧ Pi'.rel2_b ∧ Pi'.rel2_c ∧ Pi'.rel2_d ∧ Pi'.rel2_e
lean/LeanUrat/MovesT/D12_packages.lean — definition
6 Tables and the resummation solve
The per-pattern weights are tabulated as rational functions of q, and summing the transfer recursion over all depths is a Neumann series: the candidate densities solve a finite linear system with denominators dividing an explicit determinant, verified nonzero at the evaluation points used. The degree-3 solve was re-derived bottom-up inside the development and matches the independently recorded tables exactly (all 65 decided integer values at both test primes; candidate functions sum to 1 identically). Four named unproved statements remain in the value-layer corpus.
The rational-function solve (MovesS) 9 definition · 9 proved · 2 conditional
One matrix inversion resums infinite depth: a rational function per factorization type, summing to 1
The layer where the infinite recursion becomes finite linear algebra: the factorization process branches without bound, but its one-step masses fill a finite transfer matrix K over the field Q(q) of rational functions in the residue-field size q, and inverting 1 − K resums all depths at once. A finite convolution over the shallow openings of the process then assembles one fixed rational function R_σ per factorization type, and since two rational functions agreeing at infinitely many primes are equal, the interpolant is unique and the R_σ are pinned to sum to 1. These identities are machine-checked with no axioms beyond Lean's core but conditional on the hypotheses the corpus takes as input — the measured counting laws, the read-off check at wild primes, and the shallow-weight production law — which is where the counting corpora MovesT and MovesV supply their content and where the remaining conditionality lives.
definition Rational functions in q, and where they may be evaluated
Every passage from a symbolic identity to a numerical density at an actual prime goes through this partial evaluation, so a pole surviving cancellation is a hard stop — detecting that is the job of the read-off check at wildly ramified primes.
All densities live in the field $\mathbb{Q}(q)$ of rational functions in one variable $q$, a placeholder for the residue-field size. For each $q_0 \in \mathbb{Q}$, the functions $f$ whose reduced denominator is nonzero at $q_0$ form a subring, and on it $f \mapsto f(q_0)$ is a ring homomorphism. Membership is tested after cancellation: a removable singularity evaluates without complaint, while a genuine pole does not evaluate at all.
The Lean statement
abbrev Qq := RatFunc ℚ
def OKat (q₀ : ℚ) : Subring Qq where
carrier := {f : Qq | f.denom.eval q₀ ≠ 0}
-- (zero/one/add/mul/neg closure proofs omitted)
theorem mem_OKat_iff {q₀ : ℚ} {f : Qq} : f ∈ OKat q₀ ↔ f.denom.eval q₀ ≠ 0
noncomputable def evalAt (q₀ : ℚ) : OKat q₀ →+* ℚ
lean/LeanUrat/MovesS/Defs.lean — definition
definition One step of the factorization process, as finite data
Every statement in the corpus is typed over this vocabulary, and the identification of verdicts with pairs $(e,f)$ is what keys the densities to factorization types.
For a degree $n$, one step of the process is finite data: for each block size $e$, a finite set of states; an alphabet of verdicts, which are exactly the pairs $(e,f)$ of positive integers with $ef \le n$ — a finished factor of ramification index $e$ and residue degree $f$, of degree $ef$; and at each state a finite roster of outcomes, each a nonempty list of members carrying a size, a base-change factor $\delta \ge 1$, and either a verdict (that member is finished) or a new state (it continues). Writing $m$ for the number of members and $c$ for the continuing ones, every outcome falls into exactly one of three routes: terminal ($c = 0$), column move ($c \ge 1$, $m = 1$), or split ($c \ge 1$, $m \ge 2$).
The Lean statement
structure TableShape (n : ℕ) where
State : ℕ → Type
fin : ∀ e, Fintype (State e)
deq : ∀ e, DecidableEq (State e)
VType : Type
deqV : DecidableEq VType
finV : Fintype VType
vdeg : VType → ℕ+
vEquiv : VType ≃ {ef : ℕ+ × ℕ+ // ((ef.1 : ℕ) * (ef.2 : ℕ)) ≤ n}
vdeg_spec : ∀ v, (vdeg v : ℕ) = ((vEquiv v).1.1 : ℕ) * ((vEquiv v).1.2 : ℕ)
Out : ∀ e, State e → Type
finO : ∀ e (τ : State e), Fintype (Out e τ)
odata : ∀ e (τ : State e), Out e τ → Outcome VType State
Wloc : ∀ e (τ : State e), Out e τ → ℕ
Wstate : ∀ e, State e → ℕ
lean/LeanUrat/MovesS/Defs.lean — structure
definition The transfer matrix of one-step continuations
This is the matrix the block solve inverts; its entries are rational by an explicit hypothesis supplied by the counting side, never by assumption on the measured process.
For a block size $e$ with states $\tau, \beta$ and a step count $k$, the transfer matrix $K_e$ over $\mathbb{Q}(q)$ is indexed by the states of block $e$: its $(\tau,\beta)$ entry adds up the one-step masses of the column moves at $\tau$ — outcomes with a single continuing member, necessarily of size $e$ — that land in state $\beta$. The power $K_e^k$ then carries the mass still in play after $k$ steps; that every column-move member has size $e$ is a proved lemma, not a convention.
The Lean statement
abbrev KmatHyp (T : TableShape n) (e : ℕ) : Prop :=
∀ (τ : T.State e) (o : T.Out e τ), routeOf (T.odata e τ o) = .kcol →
∀ μ ∈ (T.odata e τ o).mem, μ.size = e
noncomputable def Kmat (T : TableShape n) {M : MeasuredSide T} (RB : RatBurdens T M)
(e : ℕ) (hK : KmatHyp T e) : Matrix (T.State e) (T.State e) Qq :=
fun τ β => ∑ o : T.Out e τ,
if hk : routeOf (T.odata e τ o) = .kcol then
(if kTarget T e τ o hk (hK τ o hk) = β then RB.TG e τ o else 0)
else 0
lean/LeanUrat/MovesS/Defs.lean — definition
definition One matrix inversion resums all depths
The central construction of the corpus: one inversion replaces an infinite recursion, and the capstone corpus MovesU identifies its density function with sums of these solves.
For a block size $e$, a state $\tau$, and a verdict multiset $\sigma'$: by strong recursion on the block size $e$, define $\beta_e(\tau,\sigma') = \big((1-K_e)^{-1}(b^{\mathrm{term}} + b^{\mathrm{split}})\big)_\tau$, where $b^{\mathrm{term}}$ collects the terminal outcomes emitting exactly the verdict multiset $\sigma'$, and $b^{\mathrm{split}}$ collects the split outcomes, each contributing its splitting mass times a convolution, over decompositions $\sigma' = \sum_j \sigma_j$, of the already-computed solves at the strictly smaller member sizes, each leg read at $q^{\delta}$ for its base-change factor $\delta$. Since $(1-K_e)^{-1}$ is the sum of the geometric series $\sum_k K_e^k$, one matrix inversion resums the entire infinite-depth branching recursion into a single element of $\mathbb{Q}(q)$.
The Lean statement
noncomputable def blockSolve (T : TableShape n) {M : MeasuredSide T}
(RB : RatBurdens T M) (hdc : DegCons T)
(hK : ∀ e, e ∈ Finset.Icc 1 n → KmatHyp T e) (hdet : DetHyp T RB hK) :
∀ e, e ∈ Finset.Icc 1 n → T.State e → Multiset T.VType → Qq
theorem blockSolve_eq (T : TableShape n) {M : MeasuredSide T}
(RB : RatBurdens T M) (hdc : DegCons T)
(hK : ∀ e, e ∈ Finset.Icc 1 n → KmatHyp T e) (hdet : DetHyp T RB hK)
(e : ℕ) (he : e ∈ Finset.Icc 1 n) (τ : T.State e) (σ' : Multiset T.VType) :
blockSolve T RB hdc hK hdet e he τ σ' =
((1 - Kmat T RB e (hK e he))⁻¹ *ᵥ
(bTerm T RB e σ' +
bSplit T RB hdc e he
(fun e' _ τ' σ'' =>
if he' : e' ∈ Finset.Icc 1 n then
blockSolve T RB hdc hK hdet e' he' τ' σ''
else 0) σ')) τ
lean/LeanUrat/MovesS/BlockSolve.lean — definition
definition One rational function per factorization type
This is the object of the uniformity theorem: the capstone corpus MovesU pins its density function to this definition.
For a degree $n$, a factorization type $\sigma$ is a multiset of verdicts $(e,f)$ with $\sum ef = n$. Its candidate density is the finite sum $R_\sigma(q) = \sum_{\hat S} W_{\hat S}(q) \cdot \sum_{\sigma = \sigma_0(\hat S) + \sum_i \sigma_i} \prod_i \beta_{e_i,\tau_i}(\sigma_i)(q^{\delta_i})$ over the shallow shapes $\hat S$ — the finitely many ways the process can begin — each carrying a rational weight $W_{\hat S}$, emitting the verdicts $\sigma_0(\hat S)$ outright, and handing off blocks in states $\tau_i$ whose solves are read at $q^{\delta_i}$. One fixed rational function per type, computed from the transfer-matrix solve rather than postulated.
The Lean statement
noncomputable def shConv (T : TableShape n) (M : MeasuredSide T)
(RB : RatBurdens T M) (hdc : DegCons T)
(hK : ∀ e, e ∈ Finset.Icc 1 n → KmatHyp T e) (hdet : DetHyp T RB hK)
(Ŝ : Shape T) (σ : Multiset T.VType) : Qq :=
∑ g : {g : Fin Ŝ.k → Multiset T.VType // σ = Ŝ.σ0 + ∑ i, g i},
∏ i, powSubst (Ŝ.δOf i)
(blockSolve T RB hdc hK hdet (Ŝ.eOf i) (Ŝ.eIcc i) (Ŝ.τOf i) (g.1 i))
noncomputable def Rsh (T : TableShape n) (M : MeasuredSide T)
(RB : RatBurdens T M) (hdc : DegCons T)
(hK : ∀ e, e ∈ Finset.Icc 1 n → KmatHyp T e) (hdet : DetHyp T RB hK)
(F : ShapeFam T) (WshP : Shape T → PolyGeom) (σ : Multiset T.VType) : Qq :=
∑ Ŝ ∈ F.Sh, (WshP Ŝ).val * shConv T M RB hdc hK hdet Ŝ σ
lean/LeanUrat/MovesS/RshDef.lean — definition
definition Escape: the surviving mass dies out
Invertibility of the solve's linear system is derived from this condition; discharging it at every evaluation site at general $n$ remains open.
A square matrix $A$ with rational entries escapes if its entries are nonnegative and $A^k \mathbf{1} \to 0$ as $k \to \infty$, where $\mathbf{1}$ is the all-ones vector: the mass still in play after $k$ steps tends to zero, i.e. every trajectory of the process eventually terminates. This is the analytic regularity input at each prime, doing the work of a spectral-radius-below-one bound without ever mentioning spectra.
The Lean statement
structure EscapeE0 {ι : Type*} [Fintype ι] [DecidableEq ι] (A : Matrix ι ι ℚ) :
Prop where
nonneg : ∀ i j, 0 ≤ A i j
escape : Filter.Tendsto (fun k => (A ^ k) *ᵥ (fun _ => (1 : ℚ)))
Filter.atTop (nhds 0)
lean/LeanUrat/MovesS/Defs.lean — structure
definition Everything the checksum assumes, in one structure
These fields are the hypotheses the counting corpora MovesT and MovesV must still supply at general $n$; at $n = 2$ every field is filled by proof.
For a degree $n$, with base primes $p$ and base-change exponents $\delta$: one structure lists every condition the checksum uses: the nine counting laws of the measured process; the measured subtree values with their fixed-point and height-independence laws; null-set exactness; escape at every fully active base prime and at every base-change site $p^{\delta}$ the argument uses; the read-off check at every wildly ramified site it uses; the factorization types of total degree $n$; the shallow-shape weights with their denominator regularity, interpolation, and boundedness; and the measured densities, with the identity that they total $1$ and the law tying the evaluations of $R_\sigma$ to them. Nothing rides implicitly — every input is a named field.
The Lean statement
structure RS4Chain (T : TableShape n) (M : MeasuredSide T) (RB : RatBurdens T M)
(hdc : DegCons T) (hK : ∀ e, e ∈ Finset.Icc 1 n → KmatHyp T e)
(F : ShapeFam T) where
L : LedgerIV T M
B : RS1Bundle T M RB hdc hK
hns : B.nsNull
PrimePools : Set ℚ
prime_sub : PrimePools ⊆ M.Pools
prime_base : ∀ q₀, q₀ ∈ PrimePools ↔ ∃ p : ℕ, p.Prime ∧ q₀ = (p : ℚ)
pools_e0 : ∀ e (he : e ∈ Finset.Icc 1 n), ∀ q₀ ∈ PrimePools ∩ allActivePools M,
Nonempty (PoolHyp T M RB e (hK e he) q₀)
legs_reg : ∀ p : ℕ, (p : ℚ) ∈ PrimePools → RegP T M RB p hK F
legs_read : ∀ p : ℕ, (p : ℚ) ∈ PrimePools → ∀ δ ∈ consumedDeltas T F,
((p : ℚ) ^ (δ : ℕ)) ∉ allActivePools M → ∀ hdet : DetHyp T RB hK,
LegAgree T M RB hdc hK hdet B.βmeas ((p : ℚ) ^ (δ : ℕ))
Sigmas : Finset (Multiset T.VType)
sig_exact : ∀ σ, σ ∈ Sigmas ↔ (σ.map fun v => ((T.vdeg v : ℕ))).sum = n
WshP : Shape T → PolyGeom
wsh_ok : ∀ Ŝ ∈ F.Sh, ∀ q₀ ∈ M.Pools, (WshP Ŝ).val ∈ OKat q₀
WshVal : Shape T → ℚ → ℝ
wsh_interp : ∀ Ŝ (hŜ : Ŝ ∈ F.Sh), ∀ q₀ (h : q₀ ∈ M.Pools),
((evalAt q₀ ⟨(WshP Ŝ).val, wsh_ok Ŝ hŜ q₀ h⟩ : ℚ) : ℝ) = WshVal Ŝ q₀
wshval_bdd : ∀ Ŝ ∈ F.Sh, ∀ q₀ ∈ M.Pools, WshVal Ŝ q₀ ∈ Set.Icc (0 : ℝ) 1
shDom : Shape T → Set M.Hgt
shEvtH : Shape T → M.Hgt → ∀ (q₀ : ℚ) (N : ℕ), Finset (M.Box q₀ N)
visH : Shape T → ∀ (q₀ : ℚ) (N : ℕ), Finset M.Hgt
shEvt : Shape T → ∀ (q₀ : ℚ) (N : ℕ), Finset (M.Box q₀ N)
shWeightH : Shape T → M.Hgt → ℚ → ℝ
shevt_grouping : ∀ Ŝ (q₀ : ℚ) (N : ℕ),
shEvt Ŝ q₀ N = (visH Ŝ q₀ N).biUnion (fun h => shEvtH Ŝ h q₀ N)
shDom_ne : ∀ Ŝ ∈ F.Sh, (shDom Ŝ).Nonempty
sh_realized : ∀ Ŝ ∈ F.Sh, ∀ q₀ ∈ allActivePools M,
∃ N₀, ∀ N ≥ N₀, (shEvt Ŝ q₀ N).Nonempty
shweight_card : ∀ Ŝ ∈ F.Sh, ∀ h : M.Hgt, h ∈ shDom Ŝ → ∀ q₀ ∈ M.Pools,
∃ N₀, ∀ N ≥ N₀, shWeightH Ŝ h q₀ * (Fintype.card (M.Box q₀ N) : ℝ)
= ((shEvtH Ŝ h q₀ N).card : ℝ)
wshval_card : ∀ Ŝ ∈ F.Sh, ∀ q₀ ∈ M.Pools, ∃ N₀, ∀ N ≥ N₀,
WshVal Ŝ q₀ * (Fintype.card (M.Box q₀ N) : ℝ) = ((shEvt Ŝ q₀ N).card : ℝ)
Rval : Multiset T.VType → ℚ → ℝ
r_bdd : ∀ σ (q₀ : ℚ), q₀ ∈ M.Pools → Rval σ q₀ ∈ Set.Icc (0 : ℝ) 1
decidedTotal : ℚ → ℝ
x3_total : ∀ p ∈ PrimePools, decidedTotal p = 1
rs1_equates : ∀ p ∈ PrimePools, (∑ σ ∈ Sigmas, Rval σ p) = decidedTotal p
rsh_interp : ∀ σ ∈ Sigmas, ∀ p ∈ PrimePools, ∀ hdet : DetHyp T RB hK,
∃ hok : Rsh T M RB hdc hK hdet F WshP σ ∈ OKat p,
((evalAt p ⟨Rsh T M RB hdc hK hdet F WshP σ, hok⟩ : ℚ) : ℝ) = Rval σ p
lean/LeanUrat/MovesS/Interfaces.lean — structure
definition The read-off check at wildly ramified primes
It forbids silently reading a symbolic value where a pole survives; at $n = 2$ every pool is fully active so the gate holds vacuously, while at general $n$ it is an open condition.
Call an evaluation site — a prime power $q_0$ together with its measured counting data — a pool. The gate at a pool demands, for every block size, that the symbolic block solve, evaluated at $q_0$ after cancellation, agree with the finite linear solve $(1-A)^{-1}b$ of the active subsystem $A$ against the measured exit vector $b$ — at every active state, every verdict multiset, every entrance height. At a wildly ramified pool (one with inactive states) this check must pass before the symbolic value may be read off: a pole surviving cancellation there is precisely a failure of the gate, and the determinants of the inactive blocks are recorded but never required to be nonzero.
The Lean statement
def LegAgree (T : TableShape n) (M : MeasuredSide T) (RB : RatBurdens T M)
(hdc : DegCons T) (hK : ∀ e, e ∈ Finset.Icc 1 n → KmatHyp T e)
(hdet : DetHyp T RB hK)
(βm : ∀ e, e ∈ Finset.Icc 1 n → ℕ → T.State e → Multiset T.VType → ℚ → ℝ)
(q₀ : ℚ) : Prop :=
∀ e (he : e ∈ Finset.Icc 1 n), ∃ P : PoolHyp T M RB e (hK e he) q₀,
∀ (τA : P.Act) (σ' : Multiset T.VType) (h_ent : ℕ),
AVAgree P (blockSolve T RB hdc hK hdet e he (↑τA) σ')
(bhatMeas P (fun e' he' => βm e' he' h_ent) σ') τA
lean/LeanUrat/MovesS/Interfaces.lean — definition
definition The shallow-weight production law, still open
Clause (ii) is the single unproved statement in this family of corpora — open in MovesV at general $n$, proved at $n = 2$ — and holding it as an explicit hypothesis is why every downstream result here is proved only conditionally on it.
The one law among the checksum's inputs that is still open, stated for every shallow shape in the family and every pool (an evaluation site: a prime power with its measured counting data): (i) the shape's weight presentation, evaluated at the pool, gives its weight value, and (ii) that value equals the sum of the shape's height weights over its height domain. The checksum uses this law as an explicit hypothesis, so its conclusion stays conditional until the law is proved.
The Lean statement
def W17ii (T : TableShape n) (M : MeasuredSide T) (F : ShapeFam T)
(WshP : Shape T → PolyGeom) (WshVal : Shape T → ℚ → ℝ)
(shDom : Shape T → Set M.Hgt) (shWeightH : Shape T → M.Hgt → ℚ → ℝ) : Prop :=
∀ Ŝ ∈ F.Sh, ∀ q₀ ∈ M.Pools,
(∃ hok : (WshP Ŝ).val ∈ OKat q₀,
((evalAt q₀ ⟨(WshP Ŝ).val, hok⟩ : ℚ) : ℝ) = WshVal Ŝ q₀) ∧
HasSum (fun h : shDom Ŝ => shWeightH Ŝ (↑h) q₀) (WshVal Ŝ q₀)
def RS4Chain.wsh17_pin {T : TableShape n} {M : MeasuredSide T} {RB : RatBurdens T M}
{hdc : DegCons T} {hK : ∀ e, e ∈ Finset.Icc 1 n → KmatHyp T e} {F : ShapeFam T}
(C : RS4Chain T M RB hdc hK F) : Prop :=
W17ii T M F C.WshP C.WshVal C.shDom C.shWeightH
lean/LeanUrat/MovesS/Interfaces.lean — definition
proved Vanishing at infinitely many points forces zero
Uniqueness of $R_\sigma$, the row-sum identity, the symbolic determinant, and the checksum all reduce to this one lemma applied on an infinite set of primes.
If $f \in \mathbb{Q}(q)$ is defined on an infinite set $S \subseteq \mathbb{Q}$ — its reduced denominator vanishes nowhere on $S$ — and $f(x) = 0$ for every $x \in S$, then $f = 0$ identically. Applied to differences, this turns agreement at infinitely many primes into equality of rational functions: the reason one fixed function can serve all regular primes at once.
The Lean statement
theorem ratfunc_eval_infinite (f : Qq) (S : Set ℚ) (hS : S.Infinite)
(hden : ∀ x ∈ S, f.denom.eval x ≠ 0)
(hval : ∀ x ∈ S, RatFunc.eval (RingHom.id ℚ) x f = 0) :
f = 0
lean/LeanUrat/MovesS/RatfuncEvalInfinite.lean — theorem
proved One-step masses sum to one in Q(q)
This conservation law is what makes the solve a probability resummation rather than formal algebra; it uses the measured counting laws and the rationality hypotheses as typed inputs.
For a degree $n$, every block size $e$ with $1 \le e \le n$, and every state $\tau$, the one-step masses of all outcomes at $\tau$ — splitting mass for the splits, terminal or column mass for the rest — sum to $1$ identically in $\mathbb{Q}(q)$. The proof evaluates at each fully active prime, where the measured masses sum to $1$ by the counting laws, and lets rigidity promote agreement at infinitely many primes to an identity in the field.
The Lean statement
noncomputable def routedMass {T : TableShape n} {M : MeasuredSide T}
(RB : RatBurdens T M) (e : ℕ) (τ : T.State e) (o : T.Out e τ) : Qq :=
if routeOf (T.odata e τ o) = .split then RB.J e τ o else RB.TG e τ o
theorem ksub {T : TableShape n} {M : MeasuredSide T} (RB : RatBurdens T M)
(L : LedgerIV T M) (hdc : DegCons T) {e : ℕ} (he : e ∈ Finset.Icc 1 n)
(τ : T.State e) (hK : KmatHyp T e) :
∑ o : T.Out e τ, routedMass RB e τ o = 1
lean/LeanUrat/MovesS/Ksub.lean — theorem
proved Escape makes 1 − A invertible
Termination of the process at a prime is what makes the resummation's linear system well posed there.
For a square matrix $A$ over $\mathbb{Q}$: if $A$ escapes — nonnegative entries and $A^k\mathbf{1} \to 0$ — then $\det(1-A) \neq 0$. Were the determinant zero, some nonzero vector $v$ would satisfy $v = Av$, hence $v = A^k v$ for all $k$, and nonnegativity gives $|v_i| \le (\max_j |v_j|)\,(A^k\mathbf{1})_i \to 0$, forcing $v = 0$. (An empty active block has determinant $1$, matching the realized-states-only scope.)
The Lean statement
theorem e0_det_ne_zero {ι : Type*} [Fintype ι] [DecidableEq ι]
{A : Matrix ι ι ℚ} (h : EscapeE0 A) : (1 - A).det ≠ 0
lean/LeanUrat/MovesS/E0DetNeZero.lean — theorem
proved The symbolic determinant never vanishes
Lifts invertibility from each prime to the field $\mathbb{Q}(q)$ itself — the reason the block solve exists symbolically and not merely prime by prime.
Assume escape at every fully active base prime. Then for a degree $n$ and each block size $e$ with $1 \le e \le n$, the determinant $\det(1-K_e)$ is nonzero in $\mathbb{Q}(q)$: fully active base primes exist, since all but finitely many are, and a determinant vanishing identically would vanish at one of them, contradicting the invertibility that escape forces there. This discharges, from the hypothesis package's own fields, the nonvanishing that every use of the block solve requires.
The Lean statement
theorem rs3_det_symbolic {T : TableShape n} {M : MeasuredSide T}
(RB : RatBurdens T M) (hdc : DegCons T)
(hK : ∀ e, e ∈ Finset.Icc 1 n → KmatHyp T e)
(PP : Set ℚ) (hsub : PP ⊆ M.Pools)
(hbase : ∀ q₀, q₀ ∈ PP ↔ ∃ p : ℕ, p.Prime ∧ q₀ = (p : ℚ))
(hact : ∀ e (he : e ∈ Finset.Icc 1 n), ∀ q₀ ∈ PP ∩ allActivePools M,
Nonempty (PoolHyp T M RB e (hK e he) q₀)) :
∀ e (he : e ∈ Finset.Icc 1 n), (1 - Kmat T RB e (hK e he)).det ≠ 0
lean/LeanUrat/MovesS/Rs3DetSymbolic.lean — theorem
proved All but finitely many primes are fully active
This is why one rational function can serve almost every prime: finitely many wild exceptions cannot break an identity in $\mathbb{Q}(q)$, and at those the read-off check takes over.
Only finitely many base primes fail to be fully active, i.e. have some inactive state. A state is inactive at $q_0$ precisely when some counting polynomial attached to it vanishes at $q_0$; each of these polynomials is nonzero, so each contributes only finitely many bad primes. What remains is an infinite set of fully active primes — the locus on which identities of rational functions are forced.
The Lean statement
theorem allActive_cofinite_primes {T : TableShape n} {M : MeasuredSide T}
(RB : RatBurdens T M) (PP : Set ℚ) (hsub : PP ⊆ M.Pools)
(hbase : ∀ q₀, q₀ ∈ PP ↔ ∃ p : ℕ, p.Prime ∧ q₀ = (p : ℚ)) :
{q₀ ∈ PP | q₀ ∉ allActivePools M}.Finite
lean/LeanUrat/MovesS/AllActivePrimes.lean — theorem
conditional The measured values determine the solve uniquely
The uniqueness half of uniformity: whatever rational functions the measured densities trace out can only be the block solve — established once the read-off and interpolation hypotheses hold.
Fix an infinite set $S$ of fully active pools (evaluation sites: prime powers with their measured counting data). Any family of rational functions whose denominators vanish nowhere on $S$ and which interpolates the measured subtree values on $S$ coincides with the block solve — coordinate by coordinate, at every block size, state, and verdict multiset: each $\beta_{e,\tau}(\sigma')$ is the only rational function the measured data can trace out. The proof matches the symbolic solve against the measured values at each point of $S$ and then applies rigidity in every coordinate.
Hypotheses this rests on: hread : ReadOffBundle S hS B hdet — per-pool agreement of the symbolic solve with the measured active values across S (the read-off burden): instantiated at the n = 2 gate, open at general n. L : LedgerIV T M — the nine measured counting laws (a scoped hypothesis confirmed necessary by independent review, 2026-07-30). hdet : DetHyp T RB hK — nonvanishing of every det(1 − K_e), dischargeable via the symbolic-determinant theorem.
The Lean statement
theorem rs2_unique_interp {T : TableShape n} {M : MeasuredSide T}
{RB : RatBurdens T M} {hdc : DegCons T}
{hK : ∀ e, e ∈ Finset.Icc 1 n → KmatHyp T e}
(S : Set ℚ) (hS : S ⊆ allActivePools M) (hinf : S.Infinite)
(B : RS1Bundle T M RB hdc hK) (L : LedgerIV T M) (hdet : DetHyp T RB hK)
(hread : ReadOffBundle S hS B hdet)
(f : ∀ e, e ∈ Finset.Icc 1 n → T.State e → Multiset T.VType → Qq)
(hfok : ∀ e (he : e ∈ Finset.Icc 1 n) (τ : T.State e)
(σ' : Multiset T.VType) (q₀ : ℚ), q₀ ∈ S → f e he τ σ' ∈ OKat q₀)
(hfin : ∀ e (he : e ∈ Finset.Icc 1 n) (τ : T.State e)
(σ' : Multiset T.VType) (q₀ : ℚ) (hq : q₀ ∈ S) (h_ent : ℕ),
((evalAt q₀ ⟨f e he τ σ', hfok e he τ σ' q₀ hq⟩ : ℚ) : ℝ)
= B.βmeas e he h_ent τ σ' q₀) :
∀ e (he : e ∈ Finset.Icc 1 n) (τ : T.State e) (σ' : Multiset T.VType),
f e he τ σ' = blockSolve T RB hdc hK hdet e he τ σ'
lean/LeanUrat/MovesS/Rs2Unique.lean — theorem
conditional The candidate densities sum to one
The capstone of the corpus: the resummation loses no mass, an identity that stays conditional as long as the shallow-weight production law stays open.
For a degree $n$, $\sum_{\sigma} R_\sigma = 1$ identically in $\mathbb{Q}(q)$, the sum running over all factorization types of total degree $n$: the candidate densities form an exact probability distribution as rational functions, not merely at each prime. At every base prime the hypothesis package evaluates the left side to the measured total mass, which is $1$; such primes are infinite in number, and rigidity turns pointwise agreement into identity.
Hypotheses this rests on: h17 : C.wsh17_pin — the shallow-weight production law, OPEN: its general-carrier discharge is the family's single unproved goal (a `sorry` in MovesV/V7_w17ii), while the n = 2 device instance is discharged. C : RS4Chain — the full inherited measured/rationality ledger, fully instantiated at n = 2; its general-n instantiation is still owed by the counting corpora MovesT/MovesV. hdet : DetHyp T RB hK — determinant nonvanishing, derivable from the chain's own escape packages via the symbolic-determinant theorem.
The Lean statement
theorem rs4_rational_step {T : TableShape n} {M : MeasuredSide T}
{RB : RatBurdens T M} {hdc : DegCons T}
{hK : ∀ e, e ∈ Finset.Icc 1 n → KmatHyp T e} {F : ShapeFam T}
(C : RS4Chain T M RB hdc hK F) (h17 : C.wsh17_pin) (hdet : DetHyp T RB hK) :
(∑ σ ∈ C.Sigmas, Rsh T M RB hdc hK hdet F C.WshP σ) = 1
lean/LeanUrat/MovesS/Rs4.lean — theorem
proved Degree two, instantiated in full
Certifies that all the hypotheses can hold at once on a real model — consistency of the hypothesis bundle, not yet its inhabitation by the intended general counting model, which MovesT and MovesV still owe; its shallow weights are the trivial device disclosed in the degree-two shallow-weight card.
The entire hypothesis package, instantiated at $n = 2$: the pools (evaluation sites) are all prime powers, block $2$ has a single state, the verdicts are $(1,1)$, $(1,2)$, $(2,1)$, the factorization types are the three degree-$2$ multisets, and the measured one-step values at every pool are $q^{-3}$, $1 - q^{-1}$, and $q^{-1} - q^{-3}$. Every field — the nine counting laws, escape, cofinite activity, interpolation, total mass — is discharged by proof.
The Lean statement
noncomputable def n2Chain : RS4Chain n2T n2M n2RB n2hdc n2hK n2F
theorem n2_sigmas :
n2Chain.Sigmas = {{n2v11, n2v11}, {n2v12}, {n2v21}}
lean/LeanUrat/MovesS/N2Sigmas.lean — instance
proved The degree-two solves in closed form
The abstract matrix-inversion solve reduces, by a computation a human can check, to the predicted rational functions — denominator $q^2+q+1$ and all.
At degree $2$ the block-$2$ solves come out in closed form: $\beta_{\{(1,2)\}} = \dfrac{q+1}{q^2+q+1}$ and $\beta_{\{(1,1),(1,1)\}} = \dfrac{q^2}{q^2+q+1}$, the subscripts naming the verdict multisets — one finished factor with $(e,f) = (1,2)$, or two with $(1,1)$. As a companion check, the symbolic determinant is $\det(1-K_2) = (q^3-1)/q^3$.
The Lean statement
theorem n2_solve_vals (he : 2 ∈ Finset.Icc 1 2) :
blockSolve n2T n2RB n2hdc n2hK n2hdet 2 he n2τ {n2v12}
= algebraMap (Polynomial ℚ) Qq (X + 1)
/ algebraMap (Polynomial ℚ) Qq (X ^ 2 + X + 1) ∧
blockSolve n2T n2RB n2hdc n2hK n2hdet 2 he n2τ {n2v11, n2v11}
= algebraMap (Polynomial ℚ) Qq (X ^ 2)
/ algebraMap (Polynomial ℚ) Qq (X ^ 2 + X + 1)
lean/LeanUrat/MovesS/N2SolveVals.lean — theorem
proved The two degree-two masses sum to one
Dispatch, solve, and interpolation compose end to end on the worked instance without losing mass.
In $\mathbb{Q}(q)$, $\beta_{\{(1,2)\}} + \beta_{\{(1,1),(1,1)\}} = \dfrac{q+1}{q^2+q+1} + \dfrac{q^2}{q^2+q+1} = 1$: the two block-$2$ subtree masses of the degree-two instance sum to one — the degree-two shadow of the checksum, computed from the explicit solve values.
The Lean statement
theorem n2_checksum (he : 2 ∈ Finset.Icc 1 2) :
blockSolve n2T n2RB n2hdc n2hK n2hdet 2 he n2τ {n2v12}
+ blockSolve n2T n2RB n2hdc n2hK n2hdet 2 he n2τ {n2v11, n2v11} = 1
lean/LeanUrat/MovesS/N2Checksum.lean — theorem
proved The degree-two shallow weights are trivial by design
Declared as a placeholder so that triviality is never mistaken for verification of the shallow layer; the general-$n$ weights, still owed by the counting corpora, are specified to replace these fields.
At degree $2$ every shallow shape is given the trivial weight presentation — both counting polynomials equal to $1$, geometric part $1$, no power of $q$ — so the weight value is identically $1$ at every pool. This witnesses that the shallow-weight layer composes with the rest of the machinery; it deliberately carries no shallow-weight content of its own.
The Lean statement
theorem n2_wshp_device :
(∀ Ŝ : Shape n2T, (n2Chain.WshP Ŝ).countT = 1 ∧ (n2Chain.WshP Ŝ).countS = 1 ∧
(n2Chain.WshP Ŝ).geom = 1 ∧ (n2Chain.WshP Ŝ).qpow = 0) ∧
(∀ Ŝ ∈ n2F.Sh, ∀ q₀ ∈ n2M.Pools, n2Chain.WshVal Ŝ q₀ = 1)
lean/LeanUrat/MovesS/N2WshpDevice.lean — theorem
Tables, ledgers and values (MovesV) 4 definition · 4 open · 6 proved · 6 conditional
The measured layer: realized masses are values of fixed rational tables (the twenty-clause theorem CTS-M)
MovesV is where the classifier's combinatorics start paying out in numbers: it puts a measure on the transition system whose states are the classifier's branch cells, and its capstone CTS-M proves twenty clauses saying that, at every admissible prime power $q_0$, the masses the factorization process realizes are nothing new — cell masses at an active state sum to exactly 1, entrance masses are geometric series in $q_0$, and realized chain counts are values of fixed path-product polynomials. The theorem is conditional by design: it quantifies over an explicit record of hypotheses in which three rows remain open and the height-domain factorization kernel is only ever assumed, never proved. Three proved countermodels bound the species-word, height-writing, and template-totality statements to the restricted forms in which they hold.
Builds on: MovesS, MovesD, MovesSp, MovesC
conditional The measured theorem CTS-M: twenty clauses from one hypothesis record
The capstone of the corpus: one implication with all its hypotheses as antecedents. The composite product law, the cross-level stability, and the solve sentence are the open inputs, and the factorization kernel enters only as an antecedent of individual clauses.
Fix a degree $n$ and a record $L$ packaging the whole transition system: the fixed symbolic value tables, the step system of moves between branch cells, its measured realization at the admissible prime powers $q_0$ (the pool), the marked-event carriers, a typed summability package, and the burden laws (the polynomial value law, the mark-fiber and domain ties, realization completeness, entrance count and uniformity). Assume moreover the three total-mass legs (countable additivity, no mass at infinite height, exactness at every fixed height), that each continuing marked cell carries at least one eligible mark, the order-0 perimeter certificates on entrance domains, the composite product law, cross-level stability of entrance masses, and the solve sentence supplied by the solver corpus. Then all twenty clauses of CTS-M hold. Among them: the state partition at each $q_0$ is finite with unique cell indices; every table value is a fixed polynomial evaluated at $q_0$, and the realized chain count $T_\gamma(x,h)$ — for a template $\gamma$, admissible history $x$, and height $h$ in the listed domain — equals the path-product polynomial of $\gamma$ at $q_0$; no mass enters states inactive at $q_0$; each entrance mass aggregates exactly and is a rational geometric series in $q_0$; the cell masses at any active state sum to exactly $1$ (PART-1), while marked plus terminal mass equals $1$ plus the surplus $\sum(\text{mark weight}-1)\cdot(\text{cell mass})$ over cells carrying more than one eligible mark (PART-2); row values do not depend on the history; events of distinct marks are disjoint; and the composition laws COMP-h, COMP-$\Sigma$, COMP-AGG hold — the last two conditionally on the open factorization kernel.
Hypotheses this rests on: hb/hc/hd (the three PART-1 legs: countable additivity of cell masses, null remainder at infinite height, fixed-height exactness); hmark (every continuing digit cell has mark weight ≥ 1, the mark weight being the number of eligible marks the cell carries — refutable without it: an all-zero-multiplicity model breaks PART-2); hdom (every entrance-domain point carries an order-0 perimeter certificate — the scoping predicate defined in its own node); hcomp (the composite marked-event value factorizes — open); hstab (entrance mass is stable across levels — open); hsolve (the solve sentence: a determinant hypothesis plus Neumann convergence, given escape/agreement/kernel/count premises); plus the ledger's own burden fields (the value law VAL(a), mark-fiber tie, domain tie, realization completeness, entrance count and uniformity, stage laws)
The Lean statement
theorem ctsM {n : ℕ} (L : CtsmLedger n)
(hb : P1CtblAdd L.V L.X.w) (hc : P1NullRem L.V L.X.w)
(hd : P1FixedHeightExact L.V L.X.w)
(hmark : ∀ (τ : L.S.Cell) (c : DCellAll L.V τ),
c.isLeft → 1 ≤ markWeight L.V c)
(hdom : EntDomOrder0 L.V)
(hcomp : CompProduct L.cc L.X.w)
(hstab : IotaLvlStable L.cc)
(hsolve : SolveCond_Stmt L) :
CtsmConclusions L
lean/LeanUrat/MovesV/V7_ctsm.lean — theorem
definition The hypothesis record: everything CTS-M assumes, packaged as one structure
Proving CTS-M for a concrete classifier engine means building one of these records, so its typed fields are the exact inventory of what the capstone assumes.
The record $L$ over which CTS-M quantifies. Its fields: the family of symbolic value tables; the step system of moves between branch cells; its measured realization at the admissible prime powers; the marked-event carriers; the summability package (weights, uniformity, listed semilinear height domains, geometric-series laws); the polynomial cell packs; the composite-value carrier with its refined cells; the burden hypotheses — the domain tie, the mark-fiber tie, realization completeness (every chain is realized by a mark), the polynomial value law, entrance count and uniformity, affine entrance exponents; and the data it uses from the solver corpus — table shape, measured side, rational burdens, kernel hypotheses, species stage data, and stage laws.
The Lean statement
structure CtsmLedger (n : ℕ) where
C : CtsFamily n
S : StepSys n
V : CtsMeasured n C S
TE : TmplEvents n S
X : XHD n S TE V
cp : CellPolyPack n C S V
cc : CompCarrier V TE
J : JCells n C S V
hTie : MDomTie V TE X.d
hMark : MarkFiberTie TE
hRC : RealizationComplete TE
pack : C15Pack n S
hVA : ValA n C S V
hEC : EntCount V
hEU : EntU V
hAff : AffEnt n
T : MovesS.TableShape n
M : MovesS.MeasuredSide T
RB : MovesS.RatBurdens T M
hK : ∀ e, e ∈ Finset.Icc 1 n → MovesS.KmatHyp T e
scs : MovesS.SCSData T
stage_laws : StageLawBurden n T scs
lean/LeanUrat/MovesV/V7_ledger.lean — structure
definition The unproved kernel: composite height domains split as products
The hinge of clauses (v) and (vi): nothing proves it and nothing assumes it silently — every statement that uses it takes it as a named hypothesis, and a countermodel shows it can fail, so this is no formality.
For a one-step move $m$ followed by a template $\gamma$, with $h_1$ a height for the step and $h_2$ a height for $\gamma$, the concatenated point $(h_1,h_2)$ lies in the listed semilinear domain of the composite template if and only if $h_1$ lies in the domain of $m$ alone and $h_2$ in the domain of $\gamma$. This is clause (v) of CTS-M: stated here, verified computationally at probe points, and proved nowhere — an explicit toy system shows it can fail, so the composition clauses and the solve sentence all assume it by name.
The Lean statement
def HMC {n : ℕ} {S : StepSys n} (TE : TmplEvents n S) (D : XHDd n S TE) : Prop :=
∀ {α β} (m : S.Move α β) (γ : Template n S β) (h₁ : Hpt (S.dim m))
(h₂ : Hpt γ.D),
(D.dom (.cons m γ)).Mem (Hpt.append h₁ h₂) ↔
(D.dom (.last m)).Mem h₁ ∧ (D.dom γ).Mem h₂
lean/LeanUrat/MovesV/Defs.lean — definition
definition Entrance shapes: a height-carrying prefix with its branch selections
The central new object of this layer: entrances into a block are post-split, so at a branching each sibling carries its own shape and its own mark — the granularity to which every entrance-mass statement is keyed.
An entrance shape is a triple $\varepsilon = (\hat P,\, (g,\mu),\, \sigma)$: a nonempty shallow shape-prefix $\hat P$ that retains its per-read height data; the pair $(g,\mu)$, with $g,\mu \ge 1$, selected at its last read, subject to the eligibility budget; and a selection record $\sigma$ listing, for each branching read of $\hat P$, which member of its finite menu was taken. Entrance masses and entrance counts (clause (iii) of CTS-M) are refined by these shapes, their heights ranged through finitely many height-forgetting templates and an instantiation bijection.
The Lean statement
structure EntShapeV (n : ℕ) where
Phat : MovesD.Shape n
hne : (Phat : MovesD.ShapePrefix).reads ≠ []
gsel : ℕ
musel : ℕ
hsel_g : 1 ≤ gsel
hsel_μ : 1 ≤ musel
hentry : ∀ R, (Phat : MovesD.ShapePrefix).reads.getLast? = some R →
R.g = gsel ∧ R.μ = musel
helig : ∀ R, (Phat : MovesD.ShapePrefix).reads.getLast? = some R →
EligPair R gsel musel
selRec : List ℕ
hlen : selRec.length =
((Phat : MovesD.ShapePrefix).reads.filter
(fun R => decide (IsBranchSlot R))).length
hmenu : ∀ i (hi : i < selRec.length),
selRec.get ⟨i, hi⟩ < branchMenuCard n Phat i
lean/LeanUrat/MovesV/Defs.lean — structure
definition The order-0 perimeter: where height-writing is guaranteed to work
The scoping predicate for this layer: height-writing is total on it and false off it, the failure witnessed by a countermodel — analogous to how the order-0 decided stratum scopes the project's main capstone.
A height point $h$ of an entrance template lies on the order-0 perimeter when the template's word is a single letter $s$ that is not a self-loop, and every retained slot pair $(h_i, c_i)$ of $h$ is anchor-admissible for $s$: $h_i \geq 1$, $\gcd(e_s, h_i) = 1$, and the anchor congruence $\mathrm{bez}(e_s, h_i)\cdot c_i \equiv s_0 \pmod{e_s}$, where $e_s$ and $s_0$ are the stage numbers of the letter and $\mathrm{bez}$ is a Bézout coefficient. This is exactly the stratum on which the height-writing map is proved total; totality without it is false, the failure witnessed by a countermodel, so every downstream statement carries this certificate as a hypothesis.
The Lean statement
def Order0Perimeter {n : ℕ} (εT : EntTemplate n) (h : Hpt εT.entDim) : Prop :=
∃ s : MovesSp.Species, εT.word = [s] ∧ SelfLoopLetter n s = false ∧
∀ pr ∈ εT.pairSlots h, AnchorAdmissible s pr
lean/LeanUrat/MovesV/V3_spwordD.lean — definition
proved Sums over semilinear sets split exactly along their components
The summation kernel of the corpus: entrance aggregation, total mass one, and the composition aggregate all reduce their geometric-series bookkeeping to this exact splitting.
Let $S \subseteq \mathbb{N}^D$ be a semilinear set presented as an explicitly listed disjoint union of linear components (base points plus period generators), and let $f \geq 0$ be a function on height points. If $f$ sums to $v_j$ over the $j$-th component, then $f$ sums over all of $S$ to $\sum_j v_j$ — exactly, with no inclusion–exclusion correction, because disjointness of the components is part of the presentation.
The Lean statement
theorem semilin_sum_exact {D : ℕ} (S : SemilinPart D) (f : Hpt D → ℝ)
(hf : ∀ h, 0 ≤ f h) (v : Fin S.comps.length → ℝ)
(hv : ∀ j, HasSum (fun h : {h // (S.comps.get j).Mem h} => f h.1) (v j)) :
HasSum (fun h : {h // S.Mem h} => f h.1) (∑ j, v j)
lean/LeanUrat/MovesV/V0_partition.lean — theorem
conditional Cell masses at an active state sum to exactly one
Proved from the three legs; the exactness in the third leg is essential — dropping it admits the identically-zero mass as a counterexample to the equality.
At any admissible prime power $q_0$, any state active at $q_0$, and any admissible history, the fixed-height cell masses converge with sum exactly one: $$\sum_{c}\;\sum_{h}\; \mu(c, h) \;=\; 1,$$ where $c$ runs over the full countable family of digit cells of the state, $h$ over all height points in every dimension, and $\mu(c,h)$ is the mass the measured system assigns to cell $c$ at height $h$. This is an infinite identity, not a finite-pool one: the proof squeezes the countable-additivity upper bound against the lower bound from exactness at each finite height truncation.
Hypotheses this rests on: P1CtblAdd (the countable-partition sum exists and is at most 1); P1NullRem (no mass escapes to infinite height); P1FixedHeightExact (below-height blocks plus the height strip sum to exactly 1 at every truncation)
The Lean statement
theorem part1 {n : ℕ} {C : CtsFamily n} {S : StepSys n}
{V : CtsMeasured n C S} (X : XHDw n S)
(hb : P1CtblAdd V X) (hc : P1NullRem V X) (hd : P1FixedHeightExact V X)
{τ : S.Cell} {q₀ : ℚ} (x : S.Hist q₀ τ) (hzc : S.zc x)
(hq : q₀ ∈ V.Pools) (hact : V.activeState q₀ τ) :
HasSum (fun ch : Σ c : DCellAll V τ, Σ D : ℕ, Hpt D =>
μcellH V X x ch.1 ch.2) 1
lean/LeanUrat/MovesV/V4_part1C.lean — theorem
conditional Realized chain counts are polynomials in the prime power
The capstone exports the count the process realizes, not the one the tables promise; this theorem is the bridge, and it depends on realization completeness — surjectivity of the marking map onto chains.
For a template $\gamma$, an admissible history $x$ at a prime power $q_0$, and a height $h$ in the listed process-side domain of $\gamma$, the realized linked count — the census $T_\gamma(x,h)$ of marked boxes at the defining level — equals the path-product polynomial $P_\gamma$ evaluated at the prime power: $$T_\gamma(x, h) \;=\; P_\gamma(q_0).$$ Conditional on the polynomial value law for tables and cell sizes, the uniformity face, the tie between measured and process-side domains, and realization completeness: every counted chain is actually realized by a mark.
Hypotheses this rests on: hVA (VAL(a): tables and cell sizes are polynomial); U (the same-pool uniformity face); hTie (the measured/process domain tie); hRC (realization completeness: the marking map onto chains is surjective — a toy model shows a positive table count with zero realized marks is otherwise consistent, so this premise has real content)
The Lean statement
theorem val_b {n} {C : CtsFamily n} {S : StepSys n} {V : CtsMeasured n C S}
{TE : TmplEvents n S} {D : XHDd n S TE}
(hVA : ValA n C S V) (U : XHDu n S) (hTie : MDomTie V TE D)
(hRC : RealizationComplete TE)
{α} (γ : Template n S α) {q₀} (x : S.Hist q₀ α) (hzc : S.zc x)
(hq : q₀ ∈ V.Pools) (h : Hpt γ.D) (hmem : (D.dom γ).Mem h) :
(Tgam TE γ x h : ℚ) = (pathProdPoly V γ).eval q₀
lean/LeanUrat/MovesV/V2_valB.lean — theorem
conditional Composite mass aggregates to entrance mass times step product
The zero-mass law for non-landing templates is essential — without it non-landers leak mass into the aggregate; the height-writing dependence enters through the order-0 perimeter certificate.
Fix a landing state $\beta_0$, a template $\gamma$, and a prime power $q_0$. Summing the composite marked-event masses over all entrance templates into $\beta_0$ and over all components of their semilinear height domains gives $$\text{(total composite mass)} \;=\; \iota(\beta_0, q_0)\cdot \Pi_\gamma(q_0),$$ where $\iota(\beta_0, q_0)$ is the total entrance mass into $\beta_0$ and $\Pi_\gamma(q_0)$ the stepwise product value of $\gamma$. The aggregation runs through the exact semilinear component splitting, fiber constancy of the entrance data, and the law that templates not landing at $\beta_0$ carry zero entrance mass at every level.
Hypotheses this rests on: cc (the composite carrier's measure-definition laws, including the lands law: non-landing templates carry zero entrance mass); Xs/XsEnt (the geometric-series summability faces); hdom (order-0 perimeter certificates on the entrance domain); hEU (entrance uniformity)
The Lean statement
theorem comp_agg {n : ℕ} {C : CtsFamily n} {S : StepSys n}
{V : CtsMeasured n C S} {TE : TmplEvents n S} {D : XHDd n S TE}
(cc : CompCarrier V TE) (X : XHDw n S)
(Xs : XHDs n S X D) (XsEnt : XHDsEnt n S V)
(hdom : EntDomOrder0 V) (hEU : EntU V)
(β₀ : S.Cell) {α} (γ : Template n S α) {q₀ : ℚ} (hq : q₀ ∈ V.Pools) :
aggMass cc Xs hdom β₀ γ q₀
= iotaValV V XsEnt β₀ q₀ * stepProdVal V Xs γ q₀
lean/LeanUrat/MovesV/V5_compagg.lean — theorem
proved Monic cubics over a finite field, counted by root profile
The concrete degree-3 census behind the value tables, proved for every finite field rather than spot-checked at nine prime powers. The double-plus-simple class is counted by $q(q-1)$ — over the 3-element field that is 6, not the 9 a naive keying predicts.
Over any finite field $F$ with $q$ elements, the monic cubics $x^3 + ax^2 + bx + c$ fall into five root profiles (number of distinct roots in $F$, largest multiplicity), each counted by a fixed polynomial in $q$: three simple roots, $\tfrac{1}{6}q(q-1)(q-2)$; one simple root with an irreducible quadratic cofactor, $\tfrac{1}{2}q^2(q-1)$; no roots (irreducible cubic), $\tfrac{1}{3}(q^3 - q)$; a double plus a simple root, $q(q-1)$; a triple root, $q$. The five classes are exhaustive and their counts sum to $q^3$.
The Lean statement
theorem rootTable_census_complete (F : Type*) [Field F] [Fintype F]
[DecidableEq F] (q : ℚ) (hq : (Fintype.card F : ℚ) = q) :
(classCount F (3, 1) : ℚ) = TH3.eval q ∧
(classCount F (1, 1) : ℚ) = TH12.eval q ∧
(classCount F (0, 0) : ℚ) = TH3c.eval q ∧
(classCount F (2, 2) : ℚ) = T21.eval q ∧
(classCount F (1, 3) : ℚ) = T3.eval q
lean/LeanUrat/MovesV/V6_a1census.lean — theorem
proved A table instance for the solver corpus, pinned to the transition system
The pins carry the content: the degree bounds are the real bounds and the state carrier retains its cell index. At the working degree $n = 3$ the skeleton is finite, so its finiteness hypothesis is discharged there.
Given the transition system's table family at degree $n$ and finiteness of the skeleton catalogue, there exists a table shape — the structure the solver corpus uses — whose absorbing labels, per-block state carriers (retaining the transition system's cell indices), outcome menus, degree bounds, and outcome rosters are pinned to the transition-system data by an explicit bundle of equivalences and transported equalities, and all of whose outcome rosters are nonempty.
The Lean statement
theorem tableShape_inst {n : ℕ} (C : CtsFamily n)
(hfin : Finite (Skeleton n)) :
∃ T : MovesS.TableShape n,
TablePins C T ∧
∀ e (τ : T.State e) (o : T.Out e τ), (T.odata e τ o).mem ≠ []
lean/LeanUrat/MovesV/V7_ts.lean — theorem
conditional Every coherent prefix with wide continuations carries a species word
The two extra hypotheses — width $\ge 2$ and species coherence — are exactly what the countermodels exploit; deriving species coherence from the classifier engine's output laws is an open problem.
Let $P$ be a well-formed shape prefix (a sequence of reads carrying degrees, heights, and window data) at degree $n \geq 2$, with every continued read of width $\mu \geq 2$, and satisfying species coherence: read $r{+}1$ is of increment species exactly when read $r$'s selected move is proper, i.e. $2 \leq e_r g_r$. Then some species word fits $P$: a word of catalogue letters, one per read, each realizing its read's data, with consecutive letters chained by the stage-successor relation. The proof is an explicit letter-by-letter construction.
Hypotheses this rests on: hn and hcont (the width-≥-2 continuation scope: the catalogue's terminal rule forbids selections at window 1); hspec (the cross-read species-coherence law, which well-formedness does not carry)
The Lean statement
theorem spWord_exists (n : ℕ) (P : MovesD.ShapePrefix)
(hWF : MovesD.ShapeWF n P) (hn : 2 ≤ n)
(hcont : ∀ (r : ℕ) (hr : r + 1 < P.reads.length),
2 ≤ (P.reads[r]'(Nat.lt_of_succ_lt hr)).μ)
(hspec : SpeciesCoherent P) :
∃ ws, SpWordFits n P ws
lean/LeanUrat/MovesV/V3_spwordA.lean — theorem
conditional Height-writing succeeds on the order-0, anchor-admissible stratum
Unrestricted totality is false (a countermodel refutes it), so height-writing is guaranteed only on this order-0, anchor-admissible stratum; the order-0 perimeter certificate packages exactly these hypotheses, which every statement up to the capstone carries.
The height-writing map reconstructs a concrete entrance shape from a height-forgetting entrance template and a numeric slot point. It always returns a value whenever the template's word is a single non-self-loop letter $s$ and every slot pair $(h, c)$ is anchor-admissible: $h \geq 1$, $\gcd(e_s, h) = 1$, and $\mathrm{bez}(e_s, h)\cdot c \equiv s_0 \pmod{e_s}$, with $e_s$, $s_0$ the stage numbers of $s$ and $\mathrm{bez}$ a Bézout coefficient. The reconstruction exhibits an explicit fitting read with exact-division anchor, a well-formedness certificate, and the entrance ties.
Hypotheses this rests on: hword and hsl (the order-0, self-loop-free stratum: the template word is one non-self-loop letter); hadm (anchor admissibility of every slot point — the semilinear conditions the entrance domain owns)
The Lean statement
theorem writeHeights_total {n : ℕ} (εT : EntTemplate n) (h : Hpt εT.entDim)
(s : MovesSp.Species) (hword : εT.word = [s])
(hsl : SelfLoopLetter n s = false)
(hadm : ∀ pr ∈ εT.pairSlots h, AnchorAdmissible s pr) :
(writeHeights? εT h).isSome
lean/LeanUrat/MovesV/V3_spwordD.lean — theorem
proved Countermodel: a well-formed prefix that no species word fits
This countermodel shows the width hypothesis is necessary for species-word existence; a second countermodel shows species coherence is necessary too.
Not every well-formed shape prefix admits a fitting species word. Witness at $n = 3$: the two-read prefix — a root read with $(e, g, \mu) = (1, 1, 1)$, then a recentering read inside its width-1 window — is well-formed, yet the stage laws force the second letter's window to $1$, where the catalogue's terminal rule forbids the very selection the fit clauses demand; no fitting word exists.
The Lean statement
theorem spWord_exists_false :
¬ ∀ (n : ℕ) (P : MovesD.ShapePrefix), MovesD.ShapeWF n P →
∃ ws, SpWordFits n P ws
lean/LeanUrat/MovesV/V3_spwordA_negWitness.lean — countermodel
proved Countermodel: height-writing fails at the all-zero slot point
This countermodel refutes unrestricted totality of the height-writing map: any unrestricted totality claim is inconsistent with it, so height-writing is scoped to the order-0 perimeter certificate.
The height-writing map is not total: at the one-letter root template, the all-zero slot point already fails, since by definition every read carries height $\geq 1$. Positivity alone cannot repair it: at any letter with $e \geq 2$ a Bézout anchor congruence is also needed, so totality can only hold on a restricted semilinear domain — the order-0 perimeter.
The Lean statement
theorem writeHeights_total_false : ¬ (writeHeights? T0 h0).isSome
lean/LeanUrat/MovesV/V3_spword_negWitness2.lean — countermodel
proved Countermodel: an entrance shape with no template
Template extraction is not total, so any statement that uses a template requires the fitting-word certificate as a hypothesis.
The sentence “every entrance shape yields a height-forgetting template” is false: the entrance shape built over the two-read witness prefix admits no fitting species word, so its species word defaults to the junk empty word and template extraction returns nothing. The true replacement is scoped: extraction succeeds once the shape's species word is a fitting word rather than the junk default.
The Lean statement
theorem template_total_false :
¬ ∀ (n : ℕ) (ε : EntShapeV n), (ε.template?).isSome
lean/LeanUrat/MovesV/V3_spword_negWitness3.lean — countermodel
open The per-shape height-sum clause: stated, still open
No countermodel is known — the in-corpus witness satisfies the clause — but an infinite-domain chain might break summability, so the domain census must be settled before the sum identity can be proved.
For a full chain instance of the solver corpus's structure, two clauses are asserted per shape: (i) the shallow-shape presentation evaluates to the shallow-shape value — this half holds by the chain's own fields; and (ii) the shallow-shape value equals the sum, over the shallow height domain, of the shallow height weights — a convergent-sum identity at the per-shape layer. Clause (ii) is the corpus's one open goal.
The Lean statement
theorem w17ii_wave4 {n : ℕ} {T : TableShape n} {M : MeasuredSide T}
{RB : RatBurdens T M} {hdc : DegCons T}
{hK : ∀ e, e ∈ Finset.Icc 1 n → KmatHyp T e} {F : ShapeFam T}
(C : RS4Chain T M RB hdc hK F) :
W17ii T M F C.WshP C.WshVal C.shDom C.shWeightH
lean/LeanUrat/MovesV/V7_w17ii.lean — theorem
open Wanted: a table-and-measure witness for the solver's LedgerIV structure
The existential form is necessary: the universal version is false for adversarial measured sides. The intended witness — the pinned table instance plus a measured side of some thirty fields — cannot be faked by satisfying the pins alone.
Sought: a table shape $T$ and a measured side $M$ such that $T$ is pinned to the transition-system family by the table-side bundle (label, state, and outcome equivalences, real degree bounds, roster ties); the box cardinalities of $M$ agree with the transition system's at every admissible prime power (guarded on nonemptiness); and the solver corpus's LedgerIV structure is inhabited over $(T, M)$. Stated under the full hypothesis set the eventual witness will use: the summability package, polynomial packs, the value law, the factorization kernel, the three total-mass legs, entrance count and uniformity.
The Lean statement
theorem ledgerIV_inst {n : ℕ} {C : CtsFamily n} {S : StepSys n}
(V : CtsMeasured n C S) {TE : TmplEvents n S}
(X : XHD n S TE V) (cp : CellPolyPack n C S V) (hVA : ValA n C S V)
(hHMC : HMC TE X.d)
(hb : P1CtblAdd V X.w) (hc : P1NullRem V X.w)
(hd : P1FixedHeightExact V X.w)
(hEC : EntCount V) (hEU : EntU V) :
∃ (T : MovesS.TableShape n) (M : MovesS.MeasuredSide T),
TablePins C T ∧
(∀ q₀ ∈ V.Pools, ∀ N : ℕ, Nonempty (V.Box q₀ N) →
Fintype.card (M.Box q₀ N) = @Fintype.card _ (V.finB q₀ N)) ∧
Nonempty (MovesS.LedgerIV T M)
lean/LeanUrat/MovesV/V7_livC.lean — theorem
open Wanted: a pinned witness carrying the rational-burden polynomials
Same existential shape and pin inventory as the LedgerIV obligation; the roster-nonemptiness step is already proved, and the structure names which polynomial wiring the witness must supply.
Sought: a table shape $T$ and a measured side $M$, pinned to the transition-system data by the same bundle and guarded box-cardinality agreement as the LedgerIV obligation, over which the solver corpus's rational-burden structure — the per-outcome count polynomials and geometric-series packs — is inhabited. The intended witness draws its polynomials from the cell-size and count wiring and the per-entrance rational packs.
The Lean statement
theorem ratBurdens_exists {n : ℕ} {C : CtsFamily n} {S : StepSys n}
(V : CtsMeasured n C S) {TE : TmplEvents n S}
(X : XHD n S TE V) (cp : CellPolyPack n C S V) (hVA : ValA n C S V)
(hTie : MDomTie V TE X.d) (J : JCells n C S V) (hEU : EntU V)
(hEC : EntCount V) (hA : AffEnt n) :
∃ (T : MovesS.TableShape n) (M : MovesS.MeasuredSide T),
TablePins C T ∧
(∀ q₀ ∈ V.Pools, ∀ N : ℕ, Nonempty (V.Box q₀ N) →
Fintype.card (M.Box q₀ N) = @Fintype.card _ (V.finB q₀ N)) ∧
Nonempty (MovesS.RatBurdens T M)
lean/LeanUrat/MovesV/V7_rbC.lean — theorem
open Wanted: a pinned table carrying the species stage data
A degenerate stage supply passes the algebraic laws but fails the selected-member laws against the real rosters, so only the true species-catalogue wiring can discharge it.
Sought: for the transition-system family with finite skeleton catalogue, a table shape pinned to it by the bundle of equivalences, over which the solver corpus's species-stage structure is inhabited: the stage fields — window, degree, budget, selection, and cluster laws — wired from the species catalogue through the outcome rosters.
The Lean statement
theorem scs_data_supply {n : ℕ} (C : CtsFamily n)
(hfin : Finite (Skeleton n)) :
∃ T : MovesS.TableShape n,
TablePins C T ∧
Nonempty (MovesS.SCSData T)
lean/LeanUrat/MovesV/V7_scsData.lean — theorem
7 Exhaustion: the undecided mass vanishes
Reading only finitely many digits, the classifier decides all but a bounded fraction of polynomials. At degree 2 the vanishing of that fraction is proved outright at every prime. At general degree the bounds are proved in threshold form as implications from named hypotheses — the sharpest unconditional general form is one of the open kernels in the amber panel.
The exhaustion bounds (MovesX) 6 definition · 7 proved · 7 conditional
The classifier eventually decides almost every polynomial, at explicit prime-uniform rates
MovesX proves that the classifier finishes its work: for a prime $p$ and degree $n \ge 2$, the fraction of monic degree-$n$ polynomials over $\mathbb{Z}_p$ still undecided after $N$ levels of inspection drains to zero, quantitatively with prime-uniform envelopes $c_3\,p^{-c_4 N}$ and $c_3'\,p^{-c_4'\sqrt{N}}$ whose constants depend only on $n$. It works entirely against a hypotheses bundle recording what the classifier attaches to each polynomial — a finitely branching tree, per-branch detection thresholds, and a finitely additive content on coefficient space — and once the undecided mass vanishes in the limit, summing the contents of the decided trees of a given splitting type recovers that type's density. Every analytic theorem here is conditional on nine named hypotheses about the classifier — alignment, weight-charge, threshold and cap linearity, progress, tall tails, the bridge, and nullity of the non-standard fibers — whose discharge, like a concrete instance of the bundle, remains open.
Builds on: Moves, MovesD, MovesT, HC2
definition One step of the tower: nodes and their five rows
Every statement about depth, height, or index in this corpus is a statement about finite lists of these nodes.
One node of the residual tower records a single classifier step: a tuple $(e, \ell, h, s_0, u_0)$ with $e, h, \ell \ge 1$ and $\gcd(e,h) = 1$, where $e$ is the ramification jump, $h$ the slope numerator, $\ell$ the residual length, and $(s_0, u_0)$ the current base point of the Newton polygon. A node that continues the tower also selects a pair $(g, \mu)$ with $1 \le g$, $1 \le \mu$, $\mu g \le \ell$, and a flag saying whether the step increments or recenters; on the $\ell = 1$ rows the flag is forced — increment when $e \ge 2$, recenter when $e = 1$. A history is a finite list of nodes, and every node sits in one of five rows: T1 ($\ell \ge 2$), T2 ($\ell = 1$, $e \ge 2$, $h \ge 2$), T3 ($\ell = 1$, $e \ge 2$, $h = 1$), T4 ($\ell = 1$, $e = 1$), and the terminal row T5, which selects nothing.
The Lean statement
structure XNode (n : ℕ) where
e : ℕ
ell : ℕ
h : ℕ
s0 : ℕ
u0 : ℕ
sel : Option (ℕ × ℕ)
isIncrement : Bool
epos : 1 ≤ e
hpos : 1 ≤ h
ellpos : 1 ≤ ell
hcop : Nat.Coprime e h
selBound : ∀ g μ, sel = some (g, μ) → 1 ≤ g ∧ 1 ≤ μ ∧ μ * g ≤ ell
t2inc : ell = 1 → 2 ≤ e → 2 ≤ h → sel.isSome → isIncrement = true
t3inc : ell = 1 → 2 ≤ e → h = 1 → sel.isSome → isIncrement = true
t4rec : ell = 1 → e = 1 → sel.isSome → isIncrement = false
lean/LeanUrat/MovesX/Defs.lean — structure
definition The sample space: monic p-adic polynomials and their discriminant valuation
All densities in this corpus are contents of subsets of this space, and $v_p(\operatorname{disc} f)$ is the quantity every finiteness bound is charged against.
For a prime $p$ and degree $n$: the ambient space is the set of monic degree-$n$ polynomials over $\mathbb{Z}_p$. Inside it sits the locus $\{f : \operatorname{disc} f = 0\}$ of vanishing discriminant, and off that locus each $f$ carries the natural number $v(f) := v_p(\operatorname{disc} f)$, the $p$-adic valuation of its discriminant. On the vanishing locus $v$ takes an arbitrary junk value, and every statement using $v$ excludes that locus explicitly.
The Lean statement
def MonicBox (n p : ℕ) [Fact p.Prime] : Type :=
{ f : Polynomial ℤ_[p] // f.Monic ∧ f.natDegree = n }
def discZero (n p : ℕ) [Fact p.Prime] : Set (MonicBox n p) := { f | f.1.discr = 0 }
noncomputable def vdisc {n p : ℕ} [Fact p.Prime] (f : MonicBox n p) : ℕ :=
(f.1.discr).valuation
lean/LeanUrat/MovesX/Defs.lean — definition
definition The hypotheses bundle: what the classifier provides at each prime
Every analytic theorem of the corpus is proved against this hypotheses bundle alone; producing a concrete instance from the Okutsu–Montes engine remains open.
Fix a prime $p$ and degree $n$; below $f$ ranges over monic degree-$n$ polynomials over $\mathbb{Z}_p$, $b$ over branches, and $N, D$ over levels. The hypotheses bundle records: a rooted, finitely branching tree of branches attached to every $f$, each branch carrying a finite history of tower nodes; a per-branch threshold $\mathrm{thr}(b)$ and cap $\mathrm{cap}(b)$, with the guarantee that a leaf branch whose history avoids a distinguished class of node letters (the non-standard track) is detected at every level $N \ge \mathrm{thr}(b) + \mathrm{cap}(b)$; a decreasing family of undecided sets $U(N)$, with $f \notin U(N)$ exactly when the tree of $f$ is finite and all its leaves are detected at level $N$; a countable family of fibers covering every polynomial with a non-standard leaf; and a normalized, monotone, finitely subadditive content $\mu$ that kills countable unions of null sets, satisfies $\mu(U(N)) \to \mu(\bigcap_N U(N))$, and obeys the cylinder bound $\mu\{f : v_p(\operatorname{disc} f) \ge D \text{ or } \operatorname{disc} f = 0\} \le T(p,n,D)/p^{nD}$, where $T(p,n,D)$ counts the coefficient tuples mod $p^D$ whose discriminant vanishes mod $p^D$.
The Lean statement
structure XCtx (n p : ℕ) [Fact p.Prime] where
Branch : MonicBox n p → Type
hist : ∀ {f}, Branch f → XHistory n
wf : ∀ {f} (b : Branch f), HistWF n (hist b)
root : ∀ f, Branch f
hist_root : ∀ f, hist (root f) = ([] : XHistory n)
parent : ∀ {f}, Branch f → Option (Branch f)
parent_hist : ∀ {f} (b b' : Branch f), parent b = some b' → ∃ ν, hist b = hist b' ++ [ν]
parent_root : ∀ f, parent (root f) = none
reach : ∀ {f} (b : Branch f),
Relation.ReflTransGen (fun c d => parent c = some d) b (root f)
children : ∀ {f}, Branch f → Finset (Branch f)
children_iff : ∀ {f} (b c : Branch f), c ∈ children b ↔ parent c = some b
complete : ∀ {f}, Branch f → Prop
nsTrack : XNode n → Prop
nsDec : DecidablePred nsTrack
capDetectable : ∀ {f}, Branch f → Prop
capDec : ∀ f, DecidablePred (@capDetectable f)
detCap : ∀ {f}, Branch f → ℕ
threshold : ∀ {f}, Branch f → ℕ
DetectedAt : ∀ {f}, Branch f → ℕ → Prop
detectBranch :
∀ {f} (b : Branch f), children b = ∅ → (∀ ν ∈ hist b, ¬ nsTrack ν) →
∀ N, threshold b + @ite ℕ (capDetectable b) (capDec f b) (detCap b) 0 ≤ N →
DetectedAt b N
Undec : ℕ → Set (MonicBox n p)
undec_spec :
∀ f N, f ∉ Undec N ↔
(Finite (Branch f) ∧ ∀ b : Branch f, children b = ∅ → DetectedAt b N)
undec_antitone : Antitone Undec
nsIdx : Type
nsCountable : Countable nsIdx
nsFiber : nsIdx → Set (MonicBox n p)
nsCover :
∀ f, (∃ b : Branch f, children b = ∅ ∧ ∃ ν ∈ hist b, nsTrack ν) → ∃ i, f ∈ nsFiber i
frac : Set (MonicBox n p) → ℚ
frac_univ : frac Set.univ = 1
frac_nonneg : ∀ s, 0 ≤ frac s
frac_mono : ∀ s t, s ⊆ t → frac s ≤ frac t
frac_union_le : ∀ s t, frac (s ∪ t) ≤ frac s + frac t
frac_iUnion_null :
∀ (s : ℕ → Set (MonicBox n p)), (∀ i, frac (s i) = 0) → frac (⋃ i, s i) = 0
frac_inter_tendsto :
Filter.Tendsto (fun N => frac (Undec N)) Filter.atTop (nhds (frac (⋂ N, Undec N)))
vdisc_le_tail :
∀ D, frac { f | D ≤ vdisc f ∨ f ∈ discZero n p } ≤ (tailCount p n D : ℚ) / p ^ (n * D)
lean/LeanUrat/MovesX/Defs.lean — structure
definition A classifier at every prime, tied together by the index inequality
The inequality $2\,\mathrm{ind}(f) \le v_p(\operatorname{disc} f)$ is the cited Guardia–Montes–Nart theorem of the index; exhibiting an actual family — a concrete instance of the bundle at every prime — is the one existence obligation the corpus leaves open.
For degree $n$: the corpus's one global parameter is a choice, for every prime $p$, of a classifier hypotheses bundle as above, together with an index function $\mathrm{ind}$ and a stratum-membership relation satisfying $2\,\mathrm{ind}(f) \le v_p(\operatorname{disc} f)$ for every polynomial $f$ with $\operatorname{disc} f \ne 0$ — compatible in the sense that every polynomial lies in the stratum of each of its own branch histories.
The Lean statement
structure GMNIndex (n p : ℕ) [Fact p.Prime] where
ind : MonicBox n p → ℕ
inStratum : MonicBox n p → XHistory n → Prop
p2 : ∀ f, f ∉ discZero n p → 2 * ind f ≤ vdisc f
structure XFamily (n : ℕ) where
ctx : ∀ (p : ℕ) [Fact p.Prime], XCtx n p
gmn : ∀ (p : ℕ) [Fact p.Prime], GMNIndex n p
gmnLink :
∀ (p : ℕ) [Fact p.Prime] (f : MonicBox n p) (b : (ctx p).Branch f),
(gmn p).inStratum f ((ctx p).hist b)
lean/LeanUrat/MovesX/Defs.lean — structure
definition Nine named hypotheses carry all the conditionality
These nine propositions are the hypotheses of every conditional theorem below; all remain open, to be discharged by the classifier corpora.
For a prime $p$, degree $n$, level $N$, a polynomial $f$, and a branch $b$: nine propositions about a fixed family, stated once and used everywhere. Here $\mu$ is the content, $\mathrm{thr}(b)$ and $\mathrm{cap}(b)$ the per-branch threshold and cap, $h_r$ the slope numerators along a history, $s = s(n)$ a fixed constant, $h^*$ a height threshold, and $C_T, c_T > 0$ tail constants. Alignment: the certified depth of any stratum is at most the index when $\operatorname{disc} f \ne 0$. Weight-charge: the number of recentering and T4 steps is at most $s\, v_p(\operatorname{disc} f)$. Threshold and cap linearity: $\mathrm{thr}(b)$ and $\mathrm{cap}(b)$ grow at most linearly in the total height $\sum_r h_r$. Progress: branches undetected at level $N$ are deep or tall at rates linear in $N$. Tall-tails: $\mu(\text{some node has height} \ge h^*) \le C_T\, p^{-c_T h^*}$. Ns-null: every non-standard-track fiber has content zero. The route disjunction combines alignment and weight-charge in either of two admissible pairings. And the bridge, displayed here: at every level $N$ the undecided set is contained in $(\operatorname{disc} = 0) \cup (\text{ns-fibers}) \cup (\text{infinite trees}) \cup \{f \text{ with a leaf, ns-free branch } b \text{ and } N < \mathrm{thr}(b) + \mathrm{cap}(b)\}$, and the undecided mass carrying no such witness branch is zero.
The Lean statement
def X2BridgeP (n : ℕ) (X : XFamily n) : Prop :=
∀ (p : ℕ) [Fact p.Prime] (N : ℕ),
((X.ctx p).Undec N ⊆ discZero n p ∪ (⋃ i, (X.ctx p).nsFiber i) ∪ InfTree (X.ctx p) ∪
{ f | ∃ b : (X.ctx p).Branch f,
IsLeafB (X.ctx p) b ∧ NsFreeB (X.ctx p) b ∧
N < (X.ctx p).threshold b + capHB (X.ctx p) b }) ∧
(X.ctx p).frac { f | f ∈ (X.ctx p).Undec N ∧
¬ ∃ b : (X.ctx p).Branch f,
IsLeafB (X.ctx p) b ∧ NsFreeB (X.ctx p) b ∧
N < (X.ctx p).threshold b + capHB (X.ctx p) b } = 0
def X3aRouteP (n : ℕ) (X : XFamily n) (K : XConsts n) : Prop :=
(X1aAlignP n X ⟨true, true⟩ ∧ WeightChargeT4P n X K) ∨
(X1aAlignP n X ⟨true, false⟩ ∧ WeightChargeFullP n X K)
lean/LeanUrat/MovesX/Defs.lean — definition
definition Decided trees and the density of a splitting type
Fixes what 'the density of a splitting type' means and packages the countable decided-tree family the series identity sums over; a concrete instance from the classifier corpora is open.
For a prime $p$ and degree $n$: a series presentation consists of a countable family of complete realizable finite trees $T$, each carrying a fiber (a set of monic degree-$n$ polynomials over $\mathbb{Z}_p$) and a splitting type computed from its letters, together with the true splitting type $\mathrm{type}(f)$ of each polynomial $f$. The fibers are pairwise disjoint, avoid the never-decided set $\bigcap_N U(N)$ (with $U(N)$ the level-$N$ undecided set), and cover every decided polynomial with nonzero discriminant. The density of a splitting type $\sigma$ is then $\mathrm{density}(\sigma) := \mu\{f : \mathrm{type}(f) = \sigma\}$, with $\mu$ the content.
The Lean statement
structure SeriesData (n p : ℕ) [Fact p.Prime] (C : XCtx n p) where
FinTree : Type
treeCountable : Countable FinTree
fiber : FinTree → Set (MonicBox n p)
typemult : FinTree → SplitType n
splitType : MonicBox n p → SplitType n
fiber_disjoint : ∀ T T', T ≠ T' → Disjoint (fiber T) (fiber T')
fiber_decided : ∀ T, Disjoint (fiber T) (⋂ N, C.Undec N)
decided_covered : ∀ f, f ∉ (⋂ N, C.Undec N) → f ∉ discZero n p → ∃ T, f ∈ fiber T
def densityOf (S : SeriesData n p C) (σ : SplitType n) : ℚ :=
C.frac { f | S.splitType f = σ }
lean/LeanUrat/MovesX/Defs.lean — structure
proved The table index counts lattice points under the Newton segment
The $0$ on rows T3/T4 records 'no per-step bound from the table', never 'the index is zero'; the T1/T2 positivity is what lets each certified step draw down the index by at least one in the depth bound.
For a continuing node $\nu = (e, \ell, h, s_0, u_0)$, the doubled table index — $\ell(eh\ell + 1 - e - h)$ on row T1 (residual length $\ell \ge 2$), $(e-1)(h-1)$ on row T2 ($\ell = 1$, $e \ge 2$, $h \ge 2$), and $0$ on the remaining rows — equals twice the number of lattice points $(x, y)$ with $s_0 < x \le s_0 + e\ell$, $u_0 < y \le u_0 + h\ell$, and $h(x - s_0) + e(y - u_0) \le eh\ell$: the points strictly to the right of and above the base point, on or below the Newton-polygon segment. On rows T1 and T2 the doubled index is moreover at least $1$.
The Lean statement
theorem ind2Region {n : ℕ} (ν : XNode n) (hc : ν.continuing) :
ind2 ν = 2 * ν.region.card ∧ ((rowOf ν = .T1 ∨ rowOf ν = .T2) → 1 ≤ ind2 ν)
lean/LeanUrat/MovesX/XA9.lean — theorem
conditional Tower depth is linear in the discriminant valuation
The finiteness engine of the whole corpus: trees over polynomials of bounded discriminant valuation cannot be deep.
For a prime $p$, degree $n \ge 1$, and a monic polynomial $f$ over $\mathbb{Z}_p$: assume alignment (increment steps certified against the index, recenterings not) and full weight-charge (at most $s\, v_p(\operatorname{disc} f)$ recentering and T4 steps). If $f$ has nonzero discriminant and lies in a well-formed stratum with history $H$, then $$2\, d(H) \le (2s+1)\, v_p(\operatorname{disc} f) + 2 \lfloor \log_2 n \rfloor,$$ where $d(H)$ counts the continuing nodes of $H$ and $s = s(n)$ is the weight-charge constant.
Hypotheses this rests on: X1aAlignP ⟨true,false⟩ — the certified depth of any stratum is at most the GMN index (T1/T2 increments certified, recenterings not); WeightChargeFullP — #T1-recenterings + #T4 steps ≤ s(n)·v_p(disc f). Both owed to the classifier corpora.
The Lean statement
theorem x1bReduction {n : ℕ} (X : XFamily n) (K : XConsts n)
(AL : X1aAlignP n X ⟨true, false⟩) (WC : WeightChargeFullP n X K)
(p : ℕ) [Fact p.Prime] (f : MonicBox n p) (H : XHistory n)
(hf : (X.gmn p).inStratum f H) (hd : f ∉ discZero n p) (W : HistWF n H) (hn : 1 ≤ n) :
2 * dTotal H ≤ (2 * K.s + 1) * vdisc f + 2 * Nat.log 2 n
lean/LeanUrat/MovesX/XC3.lean — theorem
conditional Undetected branches are deep or tall on the scale of √N
Depth and height are both priced in the single currency $\sum_r h_r$; this dichotomy drives the square-root fallback envelope.
For a prime $p$, degree $n$, a monic polynomial $f$ over $\mathbb{Z}_p$, a branch $b$ of $f$, a level $N$, and constants $c_0, c_{\mathrm{cap}} > 0$: assume the detection threshold and cap are affine in the total height, $\mathrm{thr}(b) \le 1 + c_0 \sum_r h_r$ and $\mathrm{cap}(b) \le c_{\mathrm{cap}}(1 + \sum_r h_r)$, where $h_r$ runs over the slope numerators of the history of $b$. If $b$ — a leaf, or a prefix of a complete branch, avoiding the non-standard track — is undetected at level $N$, meaning $N < \mathrm{thr}(b) + \mathrm{cap}(b)$, then $$N - 1 - c_{\mathrm{cap}} < (c_0 + c_{\mathrm{cap}})(d + 1)^2 \quad \text{or} \quad N - 1 - c_{\mathrm{cap}} < (c_0 + c_{\mathrm{cap}})\, h_{\max}^2,$$ with $d$ the number of continuing nodes and $h_{\max}$ the largest slope numerator along $b$: escaping detection at level $N$ forces depth or height of order $\sqrt{N}$.
Hypotheses this rests on: X2AffP — the detection threshold of a fourth-piece branch is ≤ 1 + c₀·Σ h_r; X2CapP — its detection cap is ≤ c_cap·(1 + Σ h_r). Both open, to be discharged by the classifier corpora.
The Lean statement
theorem x2hypAssembled {n : ℕ} (X : XFamily n) (K : XConsts n)
(AF : X2AffP n X K) (CP : X2CapP n X K)
(p : ℕ) [Fact p.Prime] (f : MonicBox n p) (b : (X.ctx p).Branch f)
(hb : FourthPieceB (X.ctx p) b) (N : ℕ)
(hN : N < (X.ctx p).threshold b + capHB (X.ctx p) b) :
(N : ℚ) - 1 - K.ccap < (K.c0 + K.ccap) * ((dTotal ((X.ctx p).hist b) : ℚ) + 1) ^ 2 ∨
(N : ℚ) - 1 - K.ccap < (K.c0 + K.ccap) * (maxH ((X.ctx p).hist b) : ℚ) ^ 2
lean/LeanUrat/MovesX/XD4.lean — theorem
proved A normed extension where any p-adic polynomial splits
An existence witness for the tail bound, used only inside the ball-cover argument.
For a prime $p$ and a nonzero polynomial $g$ over $\mathbb{Q}_p$: there is a field extension $L/\mathbb{Q}_p$, equipped with a multiplicative absolute value extending the $p$-adic one, over which $g$ factors into linear pieces — take the splitting field of $g$ with its spectral norm.
The Lean statement
noncomputable def valExtOf (p : ℕ) [Fact p.Prime] (g : Polynomial ℚ_[p]) (hg : g ≠ 0) :
ValExt p g
lean/LeanUrat/MovesX/XF3.lean — definition
proved n − 1 balls cover the discriminant event on a coefficient line
The geometric heart of the tail bound: constant terms producing high discriminant divisibility cluster around the $n-1$ critical points, one ball apiece.
Fix a prime $p$, degree $n \ge 2$, a level $D$, and tail coefficients $a_1, \dots, a_{n-1} \in \mathbb{Z}_p$, and write $f_{a_0} = X^n + a_{n-1}X^{n-1} + \cdots + a_1 X + a_0$. There is a labeling of $\mathbb{Z}_p$ by at most $n - 1$ labels such that whenever two constant terms $a_0, b_0$ both satisfy $p^D \mid \operatorname{disc} f_{a_0}$ (respectively $p^D \mid \operatorname{disc} f_{b_0}$) and receive the same label, they agree modulo $p^E$, where $E = \lceil (D - n\, v_p(n))/(n-1) \rceil$. In other words: on each line where only the constant term varies, the level-$D$ discriminant event lies in at most $n - 1$ balls of radius $p^{-E}$, clustered around the critical points of the polynomial.
The Lean statement
theorem ballCover (p n D : ℕ) [Fact p.Prime] (h2 : 2 ≤ n) (aTail : Fin (n - 1) → ℤ_[p])
(V : ValExt p (fTail n p (by omega) aTail)) :
∃ idx : ℤ_[p] → Fin (n - 1), ∀ a0 b0,
Event p n D (by omega) aTail a0 → Event p n D (by omega) aTail b0 →
idx a0 = idx b0 → (p : ℤ_[p]) ^ (tailExp p n D).toNat ∣ (a0 - b0)
lean/LeanUrat/MovesX/XF6.lean — theorem
proved High discriminant divisibility is rare, unconditionally
The corpus's one fully unconditional analytic estimate over $\mathbb{Z}_p$; fed through the bundle's cylinder bound, it powers every measure statement downstream.
For a prime $p$, degree $n \ge 2$, and a level $D$: write $T(p,n,D)$ for the number of coefficient tuples in $(\mathbb{Z}/p^D)^n$ whose monic degree-$n$ polynomial has discriminant divisible by $p^D$. Then, with no further hypotheses, $$T(p,n,D)\, p^{E} \le (n-1)\, p^{nD}, \qquad E = \lceil (D - n\, v_p(n))/(n-1) \rceil;$$ equivalently, the fraction of level-$D$ coefficient boxes with $p^D \mid \operatorname{disc}$ is at most $(n-1)\, p^{-E}$.
The Lean statement
theorem tailCountBound (p n D : ℕ) [Fact p.Prime] (h2 : 2 ≤ n) :
(tailCount p n D : ℚ) * (p : ℚ) ^ (tailExp p n D) ≤
(n - 1 : ℚ) * (p : ℚ) ^ ((n * D : ℕ) : ℤ)
lean/LeanUrat/MovesX/XF7.lean — theorem
proved The zero-discriminant locus carries no density
The polynomials on which the classifier can never halt carry no mass, so drainage need only be proved off a null set; the proof squeezes the bundle's cylinder bound against the unconditional tail count, for any content satisfying the bundle (whose concrete instance is open).
For every degree $n \ge 2$, every prime $p$, and every content $\mu$ satisfying the hypotheses bundle, the monic degree-$n$ polynomials over $\mathbb{Z}_p$ with discriminant zero form a null set: $\mu\{f : \operatorname{disc} f = 0\} = 0$.
The Lean statement
theorem discZeroNull (n p : ℕ) [Fact p.Prime] (h2 : 2 ≤ n) (C : XCtx n p) :
C.frac (discZero n p) = 0
lean/LeanUrat/MovesX/XF10.lean — theorem
proved König's lemma for the classifier tree
Pure tree combinatorics upgrading 'every path is finite' to 'the whole tree is finite'; it uses none of the nine named hypotheses.
For a prime $p$, degree $n$, any classifier hypotheses bundle over them, and any monic polynomial $f$ over $\mathbb{Z}_p$: if the rooted tree of branches of $f$ admits no infinite descending path — no sequence $g_0, g_1, \dots$ with $g_0$ the root and each $g_{k+1}$ a child of $g_k$ — then $f$ has only finitely many branches. This is König's lemma in contrapositive form; the finite branching it needs is the bundle's finite child sets.
The Lean statement
theorem koenigFinite {n p : ℕ} [Fact p.Prime] (C : XCtx n p) (f : MonicBox n p)
(hbranch : ¬ ∃ g : ℕ → C.Branch f,
g 0 = C.root f ∧ ∀ k, C.parent (g (k + 1)) = some (g k)) :
Finite (C.Branch f)
lean/LeanUrat/MovesX/XG2.lean — theorem
conditional Every classifier tree is finite away from disc = 0
The pointwise half of exhaustiveness: off the null discriminant locus, the classifier halts on every polynomial.
For a prime $p$, degree $n \ge 1$, and a monic polynomial $f$ over $\mathbb{Z}_p$ with $\operatorname{disc} f \ne 0$: assume the route hypothesis, alignment together with weight-charge in either of its two admissible pairings. Then the classifier tree of $f$ is finite: an infinite path would produce strata of unbounded certified depth, contradicting the linear bound $2\, d \le (2s+1)\, v_p(\operatorname{disc} f) + 2\lfloor \log_2 n \rfloor$ (with $d$ the certified depth and $s$ the weight-charge constant), and König's lemma closes the tree.
Hypotheses this rests on: X3aRouteP — either (alignment with recenterings certified + T4-only weight-charge) or (alignment without recenterings + full weight-charge); owed to the classifier corpora.
The Lean statement
theorem treeFinite {n : ℕ} (X : XFamily n) (K : XConsts n) (R : X3aRouteP n X K)
(p : ℕ) [Fact p.Prime] (hn : 1 ≤ n) (f : MonicBox n p) (hd : f ∉ discZero n p) :
Finite ((X.ctx p).Branch f)
lean/LeanUrat/MovesX/XG2d.lean — theorem
conditional Exponential drainage: undecided mass at most c₃·p^(−c₄N)
The strongest drainage rate; the threshold $N_0$ must be fixed before the prime $p$, since an all-$N$, family-dependent bound is false (last card).
For each degree $n \ge 2$ and each fixed list $K$ of constants (the weight-charge, threshold, cap, and tail constants) there exist a level $N_0$ and constants $c_3, c_4 > 0$, all depending only on $(n, K)$ — in particular fixed before the prime — such that for every family satisfying all nine named hypotheses, every prime $p$, and every $N \ge N_0$: $$\mu(U(N)) \le c_3\, p^{-c_4 N},$$ where $U(N)$ is the set of polynomials undecided at level $N$ and $\mu$ the content.
Hypotheses this rests on: X2ProgressP — undetected fourth-piece branches are deep or tall at linear rates in N; X2BridgeP — Undec(N) splits into disc-zero / ns-fiber / infinite-tree / witness-branch pieces with the witness-free remainder of content zero; X2AffP and X2CapP — detection threshold and cap linear in Σ h_r; X1aAlignP ⟨true,false⟩ and WeightChargeFullP — depth charged against v_p(disc); X2TailsP — content of the height-≥h* event ≤ C_T·p^(−c_T·h*); NsNullP — ns fibers null; X3aRouteP — the route disjunction. All owed to the classifier corpora.
The Lean statement
theorem envelopeExp (n : ℕ) (hn : 2 ≤ n) (K : XConsts n) :
∃ N₀ : ℕ, ∃ c3 c4 : ℝ, 0 < c3 ∧ 0 < c4 ∧
∀ (X : XFamily n), X2ProgressP n X K → X2BridgeP n X → X2AffP n X K → X2CapP n X K →
X1aAlignP n X ⟨true, false⟩ → WeightChargeFullP n X K →
X2TailsP n X K → NsNullP n X → X3aRouteP n X K →
∀ (p : ℕ) [Fact p.Prime], ∀ N, N₀ ≤ N →
((X.ctx p).frac ((X.ctx p).Undec N) : ℝ) ≤ c3 * (p : ℝ) ^ (-(c4 * N))
lean/LeanUrat/MovesX/XE2.lean — theorem
conditional Square-root fallback: undecided mass at most c₃′·p^(−c₄′√N)
Trades the hardest hypothesis (linear progress) for the square-root dichotomy, at the price of a $p^{-c\sqrt{N}}$ rate; like the exponential envelope, it needs $N_0$ fixed before the prime $p$.
Drop the progress hypothesis. For each degree $n \ge 2$ and each fixed list $K$ of constants there exist a level $N_0$ and constants $c_3', c_4' > 0$ depending only on $(n, K)$ such that for every family satisfying the remaining eight named hypotheses, every prime $p$, and every $N \ge N_0$: $$\mu(U(N)) \le c_3'\, p^{-c_4' \sqrt{N}},$$ with $U(N)$ the level-$N$ undecided set and $\mu$ the content — subexponential decay, enough for drainage but not for squeeze constants.
Hypotheses this rests on: Same hypothesis list as the exponential envelope minus X2ProgressP: X2BridgeP, X2AffP, X2CapP, X1aAlignP ⟨true,false⟩, WeightChargeFullP, X2TailsP, NsNullP, X3aRouteP; the square-root dichotomy replaces the linear progress hypothesis. All open, to be discharged by the classifier corpora.
The Lean statement
theorem envelopeSqrt (n : ℕ) (hn : 2 ≤ n) (K : XConsts n) :
∃ N₀ : ℕ, ∃ c3' c4' : ℝ, 0 < c3' ∧ 0 < c4' ∧
∀ (X : XFamily n), X2BridgeP n X → X2AffP n X K → X2CapP n X K →
X1aAlignP n X ⟨true, false⟩ → WeightChargeFullP n X K →
X2TailsP n X K → NsNullP n X → X3aRouteP n X K →
∀ (p : ℕ) [Fact p.Prime], ∀ N, N₀ ≤ N →
((X.ctx p).frac ((X.ctx p).Undec N) : ℝ) ≤ c3' * (p : ℝ) ^ (-(c4' * Real.sqrt N))
lean/LeanUrat/MovesX/XE3.lean — theorem
conditional Drainage: the undecided fraction goes to zero
The qualitative capstone of the corpus and the exhaustiveness leg the project's full density theorem still needs: the never-decided set is squeezed inside the null discriminant locus and the null ns-fibers.
For every degree $n \ge 2$, every family satisfying the route and ns-null hypotheses, and every prime $p$: $$\mu(U(N)) \longrightarrow 0 \quad (N \to \infty),$$ where $U(N)$ is the set of polynomials undecided at level $N$ and $\mu$ the content — asymptotically, the classifier decides every monic degree-$n$ polynomial over $\mathbb{Z}_p$.
Hypotheses this rests on: X3aRouteP — the alignment/weight-charge route disjunction; NsNullP — every non-standard-track fiber has content zero. Both owed to the classifier corpora, as is the family's real instance.
The Lean statement
theorem x3Density {n : ℕ} (X : XFamily n) (K : XConsts n) (hn : 2 ≤ n)
(R : X3aRouteP n X K) (NS : NsNullP n X) (p : ℕ) [Fact p.Prime] :
Filter.Tendsto (fun N => (X.ctx p).frac ((X.ctx p).Undec N)) Filter.atTop (nhds 0)
lean/LeanUrat/MovesX/XG3.lean — theorem
conditional Summing decided trees gives each splitting-type density
The corpus's final output: the bridge from tree-by-tree computation to the exact density of every splitting type — the quantity the uniformity theorem's rational function ultimately evaluates.
For a prime $p$, degree $n \ge 2$, and a content $\mu$: assume the route and ns-null hypotheses, that membership in a tree's fiber pins the true splitting type of a polynomial to the tree's computed one, and that $\mu$ is countably additive over the disjoint family of tree fibers. Then for each splitting type $\sigma$, the sum of $\mu(\text{fiber of } T)$ over the decided trees $T$ of computed type $\sigma$ converges to $$\mathrm{density}(\sigma) = \mu\{f : \mathrm{type}(f) = \sigma\},$$ with $\mathrm{type}(f)$ the true splitting type of $f$.
Hypotheses this rests on: X3aRouteP — route disjunction; NsNullP — ns fibers null; VPSoundP — membership in a tree fiber pins the true splitting type to the letter-computed one; CountableFiberAdditive — the content is countably additive over the disjoint tree-fiber family (the Tonelli positive-term regrouping, owed); plus the series presentation itself, whose instance is owed.
The Lean statement
theorem x3Series {n : ℕ} (X : XFamily n) (K : XConsts n) (hn : 2 ≤ n)
(R : X3aRouteP n X K) (NS : NsNullP n X)
(p : ℕ) [Fact p.Prime] (S : SeriesData n p (X.ctx p))
(VP : VPSoundP S) (ADD : CountableFiberAdditive S) (σ : SplitType n) :
HasSum (fun T : { T // S.typemult T = σ } => (X.ctx p).frac (S.fiber T))
(densityOf S σ)
lean/LeanUrat/MovesX/XG4.lean — theorem
proved The countermodel that killed the all-levels envelope
Both envelope theorems therefore fix the level $N_0$ before the prime $p$; the square-root envelope's all-$N$ form fails to the same point mass.
At degree $n = 2$: the exponential envelope as first stated — constants allowed to depend on the family, the bound asserted at every level $N$ and prime $p$ — is false. Take the point mass at $f_0 = X^2 + X$, whose discriminant is $1$ and hence a unit at every prime, with the root-only tree and threshold plus cap equal to $2$: all nine named hypotheses hold, yet the undecided mass at level $N = 1$ equals $1$ for every prime $p$, which no bound of the form $c_3\, p^{-c_4}$ survives as $p \to \infty$.
The Lean statement
theorem envelopeExp_statement_false :
¬ (∀ (n : ℕ) (hn : 2 ≤ n) (X : XFamily n) (K : XConsts n),
X2ProgressP n X K → X2BridgeP n X → X2AffP n X K → X2CapP n X K →
X1aAlignP n X ⟨true, false⟩ → WeightChargeFullP n X K →
X2TailsP n X K → NsNullP n X → X3aRouteP n X K →
∃ c3 c4 : ℝ, 0 < c3 ∧ 0 < c4 ∧ ∀ (p : ℕ) [Fact p.Prime] (N : ℕ),
((X.ctx p).frac ((X.ctx p).Undec N) : ℝ) ≤ c3 * (p : ℝ) ^ (-(c4 * N)))
lean/notes/XE2_refutation_witness.lean — countermodel
8 The squeeze: Theorem U
From a per-prime instance bundle (decided counts, vanishing envelope, regularity data, a coefficient-class bridge), the capstone proves: at every prime passing the two-clause regularity gate, each splitting type's density exists, equals the candidate rational function's value, and does so in three provably equivalent readings, with the candidates summing to 1. This is a machine-checked implication whose axiom footprint is exactly Lean's core; what feeds it — including thirteen typed placeholder slots that currently impose no constraint — is itemized in the amber panel.
Theorem U: the capstone (MovesU) 12 definition · 3 proved · 5 conditional
Theorem U: one rational function per splitting type, exact at every gate-passing prime — conditional on the open per-prime counting and identification ties.
The summit of the pipeline: Theorem U says that for each splitting type $\sigma$ of degree $n$ there is one rational function $R_\sigma(q)$, with $\sum_\sigma R_\sigma = 1$ identically, whose value at any prime $p$ passing a typed regularity gate — wildly ramified primes included — is the density of monic degree-$n$ polynomials over $\mathbb{Z}_p$ that factor with shape $\sigma$. The proof is a squeeze: decided counts are partial sums of a positive series over canonical trees (the upper leg), an exact partition of the coefficient box plus the checksum wring out the lower leg, and a vanishing undecided envelope pinches the two together. Every step is proved from its stated hypotheses with no axioms beyond Lean's core, but those hypotheses are the honest measure of what remains open: the counting and identification ties to the corpora it depends on, thirteen assumptions still awaiting their vocabulary, and a per-prime instantiation bundle constructed nowhere in the repository.
Builds on: MovesS, MovesT, MovesX, MovesV, MovesRBase, MovesD, MovesC
conditional Theorem U: one rational function gives the splitting density at every regular prime
The capstone of the whole project: complete from its stated hypotheses with no axioms beyond Lean's core, but conditional — no per-prime bundle is constructed anywhere in the repository and the thirteen bare assumptions still await their vocabulary, so the hypothesis list measures the distance to an unconditional theorem.
For a prime $p$, degree $n \ge 2$, level $N \in \mathbb{N}$, indeterminate $q$, and splitting type $\sigma$ of degree $n$, assume all the stated hypotheses: the carrier pack of the built resolvent-solve corpus, the upstream kernel carriers with their typed counting laws, the prime-uniform finiteness kernel, thirteen named auxiliary assumptions, and — for every prime $p$ — a per-prime instantiation bundle. Then there is a family of rational functions $R_\sigma \in \mathbb{Q}(q)$, one for each splitting type $\sigma$ of degree $n$ and equal to the solver's own output family, with $\sum_\sigma R_\sigma = 1$ identically in $q$, such that at every prime $p$ passing the regularity gate (REG-$p$) — writing $d_\sigma(N)$ for the number of level-$N$ coefficient classes decided $\sigma$ (out of $p^{nN}$) and $\mathrm{env}(N)$ for the undecided fraction: (U-n) $(R_\sigma(p) - \mathrm{env}(N))\,p^{nN} \le d_\sigma(N) \le R_\sigma(p)\,p^{nN}$ for all $\sigma$ and $N$; (i) $d_\sigma(N)/p^{nN} \to R_\sigma(p)$; (ii) the density of classes whose true factorization type is $\sigma$ tends to the same limit; (ii-$\mathbb{Z}_p$) so does the $\mathbb{Z}_p$-read density — the fraction of classes all of whose monic degree-$n$ lifts to $\mathbb{Z}_p$ factor over $\mathbb{Q}_p$ with shape $\sigma$, each irreducible factor read as its (ramification index, residue degree); and (iii) $\mathrm{env}(N) \to 0$. At a prime failing the gate, nothing is claimed.
Hypotheses this rests on: C (the built resolvent-solve corpus's carrier pack: table, measured side, rational burdens, degree conservation, K-matrix hypotheses, shape family, measured chain); KC (the built MovesX/MovesV/MovesRBase carrier corpora); KT (five numbered upstream counting laws of the source note — its rows CL-2/CL-3/CL-8/CL-13/CL-15 — stated at those carriers); K7 (the prime-uniform finiteness kernel with its counting laws); rel1, rel2a, rel2b, rel2d, rel2e, rel3, rs0Lump, trackRule, dnLattice, m1m5Echo, x1aDict, m4bConst, jcInvHist (13 named bare assumptions — untyped and trivially instantiable per the adjudicated review record: the vocabulary needed to type them is not yet built, so they impose no mathematical obligation yet); inst (for EVERY prime, a per-prime bundle: the ledger with its tree-count and solver ties, the block-system pin, the tree pin plus its sibling/junction counting rows, the p-adic bridge with its stated residue, and the slice bound — constructed nowhere in the repository); per-prime RegP (the (REG-p) regularity gate, gating each prime's conclusion).
The Lean statement
theorem theoremU (n : ℕ) (hn : 2 ≤ n) (C : UCarriers n) (KC : KernelCarriers n C)
(K7 : Cl7Kernel n KC) (S : SolveData n)
(KT : UpstreamTyped n KC)
(rel1 rel2a rel2b rel2d rel2e rel3 : Prop)
(rs0Lump trackRule dnLattice : Prop)
(m1m5Echo x1aDict m4bConst jcInvHist : Prop)
(hrel1 : rel1) (hrel2a : rel2a) (hrel2b : rel2b) (hrel2d : rel2d)
(hrel2e : rel2e) (hrel3 : rel3)
(hrs0 : rs0Lump) (htrk : trackRule) (hdn : dnLattice)
(hm15 : m1m5Echo) (hx1a : x1aDict) (hm4b : m4bConst) (hjc : jcInvHist)
(inst : ∀ (p : ℕ) (hp : p.Prime), UInstance n C KC K7 S p hp) :
∃ R : SplittingType n → RatFunc ℚ,
R = S.R ∧
(∑ σ, R σ = 1) ∧
∀ (p : ℕ) (hp : p.Prime), RegP (inst p hp).D →
(∀ (σ : SplittingType n) (N : ℕ),
(evalℝ ⟨R⟩ σ p - (inst p hp).X.env N) * (p : ℝ) ^ (n * N)
≤ ((inst p hp).X.decided σ N : ℝ) ∧
((inst p hp).X.decided σ N : ℝ)
≤ evalℝ ⟨R⟩ σ p * (p : ℝ) ^ (n * N))
∧ (∀ σ : SplittingType n,
Tendsto ((inst p hp).X.dmass σ) atTop (𝓝 (evalℝ ⟨R⟩ σ p)))
∧ (∀ σ : SplittingType n,
Tendsto ((inst p hp).X.trueDmass σ) atTop (𝓝 (evalℝ ⟨R⟩ σ p)))
∧ (∀ σ : SplittingType n,
Tendsto (@ZpBridge.zpDmass n p ⟨hp⟩ _ (inst p hp).bridge σ) atTop
(𝓝 (evalℝ ⟨R⟩ σ p)))
∧ Tendsto (inst p hp).X.env atTop (𝓝 0)
lean/LeanUrat/MovesU/U10_theoremU.lean — theorem
definition Splitting types: the shapes a degree-n polynomial can factor into
The index of the whole theorem — densities, rational functions, and classifier verdicts are all keyed by these — and their finiteness is what makes the checksum $\sum_\sigma R_\sigma = 1$ a finite sum.
For a degree $n$: a splitting type of degree $n$ is a multiset of pairs $(e_i, f_i)$ of positive integers with $\sum_i e_i f_i = n$ — the shape of a factorization of a monic degree-$n$ polynomial into irreducible factors with ramification indices $e_i$ and residue degrees $f_i$. For each $n$ there are finitely many, proved separately.
The Lean statement
def SplittingType (n : ℕ) : Type :=
{σ : Multiset (ℕ × ℕ) // (∀ x ∈ σ, 1 ≤ x.1 ∧ 1 ≤ x.2) ∧
(σ.map fun x => x.1 * x.2).sum = n}
lean/LeanUrat/MovesU/Defs.lean — definition
definition A classifier: level-by-level verdicts on coefficient classes
The vocabulary every density statement is typed in; soundness of verdicts is deliberately not built in but carried as a separate hypothesis, and the classifier is later identified with the built canonical-tree corpus by the tree pin.
For a prime $p$, degree $n$, and level $N$: a classifier at $p$ consists of a verdict map assigning to every class of the level-$N$ box — the $n$ free coefficients of a monic degree-$n$ polynomial modulo $p^N$, hence $p^{nN}$ classes — either a splitting type or “undecided”; a true-type field on the same classes; a stability law, that a verdict made at level $N$ persists to every higher level; and a fixed digit-section convention. From the verdicts one defines the decided count $d_\sigma(N)$, the undecided count $\mathrm{undec}(N)$, the envelope $\mathrm{env}(N) = \mathrm{undec}(N)/p^{nN}$, and the decided and true-type densities.
The Lean statement
structure ClassifierSpec (n p : ℕ) where
canonical : ∀ N : ℕ, Box p n N → Option (SplittingType n)
trueType : ∀ N : ℕ, Box p n N → Option (SplittingType n)
canonical_stable : ∀ {N N'} (h : N ≤ N') (f : Box p n N') (σ : SplittingType n),
canonical N (boxProj p n h f) = some σ → canonical N' f = some σ
baseSection : BaseSection
lean/LeanUrat/MovesU/Defs.lean — structure
definition The regularity gate (REG-p): when a prime may evaluate the tables
The theorem's only per-prime restriction: conclusions are asserted exactly at primes passing the gate and nowhere else — which is how one fixed rational function can cover wildly ramified primes without overclaiming.
For a prime $p$, the gate (REG-$p$) requires: for every value $q_0$ in the pool $Q(p) = \{p^\delta : \delta \in \text{depth set}\}$ and every block $e$ of the block system: (r1) the determinant $\det(I - K_e)$ is defined and nonzero at $q_0$; and (r2) every rational function on the block's entry list — the entries of the matrix $K_e$, the terminal and split vectors, the per-cell branching entries, the injection entries, the shallow-shape weights, and the $\beta$-legs at every depth — is defined at $q_0$ with value equal to its prescribed active value. Definedness of $R_\sigma$ itself at $p$, and agreement with its active value, are derived consequences rather than extra conditions.
The Lean statement
def RegP {p : ℕ} (D : RegData p) : Prop :=
∀ q₀ ∈ D.Pool, ∀ e : D.Block,
(letI := D.instBi e; letI := D.instBd e;
DefinedAt (Matrix.det (1 - D.K e)) (q₀ : ℚ) ∧
(Matrix.det (1 - D.K e)).eval (RingHom.id ℚ) (q₀ : ℚ) ≠ 0) ∧
∀ g ∈ D.entryList e,
DefinedAt g (q₀ : ℚ) ∧ g.eval (RingHom.id ℚ) (q₀ : ℚ) = D.act g q₀
lean/LeanUrat/MovesU/Defs.lean — definition
definition A positive series over canonical trees
Decided counts turn out to be exactly the threshold-$\le N$ partial sums of this series — the source of the upper bracket leg — and its full sum is later matched to the solver's measured value.
For a splitting type $\sigma$ of degree $n$ and level $N$: a family of canonical trees, each tree $T$ carrying the mass $\mu(\mathrm{fiber}\,T) \in [0,\infty]$ of its fiber and a decision threshold $\mathrm{thr}(T) \in \mathbb{N}$, with the finite slice $\{T : \mathrm{thr}(T) \le N\}$ characterized by the threshold rather than freely chosen. The full sum $\sum_T \mu(\mathrm{fiber}\,T)$ always exists in the extended reals, and every slice sum is dominated by it — positivity does Tonelli's work.
The Lean statement
structure FiberSeries (n p : ℕ) (X : ClassifierSpec n p) where
Tree : SplittingType n → Type
instTreeDeq : ∀ σ, DecidableEq (Tree σ)
mass : ∀ σ, Tree σ → ℝ≥0∞
thr : ∀ σ, Tree σ → ℕ
thrSlice : ∀ σ : SplittingType n, ℕ → Finset (Tree σ)
mem_slice_iff : ∀ σ N (T : Tree σ), T ∈ thrSlice σ N ↔ thr σ T ≤ N
slice_exhausts : ∀ σ (T : Tree σ), T ∈ thrSlice σ (thr σ T)
lean/LeanUrat/MovesU/Defs.lean — structure
definition The tree-count tie: each canonical tree counts its classes exactly (open premise)
The tree-side distance to unconditionality: the count tie is the open premise, and the tree-expansion theorem of the MovesT corpus is the candidate for discharging it through the tree pin.
For a prime $p$, degree $n$, level $N$, and splitting type $\sigma$: three named open counting premises — (a) every level-$N$ class decided $\sigma$ is assigned a canonical tree of type $\sigma$; (b) the assigned tree has decision threshold $\le N$; and (c) the exact tie — for each tree $T$ with $\mathrm{thr}(T) \le N$, the mass of its fiber scales to the exact count, $\mu(\mathrm{fiber}\,T)\cdot p^{nN} = \#\{\text{decided-}\sigma\text{ classes assigned } T\}$.
The Lean statement
structure TreeSeam (n p : ℕ) (X : ClassifierSpec n p) (F : FiberSeries n p X) where
treeOf : ∀ (σ : SplittingType n) (N : ℕ)
(f : {f : Box p n N // X.canonical N f = some σ}), F.Tree σ
thr_le : ∀ σ N f, F.thr σ (treeOf σ N f) ≤ N
count_tie : ∀ (σ : SplittingType n) (N : ℕ) (T : F.Tree σ), F.thr σ T ≤ N →
F.mass σ T * (p : ℝ≥0∞) ^ (n * N)
= (Nat.card {f : {f : Box p n N // X.canonical N f = some σ} //
treeOf σ N f = T} : ℝ≥0∞)
lean/LeanUrat/MovesU/DefsLedger.lean — structure
conditional Decided counts are partial sums of the tree series
Derived from the named counting premises rather than assumed as its own hypothesis, so the decided-count identity rests on fewer assumptions.
For a prime $p$, degree $n$, level $N$, and splitting type $\sigma$: granting the tree-count tie, $d_\sigma(N) = p^{nN} \sum_{\mathrm{thr}(T) \le N} \mu(\mathrm{fiber}\,T)$, where $d_\sigma(N)$ is the number of level-$N$ classes decided $\sigma$ and the sum runs over canonical trees $T$ of type $\sigma$ with threshold $\le N$, each weighted by its fiber mass — partition the decided classes by their assigned tree and add the exact per-tree counts.
Hypotheses this rests on: seam — the tree-count tie: the canonical-tree assignment, its threshold bound, and the exact per-tree count law (the open TREE-N premise, supplied per prime by the instantiation bundle).
The Lean statement
theorem TreeSeam.finiteness_stack {n p : ℕ} [NeZero p] {X : ClassifierSpec n p}
{F : FiberSeries n p X} (seam : TreeSeam n p X F)
(σ : SplittingType n) (N : ℕ) :
(X.decided σ N : ℝ≥0∞)
= (p : ℝ≥0∞) ^ (n * N) * ∑ T ∈ F.thrSlice σ N, F.mass σ T
lean/LeanUrat/MovesU/DefsLedger.lean — theorem
proved Decided plus undecided fills the box exactly
The identity that lets the checksum $\sum_\sigma R_\sigma = 1$ convert upper bounds at every type $\tau \ne \sigma$ into the lower bracket leg at $\sigma$.
For a prime $p$, degree $n$, level $N$, and splitting type $\sigma$: $\sum_\sigma d_\sigma(N) + \mathrm{undec}(N) = p^{nN}$, where $d_\sigma(N)$ counts the level-$N$ classes decided $\sigma$ and $\mathrm{undec}(N)$ the undecided ones — the $p^{nN}$ classes of monic coefficients modulo $p^N$ partition exactly. A pure counting identity, true for any classifier.
The Lean statement
theorem boxN {n p : ℕ} (X : ClassifierSpec n p) [NeZero p] (N : ℕ) :
(∑ σ : SplittingType n, X.decided σ N) + X.undec N = p ^ (n * N)
lean/LeanUrat/MovesU/U1_boxN.lean — theorem
conditional The two-sided bracket: every decided count is pinched by R_σ(p)
Hands the capstone exactly the inequality the squeeze needs — the upper leg costs only positivity of the tree series, the lower leg only arithmetic with the box partition and the evaluated checksum.
For a prime $p$, degree $n$, level $N$, indeterminate $q$, and splitting type $\sigma$: granting the tree-count tie, the solver tie, the block-system pin, the checksum $\sum_\sigma R_\sigma = 1$ in $\mathbb{Q}(q)$, and the gate (REG-$p$), and writing $d_\sigma(N)$ for the decided count and $\mathrm{env}(N)$ for the undecided fraction, $$(R_\sigma(p) - \mathrm{env}(N))\, p^{nN} \le d_\sigma(N) \le R_\sigma(p)\, p^{nN}.$$ Upper leg: $d_\sigma(N)$ is a partial sum of the positive tree series, whose full sum is $R_\sigma(p)$. Lower leg: the box partition plus the evaluated checksum turn the upper bounds at all $\tau \ne \sigma$ into the lower bound at $\sigma$.
Hypotheses this rests on: seam (the tree-count tie: the exact per-tree fiber count — open premise); ss (the solver tie: the rational family is the real solver output and the series sums to the measured value — open premise); P (the pin identifying the regularity data with the real block system); hchk (the ℚ(q) checksum Σ_σ R_σ = 1); hreg (the (REG-p) gate); hp (p prime).
The Lean statement
variable {n p : ℕ} {C : UCarriers n} {X : ClassifierSpec n p} {F : FiberSeries n p X}
{S : SolveData n} {D : RegData p}
theorem un_bracket (seam : TreeSeam n p X F) (ss : SolveSeam n p C F S)
(P : RegPin C D) (hchk : ∑ σ, S.R σ = 1) (hreg : RegP D) (hp : p.Prime)
(σ : SplittingType n) (N : ℕ) :
(evalℝ S σ p - X.env N) * (p : ℝ) ^ (n * N) ≤ (X.decided σ N : ℝ) ∧
(X.decided σ N : ℝ) ≤ evalℝ S σ p * (p : ℝ) ^ (n * N)
lean/LeanUrat/MovesU/U6_un_bracket.lean — theorem
proved A vanishing envelope forces the limit
The analytic engine of clause (i), proved unconditionally: existence of the splitting density and its exact value drop out of the bracket together.
For an integer $p > 1$, degree $n$, level $N$, splitting type $\sigma$, and real number $r$: if $(r - \mathrm{env}(N))\,p^{nN} \le d_\sigma(N) \le r\,p^{nN}$ at every level $N$ — with $d_\sigma(N)$ the decided count and $\mathrm{env}(N)$ the undecided fraction — and $\mathrm{env}(N) \to 0$, then the density $d_\sigma(N)/p^{nN}$ converges, with limit $r$.
The Lean statement
theorem squeeze_limit {n p : ℕ} (X : ClassifierSpec n p) (hp : 1 < p) (r : ℝ)
(σ : SplittingType n)
(hbr : ∀ N, (r - X.env N) * (p : ℝ) ^ (n * N) ≤ (X.decided σ N : ℝ) ∧
(X.decided σ N : ℝ) ≤ r * (p : ℝ) ^ (n * N))
(henv : Tendsto X.env atTop (𝓝 0)) :
Tendsto (X.dmass σ) atTop (𝓝 r)
lean/LeanUrat/MovesU/U7_squeeze.lean — theorem
conditional From verdicts to truth: the decided density is the true-type density
The step that makes Theorem U about actual splitting behavior rather than one algorithm's labels — verdict soundness itself stays an open, cited hypothesis carried per prime.
For an integer $p > 1$, degree $n$, level $N$, splitting type $\sigma$, and real number $r$: assume the classifier is verdict-sound — every class it decides $\sigma$ truly has factorization type $\sigma$. If the decided density tends to $r$ and the undecided fraction tends to $0$, then the density of classes of TRUE type $\sigma$ also tends to $r$ — by the sandwich $d_\sigma(N) \le t_\sigma(N) \le d_\sigma(N) + \mathrm{undec}(N)$, where $d_\sigma(N)$ counts classes decided $\sigma$ and $t_\sigma(N)$ classes truly of type $\sigma$: a true-$\sigma$ class is either decided $\sigma$ or undecided.
Hypotheses this rests on: hvs — verdict soundness: every class decided σ truly has type σ (an open kernel with a citation duty, carried as a per-prime ledger row, never proved here); hd, henv — the decided-density limit and vanishing envelope (supplied by the squeeze and the ledger).
The Lean statement
theorem identification {n p : ℕ} (X : ClassifierSpec n p) [NeZero p] (hp : 1 < p)
(r : ℝ) (σ : SplittingType n) (hvs : VPSound X)
(hd : Tendsto (X.dmass σ) atTop (𝓝 r))
(henv : Tendsto X.env atTop (𝓝 0)) :
Tendsto (X.trueDmass σ) atTop (𝓝 r)
lean/LeanUrat/MovesU/U11_identification.lean — theorem
definition The solver tie: the rational family is the solver's output (open premise)
Pins the capstone's existential witness to the real solver output — closing the loophole where any rational family summing to one would have satisfied the statement — while the series half, matching Haar mass of canonical fibers to the measured chain, is the open counting premise.
For a prime $p$, degree $n$, indeterminate $q$, and splitting type $\sigma$: two named open premises binding the abstract data to the built solver corpus — (a) for each $\sigma$, the tree-fiber series sums exactly to the measured chain value at $q = p$; and (b) under the determinant hypothesis, $R_\sigma$ IS the shallow resolvent solve, the fixed rational function produced by the Cramer–adjugate route through the block system.
The Lean statement
structure SolveSeam (n p : ℕ) (C : UCarriers n) {X : ClassifierSpec n p}
(F : FiberSeries n p X) (S : SolveData n) : Prop where
series_tie : ∀ σ : SplittingType n,
F.seriesSum σ = ENNReal.ofReal (C.chain.Rval (vmap C.T σ) (p : ℚ))
r_is_solve : ∀ (hdet : MovesS.DetHyp C.T C.RB C.hK) (σ : SplittingType n),
S.R σ = MovesS.Rsh C.T C.MS C.RB C.hdc C.hK hdet C.Fam C.chain.WshP (vmap C.T σ)
lean/LeanUrat/MovesU/DefsLedger.lean — structure
conditional The checksum evaluates: densities sum to one at each regular prime
Derived from the symbolic checksum plus derived definedness rather than assumed as its own hypothesis, so the sum-to-one at each regular prime costs no extra assumption.
For a prime $p$, degree $n$, indeterminate $q$, and splitting type $\sigma$: from the identity $\sum_\sigma R_\sigma = 1$ in $\mathbb{Q}(q)$, at any prime $p$ passing (REG-$p$) each $R_\sigma$ is defined at $q = p$ — definedness is itself derived, through the pins — and the values satisfy $\sum_\sigma R_\sigma(p) = 1$ in $\mathbb{R}$, because evaluation at $p$ is a ring homomorphism on the rational functions regular there.
Hypotheses this rests on: ss (the solver tie — open premise); P (the pin to the real block system); hreg (the (REG-p) gate); hchk (the ℚ(q) checksum Σ_σ R_σ = 1, a ledger row).
The Lean statement
theorem SolveSeam.rs4_eval {n p : ℕ} {C : UCarriers n} {X : ClassifierSpec n p}
{F : FiberSeries n p X} {S : SolveData n} {D : RegData p}
(ss : SolveSeam n p C F S) (P : RegPin C D) (hreg : RegP D) (hp : p.Prime)
(hchk : ∑ σ, S.R σ = 1) :
∑ σ, evalℝ S σ p = 1
lean/LeanUrat/MovesU/DefsLedger.lean — theorem
definition Pinning the regularity data to the real block system
Rules out toy models on the solver side — no surrogate block system can satisfy the pinning hypotheses — and the leg-roster bijection ensures every real leg value is gated by (REG-$p$), with no $\beta$-leg duplicated or dropped.
For a degree $n$: every component of the abstract regularity data is equated with the real built block system: blocks correspond to the working degrees $e \in \{1,\dots,n\}$ and per-block indices to the real table states; the depth set, the matrix entries $K_e$, the injections $\iota_e$, the per-cell branching entries, and the shape weights all equal the real tables'; the active-value operation is the real post-cancellation evaluation on its defined locus; the terminal and split vectors are the designated assembled solver entries, not instance-chosen; and the $\beta$-leg labels biject with the real leg roster — one label per continuing member of each split outcome of each state — each reading its true target degree and state. In particular the gate's condition (r1) forces the real symbolic determinant hypothesis.
The Lean statement
structure RegPin {n : ℕ} (C : UCarriers n) {p : ℕ} (D : RegData p) where
blk : D.Block ≃ {e : ℕ // e ∈ Finset.Icc 1 n}
st : ∀ b : D.Block, D.bidx b ≃ C.T.State (blk b).1
depth_pin : D.depthSet
= (MovesS.consumedDeltas C.T C.Fam).image (fun d : ℕ+ => (d : ℕ))
K_pin : ∀ (b : D.Block) (i j : D.bidx b),
D.K b i j
= MovesS.Kmat C.T C.RB (blk b).1 (C.hK (blk b).1 (blk b).2) (st b i) (st b j)
iota_pin : ∀ (b : D.Block) (i : D.bidx b),
D.iota b i = C.RB.ι (blk b).1 (st b i)
act_pin : ∀ (g : RatFunc ℚ) (q₀ : ℕ) (hok : g ∈ MovesS.OKat (q₀ : ℚ)),
D.act g q₀ = MovesS.evalAt (q₀ : ℚ) ⟨g, hok⟩
bterm_pin : ∀ (b : D.Block) (i : D.bidx b),
D.bterm b i
= ∑ σ' ∈ MovesS.verdictImage C.T (blk b).1 (st b i),
MovesS.bTerm C.T C.RB (blk b).1 σ' (st b i)
bsplit_pin : ∀ (hdet : MovesS.DetHyp C.T C.RB C.hK) (b : D.Block) (i : D.bidx b),
D.bsplit b i
= ∑ σ' ∈ C.chain.Sigmas,
MovesS.bSplit C.T C.RB C.hdc (blk b).1 (blk b).2
(MovesS.blockSolveLt C.RB C.hdc C.hK hdet (blk b).1) σ' (st b i)
legSt : ∀ b : D.Block,
D.legIdx b → (e' : {e' : ℕ // e' ∈ Finset.Icc 1 n}) × C.T.State e'.1
legEquiv : ∀ b : D.Block, D.legIdx b ≃ LegRoster C.T (blk b).1
legSt_pin : ∀ (b : D.Block) (l : D.legIdx b),
legSt b l = legTarget C (blk b).1 (blk b).2 (legEquiv b l)
betaLeg_pin : ∀ (hdet : MovesS.DetHyp C.T C.RB C.hK) (b : D.Block)
(l : D.legIdx b) (δ : ℕ) (hδ : 0 < δ), δ ∈ D.depthSet →
D.betaLeg b l δ
= MovesS.powSubst ⟨δ, hδ⟩
(∑ σ' ∈ C.chain.Sigmas,
MovesS.blockSolve C.T C.RB C.hdc C.hK hdet
(legSt b l).1.1 (legSt b l).1.2 (legSt b l).2 σ')
blockDim_pin : ∀ b, D.blockDim b = Fintype.card (C.T.State (blk b).1)
cell_pin : ∀ b, D.cellCount b
= ∑ τ : C.T.State (blk b).1, ∑ o ∈ MovesS.splitOuts C.T (blk b).1 τ,
(C.MS.cells (blk b).1 τ o).card
Jcell_pin : ∀ b,
(letI := D.instJ b; letI := Classical.decEq (RatFunc ℚ)
Finset.univ.image (D.Jcell b))
= (letI := Classical.decEq (RatFunc ℚ)
(Finset.univ : Finset (C.T.State (blk b).1)).biUnion fun τ =>
(MovesS.splitOuts C.T (blk b).1 τ).biUnion fun o =>
(C.MS.cells (blk b).1 τ o).image fun c =>
(C.RB.jPCell (blk b).1 τ c).val)
shape_pin : D.shapeCount = C.Fam.Sh.card
W_pin : (letI := D.instW; letI := Classical.decEq (RatFunc ℚ)
Finset.univ.image D.Wcoef)
= (letI := Classical.decEq (RatFunc ℚ)
C.Fam.Sh.image fun Ŝ => (C.chain.WshP Ŝ).val)
leg_pin : ∀ b, D.legCount b
= ∑ τ : C.T.State (blk b).1, ∑ o ∈ MovesS.splitOuts C.T (blk b).1 τ,
MovesS.Outcome.c (C.T.odata (blk b).1 τ o)
lean/LeanUrat/MovesU/DefsLedger.lean — structure
definition Pinning the abstract trees to the built canonical-tree corpus
The tree-side twin of the block-system pin: the classifier must speak about the real canonical trees, and the completeness direction makes the count tie a claim about the FULL realizable family rather than some convenient subfamily.
For a prime $p$, degree $n$, level $N$, and splitting type $\sigma$: an injective map sends each abstract $\sigma$-tree to a complete finite canonical tree of the built corpus with the same verdict type and the same threshold, realizable at every positive level at or above that threshold; conversely, every realizable tree of type $\sigma$ and threshold $\le N$ is hit. The level-$N$ coefficient box is identified with the digit box through the base-$p$ digit expansion — no free relabeling — and the verdict is pinned: a class is decided $\sigma$ at level $N$ exactly when it lies in the fiber of a carried $\sigma$-tree within threshold, and the assigned tree is that fibering tree. The coefficient chart lives only at positive levels; at $N = 0$, a one-class box, the pin is silent.
The Lean statement
structure TreePin (X : ClassifierSpec n p) (F : FiberSeries n p X)
(seam : TreeSeam n p X F) where
pol : MovesD.CanonPolicy p (ZMod p)
Tm : ∀ N : ℕ, MovesD.TreeModel p (ZMod p) n N (n * N) pol
chart : ∀ N : ℕ, 0 < N → Fin n → Fin (n * N)
chart_inj : ∀ (N : ℕ) (hN : 0 < N), Function.Injective (chart N hN)
boxeq : ∀ N : ℕ, Box p n N ≃ MovesD.Box p (n * N)
boxeq_digits : ∀ (N : ℕ) (f : Box p n N) (i : Fin n),
f i = ∑ k : Fin N,
((boxeq N f (digitIdx n N i k)).val : ZMod (p ^ N))
* (p : ZMod (p ^ N)) ^ (k : ℕ)
vt : ∀ σ : SplittingType n, F.Tree σ → MovesT.VTree p (ZMod p)
vt_inj : ∀ σ, Function.Injective (vt σ)
vt_typemult : ∀ (σ : SplittingType n) (T : F.Tree σ), (vt σ T).typemult = σ.1
vt_thr : ∀ (σ : SplittingType n) (T : F.Tree σ), F.thr σ T = (vt σ T).thr n
vt_real : ∀ (σ : SplittingType n) (T : F.Tree σ) (N : ℕ) (hN : 0 < N),
F.thr σ T ≤ N → MovesT.Realizes (Tm N) (chart N hN) (vt σ T)
vt_surj : ∀ (σ : SplittingType n) (V : MovesT.VTree p (ZMod p)) (N : ℕ)
(hN : 0 < N), V.typemult = σ.1 → V.thr n ≤ N →
MovesT.Realizes (Tm N) (chart N hN) V →
∃ T : F.Tree σ, vt σ T = V
canonical_pin : ∀ (N : ℕ) (hN : 0 < N) (f : Box p n N) (σ : SplittingType n),
X.canonical N f = some σ ↔
∃ T : F.Tree σ, F.thr σ T ≤ N ∧
(vt σ T).fiberAt (Tm N) (chart N hN) (boxeq N f)
treeOf_pin : ∀ (σ : SplittingType n) (N : ℕ) (hN : 0 < N)
(f : {f : Box p n N // X.canonical N f = some σ}),
(vt σ (seam.treeOf σ N f)).fiberAt (Tm N) (chart N hN) (boxeq N f.1)
lean/LeanUrat/MovesU/DefsLedger.lean — structure
proved The guarded coefficient chart is inhabited
Without the positivity guard, the chart type is uninhabited at level $0$, which would make the capstone's instantiation premise contradictory and the theorem vacuously true; the guard $N > 0$ plus this witness make the premise satisfiable.
For every $n$ and every level $N > 0$, the map $i \mapsto i\cdot N$ is an injection $\{0,\dots,n-1\} \hookrightarrow \{0,\dots,nN-1\}$ — so the positive-level chart type of the tree pin has an explicit inhabitant and its guard is consistent.
The Lean statement
def chartWitness (n N : ℕ) (hN : 0 < N) : Fin n → Fin (n * N) :=
fun i => digitIdx n N i ⟨0, hN⟩
theorem chartWitness_inj (n N : ℕ) (hN : 0 < N) :
Function.Injective (chartWitness n N hN)
lean/LeanUrat/MovesU/DefsLedger.lean — theorem
definition Reading verdicts as p-adic invariants (open premise)
Makes clause (ii-$\mathbb{Z}_p$) about real ramification and residue degrees rather than bare $(e,f)$ labels — which cannot distinguish $(1,6)$ from $(2,3)$ — and instantiating it at the real classifier, with the local-ring plumbing and two local-field laws, is what remains open here.
For a prime $p$, degree $n$, level $N$, and splitting type $\sigma$: a reading assigns to each monic degree-$n$ polynomial $g$ over $\mathbb{Z}_p$ a multiset of pairs $(e,f)$ of positive integers, subject to: $g$ factors over $\mathbb{Q}_p$ into monic irreducible factors with $\mathbb{Z}_p$ coefficients whose (ramification index, residue degree) pairs — the valuation-theoretic invariants, computed in the local ring obtained by adjoining a root — form exactly that multiset, with $e\cdot f$ the degree of each factor; every level-$N$ class admits a monic lift; and the classifier's true type is $\sigma$ precisely when EVERY monic lift reads $\sigma$. It follows that the $\mathbb{Z}_p$-read density equals the true-type density.
The Lean statement
variable (n p : ℕ) [Fact p.Prime]
structure ZpBridge (X : ClassifierSpec n p) where
zfType : Polynomial ℤ_[p] → Multiset (ℕ × ℕ)
zf_pos : ∀ g : Polynomial ℤ_[p], g.Monic → g.natDegree = n →
∀ ef ∈ zfType g, 1 ≤ ef.1 ∧ 1 ≤ ef.2
zf_factor : ∀ g : Polynomial ℤ_[p], g.Monic → g.natDegree = n →
∃ factors : Multiset (Polynomial ℤ_[p]),
g.map (PadicInt.Coe.ringHom)
= (factors.map (Polynomial.map PadicInt.Coe.ringHom)).prod ∧
(∀ h ∈ factors, h.Monic ∧ Irreducible (h.map PadicInt.Coe.ringHom)) ∧
zfType g = factors.map (fun h => (MovesT.ramIdx h, MovesT.resDeg h)) ∧
(zfType g).map (fun ef => ef.1 * ef.2) = factors.map Polynomial.natDegree
lift_exists : ∀ (N : ℕ) (f : Box p n N), ∃ g : Polynomial ℤ_[p],
g.Monic ∧ g.natDegree = n ∧ g.map (PadicInt.toZModPow N) = f.toPoly
lift_true : ∀ (N : ℕ) (f : Box p n N) (σ : SplittingType n),
X.trueType N f = some σ ↔ ZpReads n p zfType N f σ
lean/LeanUrat/MovesU/DefsLedger.lean — structure
definition The per-prime bundle of named hypotheses
Conditionality itemized: each is a named, typed premise with a source corpus responsible for discharging it, not a bare proposition satisfiable trivially.
For a prime $p$, degree $n$, indeterminate $q$, and splitting type $\sigma$: the typed per-prime assumptions of Theorem U, each a named hypothesis: the undecided envelope tends to $0$; the geometric laws for polynomial values and degrees; verdict soundness of the classifier; the equal-degree-continuation classification over the real roster; the shape-weight production law; representative-invariance of the per-cell conditional masses; the Teichmüller digit-section convention; the tree-count tie and the solver tie (the open counting and identification premises); and the checksum $\sum_\sigma R_\sigma = 1$ in $\mathbb{Q}(q)$.
The Lean statement
structure CapstoneLedger (n p : ℕ) (C : UCarriers n) (X : ClassifierSpec n p)
(F : FiberSeries n p X) (S : SolveData n) (D : RegData p) where
cl4_env_tendsto : Tendsto X.env atTop (𝓝 0)
cl6 : Nonempty (MovesS.PolyGeomLaws C.T C.MS C.RB)
cl10_vpsound : VPSound X
cl11_ksub : KsubM1C1T C.T
cl17 : C.chain.wsh17_pin
cl19_rep : ∀ e (τ : C.T.State e) (x x' : C.MS.Rep e τ) (c : C.MS.Cell e τ)
(q₀ : ℚ), q₀ ∈ C.MS.Pools → C.MS.activeState q₀ e τ →
C.MS.μcell e τ x c q₀ = C.MS.μcell e τ x' c q₀
o3_teichmuller : X.baseSection = BaseSection.teichmuller
seam : TreeSeam n p X F
ssrc : SolveSeam n p C F S
rs4_checksum : ∑ σ, S.R σ = 1
lean/LeanUrat/MovesU/DefsLedger.lean — structure
definition The per-prime bundle: everything Theorem U needs at one prime
The measure of Theorem U's distance from unconditionality: constructing one of these at every prime, from the real classifier, is what remains — none exists in the repository.
For a prime $p$, degree $n$, and level $N$: one package — the single hypothesis surface the capstone quantifies over: a classifier, a tree-fiber series, regularity data, the per-prime hypotheses bundle, the block-system pin, the $\mathbb{Z}_p$ reading, the tree pin together with the sibling/junction counting laws asserted at that identified instance, and the slice bound — every threshold-$\le N$ family of trees has at most $T(n,N)$ members, for the prime-uniform bound $T$ fixed before any prime is chosen.
The Lean statement
structure UInstance (n : ℕ) (C : UCarriers n) (KC : KernelCarriers n C)
(K7 : Cl7Kernel n KC) (S : SolveData n) (p : ℕ) (hp : p.Prime) where
X : ClassifierSpec n p
F : FiberSeries n p X
D : RegData p
L : CapstoneLedger n p C X F S D
Dpin : RegPin C D
bridge : @ZpBridge n p ⟨hp⟩ X
Tpin : @TreePin n p ⟨hp⟩ X F L.seam
sibjc : @SibJcRows n p ⟨hp⟩ X F L.seam Tpin
cl7_slice : ∀ (σ : SplittingType n) (N : ℕ),
(F.thrSlice σ N).card ≤ K7.Tbound N
lean/LeanUrat/MovesU/DefsLedger.lean — structure
definition Prime-uniform finiteness: one tree bound for all primes
Uniformity lives in the binder order — one bound $T(n,N)$ must serve every prime simultaneously, so the per-prime finite maximum that always exists cannot satisfy these laws trivially.
For a degree $n$ and level $N$: the finiteness data of the tree-count argument, fixed before any prime is chosen: constants $L(n)$ and $D(n)$, a key-weight budget $w^*(N)$, and a tree-count bound $T(n,N)$, together with three counting laws valid at every prime — each stratum history has at most $L$ ladder restarts; along branches of decision threshold $\le N$, the nodes carrying no genuine increment number at most $L \cdot D \cdot w^*(N)$; and the genuine increments number at most $n\cdot N$. Used per prime as: every threshold-$\le N$ slice of trees has at most $T(n,N)$ members.
The Lean statement
structure Cl7Kernel (n : ℕ) {C : UCarriers n} (KC : KernelCarriers n C) where
L : ℕ
Dden : ℕ
wstar : ℕ → ℕ
Tbound : ℕ → ℕ
hL : 1 ≤ L
hD : 1 ≤ Dden
track_restarts : ∀ (p : ℕ) [Fact p.Prime] (f : MovesX.MonicBox n p)
(H : MovesX.XHistory n), f ∉ MovesX.discZero n p →
(KC.XF.gmn p).inStratum f H →
MovesX.countPop H MovesX.Pop.recT1 + MovesX.countPop H MovesX.Pop.t4 ≤ L
zero_gain : ∀ (p : ℕ) [Fact p.Prime] (f : MovesX.MonicBox n p)
(b : (KC.XF.ctx p).Branch f) (N : ℕ), (KC.XF.ctx p).threshold b ≤ N →
MovesX.dTotal ((KC.XF.ctx p).hist b)
- MovesX.countPop ((KC.XF.ctx p).hist b) MovesX.Pop.incT12
≤ L * Dden * wstar N
genuine_bound : ∀ (p : ℕ) [Fact p.Prime] (f : MovesX.MonicBox n p)
(b : (KC.XF.ctx p).Branch f) (N : ℕ), (KC.XF.ctx p).threshold b ≤ N →
MovesX.countPop ((KC.XF.ctx p).hist b) MovesX.Pop.incT12 ≤ n * N
lean/LeanUrat/MovesU/DefsLedger.lean — structure
9 The independent measure route and the trusted base
A second, independent route expresses the densities through p-adic measure theory and the Denef–Igusa cell decomposition (entering as a cited axiom, used on this route only). The root modules also hold the shared vocabulary (rational-function carriers, the goal interfaces) and the axiom census that pins the trusted base of every capstone.
The measure route and the trusted base (root modules) 2 cited axiom · 6 definition · 11 proved · 1 conditional
One induction makes tree recursions rational in q; the counting lemmas, the meaning of density, and the cited axioms live beside it
The engine room shared by both proof routes. Its centerpiece is a single abstract induction: any well-founded tree recursion whose coefficients are rational functions of q has solutions that are themselves single rational functions of q — the mechanism by which the splitting density forgets the prime. Around it sit the finite-field counts, the Newton-polygon volume, and the tame-prime interpolation that feed the induction; the definition giving density its honest meaning as a limit of decided counts rather than the trivial box total; the cited Denef–Igusa cell recursion and Guardia–Montes–Nart tree structure on which the measure route depends; and the file printing which axioms each capstone uses.
Builds on: Interface, L5fix, OM, MontesV2, Goal
definition One rational function of q for every prime power at once
Every density capstone concludes that some counting limit satisfies this predicate; the same file proves the closure under sums, products, and division by pole-free denominators that the induction engine closes with.
A function $f : \mathbb{N} \to \mathbb{Q}$ is a *uniform rational function of $q$* if a single pair of polynomials $\mathrm{num}, \mathrm{den} \in \mathbb{Q}[t]$, with $\mathrm{den}$ nonvanishing at every integer $q > 1$, gives $f(q) = \mathrm{num}(q)/\mathrm{den}(q)$ for all $q > 1$. One fraction serves every prime power at once — the precise content of the theorem’s "independent of the prime" clause.
The Lean statement
def IsRationalFn (f : ℕ → ℚ) : Prop :=
∃ num den : Polynomial ℚ, den ≠ 0 ∧
∀ q : ℕ, 1 < q → den.eval (q : ℚ) ≠ 0 ∧ f q = num.eval (q : ℚ) / den.eval (q : ℚ)
lean/LeanUrat/RatFn.lean — definition
proved Well-founded tree recursions with rational coefficients have rational solutions
Both routes to the main theorem — measure and count-native — are instantiations of this one induction; this is the step where prime-independence actually happens.
Let every shape $T$ carry a finite list of cells, each pairing a coefficient function of $q$ with a list of child shapes of strictly smaller size, and let $\mathrm{vol}$ satisfy, for all $q > 1$, $\mathrm{vol}(T,q) = \big(\sum_{\text{cells}} \mathrm{coeff}(q) \prod_{\text{children}} \mathrm{vol}(\text{child},q)\big) / \mathrm{pivot}(T,q)$. If every coefficient is a uniform rational function of $q$ and every pivot is rational and nonzero for $q > 1$, then $\mathrm{vol}(T,\cdot)$ is a uniform rational function of $q$ for every $T$ — strong induction on size, closed at each step by the rational-function closure lemmas. No prime $p$ appears in the argument.
The Lean statement
theorem clusterVol_isRational
{Shape : Type*} (size : Shape → ℕ)
(clusterVol : Shape → ℕ → ℚ)
(contribs : Shape → List ((ℕ → ℚ) × List Shape))
(pivot : Shape → (ℕ → ℚ))
(hrec : ∀ (T : Shape) (q : ℕ), 1 < q →
clusterVol T q
= ((contribs T).map
(fun c => c.1 q * (c.2.map (fun ch => clusterVol ch q)).prod)).sum / pivot T q)
(hdescend : ∀ (T : Shape), ∀ c ∈ contribs T, ∀ ch ∈ c.2, size ch < size T)
(hcoeff : ∀ (T : Shape), ∀ c ∈ contribs T, IsRationalFn c.1)
(hpivot_rat : ∀ (T : Shape), IsRationalFn (pivot T))
(hpivot_ne : ∀ (T : Shape) (q : ℕ), 1 < q → pivot T q ≠ 0) :
∀ T : Shape, IsRationalFn (clusterVol T)
lean/LeanUrat/OMInduction.lean — theorem
proved The Newton-polygon cell volume is pure lattice data
The factorization hypothesis records the standard Igusa box/shell Haar computations (absent from mathlib at this pin) as an explicit hypothesis, so the closed form is derived rather than assumed.
For a prime $p$ and a lattice Newton polygon $\Pi$ of width $e$ over a local field whose residue field has size $Q \ge 1$, let $h_i$ be the height over column $i$ ($0 \le i < e$), $V(\Pi)$ the vertex count, $A(\Pi) = \sum_i \lceil h_i \rceil$, $\mu$ the Haar measure, $v$ the valuation, and $c_i$ the degree-$i$ coefficient of a polynomial $g$. If the Haar volume of the cell $\{g : \mathrm{NP}(g) = \Pi\}$ factors as a product of one-variable measures over the columns — $\mu\{v(c_i) = h_i\} = (1-Q^{-1})Q^{-h_i}$ where $\Pi$ has a vertex, $\mu\{v(c_i) \ge \lceil h_i \rceil\} = Q^{-\lceil h_i \rceil}$ elsewhere — then it equals $(1-Q^{-1})^{V(\Pi)}\, Q^{-A(\Pi)}$. Both $V$ and $A$ are lattice data: a wildly ramified slope $a/b$ with $p \mid b$ yields the same $(V, A)$ as a tame slope of the same reduced fraction, so the volume cannot see $p$.
The Lean statement
theorem cellVolume_eq
(cellVol : LatticePolygon → ℕ → ℚ) (pg : LatticePolygon) (Q : ℕ) (hQ : 1 ≤ Q)
(hfactor : cellVol pg Q = ∏ i : Fin pg.width, columnMeasure pg Q i) :
cellVol pg Q = bb1Value pg Q
lean/LeanUrat/L4.lean — theorem
proved Squarefree monic polynomials of degree m number exactly Q^m − Q^(m−1)
The complement count $Q^{m-1}$ — the non-squarefree residuals that force refinement — is the $q$-varying factor of every wild cell coefficient; mathlib has no squarefree-polynomial count, so it is proved here from scratch.
Over a finite field $F$ with $Q = |F|$ elements, for every $m \ge 2$ exactly $Q^m - Q^{m-1}$ of the $Q^m$ monic polynomials of degree $m$ are squarefree. Every monic $R$ factors uniquely as $R = A \cdot B^2$ with $A$ squarefree monic and $B$ monic, giving the convolution identity $Q^n = \sum_{2j \le n} S(n-2j)\, Q^j$ for the squarefree counts $S$, which strong induction solves.
The Lean statement
theorem card_squarefreeMonicDegree (m : ℕ) (hm : 2 ≤ m) :
Nat.card (squarefreeMonicDegree F m) = Nat.card F ^ m - Nat.card F ^ (m - 1)
lean/LeanUrat/L3Squarefree.lean — theorem
proved Gauss’s necklace formula counts the irreducible polynomials
The base of the residue-field combinatorics: it turns every tame shape count into a universal polynomial in $Q$ and feeds the order-0 counting instances of the OM corpus.
Over $\mathbb{F}_Q$, the number $N_d$ of monic irreducible polynomials of degree $d \ge 1$ satisfies $d \cdot N_d = \sum_{e \mid d} \mu(e)\, Q^{d/e}$, with $\mu$ the Möbius function. Counting the elements of $\mathbb{F}_{Q^d}$ by their minimal polynomials gives $\sum_{e \mid d} e \cdot N_e = Q^d$; Möbius inversion does the rest.
The Lean statement
theorem gauss_necklace_count
(F : Type*) [Field F] [Finite F] (d : ℕ) (hd : 1 ≤ d) :
(d : ℚ) * (Nat.card (L3.monicIrreducibleDegree F d) : ℚ)
= ∑ e ∈ d.divisors,
((ArithmeticFunction.moebius e : ℤ) : ℚ) * (Nat.card F : ℚ) ^ (d / e)
lean/LeanUrat/L3Gauss.lean — theorem
proved Agreement at the tame primes forces agreement at every prime
Whatever is computed at the infinitely many easy (tame) primes is thereby forced on the hard (wild) primes as well — the interpolation step behind the whole endgame.
For a degree $n$, a factorization type $\sigma$ of degree $n$, and polynomials $\mathrm{num}, \mathrm{den}, \mathrm{tnum}, \mathrm{tden} \in \mathbb{Q}[t]$ with $\mathrm{den}, \mathrm{tden} \ne 0$: suppose $S = \mathrm{num}/\mathrm{den}$ represents the density $\rho(n,\sigma;q)$ at every $q > 1$ with denominator pole-free there, while $R = \mathrm{tnum}/\mathrm{tden}$ represents the same density only at the tame primes $q = p > n$. Then $\mathrm{num} \cdot \mathrm{tden} = \mathrm{tnum} \cdot \mathrm{den}$, i.e. $S = R$ in $\mathbb{Q}(t)$: there are infinitely many tame primes (Euclid), and a nonzero polynomial has only finitely many roots.
The Lean statement
theorem tame_to_all_primes
(F : DensityFoundation) (n : ℕ) (σ : FactorizationType) (hσ : σ.degree = n)
(num den tnum tden : Polynomial ℚ)
(hden0 : den ≠ 0) (htden0 : tden ≠ 0)
(hL6 : ∀ q : ℕ, 1 < q → den.eval (q : ℚ) ≠ 0 ∧ F.density n σ q = num.eval (q : ℚ) / den.eval (q : ℚ))
(htame : ∀ q : ℕ, q.Prime → n < q →
F.density n σ q = tnum.eval (q : ℚ) / tden.eval (q : ℚ)) :
num * tden = tnum * den
lean/LeanUrat/L7.lean — theorem
proved Palindromy transfers along equality of rational functions
The transfer itself is proved; its input — palindromy at the tame primes — is the hypothesis still open on the real instance, which keeps the functional-equation clause of the capstone conditional.
For nonzero polynomials $\mathrm{num}, \mathrm{den}, \mathrm{tnum}, \mathrm{tden} \in \mathbb{Q}[t]$: call $R = \mathrm{tnum}/\mathrm{tden}$ palindromic if $R(1/x) = R(x)$. If $\mathrm{num} \cdot \mathrm{tden} = \mathrm{tnum} \cdot \mathrm{den}$ and $\mathrm{tnum}/\mathrm{tden}$ is palindromic, then so is $\mathrm{num}/\mathrm{den}$. Pointwise transfer fails at the poles of $\mathrm{tden}$, so the proof establishes the polynomial identity $\widetilde{\mathrm{num}} \cdot \mathrm{den} = \mathrm{num} \cdot \widetilde{\mathrm{den}}$ (tilde = coefficient reversal) on a cofinite set and extends it everywhere by the identity theorem.
The Lean statement
theorem isPalindromic_of_agree
(num den tnum tden : Polynomial ℚ)
(hden : den ≠ 0) (htden : tden ≠ 0)
(hagree : num * tden = tnum * den)
(htpalin : IsPalindromic tnum tden) :
IsPalindromic num den
lean/LeanUrat/L7.lean — theorem
definition What one node of the Montes tree carries
The proof-carrying fields make degenerate instantiations impossible: with them $|F_r| = q^{[F_r : \mathbb{F}]}$ is a lemma rather than an assumption, and every downstream count comes from a polynomial over a field extension.
A shape packages the data of one node of the Okutsu–Montes tree at order $r$: a finite residue field $F_r$ with an algebra structure over the base residue field $\mathbb{F}$, so the residue degree is the true extension degree $[F_r : \mathbb{F}]$ rather than a free integer; the order-$r$ residual polynomial over $F_r$, its recorded degree tied to its actual degree; the order-$r$ lattice Newton polygon; and the cluster size that serves as the well-founded descent measure.
The Lean statement
structure OMShape where
size : ℕ
order : ℕ
Fr : Type
[instField : Field Fr]
[instFinite : Finite Fr]
baseField : Type
[instBaseField : Field baseField]
[instBaseFinite : Finite baseField]
[instAlg : Algebra baseField Fr]
residueDeg : ℕ
hResidueDeg : residueDeg = Module.finrank baseField Fr
polygon : L4.LatticePolygon
residual : Polynomial Fr
residualDeg : ℕ
hResidualDeg : residualDeg = residual.natDegree
lean/LeanUrat/PadicMeasure.lean — structure
cited axiom Three structural facts about the Montes tree, cited from Guardia–Montes–Nart
Only the measure route uses these axioms; the count-native capstones avoid them. One point remains open: whether the cell strata jointly reconstruct the full residual.
Three facts about the Okutsu–Montes tree are cited from Guardia–Montes–Nart (Trans. AMS 364, 2012) and declared as axioms: every shape carries a finite list of order-$r$ cells, one per Newton-polygon face and residual stratum; a descent operation produces the child shapes; and every child of every cell has strictly smaller cluster size — the well-foundedness that drives the induction. None of the three asserts a volume, a rationality, or any $p$-independence; those are always derived.
The Lean statement
axiom omCells : (T : OMShape) → List (OMCell T)
axiom descend : OMShape → List OMShape
axiom descend_size_lt :
∀ (T : OMShape), ∀ c ∈ omCells T, ∀ ch ∈ c.children, ch.node.size < T.size
lean/LeanUrat/PadicMeasure.lean — definition
cited axiom The cited Denef–Igusa recursion for the p-adic cluster measure
The axiom names one fixed object rather than a freely quantified pivot, which would be inconsistent, and comes with an explicit model witnessing its satisfiability.
For a prime $p$ and integer $q > 1$: one fixed symbol denotes the conditional $p$-adic Haar measure of each shape’s cluster — mathlib has no $p$-adic Haar measure, so the object itself is declared as an axiom — and the load-bearing cited axiom asserts Igusa and Denef’s cell decomposition for it: the cluster measure equals $\big(\sum_{\text{cells}} (\text{residual point count}) \cdot (\text{Newton-box volume}) \cdot \prod_{\text{children}} (\text{child measure})\big) \big/ (1 - q^{-w})$, with $w$ the self-loop exponent and $1 - q^{-w}$ the geometric self-loop pivot. A structural factorization of a measure, never a rationality claim (Igusa, *Local Zeta Functions* §7.4; Denef, *Invent. Math.* 77 (1984)).
The Lean statement
axiom clusterMeasure : OMShape → ℕ → ℚ
axiom AX_cellRecursion (T : OMShape) (q : ℕ) (hq : 1 < q) :
clusterMeasure T q
= ((omCells T).map (fun c =>
residualCountFn T c.residualDeg q
* L4.bb1Value c.polygon q
* (c.children.map (fun ch => clusterMeasure ch.node q)).prod)).sum
/ omPivot T q
lean/LeanUrat/PadicMeasure.lean — theorem
proved An explicit model witnesses that the cell-recursion axiom is satisfiable
This model certifies that the cell-recursion axiom is satisfiable.
A function constructed by well-founded recursion on cluster size — descending along the strict-descent axiom — satisfies the identity that the cell-recursion axiom asserts. The axiom is therefore satisfiable, hence relatively consistent; by contrast, quantifying the pivot freely over all values would force $1 = 1/2$, so only the fixed-object form is consistent.
The Lean statement
theorem clusterMeasureModel_rec (T : OMShape) (q : ℕ) (hq : 1 < q) :
clusterMeasureModel T q
= ((omCells T).map (fun c =>
residualCountFn T c.residualDeg q
* L4.bb1Value c.polygon q
* (c.children.map (fun ch => clusterMeasureModel ch.node q)).prod)).sum
/ omPivot T q
lean/LeanUrat/PadicMeasure.lean — theorem
conditional Measure route: every cluster measure is one rational function of q
A complete second route to rationality, conditional on the cited measure axioms and independent of the count-native chain, whose capstones avoid every axiom named in this gate.
For a prime $p$, residue size $q > 1$, and self-loop exponent $w$: the fixed conditional $p$-adic cluster measure of every Okutsu–Montes shape is a uniform rational function of $q$. The cited cell recursion discharges the recursion hypothesis of the abstract engine; every other input is proved — strict descent from the cited tree structure, coefficient rationality from the finite-field residual count times the Newton-box volume, and pole-freeness of the self-loop pivot $1 - q^{-w}$. No axiom mentions rationality; it emerges only through the induction.
Hypotheses this rests on: clusterMeasure, the opaque cited p-adic Haar cluster-measure interface object; AX_cellRecursion, the cited Denef–Igusa cell-decomposition identity for it; omCells / descend_size_lt, the cited GMN finite cell partition and strict size descent
The Lean statement
theorem clusterMeasure_isRational_of_AX :
∀ T : OMShape, IsRationalFn (clusterMeasure T)
lean/LeanUrat/PadicMeasure.lean — theorem
definition The count-native cluster recursion, built from proved counts alone
Because every ingredient is a proved counting block, the density capstones built on it need no measure axioms at all.
For a cluster shape $T$ and integer $q \ge 2$, a cluster count defined by well-founded recursion on tree size: $\mathrm{count}(T,q) = \big(\sum_{\text{cells } c} (q^{\delta})^{d_S-1} \cdot \mathrm{box}(c,q) \cdot \prod_{\text{children}} \mathrm{count}(\cdot,q)\big) \big/ \big(1 - q^{-w(s)}\big)$, where $\delta$ is the cell’s residue degree, $(q^{\delta})^{d_S-1}$ is the proved count of non-squarefree residuals of degree $d_S$ over $\mathbb{F}_{q^{\delta}}$, $\mathrm{box}(c,q)$ is the proved Newton-box volume, and $w(s) = s(s+1)/2 - 1$ is the self-loop exponent at cluster size $s$. No opaque measure object appears anywhere.
The Lean statement
noncomputable def clusterCount
(cells : ClusterShape → List CountCell) (treeSize : ClusterShape → ℕ)
(hdesc : ∀ (T : ClusterShape), ∀ c ∈ cells T, ∀ ch ∈ c.children, treeSize ch < treeSize T)
(T : ClusterShape) (q : ℕ) : ℚ :=
((cells T).attach.map (fun c =>
countCellCoeff c.1 q
* (c.1.children.attach.map (fun ch => clusterCount cells treeSize hdesc ch.1 q)).prod)).sum
/ countPivot (treeSize T) q
lean/LeanUrat/MontesAxiom.lean — definition
proved Exactly Q^(d−1) residual configurations trigger refinement
The $q$-varying wild factor inside every cell coefficient; a constant here would leave the wild mechanism unexercised.
Over a finite field $F$ with $Q = |F|$, the monic polynomials of degree $d_S \ge 2$ that are not squarefree — precisely the residuals that force a further refinement step — number exactly $Q^{d_S - 1}$: the monic total $Q^{d_S}$ minus the squarefree count $Q^{d_S} - Q^{d_S - 1}$.
The Lean statement
theorem residualBoxCount (F : Type*) [Field F] [Finite F] (dS : ℕ) (hd : 2 ≤ dS) :
Nat.card {R : Polynomial F // R.Monic ∧ R.natDegree = dS ∧ ¬ Squarefree R}
= Nat.card F ^ (dS - 1)
lean/LeanUrat/MontesAxiom.lean — theorem
definition Density means the limit of decided counts
This fixes the semantics of the whole counting route — a density is a limit of decided counts — and realizing the structure with $p$-adic digit counts is what the real instances in the OM corpus do.
A counting model at residue size $q \ge 2$ and degree $n$ records, for each factorization type $\sigma$ and precision $N$, how many coefficient boxes mod $p^N$ ($p$ the underlying prime) have their type already determined by their digits (decided) and how many do not (undecided), subject to: decided plus undecided partition the full box of $q^{nN}$; the normalized decided counts are monotone in $N$ and converge; and mass newly decided after level $N$ is drawn from the level-$N$ undecided pool. The density of $\sigma$ is defined as that decided limit — never the trivial box count, which is identically $1$.
The Lean statement
structure CountingModel (q n : ℕ) where
hq : 2 ≤ q
decidedCount : FactorizationType → ℕ → ℚ
undecidedCount : ℕ → ℚ
decidedCount_nonneg : ∀ σ N, 0 ≤ decidedCount σ N
undecidedCount_nonneg : ∀ N, 0 ≤ undecidedCount N
typeMenu : Finset FactorizationType
typeMenu_degree : ∀ σ ∈ typeMenu, σ.degree = n
decidedCount_off_menu : ∀ σ N, σ ∉ typeMenu → decidedCount σ N = 0
box_partition : ∀ N, (∑ σ ∈ typeMenu, decidedCount σ N) + undecidedCount N = (q : ℚ) ^ (n * N)
decided_mono : ∀ σ, Monotone (fun N => decidedCount σ N / (q : ℚ) ^ (n * N))
densityVal : FactorizationType → ℚ
decided_tendsto : ∀ σ, Filter.Tendsto (fun N => decidedCount σ N / (q : ℚ) ^ (n * N))
Filter.atTop (nhds (densityVal σ))
upper_tail : ∀ (σ : FactorizationType) (N K : ℕ), N ≤ K →
decidedCount σ K / (q : ℚ) ^ (n * K)
≤ decidedCount σ N / (q : ℚ) ^ (n * N) + undecidedCount N / (q : ℚ) ^ (n * N)
lean/LeanUrat/CountingModel.lean — structure
proved Vanishing undecided mass squeezes out the density
The vanishing-undecided hypothesis is the termination content — the classifier must eventually decide almost every polynomial; it is proved for the full degree-2 model and open in general.
In a counting model at residue size $q \ge 2$ and degree $n$, for a factorization type $\sigma$ both brackets hold at every level $N$: $\mathrm{decided}(\sigma,N) \le \rho(\sigma) \le \mathrm{decided}(\sigma,N) + \mathrm{undecided}(N)$, where $\rho(\sigma)$ is the decided limit and all quantities are normalized by $q^{nN}$. If the undecided mass tends to $0$, the upper bracket also converges to $\rho(\sigma)$: the density is the unique value caught between brackets of vanishing width.
The Lean statement
theorem countingDensity_is_squeezed_limit {q n : ℕ} (M : CountingModel q n)
(hU : UndecidedVanishes M) (σ : FactorizationType) :
Filter.Tendsto (fun N => M.decidedMeasure σ N + M.undecided N) Filter.atTop
(nhds (M.countingDensity σ))
lean/LeanUrat/CountingModel.lean — theorem
proved The box count is the total over all types, never a density
This theorem forecloses the classic failure mode of a density result that secretly computes the trivial total $1$.
For a prime $p$ and degree $n$, at every precision $N$ the full box measure, identically $1$, equals the sum over all factorization types $\sigma$ of the decided measures plus the undecided remainder. The trivial count of all monic degree-$n$ polynomials mod $p^N$ is therefore the partition total across every type — not the density of any single type $\sigma$.
The Lean statement
theorem box_is_total_not_density (N : ℕ) :
M.boxMeasure N = (∑ σ ∈ M.typeMenu, M.decidedMeasure σ N) + M.undecided N
lean/LeanUrat/CountingModel.lean — theorem
definition The self-loop collapse is a nested recursion over set partitions
A predicate that a constructed solution must satisfy, not an axiom asserting a conclusion; the naive single-geometric-series collapse is false for $s \ge 3$, and this is the corrected equation.
For an integer $q \ge 2$ and the completely-split cluster volumes $I_m$ ($m \ge 0$, with $I_0 = I_1 = 1$): for $s \ge 3$ the size-$s$ volume $I_s$ is not a single geometric series; the correct equation is $I_s \cdot (1 - q^{-w(s)}) = \sum_P q^{\underline{r}} \prod_{B \in P} q^{-(|B| + \binom{|B|}{2})} I_{|B|}$, summed over set partitions $P$ of $\{1,\dots,s\}$ into $r \ge 2$ blocks, where $q^{\underline{r}} = q(q-1)\cdots(q-r+1)$ counts assignments of distinct residues to the blocks, $w(s) = s(s+1)/2 - 1$ is the self-loop exponent. Every block is strictly smaller than $s$, so the recursion is well-founded.
The Lean statement
def SatisfiesNested (I : ℕ → ℕ → ℚ) : Prop :=
(∀ q, I 0 q = 1) ∧ (∀ q, I 1 q = 1) ∧
∀ (s q : ℕ), 2 ≤ s → 2 ≤ q →
I s q * (1 - ((q : ℚ) ^ L5fix.selfLoopExponent s)⁻¹) = nestedRHS I s q
lean/LeanUrat/NestedCollapse.lean — definition
proved The nested recursion reproduces the known closed forms of I₂ and I₃
A check of the corrected recursion against independently derived closed forms; the same module realizes the pivot $(1 - q^{-w})^{-1}$ as a limit of finite geometric sums rather than a formal identity.
Any $I$ satisfying the nested recursion has $I_3 = q^3(q^2 - q + 1) \big/ \big((q+1)(q^4+q^3+q^2+q+1)\big)$ for all $q \ge 2$, and a companion theorem gives $I_2 = q/(q+1)$: the set partitions of three elements into at least two blocks — four of them — are listed outright, their weights computed, and the pole-free self-loop pivot inverted.
The Lean statement
theorem nested_reproduces_I3 (I : ℕ → ℕ → ℚ) (hI : SatisfiesNested I) (q : ℕ) (hq : 2 ≤ q) :
I 3 q = closedI3 q
lean/LeanUrat/NestedCollapse.lean — theorem
definition The kernel prints every capstone’s axiom list
For everything censused here (the five measure-route axioms in PadicMeasure.lean, the two cited OM axioms, and one unproved goal in the classic tree), the printed axiom lists agree with the stated claims; the newer development directories carry roughly 40 further unproved goals not censused here.
One compile-time file issues 739 #print axioms directives, one per capstone and gate theorem of the project, making Lean’s kernel print the exact set of axioms each proof term uses. Every axiom-list claim — "this rests on Lean’s core axioms alone", "exactly on this one cited axiom" — reduces to a line of this output, printed by the kernel rather than asserted.
The Lean statement
#print axioms LeanUrat.Goal.goal_theorem
#print axioms LeanUrat.PadicMeasure.clusterMeasure_isRational_of_AX
#print axioms LeanUrat.OM.RealInstanceV2.montes_unconditional
#print axioms LeanUrat.OM.SeriesAssembly.montes_unconditional_n2_full
#print axioms LeanUrat.OM.UniformCapstone.montes_uniform_n2
lean/LeanUrat/AxChk_baseline.lean — definition
The honest boundary
PROVED, from Lean's three built-in logical axioms plus its standard library, with no unproved hypotheses: the complete degree-2 uniformity theorem at every prime (one rational function per quadratic splitting type, undecided remainder vanishing, wild prime 2 included); the order-0 density theorem at general degree; the finiteness of the pattern catalogue with an explicit bound at every degree and the enumerated count of 53 at degree three; the candidate-function solve and its identical checksum; the capstone squeeze as an implication; and the large majority of the roughly 970 public declarations mapped on this page.
PROVED CONDITIONALLY (machine-checked implications from named, displayed hypotheses): the capstone theorem — at any prime whose instance bundle passes the two-clause regularity gate, each density exists and equals its candidate value in three equivalent readings. The hypothesis surface is typed and visible in the statement: a per-prime instance bundle (whose construction from the classifier at every degree beyond the certified cases is the main open work), the regularity gate, and thirteen named placeholder slots reserved for conditions whose vocabulary is not yet built — in the current text these are satisfiable trivially and so impose no constraint yet; the theorem's final strength depends on their eventual content.
CITED (audited literature imports, each with a faithfulness record): the Guàrdia–Montes–Nart theorem of the index, in a form deliberately narrowed after two broader formulations were refuted by explicit polynomials; and the Denef–Igusa cell recursion, used only on an independent measure-theoretic route. Neither enters the two capstones' certificates, which the proof assistant's axiom printout confirms are exactly Lean's core.
VERIFIED COMPUTATIONALLY (general statements are conjectures; every instance in the stated finite ranges checked exactly, cross-checked against an independent computer-algebra factorization routine): the base combinatorial lemmas of the carry analysis — the largest checks cover all 40,378 boundary configurations of one lemma, all 140 cases of a pool census, and a 404,128,692-box partition with zero defects; and the two regularity clauses across their probed ranges.
OPEN (each an explicitly marked unproved statement in the tree, 46 in all at the time of writing): ten named statements in the counting-campaign corpora (six in the branch-tree corpus, four in the value layer), each carrying a written record — two of these are recorded as false at their pinned test tables, a documented blueprint defect awaiting a design decision rather than missing mathematics; two in the tower-kernel corpus; nine construction-phase statements in the existence-bridge corpus; twenty in a superseded graded-ring bridge kept for the record; four in deprecated files retained as history; and one banked bound in the classifier, off the capstone path.
CONJECTURES (stated precisely, nothing certified depends on them being true): exhaustiveness — the classifier decides almost every polynomial at every degree and prime (proved at degree 2, threshold form at general degree); regularity at every prime; and the palindromic functional equation of the candidate functions — proved at tame primes in arXiv:2212.00294 (Poincaré duality), open at wild primes; recorded in this development as an uncertified statement no certified result consumes.
Legend
proved machine-checked from Lean core axioms alone
conditional machine-checked from named, displayed hypotheses
open an explicitly fenced unproved goal
definition a definition or interface (nothing to prove)
cited axiom a literature result imported as a named, audited axiom
This map shows %(total)d selected declarations out of roughly 970 public theorems and definitions in the development: %(ptot)d proved, %(ctot)d conditional, %(otot)d open, %(dtot)d definitions, %(atot)d cited axioms among the selection. Selection favors load-bearing results, interfaces, and honest negative results (compiled countermodels).
Provenance: the mathematics extends A Chebotarev Density Theorem over Local Fields (Asvin G, Yifan Wei, John Yin). The formalization was carried out in Lean 4 with Mathlib by Claude (Anthropic) orchestrating fleets of proving and adversarially verifying agents, with independent statement audits by a second model family (OpenAI Codex), under the direction of Asvin G. Page generated from the formal development; translations audited for faithfulness to the Lean statements.