[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"GcUyKEghRn":3},"# Ripple\n\nAn open, AI-formalized **Lean 4 framework for the mathematics of computing with chemical reaction networks** — from CRN-computable real numbers and their compilation down to large-population protocols, through the stochastic-to-deterministic bridge (Kurtz's mean-field theorem), to two classical Turing-completeness constructions and four population-protocol majority analyses. Everything builds with **zero `sorry`**, **zero named `axiom` declarations** and **no `native_decide`**: every finite computation is checked by the Lean kernel, and `#print axioms` on every headline theorem reports only Lean's three standard axioms (`propext`, `Classical.choice`, `Quot.sound`).\n\nThis README describes release **r2026.11.11** (2026-11-27). The Technical Report (`arXiv:2607.13531v2`, 21 July 2026) is a historical snapshot of an earlier tree, and part of what it says about LPP computability was corrected in release r2026.11; see [Publications](#publications) and the [erratum](paper/ERRATA.md). Changes since the report are in [`CHANGELOG.md`](CHANGELOG.md), [`RELEASE_NOTES.md`](RELEASE_NOTES.md) and the [GitHub Releases](https://github.com/zinan-huang/Ripple/releases).\n\n## Where the name comes from\n\n\"Ripple\" is a mishearing — by an AI. The author said *repo* (short for *repository*) in a voice message; the speech-recognition model heard *ripple*. The transcription stuck as the name — because the underlying research actually did start small and ripple outward.\n\nIt began as a homework exercise in Jack Lutz's class at Iowa State: *can you compute rational numbers with a chemical reaction network?* That grew into algebraic numbers, then transcendentals (e, π, the Euler–Mascheroni constant γ, ln 2), then the shape of the whole real-time class, then weaker population-protocol refinements, then — on the other side — stronger infinite-time analogues. Each layer was a new ripple from the same class exercise.\n\nThis repository is the Lean 4 counterpart to that trajectory.\n\n## Scope\n\n**The CRN-computability line** — the repository's spine:\n\n1. Huang, Klinge, Lathrop, Li, Lutz — *Real-time computability of real numbers by chemical reaction networks*, Nat. Comput. 2019.\n2. Huang, Klinge, Lathrop — *Real-time equivalence of CRNs and analog computers*, DNA 25 (2019).\n3. Huang, Huls — *Computing real numbers with large-population protocols having a continuum of equilibria*, DNA 28 (2022).\n4. Chen, Huang — *Bounded analog complexity*, DNA 32, LIPIcs 387 (2026).\n\n**Turing-completeness, one theorem on each side of the model ladder:**\n\n5. Bournez, Graça, Pouly — *Polynomial time corresponds to solutions of polynomial ODEs of polynomial length*, J. ACM 2017 (deterministic GPAC/PIVP side).\n6. Soloveichik, Cook, Winfree, Bruck — *Computation with finite stochastic chemical reaction networks*, Nat. Comput. 2008 (stochastic side).\n\n**Population-protocol majority — four analyses and protocols:**\n\n7. Angluin, Aspnes, Eisenstat — *A simple population protocol for fast robust approximate majority*, Distributed Computing 2008.\n8. Doty, Eftekhari, Gąsieniec, Severson, Stachowiak, Uznański — time- and space-optimal stable exact majority, FOCS 2021.\n9. Kanaya, Eguchi, Sasada, Ooshita, Inoue — *Time- and space-optimal silent self-stabilizing exact majority in population protocols*, SSS 2025.\n10. Burman, Chen, Chen, Doty, Nowak, Severson, Xu — *Time-optimal self-stabilizing leader election in population protocols*, PODC 2021 (source of the Optimal-Silent-SSR ranking subprotocol that (9) composes with).\n11. Condon, Hajiaghayi, Kirkpatrick, Mañuch — *Approximate Majority Analyses using Tri-molecular Chemical Reaction Networks*, Natural Computing 2020.\n\n**The probabilistic foundation** — the mean-field limit connecting stochastic CRN dynamics (CTMCs) to their deterministic ODE approximations (GPACs):\n\n12. Kurtz — *Solutions of ordinary differential equations as limits of pure jump Markov processes*, J. Appl. Probab. 1970 (convergence in probability).\n13. Kurtz — *The relationship between stochastic and deterministic models for chemical reactions*, J. Chem. Phys. 1972 (Chebyshev deviation bound and CLT).\n14. Kurtz — *Strong approximation theorems for density dependent Markov chains*, Stochastic Process. Appl. 1978 (a.s. O(log N/√N) rate).\n15. Ethier, Kurtz — *Markov Processes: Characterization and Convergence*, Wiley 1986.\n\n**Classical mathematics in service of the number constructions:** van der Poorten's account (1979) of Apéry's ζ(3) recurrences, formalized via an explicit Zeilberger witness; Cassels' elementary descent (1960) for the Catalan equation; Ramanujan's 1914 modular 1/π series, with the surrounding reduction machine-checked (Clausen, Picard–Fuchs, Chowla–Selberg) and the CM evaluation `j((1+√−163)/2) = −640320³` fully verified through the level-41 modular polynomial Φ₄₁. On that evaluation rests the **Chudnovsky formula** for 1/π, proved without hypotheses (`chudnovsky_one_over_pi`): Milla's proof of the main identity, formalized by Xuanji Li in Lean Pool and ported under `Ripple/Number/Milla/` (see [`NOTICE`](NOTICE)), is evaluated at `τ₁₆₃ = (1+√−163)/2`, where the value `s₂(τ₁₆₃) = 77265280/90856689` is derived from Φ₄₁ by a third-order expansion at its node (`s2_heegnerTau163`; notes in [`docs/audit/CHUD-PAPER.md`](docs/audit/CHUD-PAPER.md)). **Ramanujan's 1914 series** for 1/π is likewise proved without hypotheses (`ramanujan_one_over_pi`): its CM evaluation at level 58 (`ramanujanCM58_evaluation`) comes from the degree-29 modular equation of the `Γ₀(2)+` Hauptmodul, certified by the kernel on `Γ₀(58)`, a second-order expansion at the fixed point `i√58/2`, and a level-2 Kummer identity derived from Milla's `E₄` formula and two hypergeometric transformations (notes in [`docs/audit/CHUD-PAPER.md`](docs/audit/CHUD-PAPER.md) §4).\n\nThe goal is to treat all of this as one unified, extensible pipeline: a CRN in its mass-action limit is a polynomial ODE system, a population protocol is its finite-N stochastic shadow, and Kurtz's theorem is the verified bridge between them.\n\n## What is formalized (release r2026.11.11)\n\nA prose tour of the current tree follows. The Technical Report documents the older 21 July snapshot and does not cover the `Tri` library, the faithful computability predicates, the LPP compiler in its current form, bounded compilation, Kurtz's strong approximation theorems, the stochastic-calculus library, the time bound of Doty et al., or the construction from population protocols to non-autocatalytic protocols.\n\n### The model ladder\n\nThe core is one Lean notion of what it means for a bounded CRN/GPAC to *compute* a real number, `CertifiedBoundedTimeComputable` (`Ripple/Core/BoundedTime.lean`): a PIVP whose vector field is a tuple of polynomials with rational coefficients, with a rational initial value, a bounded trajectory and a time modulus. The class predicates follow the papers: `IsCRNComputable` and `IsPolyTimeComputable` are Definitions 2.1 and 2.3 of the bounded analog complexity paper, and `IsRealTimeComputable` (linear modulus) equals the real-time GPAC class of the DNA 25 paper (`isRealTimeComputable_iff_rtgpac`); the real-time class is closed under the field operations (`realtime_field_add`, `_mul`, `_neg`, `_sub`, `_inv`, `_div`).\n\nAround this notion sits the machinery that moves computations along the ladder of models:\n\n- **Bounded compilation** (bounded analog complexity, Construction 3.1 and Theorems 3.3–4.6): a possibly unbounded ℚ-PIVP whose output converges to `α` becomes a bounded one computing `α` through one time change with the joint clock `1 + Σᵢ yᵢ^N` (`bounded_compilation`, `isGPACComputable_iff_isCRNComputable`); blow-up times are computable (`isCRNComputable_blowupTime`), and polynomial time and length give a polynomial modulus (`bounded_compilation_polyTime`). Poly-length computability in the sense of Bournez, Graça and Pouly, for numbers and for functions on compact sets, gives polynomial time for bounded systems (`isPolyTimeComputable_of_isBGPPolyLengthComputable`, `isPolyTimeComputableOn_of_isBGPPolyLengthComputableOn`). The statements of the journal version are formalized as well: unique maximal forward solutions and blow-up at a finite endpoint (`MaximalPIVP.exists_maximal`, `MaximalSolution.unique`), computability of a finite maximal lifetime (`isCRNComputable_maximalTime_certified`), the exact clock modulus in the polynomial-time certificate (`bounded_compilation_polyTime_clock_certified`), general subset compilation (`SubsetCompilation`) and selective dual rail (`SelectiveDualRail`).\n- **Closure under powers** (bounded analog complexity, Theorem 6.1): `α^β` is computable for computable `α > 0` and `β` (`isCRNComputable_rpow`), and polynomial time is preserved (`isPolyTimeComputable_rpow`), with the construction of [`docs/refactor/BAC2-PAPER.md`](docs/refactor/BAC2-PAPER.md) §6.\n- **CRN readout** (bounded analog complexity, Section 7): a bounded ℚ-PIVP computing `α > 0` gives a mass-action CRN with zero initial values whose modulus is at most `max(μ(r + k), 0) + (4/α + 4α) r + C` (`crn_of_certified`); polynomial-time GPAC and CRN computation agree for `α > 0` (`isPolyTimeCRNComputable_iff`).\n- **The dual-rail compiler** for polynomial dynamics.\n- **Large-population protocols** (DNA 28), with the paper's definitions of deterministic and probabilistic LPPs (`IsLPPComputable`, `IsPLPPComputable`, equal by Theorem 17). The main theorem in the GPAC-to-LPP direction, `bounded_crn_is_lpp_computable`, compiles every `α ∈ [0, 1]` computed by a certified PIVP with a CRN decomposition into a deterministic LPP, and with the CRN readout every `IsCRNComputable` number in `[0, 1]` is LPP-computable (`IsCRNComputable.isLPPComputable`); the converse is `lpp_to_gpac`. Unimolecular protocols compute exactly the rationals (`isLPUPComputable_iff_rat`), LPP numbers are closed under products (`lpp_product`), and every algebraic number in `[0, 1]` is LPP-computable (`algebraic_lpp_computable`).\n- **From population protocols to non-autocatalytic protocols** (`Ripple/LPP/NAP*.lean`). A non-autocatalytic protocol (NAP) is one in which no reaction net-produces one of its own reactants. For every syntactic quadratic population protocol, a slack species, the r²-trick and cubing (the degree-3 Veronese lift) give a NAP whose unique solution, from the lifted initial point, is the Veronese image of a time-changed trajectory of the original protocol, with the same readout limit and, when the slack has a positive limit, the exponential rate transferred (`pp_to_nap_ode_of_init`). The reactions are routed by a transportation (supply/demand) construction; for an arbitrary quartic protocol two sign conditions on its coefficients suffice for the cubed field to be NAP-realisable (`exists_nap_realizing_of_C1C2`), and any non-negative NAP realisation forces the corresponding sign at every monomial all of whose splittings contain a given species (`realizes_nonpos_of_unique_pair`). Adding exchange reactions makes the lifted image normally attracting at every equilibrium, interior or on the boundary (`normal_stability_interior`, `normal_stability_boundary`); a cheaper squaring variant is characterized exactly (`squaring_iff`); `{0, 1}` readouts are obtained by three layer copies (`LayerCopy.pp_to_nap_layer_copy_of_init`). The statements are at the level of the mean-field ODE.\n\nAdding a new number is a plug-in: supply a ℚ-polynomial PIVP, prove boundedness and a convergence modulus, and the pipeline does the rest.\n\n### Computable numbers\n\nThe constants e, π, ln 2 and Euler's γ are real-time computable (`euler_is_realtime`, `pi_is_realtime`, `ln2_is_realtime`, `euler_gamma_is_realtime`), as is Catalan's constant G (`catalan_is_realtime`), each through an explicit ℚ-polynomial IVP with a machine-checked convergence bound. π/4, 1/e, ln 2, G, γ and the Dottie number are LPP-computable (`pi_quarter_is_lpp_computable`, `inv_e_is_lpp_computable`, `ln2_is_lpp_computable`, `catalan_is_lpp_computable`, `euler_gamma_is_lpp_computable`, `exists_dottie_lpp`). **Apéry's constant ζ(3) is real-time computable** (`apery_is_realtime`): the five-variable Fermi–Dirac system `fermiPolyPIVP`, with ℚ-polynomial field and rational initial value, computes it with modulus `2r + 6` (`fermi_certifiedBoundedTimeComputable`). A second, *series-encoding* route through the holonomic generating function is built on a formalized Frobenius theory of regular-singular ODEs, together with a formalization-discovered obstruction that delimits where that route works; its real-time statement remains conditional (`apery_real_time_from_adaptation`).\n\n### The stochastic bridge: CTMCs and Kurtz's mean-field theorem\n\nA continuous-time Markov chain theory built from the ground up (none previously existed in Mathlib), through to **Kurtz's law of large numbers** on `[0, T]` (Kurtz 1970, Theorem 3.1) for canonical density-dependent CTMCs (`kurtz_finite_horizon`), with Doob's L² maximal inequality and the quadratic-variation bound proved, for random initial states whose densities converge in probability to `x(0)` as in Kurtz's theorem; its hypotheses are model conditions and regularity of the limit ODE solution. The law of large numbers also holds with an explicit exponential tail, uniform on `[0, T]` (`kurtz_finite_horizon_exp_tail`), and **Kurtz's central limit theorem** (1971) is proved for finite-dimensional distributions (`kurtz_finite_dimensional_clt`: `√N (X_N(t_j) − x(t_j))_j` converges in law to the Gaussian with the linearized mean and covariance). **Kurtz's 1978 strong approximation theorems** are proved under the paper's hypotheses (`Ripple/Kurtz/StrongApprox/`): Lemma 3.1, a Poisson process and a Brownian motion on one space with `sup_{t≥0} |Y(t) − t − W(t)|/(log t ∨ 2)` finite a.s. with an exponential moment (`kurtz_lemma_three_one`, by a dyadic Komlós–Major–Tusnády coupling built from quantile couplings); Theorem 3.3(a), `‖X_N(t) − Z_N(t)‖ ≤ β^T log N / N` for all `N ≥ 2` and `t ≤ T` a.s., with `Z_N` the diffusion approximation (`kurtz_theorem_three_three_a`); and Theorem 4.4, `‖√N (X_N(t) − X(t)) − V(t)‖ ≤ γ_N^T log N / √N` on one coupling space carrying the chains, their diffusions and one Gaussian limit `V` (`kurtz_theorem_four_four`, with the covariance of `V` in `kurtz_theorem_four_four_covariance` and a non-vacuity instance with a state-dependent rate, `kurtz_theorem_four_four_paper_witness`). Underneath them is a stochastic-calculus library (`Ripple/Stochastic/`): the L² Itô integral for a general filtration with its continuous version, Doob's maximal inequalities, the exponential maximal inequality, strong solutions of SDEs with bounded Lipschitz coefficients, and Knight's theorem on time changes, with files ported from formal-mathfin and from Degenne et al.'s Brownian-motion and Kolmogorov-extension projects (see [`NOTICE`](NOTICE)). The process-level CLT (convergence in the Skorokhod space) is not formalized (`OPEN_PROBLEMS.md` §6.5). Supporting probability infrastructure — integral Grönwall, Doob's inequality at a random index, Bennett and discrete Freedman inequalities — is general-purpose and reusable by anyone formalizing stochastic kinetics or mean-field limits, whether or not they care about computable numbers.\n\n**Counting and measure.** Model checking computes probabilities by counting scheduler words; the theorems are stated with measures. `Ripple/Probability/CountingBridge/` identifies the two over any finite alphabet: a count of words of length `T` divided by `|α|^T` is the measure of the corresponding event under the uniform product measure, for cylinder events, survival and first-hit events and truncated and full expected hitting times (`cylinder_measure`, `survival_measure`, `firstHit_measure`, `expected_iff`). For population protocols, the uniform scheduler on ordered pairs of distinct labelled agents, observed through the configuration, is the configuration chain of the exact-majority development, after `T` steps (`map_agentRun_eq_transitionKernel_pow`) and as a path law equal to Mathlib's Ionescu–Tulcea trajectory measure (`map_agentPath_eq_chainLaw`); hence a count on agent-pair words is a survival probability, first-hit probability or truncated expected hitting time of that chain (`survivalNumerator_div_eq_chainLaw`, `firstHitNumerator_div_eq_chainLaw`, `costNumerator_div_eq_lintegral_chainLaw`; paper proof in [`docs/audit/AGENT-SCHEDULER-LUMPING.md`](docs/audit/AGENT-SCHEDULER-LUMPING.md)).\n\n### Two Turing-completeness theorems\n\nThe Bournez–Graça–Pouly side is machine-checked: `bounded_pivp_turing_complete` gives a single rational polynomial ODE with bounded trajectories that simulates a fixed universal (undecidable) machine, read out eventually by threshold. For Soloveichik–Cook–Winfree–Bruck, Theorem 3.1 is proved with the paper's quantifier order (`scwb_theorem_3_1`): for every register machine a network fixed by the machine, run under the jump chain of mass-action kinetics, makes no wrong step among the first `t` machine steps except with probability at most `δ`, with expected time `O(v t²/(k δ))`, for every `δ`, input and `t`, given enough copies of the accuracy species. Theorem 3.2, for Turing machines, is proved in the same form for a modified version of the paper's Figure 3.2 network (`scwb_theorem_3_2`, expected time `O((3/2)^L v s³ t²/(k 3^s δ))`; notes in [`docs/audit/FIX3-SCWB-T32.md`](docs/audit/FIX3-SCWB-T32.md)). The success events of both theorems include completion of the run, and both theorems also hold on the continuous-time chain with independent exponential holding times (`scwb_theorem_3_1_timed`, `scwb_theorem_3_2_timed`), whose expected elapsed time is the expected sum of mean holding times used in the jump-chain statements. Theorem 4.2 (coverability is decidable) is proved with computable instances (`Decidability.petriCoverabilityDecidable`); Theorem 4.1, simulation of Turing machines over unboundedly many steps and unbounded space, is proved for an explicit network that depends only on the machine ([`docs/audit/FIX3-SCWB-T41.md`](docs/audit/FIX3-SCWB-T41.md); `scwb_theorem_4_1`): for every space bound `s` and `δ ∈ (0, 1]`, the initial count `i₀ ≤ 2s + 4 + 37/√δ` of the accuracy species makes the run fail to encode every configuration of the machine's run with probability at most `1344/(i₀ − 1)² ≤ δ`, for every input of length at most `s`, with an explicit polynomial bound on the expected physical time per simulated step (`OPEN_PROBLEMS.md` §6.2). The clocked network is nonexplosive from every finite state, and before any fixed number of clock ticks its timed mass-action law agrees with the canonical Q-matrix CTMC of `Ripple/CTMC/` (`ctm_noExplosion`, `ctm_identification_up_to_target`). Bounded-domain extensions of the BGP construction are in preparation.\n\n### Four majority analyses and protocols\n\nThe largest pillar of the repository. For the Angluin–Aspnes–Eisenstat 3-state approximate majority protocol, Ripple formalizes the O(n log n) high-probability consensus time for `n ≥ 16` (`convergence_time_high_probability`), not only stable correctness; convergence to the initial majority under a large initial gap is not formalized. For the Doty et al. exact majority protocol: the deterministic stable-correctness chain (`stable_majority_correct`) and the paper's O(log n) state count, on a compact state type with one live Θ(log n) field per role and phase (`Compact.compact_state_count_clog`: at most `73920 (98 ⌈log₂ n⌉ + 102)` states, with stable correctness transported, `Compact.compact_stable_majority_correct`); and the **O(log n) stabilization time** without hypotheses (`StabilizationTime.exact_majority_stabilization_time`): for `L = ⌈log₂ n⌉`, `K = 256`, every `n ≥ 5·2^(2^23)` and every valid input, the protocol reaches a stable correct configuration within `16300 n (⌈log₂ n⌉ + 1)` interactions except with probability at most `110/n²`, and within at most `470 235 n ln n` interactions in expectation, under the uniform random scheduler. The population threshold is explicit but astronomically large. Theorem 3.1 of Doty et al. is also stated as one theorem about one protocol (`TheoremThreeOne.exact_majority_theorem_three_one`): the compact protocol has at most `23 136 960 (⌈log₂ n⌉ + 1)` states, stably computes majority, and its own stabilization time satisfies the same two bounds. For the Kanaya et al. silent self-stabilizing exact majority protocol: the impossibility of self-stabilization without knowledge of `n` (`impossibility_without_n`), the space lower bound (`space_lower_bound`, Theorem 2), the time lower bound in expectation and with high probability (`time_lower_bound_omega_n_expected`, `time_lower_bound_whp`, Theorem 3), and the qualitative part of Theorem 4, composed with a formalization of the Burman et al. ranking subprotocol: the protocol `P_EM` is silent self-stabilizing exact majority for every `n ≥ 4` (`P_EM_solves_silent_SSEM_linear`), with O(n) states on a finite role-indexed state type (`P_EM_fin_silent_SSEM_states`, at most `394 n` states), also for the papers' parameters (`P_EM_paper_fin_solves_silent_SSEM`, `card_PEMPaperFin_le`). The time upper bound of Theorem 4 is proved for the paper instance (`P_EM_paper_thm4_time`): for `n ≥ 1608` and every configuration, expected parallel time to silence at most `5215 n`, and silence within `4172 n² ⌈log₂ n⌉` interactions except with probability at most `1/n`; the proof includes versions of Burman et al. Lemmas 3.2–3.4.\n\nThe separate `Tri` library formalizes Condon et al.'s analysis of tri-molecular approximate-majority CRNs. Its main results include the entry clause of Theorem 4 in reached-by-deadline form (`Tri.Byzantine.theorem4_entry`) and the multi-species consensus theorem without hypotheses (`Tri.Multi.theorem5`). The development also proves `Tri.Byzantine.lemma8` for history-dependent Byzantine strategies and `Tri.Multi.lemma12` for the full printed species range, and states Theorem 1(a) with explicit constants (`theorem1a_explicit`: non-consensus mass at most `n^{−γ/200}` after `258 γ n log₂ n` interactions for `n ≥ 2^420`).\n\n### New results from the formalization\n\nFormalization also produced new mathematics: the zero-init non-collapse theorem (`zero_init_no_collapse` in `Ripple/Core/`) — in a bounded, zero-initialized CRN, any species that ever becomes positive stays above some `c > 0` from some time on, so its liminf is positive and it cannot converge to 0, and 0 is not non-trivially computable from zero initialization (`zero_of_limit_is_trivial`) — was conjectured, stated, and proved inside the framework. And the series-encoding recipe applied to Ramanujan's modular 1/π series surfaces a sharp open problem: the series anchor is a fixed point of the drive, so the natural encoding provably does not converge to π exactly.\n\n## How it was built\n\nEssentially all of the Lean was written by AI agents running *publicly available* models (Anthropic's Claude, OpenAI's GPT), orchestrated by standard agentic coding tools, with the human contribution concentrated on choosing the statements, the proof strategies, and the curation. Every AI-proposed proof is compiled and kernel-checked before acceptance: AI proposes, only the Lean kernel certifies. The workflow is reproducible by anyone with the same public toolchain; the [technical report (v2)](https://arxiv.org/abs/2607.13531v2) documents the method used for its July snapshot.\n\n## Trust footprint\n\nZero `sorry`, zero named `axiom` declarations, and no `native_decide`. `#print axioms` on every headline result reports only Lean's three standard axioms (`propext`, `Classical.choice`, `Quot.sound`). Every finite computation is checked by the Lean kernel; the large kernel-checked certificates are:\n\n| File | Declaration | What the kernel checks |\n|---|---|---|\n| `Number/Modular/SturmPackedEval.lean` | `packFinal_eq_zero` | `1728^84` times the first 1766 coefficients of the cleared level-41 Φ₄₁ q-expansion, packed into one integer, vanish (about 20 s and 2.5 GB) |\n| `Number/Modular/Phi41SymmCheck.lean` | `phi41SparseTerms_rows_eq_swapped_cols` | the 1766 terms of Φ₄₁ are symmetric under `X ↔ Y` (about 11 s and 1 GB) |\n| `Number/Modular/ModularPoly41.lean` | `phi41Diag_root`, `phi41DiagCofactor_ne_zero` | `Φ₄₁(j, j)` vanishes at `j = −640320³` with a nonzero cofactor |\n| `Number/Modular/Phi41TaylorData.lean` | `phi41Partial00` … `phi41PartialK6` | the partial derivatives of Φ₄₁ up to order three at `(j₀, j₀)`, `j₀ = −640320³`, used for `s₂(τ₁₆₃)` |\n| `Number/Modular/Psi29PackedEval.lean` | `p29Final_eq_zero` | the first 3601 coefficients of the cleared weight-480 `Ψ₂₉` form on `Γ₀(58)`, packed into one integer, vanish; with the weighted-sum coefficient bounds `p29W*_le` that fix the packing widths |\n| `Number/Modular/R5Data.lean` | `r5Check_eq_true` | the factorization `Ψ₂₉(a + h, a + h) = (h − b) D(h)` with all coefficients of `D` nonpositive, which makes `T₀ = 256·99⁴ − 104` the only root of `Ψ₂₉(X, X)` above `1.1·10¹⁰` |\n| `Number/Modular/Psi29TaylorData.lean` | `psi29Partial00` … `psi29_masser_ratio` | the partial derivatives of `Ψ₂₉` up to order two at `(T₀, T₀)`, used for the level-58 CM relation |\n| `Number/Modular/SturmCRTBoundCert.lean` | `phi41RowL1Cert_correct`, `phi41TotalL1Cert_correct` | row and total ℓ¹ norms of the Φ₄₁ coefficient matrix used in the height bound |\n| `LPP/ExampleGammaCompiled.lean` | jump-code lemmas | the 32 jumps of the compiled Γ population protocol |\n\n`SturmPacked.lean` proves that the packed integers are the Kronecker images of `1728 E₄³`, `1728 Δ`, their `q ↦ q⁴¹` pullbacks and the cleared expansion, and with the coefficient bound `phi41_final_coeff_bound` obtains `phi41Level41FrickeCoefficientCertificate_proof`, the vanishing of the first 1765 coefficients. Half of the 3529 coefficients that the Sturm bound asks for suffice because of the Fricke involution (`Phi41Fricke.lean`, argument in [`docs/refactor/FRICKE.md`](docs/refactor/FRICKE.md)); `Phi41FrickeSturm.lean` concludes that the form vanishes, and the 3529-coefficient statement `phi41Level41SturmCoefficientCertificate_proof` is a corollary.\n\n## What remains open\n\n`OPEN_PROBLEMS.md` tracks the research frontier: the cited-paper results that are not formalized (§6: Kurtz's process-level CLT; the CF'24 phase portrait, proved on paper, needs planar topology absent from Mathlib), the 1/π fixed-point obstruction and the second-floor (regular-singular arrival) question for series encodings; the [technical report's](https://arxiv.org/abs/2607.13531v2) open-problem sections state the last two precisely.\n\n## Building\n\n```bash\n# Prerequisites: elan + Lake (https://leanprover.github.io/)\nexport PATH=\"$HOME/.elan/bin:$PATH\"\nlake exe cache get    # pull Mathlib oleans\nlake build\n```\n\nThe default target checks the `Ripple.lean` import closure (1520 modules) and all of `Tri`. The exhaustive target, `lake build Ripple`, compiles all 1961 Ripple modules; it is needed for the modules outside the default closure, among them the kernel-checked Φ₄₁ Sturm certificate and the CM-163 evaluation (`Number/Modular/`), the Turing-completeness developments (`BoundedUniversality/`, `sCRNUniversality/`), and `Number/Euler.lean`, `EulerGamma.lean`, `EulerGammaLPP.lean` and `DottieCertified.lean`. A library user who imports one module builds only its dependencies.\n\nMeasured for r2026.11 on Lean v4.30.0 (all Ripple and `Tri` modules, Mathlib from the cache, one CPU node with a 16 GB memory limit): 49.9 minutes with 8 compile threads and 29.2 minutes with 16, with no module more than 3.87 GiB above its import floor and a largest peak of 7.15 GiB.\n\n### Lean and Mathlib versions\n\nRipple follows one Lean and Mathlib version at a time. elan installs the\ntoolchain named in `lean-toolchain`, so a standalone build needs no matching\nlocal installation. A project pinned to an older Mathlib should use the last\nrelease on that toolchain, for example `rev = \"r2026.11.8\"` for Lean and\nMathlib v4.30.0.\n\n| Release | Lean | Mathlib |\n|---|---|---|\n| `r2026.11.9` to `r2026.11.11` | v4.33.0 | v4.33.0 |\n| `r2026.11` to `r2026.11.8` | v4.30.0 | v4.30.0 |\n| `r2026.08` | v4.30.0 | v4.30.0 |\n| `v1.0` | v4.29.0 | v4.29.0 |\n\nThe Lean compatibility tags `v4.30.0` and `v4.33.0` mark the first public\ncommits on those toolchains. `MAINTENANCE.md` gives the support policy.\n\n## Using Ripple\n\n**To check a claim instead of trusting it.** Every headline result is an ordinary Lean theorem; the kernel will tell you exactly what it rests on:\n\n```lean\nimport Ripple.Number.AperyFermi\n\n#print axioms apery_fermi_is_crn_computable\n-- 'apery_fermi_is_crn_computable' depends on axioms: [propext, Classical.choice, Quot.sound]\n```\n\nThree standard axioms, nothing else — that check is the whole point of the repository, and it works the same way for any theorem here.\n\n**To use it as a library.** Ripple builds on Mathlib `v4.33.0` (Lean `v4.33.0`); from a project on the same toolchain, add to your `lakefile.toml`:\n\n```toml\n[[require]]\nname = \"Ripple\"\ngit  = \"https://github.com/zinan-huang/Ripple\"\nrev  = \"main\"\n```\n\nThe package exposes `Ripple` for the CRN framework and `Tri` for the\ntri-molecular approximate-majority formalization. Release `r2026.11` renames\nmany declarations and modules; [`docs/refactor/RENAMES.tsv`](docs/refactor/RENAMES.tsv)\nmaps the `r2026.08` names to the new ones, and\n[`docs/refactor/STATEMENT-CHANGES.tsv`](docs/refactor/STATEMENT-CHANGES.tsv)\nlists the statements that changed with the computability predicates.\n\n**To add your own computable number.** This is the intended extension path, and it is a plug-in: write down a polynomial IVP with rational coefficients and a rational initial value, prove boundedness and a convergence modulus, and package it as a `CertifiedBoundedTimeComputable` (`Ripple/Core/BoundedTime.lean`), the single definition of \"computes α\". That gives `IsCRNComputable α` (and `IsRealTimeComputable α` with a linear modulus); if `α ∈ [0, 1]` and the system has a CRN decomposition (`PolyCRNDecomposition`), `bounded_crn_is_lpp_computable` gives large-population-protocol computability. If the system is not bounded but its output converges, `bounded_compilation` makes it bounded. `Ripple/Number/CatalanCertified.lean` (a 4-variable IVP, self-contained) is the model to imitate.\n\n**To take pieces.** The probabilistic layers know nothing about CRNs: `CTMC/`, `Kurtz/`, `Stochastic/` and `Probability/` are a standalone verified toolkit for anyone formalizing continuous-time Markov chains, mean-field limits, or concentration bounds — the parts of this development that did not previously exist in Mathlib.\n\n**Where to start reading.** `Core/PIVP.lean` (the model) → `Core/BoundedTime.lean` (what \"computes\" means) → one certified number (`Number/CatalanCertified.lean`) → the LPP main theorem (`LPP/BoundedLPP.lean`) → `Kurtz/MeanField.lean` (the stochastic bridge). The [technical report (v2)](https://arxiv.org/abs/2607.13531v2) gives a guided tour of the July 2026 version of this route.\n\n## Structure\n\n```\nRipple/\n├── Core/                  GPAC/PIVP, computability predicates, bounded surrogate compilation,\n│                          real-time GPAC class, CRN pipeline, zero-init non-collapse\n├── DualRail/              dual-rail encoding of polynomial dynamics\n├── LPP/                   large-population protocols: definitions, compiler, main theorem, Thm 17;\n│                          PP → NAP construction (NAP*.lean)\n├── Number/                e, π, ln 2, γ, Dottie, Catalan G, ζ(3) (Fermi–Dirac + Apéry series)\n│   ├── Frobenius/         regular-singular Frobenius theory; Apéry conifold\n│   ├── Hypergeometric/    Clausen, Picard–Fuchs Wronskian, Chowla–Selberg; Ramanujan reduction\n│   └── Modular/           modular forms, Φ₄₁, CM-163, j(τ₁₆₃); Ψ₂₉ and the level-58 CM value\n├── CTMC/                  DTMC/CTMC, density process, random-index Doob, absorbing states\n├── Kurtz/                 Kurtz law of large numbers on [0, T] (with exponential tail), finite-dimensional CLT;\n│                          StrongApprox/: KMT coupling, Kurtz 1978 Lemma 3.1, Theorems 3.3(a) and 4.4\n├── Stochastic/            Itô integral, Doob inequalities, SDE strong solutions, Knight's theorem (with ports)\n├── Probability/           Bennett exponential-moment lemma, discrete Freedman inequality, lazy steps,\n│                          word counts and the uniform product measure (CountingBridge/)\n├── PopulationProtocol/    majority: approximate (AAE), exact (Doty et al.),\n│                          self-stabilizing (Kanaya et al.) + Burman ranking subprotocol\n├── sCRNUniversality/      stochastic CRNs (SCWB 2008): Theorems 3.1, 3.2 and 4.1 (register and Turing machines, bounded and unbounded space), coverability decidable\n├── BoundedUniversality/   GPAC Turing completeness (BGP 2017); bounded extensions in preparation\n├── ODE/                   scalar convergence barriers\n└── Analysis/              stable Grönwall lemma, linear Volterra equations, BV integration by parts\n```\n\n`Tri/` is a second top-level Lean library for the Condon–Hajiaghayi–\nKirkpatrick–Mañuch tri-molecular approximate-majority analysis;\n`docs/tri/` holds its formalization notes.\n\n`OPEN_PROBLEMS.md` lists the current research frontier; `docs/refactor/` holds the rename map and the paper notes cited from the source.\n\n## Publications\n\n**Technical Report (historical snapshot).** Ho-Lin Chen and Xiang Huang, *Ripple: An Open, AI-Formalized Lean 4 Framework for Computing with CRNs*, exact version [`arXiv:2607.13531v2`](https://arxiv.org/abs/2607.13531v2), revised 21 July 2026; repository copy [`paper/Ripple-DNA32.pdf`](paper/Ripple-DNA32.pdf). It describes the repository as of July 2026 and is not a guide to the current tree: it predates the `Tri` library (`r2026.08`) and everything in `r2026.11`.\n\n**Erratum.** At the v2 snapshot the Lean predicates `IsCRNComputable`, `IsRealTimeComputable` and `IsPolyTimeComputable` held for every real number, and `IsLPPComputable` for every number in `[0, 1]`, so the report's statements about LPP compilation (§3.3, §3.4, §6.1, §8) were not established by the declarations it cites. The report also overstates Kurtz's theorem, the stochastic simulation of Soloveichik et al., the state count of the Doty et al. protocol and the time and space bounds of the Kanaya et al. protocol. [`paper/ERRATA.md`](paper/ERRATA.md) gives the details, the corrected declarations, and which of these claims later releases establish.\n\n**Other documentation.** [`docs/refactor/`](docs/refactor/) holds the rename maps and the paper proofs cited from the Lean source, and [`docs/audit/`](docs/audit/) further paper notes cited from the source (the CF'24 readout, the Chudnovsky and Ramanujan CM values, SCWB Theorems 3.1 and 3.2, the Burman and Kanaya time-bound proofs); [`docs/tri/`](docs/tri/) holds the tri-molecular paper's formalization notes. `WORK_LOG.md`, `CHECKPOINT.md` and `TODO.md` are historical development logs, last updated in May 2026; they are not maintained and do not record later changes.\n\n## References\n\nThe full bibliography is in the [technical report (v2)](https://arxiv.org/abs/2607.13531v2). BibTeX for the repository's spine:\n\n```bibtex\n@article{HKLLM18,\n  author  = {Huang, Xiang and Klinge, Titus H. and Lathrop, James I. and Li, Xiaoyuan and Lutz, Jack H.},\n  title   = {Real-time computability of real numbers by chemical reaction networks},\n  journal = {Natural Computing},\n  volume  = {18},\n  pages   = {63--73},\n  year    = {2019},\n  doi     = {10.1007/s11047-018-9706-x}\n}\n\n@inproceedings{HKL19,\n  author    = {Huang, Xiang and Klinge, Titus H. and Lathrop, James I.},\n  title     = {Real-time equivalence of chemical reaction networks and analog computers},\n  booktitle = {DNA Computing and Molecular Programming (DNA 25)},\n  series    = {LNCS},\n  volume    = {11648},\n  pages     = {37--53},\n  year      = {2019},\n  doi       = {10.1007/978-3-030-26807-7_3}\n}\n\n@inproceedings{HH22,\n  author    = {Huang, Xiang and Huls, Rachel},\n  title     = {Computing real numbers with large-population protocols having a continuum of equilibria},\n  booktitle = {DNA Computing and Molecular Programming (DNA 28)},\n  series    = {LNCS},\n  volume    = {13467},\n  pages     = {55--71},\n  year      = {2022},\n  doi       = {10.1007/978-3-031-13502-6_4}\n}\n\n@inproceedings{CH26,\n  author    = {Chen, Ho-Lin and Huang, Xiang},\n  title     = {Bounded analog complexity},\n  booktitle = {DNA Computing and Molecular Programming (DNA 32)},\n  series    = {LIPIcs},\n  volume    = {387},\n  pages     = {14:1--14:22},\n  year      = {2026},\n  doi       = {10.4230/LIPIcs.DNA.32.14}\n}\n```\n\nMean-field limit (Kurtz theorem):\n\n```bibtex\n@article{Kurtz70,\n  author  = {Kurtz, Thomas G.},\n  title   = {Solutions of ordinary differential equations as limits of pure jump {M}arkov processes},\n  journal = {Journal of Applied Probability},\n  volume  = {7},\n  number  = {1},\n  pages   = {49--58},\n  year    = {1970},\n  doi     = {10.2307/3212147}\n}\n\n@article{Kurtz72,\n  author  = {Kurtz, Thomas G.},\n  title   = {The relationship between stochastic and deterministic models for chemical reactions},\n  journal = {The Journal of Chemical Physics},\n  volume  = {57},\n  number  = {7},\n  pages   = {2976--2978},\n  year    = {1972}\n}\n\n@article{Kurtz78,\n  author  = {Kurtz, Thomas G.},\n  title   = {Strong approximation theorems for density dependent {M}arkov chains},\n  journal = {Stochastic Processes and their Applications},\n  volume  = {6},\n  number  = {3},\n  pages   = {223--240},\n  year    = {1978}\n}\n\n@book{EthierKurtz86,\n  author    = {Ethier, Stewart N. and Kurtz, Thomas G.},\n  title     = {Markov Processes: Characterization and Convergence},\n  publisher = {Wiley},\n  year      = {1986},\n  edition   = {2nd ed., 2005},\n  doi       = {10.1002/9780470316658}\n}\n```\n\n## Citing\n\nIf this formalization is useful in your work, cite the revised technical report:\n\n> Ho-Lin Chen and Xiang Huang. *Ripple: An Open, AI-Formalized Lean 4 Framework for Computing with CRNs*. [arXiv:2607.13531v2](https://arxiv.org/abs/2607.13531v2), 2026.\n\nPlease cite v2 rather than v1, and note its [erratum](paper/ERRATA.md) on LPP computability. For results developed from the papers above, cite the relevant source paper as well. The repository itself is a living artifact: cite a release tag (for example `r2026.11.11`) or a commit hash alongside the report.\n\n## License\n\nApache-2.0, matching Mathlib. See `LICENSE`.\n",1795981081795]