← S2: Theorem & Basin Mini-Curso · Session S3 / 3 Vol. IV Hub →
MINI-CURSO · SESSION S3 · 60 MIN
S3

Lean 4 Skeleton & AXLE Issue #12

Formalising Theorem 2.1 in Mathlib 4. What is proved, what is sorry, and why the Lipschitz constant on the coupling is the one open door.
Objective: read a real-world Lean 4 formalisation | Pre-req: S1, S2 | Mode: code walk-through
S1 · CONTACT GEOMETRY  →  S2 · THEOREM 2.1 & BASIN  →  S3 · LEAN 4 SKELETON
Session Agenda · 60 Minutes

What We Will Cover

  1. 0 – 8 min — Why formalise? What Lean 4 / Mathlib 4 give us in this context.
  2. 8 – 20 minAXLE/Chain.lean walk-through: the operator chain $G = U\circ F\circ K\circ C$ as a Lean structure.
  3. 20 – 35 minSpiralReturn: the formal statement of Theorem 2.1 and what exists in Mathlib to close it.
  4. 35 – 48 min — AXLE Issue #12: the open Lipschitz estimate. What it says, why it is the bottleneck.
  5. 48 – 60 min — Q&A, contribution on-ramp, pointers to Mathlib's ODE and dynamics files.
§1 · Motivation

Why Lean 4, Why Now

Theorem 2.1 in its symmetric form is an ODE result. Calculus says it is true. So why formalise it?

Formalisation locates uncertainty — and sometimes it finds that a claim is not just imprecise but wrong. The symmetric Lyapunov ball $|\varepsilon_0| = 1/3$ has been removed from the canonical Lean file (GCTC/Chain_updated.lean, 2026-04-18): numerics (DOP853; FINDINGS.md) show the claim is false on the inner side — $r(0) = 0.667$ collapses in finite time. The basin is asymmetric: outer side is wide (all $r_0 > 1$ tested), inner boundary is $r_\star \approx 0.80$. On the positive side, gronwall_outer is now proved. Two obligations remain as sorry and two as axiom (pending the dm³ ODE formalisation).
§2 · Code Walk-Through

AXLE/Chain.lean — The Operator Chain

The four-operator chain $G = U\circ F\circ K\circ C$ from GTCT (contraction, curvature, filter, unfolding) is represented as a dependent structure. Each operator is a map between state spaces with its own regularity hypothesis.

/- AXLE/Chain.lean — operator chain for GTCT -/
import Mathlib.Analysis.ODE.Gronwall
import Mathlib.Analysis.NormedSpace.Basic
import Mathlib.Topology.MetricSpace.Lipschitz

namespace AXLE

structure OperatorChain (α β γ δ ω : Type*)
    [MetricSpace α] [MetricSpace β] [MetricSpace γ]
    [MetricSpace δ] [MetricSpace ω] where
  C : α → β                 -- Contract
  K : β → γ                 -- Curvature
  F : γ → δ                 -- Filter
  U : δ → ω                 -- Unfold
  C_lip : LipschitzWith 1 C
  K_lip : ∃ L : ℝ≥0, LipschitzWith L K   -- ← Issue #12
  F_lip : LipschitzWith 1 F
  U_cont : Continuous U

def OperatorChain.compose
    (ch : OperatorChain α β γ δ ω) : α → ω :=
  ch.U ∘ ch.F ∘ ch.K ∘ ch.C

end AXLE

Reading the structure

Note the regularity hypotheses: $C$ and $F$ are non-expanding (LipschitzWith 1), $U$ only needs to be continuous (it fans information out, it need not preserve metric), and $K$ — the curvature operator, geometrically the dm³ radial flow — carries an existential Lipschitz constant. This is the crucial structural choice.

Design note · Why existential for $K$
The Lipschitz constant of the radial dm³ flow at a given time depends on the initial height $z(0)$ and on $\varepsilon$. It is bounded, but the bound is not uniform in initial data. We encode this honestly: $K$ is Lipschitz, with some constant $L$, and the rest of the chain must work for any such $L$. This is exactly what Mathlib's Lipschitz API supports.
§3 · The Theorem

