← 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 is not about certainty. It is about locating uncertainty. The gap between $\varepsilon_0 = 1/3$ (Gronwall) and $r_\star = 0.80$ (numerics) is a mathematical gap. Issue #12 is a formal gap — a place where the Lean proof currently says sorry. Both deserve attention.
§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

SpiralReturn — Formalising Theorem 2.1

The ODE itself is a Picard–Lindelöf application. Mathlib's ODE.Gronwall and ODE.PicardLindelof give us existence, uniqueness, and the Gronwall lemma. The skeleton below shows the statement in its current form.

/- AXLE/SpiralReturn.lean — Theorem 2.1 (symmetric) -/
import AXLE.Chain
import Mathlib.Analysis.ODE.PicardLindelof
import Mathlib.Analysis.SpecialFunctions.Log.Basic

namespace AXLE

/-- The dm³ radial equation at ε = 2. -/
noncomputable def dm3Radial (z : ) (r : ) :  :=
  r * (1 - r^2) + 2 * (r - 1) * Real.exp (-z)

/-- Theorem 2.1 (symmetric): if |r₀ - 1| < 1/3 and z₀ ≥ log 2,
    the solution converges exponentially to r = 1 at rate -2. -/
theorem spiralReturn
    {r₀ z₀ : }
    (hr : |r₀ - 1| < 1/3)
    (hz : z₀ ≥ Real.log 2) :
    ∃ (r : ℝ → ℝ), ∃ (μ : ), μ < 0 ∧
      r 0 = r₀ ∧
      (∀ t ≥ 0, |r t - 1| ≤ |r₀ - 1| * Real.exp (μ * t)) := by
  -- Step 1: apply Picard–Lindelöf for local existence
  -- Step 2: derive the scalar inequality ½ d/dt u² ≤ (-2 + 3ε₀ + εe^{-z₀}) u²
  -- Step 3: apply Mathlib.Analysis.ODE.Gronwall
  -- Step 4: the Lipschitz bound needed at Step 2 — see Issue #12
  sorry

end AXLE

What is proved, what is sorry

Steps 1 and 3 of the proof sketch are library calls. Mathlib's ODE.PicardLindelof and ODE.Gronwall are complete, maintained, and well-documented. Step 2 — producing the scalar inequality from the radial equation — needs a bound on the coupling term. That bound is the content of Issue #12.

Lemma 2.1.A · The scalar inequality
Given $|u(0)| < 1/3$ and $z(0) \geq \log 2$, there exists $\eta > 0$ such that along solutions of dm³, $\tfrac12 \frac{d}{dt} u^2 \leq -\eta\, u^2$ for all $t \geq 0$.
This is what Step 2 must deliver. Given it, Step 3 is a one-line application of Mathlib.Analysis.ODE.Gronwall. The explicit $\eta$ is $2 - 3\varepsilon_0 - 1 > 0$ when $\varepsilon_0 < 1/3$. The missing input is a Lipschitz bound on the coupling that is uniform for all $t$ at which $|u| < \varepsilon_0$. Stated as an obligation: $\kappa(r,z) := \varepsilon(r-1)e^{-z}$ is $L$-Lipschitz in $r$ on $\{|r-1| < 1/3\} \times \{z \geq \log 2 - \delta\}$ for some explicit $L$. That is Issue #12.
§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.
Beyond #12. The sharp basin $r_\star \approx 0.80$ is a separate research project, not a formalisation gap. No amount of Lean will sharpen $1/3$ to $0.80$ — that requires a new mathematical argument, probably a Lyapunov function with sign-aware structure. If you want to work on that, the numeric lab (labs/dm3_numeric.py) is the place to start: it reproduces Table 1 in one file.
§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.
§6 · Closing

What the Course Did

In three hours we walked from contact 3-manifolds (S1) through Theorem 2.1 with its Gronwall 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.

If you contribute a proof of kappa_lipschitz, you close the last sorry in the symmetric proof of Theorem 2.1. The operator chain $G = U\circ F\circ K\circ C$ then has one fully verified instance. That is a milestone: a GTCT theorem with a machine-checked proof. Even if the sharp basin remains open.
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 a Gronwall ball $|r - 1| < 1/3$.
  • The numerics (S2) correct the inner boundary to $r_\star \approx 0.80$ — stricter than Gronwall, not weaker.
  • The formalisation (S3) reduces the whole symmetric theorem to one Mathlib-style lemma: kappa_lipschitz.

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