Chapter 13 Euclid Prime Escape, Finite Continued Fractions, and Quarter-Depth Budgets
Having constructed rational harmonic analysis on the three-sphere across Volume IV — from the integer-coefficient Chebyshev character kernels of Chapter 10 and the -free factorial Haar integral of Chapter 11 to the zero-axiom quadratic extensions and rational Schur positivity of Chapter 12 — we now enter Volume V: Adelic Arithmetic and Rational Hecke–Riemann Spectral Theory.
Classical number theory routinely begins from a Platonic premise: that the natural numbers form a completed infinite totality and that the primes sit already laid out along an infinite number line. Analytic number theory then layers on the real completion , infinite limits, and the transcendental logarithm . In zero-axiom rational mathematics without infinity or transcendentals (OmegaMath), we face a foundational challenge before touching a single spectrum: if we reject completed infinities, limits, and transcendental functions, can the three workhorses of arithmetic — the inexhaustibility of primes, best rational approximation, and geometric error-decay budgets — be rebuilt entirely as finite, terminating, executable integer constructions?
This chapter delivers three affirmative answers and anchors all core integer pillars in D5 on the strict backend (strict_omega.axioms: []). First, we formalize Bézout’s identity and the Euclid Prime-Escape theorem with literal zero axioms, replacing the static claim of infinitely many primes with a constructive proof that every finite natural-number list of positive product carries a blind-spot witness birthing a fresh prime outside the list. Second, we anchor the Euler–Wallis convergent determinant and automatic convergent coprimality in zero axioms, pairing them with classical Layer-2 Lean theorems on reduced denominators, logarithmic convergent length, and executable prime-factor order stripping in decidable monoids. Third, we certify the quarter-depth integer budget inequality in literal zero axioms and contrast it with the Layer-2 real-shadow bridge onto classical real majorants.
13.1 From Completed Infinite Sets to the Computable Arithmetic Horizon
An observer inside a finite computational horizon holds only finite integer tables and finite arithmetic loops. Traditional textbooks often frame Euclid’s proof by contradiction: suppose only finitely many primes exist, derive an absurdity, and conclude that is an infinite set. Within bare inductive type theory, turning a constructive procedure into a proof by contradiction hides the real engine beneath an unnecessary classical detour.
From a zero-axiom standpoint, arithmetic is governed not by completed infinities but by computable closure and escape rules. For any natural numbers with , Euclidean division terminates in at most bounded steps and outputs unique quotient and remainder satisfying
Iterating the Euclidean step produces a strictly decreasing sequence of remainders that reaches in finitely many steps, yielding (with ). Back-substituting the quotients along that finite trace yields the following zero-axiom Bézout identity, checked in D5 on the strict backend (strict_omega.axioms: []):
The cited D5 declarations record strict_omega.axioms: []. For all natural numbers (Omega.Nat, including zero inputs), there exist signed integers (Omega.Int) satisfying
The proof proceeds by strong induction on the second argument . In the base case , we have and the choice satisfies . When , Euclidean division yields with and . Applying the inductive hypothesis to the strictly smaller remainder produces integers with . Substituting gives , so setting and completes the zero-axiom construction. The full proof is checked by the Lean kernel.
Euclidean division together with Theorem 13.1 already unlocks the core of elementary arithmetic: whenever a prime divides a product and , we have , and multiplying by yields , forcing (Euclid’s lemma, proved purely constructively with no completed infinity or choice; by direct algebraic derivation).
13.2 Euclidean Division, Bézout’s Identity, and the Euclid Prime-Escape Mechanism
Restoring Euclid’s ancient argument from contradiction back to an explicit algorithm yields the first dynamical law of the arithmetic horizon: every finite list of positive natural numbers — in particular, every finite prime list — leaves a common blind spot, and stepping into that blind spot deterministically generates a new prime outside the list within a bounded search.
For any finite list of natural numbers (including the empty list , with empty product ; every finite prime list satisfies ), define its Euclid product-plus-one witness by
For every integer , define the bounded smallest prime divisor operator as the least divisor of in the finite range :
This construction needs no non-constructive existence principle, and its full prime-escape law is formally anchored in D5 on the strict backend (strict_omega.axioms: []):
The cited D5 declarations record strict_omega.axioms: []. Let be any finite natural-number list (s : NatList) with strictly positive product (). Then there exists a natural number satisfying simultaneously
From we have , so the witness satisfies . Within the finite range , divides itself, so bounded smallest-divisor search returns a least divisor with and . Any proper divisor of would divide by transitivity, contradicting minimality; hence holds. For escape, if then ; combined with this forces (mirrored arithmetically by remainder and the Bézout certificate ), contradicting primality (). Therefore . The full proof is checked by the Lean kernel.
One classic misconception must be guarded against: the witness itself need not be prime. Theorem 13.3 guarantees that possesses a prime divisor outside (such as the bounded smallest divisor ), not that stays indivisible. The worked ledger below exhibits the exact threshold where first splits.
Starting from the empty list, compute , its remainder modulo every , and its smallest prime divisor for the initial prime prefixes (illustrating Theorem 13.3 and Theorem 13.1):
| Finite prime list | Product | Witness | Remainders mod | Smallest prime | Full factorization of |
|---|---|---|---|---|---|
| (vacuous) | (prime) | ||||
| (prime) | |||||
| (prime) | |||||
| (prime) | |||||
| (prime) | |||||
| all | (prime) | ||||
| all | (composite) |
Across the first six rows, happens to be prime itself; at the seventh row , first factors into the composite product . Even so, leaves remainder upon division by each of , bounded trial division captures the fresh prime on the spot, and explicit Bézout identities such as certify in pure integer arithmetic that no prior prime can divide .
13.3 Finite Continued Fractions, the Euler–Wallis Determinant, and the Logarithmic Length Bound
Collecting the successive quotients of the Euclidean algorithm carries divisibility seamlessly into finite continued fractions. Given any rational , set ; as long as the fractional part is nonzero, invert it and take the floor again. Because each inversion strictly lowers the reduced denominator, the process terminates in finitely many stages , producing partial quotients with and for .
Given partial quotients (, for ), define the Euler–Wallis numerator and denominator sequences by
together with the second-order linear integer recurrence
Writing , every stage satisfies the matrix product identity
This integer matrix product exposes the algebraic rigidity of continued fractions at once: every step matrix has determinant , so evaluating a finite natural-number partial-quotient list coeffs of length coefficientCount coeffs flips the determinant sign at every step while preserving unit area. Both the Euler–Wallis convergent determinant identity and automatic convergent coprimality are formally verified in D5 on the strict backend (strict_omega.axioms: []):
The cited D5 declarations record strict_omega.axioms: []. For every finite list of natural-number partial quotients , the integer determinant of its Euler–Wallis convergent pair satisfies
The proof proceeds by structural induction on coeffs : NatList. For the empty list (coefficientCount = 0), the base convergent pair is the identity matrix (corresponding to ), whose determinant is . Each step incorporating a partial quotient acts via and satisfies , multiplying the determinant by while incrementing coefficientCount by . For a nonempty prefix (coefficient count ), this reads , equivalently for . The full proof is checked by the Lean kernel.
The unit determinant immediately enforces our first zero-axiom structural corollary: every convergent fraction is automatically in lowest terms, requiring no secondary reduction.
The cited D5 declarations record strict_omega.axioms: []. For every finite list of natural-number partial quotients with convergent numerator and denominator in , any natural number dividing both and ( and ) satisfies
By Theorem 13.6, the determinant formed from , , and the preceding convergent pair equals . Since and , the natural number divides this integer linear combination , forcing in Omega.Nat and therefore . The full proof is checked by the Lean kernel.
Dividing the determinant identity by the positive product yields a second free corollary (by direct algebraic derivation): adjacent convergents satisfy , bracketing the target rational from alternating sides inside a purely rational interval of width .
In the classical Mathlib layer of the pinned trureturing library, both the canonical denominator formula for reduced rationals and the logarithmic length bound for the executable Euclidean convergent list are also formally verified:
For all natural numbers with , put . Its canonical positive denominator equals
Constructing the canonical rational mkRat s r for divides both numerator and denominator by , leaving the reduced denominator exactly . The full proof is checked by the Lean kernel.
For every rational number , define the executable Euclidean convergent list recursively by returning when , and otherwise prepending to the image of under . Then the length of this finite list obeys
where denotes the natural base- floor logarithm (Nat.log 2 d, with Nat.log 2 1 = 0).
The proof proceeds by strong induction on . When , the list has length . Otherwise set , whose denominator satisfies ; if , then forces and the list has length . If , put . Because , the key lemma second_den_sum_le establishes ; combined with this yields , so the denominator halves at least once every two Euclidean stages (). Applying the inductive hypothesis to completes the bound (counting complete-quotient stages, not bit operations). The full proof is checked by the Lean kernel.
Take the ratio of consecutive Fibonacci numbers (the worst-case growth profile for Euclidean stages). Checking Theorem 13.8 first on a reducible fraction, gives ; for , gives . Expanding produces all convergents and their Euler–Wallis determinants (illustrating Theorem 13.6 and Theorem 13.7, with row matching the prefix of coefficient count ):
| Stage | Partial quotient | Convergent | Determinant | |
|---|---|---|---|---|
| (terminates) | — |
Every convergent is certified coprime by Theorem 13.7. Testing Theorem 13.9: since , we have , giving upper bound . At every double step the Fibonacci sum confirms the halving inequality directly: and .
The static figure below places the chapter’s three zero-axiom arithmetic pillars side by side: the Euclid prime-escape chain through (Theorem 13.3, Example 13.4), the Euler–Wallis alternating determinant chain for (Theorem 13.6, Theorem 13.7, Example 13.10), and a preview of the base- quarter-depth integer budget formalized in Section 13.5 (Theorem 13.12, Example 13.15).
Prime escape, finite continued fractions, and quarter-depth budgets. The figure juxtaposes the Euclid witness sequence reaching its first composite split at (Theorem 13.3), the seven Euler–Wallis convergents of preserving alternating unit determinant and automatic coprimality (Theorem 13.6, Theorem 13.7), and the limit-free integer budget certified at sharp depth for majorant and tolerance (Theorem 13.12).
13.4 Executable Prime-Factor Stripping in Decidable Monoids
Finite arithmetic algorithms extend well beyond fraction reduction. Suppose an operator or rotation in a monoid with decidable equality returns to the identity after steps (), and we wish to find its exact minimal period (order) . We do not need to scan all exponents: given any finite list covering the prime divisors of , repeatedly testing whether dividing the current exponent by preserves strips away every extraneous factor and lands squarely on .
Let be a monoid with decidable equality (DecidableEq), let , and let satisfy and . Let be any finite list covering all prime divisors of (for every prime , ; duplicates and extra naturals are permitted). Define to recurse on whenever , , , and , returning otherwise, and let fold over . Then
Strong induction on first establishes the single-factor invariant for : , for some , , and whenever , (otherwise would still be a multiple of , forcing and contradicting termination). Induction along the list preserves , , and , while ensuring for every with . Because covers all prime divisors of (and hence of ), the quotient has no prime divisors and must equal , so (no complexity claim is attached to the theorem). The full proof is checked by the Lean kernel.
As a concrete hand check, in the multiplicative group , we know and covers the primes dividing . Stripping tests (reducing to ) and (reducing to ); stripping tests and halts, returning the exact order (by direct algebraic derivation).
13.5 Computable Quarter-Depth Integer Budgets and Limit-Free Real Transfer
Analytic number theory and spectral estimates abound with arguments that appear inseparable from real logarithms and limits: given a majorant and a tolerance , because , there exists a convolution depth such that . In classical real analysis, locating invokes either a non-constructive convergence threshold or an irrational logarithm computed in floating point.
Yet the moment we bound the majorant by a rational fraction and express the tolerance rationally as , the entire geometric budget collapses into a single total function of natural numbers:
In the pinned trureturing library, this budget exhibits the monograph’s cleanest separation between the zero-axiom integer core and the Layer-2 real shadow. First, the integer strict inequality itself is proved with literal zero axioms (strict_omega.axioms: []) in the strict build of D5 using OmegaInit and OmegaMath, importing neither Lean’s standard Init nor Mathlib:
The cited D5 declarations record strict_omega.axioms: []. For all natural numbers (Omega.Nat) satisfying , , and , the exact integer strict inequality holds:
From and we have . Set using zero-axiom natural Euclidean division in Omega.Nat. By the discrete base- construction of quarterDepth, the bound implies , hence . Writing with strict remainder bound gives directly
using only inductive natural-number arithmetic inside OmegaInit and OmegaMath with empty axiom closure. The full proof is checked by the Lean kernel.
When classical analytic Weil–Burnol estimates require transferring this integer budget onto a real majorant , the Layer-2 Mathlib module BurnolRationalDepthBudget provides the parallel Init/Mathlib integer certificate (rationalQuarterDepth_integer_sound) together with the one-way, limit-free real-shadow transfer (rationalQuarterDepth_real_sound):
For natural numbers , define the computable integer depth
using natural floor division and the total convention . Whenever , , and satisfies , the exact integer strict inequality holds:
Set . Because and , we have , and the hypothesis implies , equivalently in . Writing Euclidean division as with gives immediately
Not a single real number, logarithm, or floating-point rounding step appears anywhere in the proof. The full proof is checked by the Lean kernel.
Let satisfy , , , and . Then for every real number bounded above by , without any limiting argument,
Casting the exact integer inequality from Theorem 13.13 into and dividing both sides by the strictly positive product gives . Dividing by and chaining the inequalities yields . The full proof is checked by the Lean kernel.
Take the rational majorant () and target error budget (), and evaluate Theorem 13.12 and Theorem 13.14 by hand (by direct algebraic derivation). The cross products are and , yielding natural quotient . Since , the computable depth is exactly
At , both the exact integer certificate and the real transfer bound hold cleanly:
Conversely, reducing the depth to fails both tests immediately: and . Hence is not only sufficient, but sharp.
Stepping back across the chapter’s ten frozen theorems reveals a razor-sharp axiomatic boundary. Bézout’s identity (Theorem 13.1), Euclid prime escape (Theorem 13.3), the Euler–Wallis convergent determinant (Theorem 13.6), convergent coprimality (Theorem 13.7), and the integer quarter-depth inequality (Theorem 13.12) are all formally verified in the strict build of D5 using OmegaInit and OmegaMath with literal zero axioms (strict_omega.axioms: []), touching neither classical choice, quotient axioms, nor real completeness. Meanwhile, Theorem 13.8, Theorem 13.9, Theorem 13.11, and the classical BurnolRationalDepthBudget pair (Theorem 13.13 and Theorem 13.14) supply the Layer-2 Mathlib bridge whenever classical analytic Weil–Burnol majorants are needed — exemplifying the one-way shadow architecture audited across the full monograph in Chapter 18.
The film below follows the chapter’s hand-worked examples, threading Euclidean division, prime escape, finite continued fractions, and the quarter-depth budget into a single line.
A division that always stops is enough to make primes escape, fractions close in, and error budgets land in integers (2 min 45 s). A cyan bar cuts into blocks of plus a magenta remainder , and the amber certificate leads to the green Bézout identity (Theorem 13.1). In the escape ledger the first six witnesses are prime; at bounded trial division stops at the amber , , and the green tag points to Theorem 13.3. Euclid’s ladder unfolds as , and the Euler–Wallis convergents through meet the length bound (Theorem 13.9); the step determinant , the determinant of , and the neighbouring cross products correspond to Theorem 13.6 and Theorem 13.7, while the alternating gaps on the number line are a violet hand derivation. Finally, majorant and tolerance give and depth ; the green integer inequality (Theorem 13.12) sits beside the classical shadow (Theorem 13.14), and depth fails. All worked numbers are computed on screen; “strict backend, zero axioms” appears only on the five theorems the chapter records that way.
Before moving on to global adelic closure, you can test all three finite integer constructions interactively in the lab card below: step through the prime-escape chain up to , trace the Euler–Wallis alternating determinants on , and vary the rational majorant and tolerance to inspect the sharp quarter-depth threshold .
Prime escape, continued fractions, and quarter-depth budget lab card (euclid-cf-quarter-depth). Step interactively through finite prime lists and the Euclid witness up to the composite split (Theorem 13.3), inspect the Euler–Wallis convergents and alternating unit determinants for (Theorem 13.6, Theorem 13.7), and verify the integer inequality at sharp depth for majorant and tolerance alongside its limit-free real shadow (Theorem 13.12, Theorem 13.14).
Finite arithmetic now guarantees that primes emerge on demand whenever stepping escapes all prior periods. Two deeper questions immediately arise: across all metrics on , how does flat archimedean stretching balance against every prime contraction? And when an odd prime leaves the commutative line to split into non-commuting integer spinors on the three-sphere , what free geometric labyrinth does it build? We turn to these questions in Chapter 14.