GCTC/Chain_updated.lean — Current Proof State

The canonical Lean file is now GCTC/Chain_updated.lean (updated 2026-04-18 in the GTCT repo). The symmetric $\varepsilon_0 = 1/3$ formulation has been replaced by an asymmetric-basin model. The snippet below shows the two key theorems: one proved, one still sorry.

/- GCTC/Chain_updated.lean — updated 2026-04-18 -/
-- ε₀ = 1/3 removed: false on the inner side (see FINDINGS.md).
-- Replaced with asymmetric basin: r_star ≈ 0.80 inner, unbounded outer.

/-- Inner-basin boundary (empirical; replaces ε₀ = 1/3). -/
noncomputable def r_star :  := 0.8

/-- Outer-basin Lyapunov bound — PROVED. -/
theorem gronwall_outer
    (μ_max ε μ_bound : ) (hμ_bound : 0 < μ_bound)
    (hμ : μ_max + 3 * ε ≤ -μ_bound) :
    ∃ C : , 0 < C ∧ ∀ t : , 0 ≤ t →
      Real.exp ((μ_max + 3 * ε) * t) ≤ C * Real.exp (-μ_bound * t) := by
  refine ⟨1, one_pos, ?_⟩
  intro t ht; rw [one_mul]
  apply Real.exp_le_exp.mpr
  exact mul_le_mul_of_nonneg_right hμ ht   -- ← proved

/-- Spiral Return (T1) — corrected hypothesis; still sorry. -/
theorem spiral_return_exists
    {X : Type*} [MetricSpace X] [SeminormedAddCommGroup X]
    (G : GChain X) (x₀ : X)
    (h_nontrivial : GChain.iter G 64 x₀ ≠ x₀) :
    ∃ sr : SpiralReturn X G, sr.x₀' ≠ sr.x₀ := by
  sorry   -- pending AXLE integration of dm³ flow dynamics

-- Two axioms mark the ODE dependency boundary:
--   axiom inner_basin_is_asymmetric  (inner side; TODO(AXLE) replace with ODE statement)
--   axiom outer_basin_unbounded      (outer side; TODO(AXLE) tie to dm³ flow)

end GCTC

What is proved, what is sorry, what is axiom

gronwall_outer is now proved — the corrected hypothesis ($\mu_{\max} + 3\varepsilon \leq -\mu_{\text{bound}}$, stronger than the old $< 0$) was what made the proof go through. Two theorems remain as sorry: spiral_return_exists and poincare_collatz. Two further claims are declared as axiom — a permanent dependency on the dm³ ODE once it is formalised in Mathlib: inner_basin_is_asymmetric and outer_basin_unbounded. An axiom is not a sorry: it extends the logical foundation, which means the "0 extra axioms" headline is only recoverable once those two are replaced with real ODE proofs.

Lemma 2.1.A · The outer-basin decay bound (proved)
For all $r_0 > 1$ (outer side), the dm³ radial flow converges exponentially to $r = 1$ at rate $\mu_{\max} = -2$. The inner boundary is asymmetric: $r_\star \approx 0.80$ (not $1 - 1/3 = 0.667$).
The decay-exponent sign — $(\mu_{\max} + 3\varepsilon) < 0$ — is proved by gronwall_outer. The full Lyapunov ODE integration (that the contraction bound follows from the exponent) is in the book proofs (GTCT-2026-001 §5) and is not yet formalised in Lean. The symmetric $\varepsilon_0 = 1/3$ claim has been removed because numerics show $r(0) = 0.667$ collapses — the inner boundary of the basin is $r_\star \approx 0.80$, not $1 - 1/3$. What remains open: spiral_return_exists, poincare_collatz, and two axiom placeholders for the ODE boundary conditions.
§4 · The Open Obligation

AXLE Issue #12 — The Lipschitz Estimate

#12 · Lipschitz bound on the coupling $\kappa(r,z) = \varepsilon(r-1)e^{-z}$
open · good first issue

Goal: Prove kappa_lipschitz in AXLE/Coupling.lean:

lemma kappa_lipschitz
    (ε₀ : ) (hε₀ : 0 < ε₀) (hε₀' : ε₀ < 1/3)
    (z_lo : ) :
    ∃ L : ℝ≥0, ∀ r₁ r₂ : , ∀ z : ,
      |r₁ - 1| < ε₀ → |r₂ - 1| < ε₀ → z ≥ z_lo →
      |κ r₁ z - κ r₂ z| ≤ L * |r₁ - r₂| := sorry

Difficulty: Low — this is really a one-line estimate in paper form: $\kappa$ is linear in $r$ with slope $\varepsilon e^{-z} \leq \varepsilon e^{-z_{\text{lo}}}$, so $L = \varepsilon e^{-z_{\text{lo}}}$ works.

Why it is in Lean: turning that one-line estimate into Lean requires the right Lipschitz.mk', some NNReal plumbing for the constant, and care with Real.exp monotonicity. A first-time Mathlib contributor can do it in an afternoon.

Contribution path:

  • git clone https://github.com/TOTOGT/AXLE
  • Open AXLE/Coupling.lean in VS Code with the Lean 4 extension.
  • Replace the sorry with an actual proof term.
  • lake build to type-check; open a PR.

Related: two already-closed issues

#8 · Port dm3Radial to ODE.Gronwall.comparison form
closed · merged #11
Rewrite the scalar inequality in the shape that Mathlib's Gronwall comparison lemma expects ($\dot u \leq f(u)$ with $f$ locally Lipschitz). Done — took two rounds of review.
#9 · Positivity of $\{r > 1\}$ (the S1 board exercise)
closed · merged #10
Formalise S1's board exercise: $\{r(t) > 1\}$ is positively invariant. Done via Mathlib.Analysis.ODE.Invariant.
The ε₀ = 1/3 claim is false on the inner side. This is no longer a sharpening gap — it is a correction. DOP853 numerics confirm $r(0) = 0.667$ (the symmetric Lyapunov estimate boundary) collapses in finite time. The canonical Lean file (GCTC/Chain_updated.lean) replaces the symmetric ball with the asymmetric pair $(r_\star \approx 0.80,\ \infty)$. The outer Lyapunov bound is proved; the inner boundary is currently an axiom pending ODE formalisation. If you want to close it, start at FINDINGS.md in the GTCT repo and the numeric sweep in dm3_inner_basin.png.
§5 · On-Ramp

How to Contribute

The mini-curso has three kinds of take-home:

Relevant Mathlib files to read before starting

▶ dm³ Contact Flow — reference sim

Keep this open while reading the Lean. The orbits you see are exactly what spiralReturn promises — modulo Issue #12.
Helical attractor simulation — see abstract-law3m-2026.html
§6 · Closing

What the Course Did

In three hours we walked from contact 3-manifolds (S1) through Theorem 2.1 with its Lyapunov basin (S2) to a Lean 4 formalisation with one open obligation (S3). The formalisation is live, public, and welcomes contributions. The sharp basin $r_\star$ is open research. The dm³ simulator runs in any browser.

The outer-basin Lyapunov bound (gronwall_outer) is proved. The remaining open obligations are: spiral_return_exists (sorry — needs dm³ flow dynamics), poincare_collatz (sorry — needs g³³ convergence), and two axiom declarations for the inner/outer ODE boundary conditions. Closing those axioms into real theorems — once Mathlib formalises a suitable ODE module for the dm³ system — would give GTCT its first fully machine-checked instance.
Final take-away
The map of the territory.
  • The geometry (S1) forces a helix. The contact form is not decoration; it is what $\Gamma$ lives on.
  • The analysis (S2) proves exponential contraction at rate $-2$ on the outer basin ($r_0 > 1$). The symmetric $\varepsilon_0 = 1/3$ claim is false on the inner side.
  • The numerics (S2) establish the asymmetric basin: outer side unbounded, inner boundary $r_\star \approx 0.80$.
  • The formalisation (S3) has proved gronwall_outer; two sorrys and two axioms mark the boundary of what Lean can currently check without a dm³ ODE module in Mathlib.

Four layers, four contributions, one helix. Obrigado, Natal.