Poincaré conjecture: the Lean proof, cleaned up together
The 2026 Lean proof of the Poincaré conjecture after Morgan and Tian, 3 million lines, cleaned up together: smaller, faster to build, more readable, the theorems unchanged

| 1 | import Mathlib.Analysis.Calculus.ImplicitContDiff |
| 2 | |
| 3 | /-! |
| 4 | # Smoothness of uniquely specified scalar roots |
| 5 | |
| 6 | The implicit function theorem gives a local smooth root. Uniqueness in |
| 7 | an open interval identifies it with an already specified global root, |
| 8 | without a separate continuity assumption on that root. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option backward.isDefEq.respectTransparency false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped ContDiff Topology |
| 16 | |
| 17 | namespace Poincare.Analysis |
| 18 | |
| 19 | /-- Unique roots with nonzero derivative depend smoothly on their parameters. |
| 20 | This applies to hitting times at a transverse section. -/ |
| 21 | theorem contDiff_unique_scalar_root |
| 22 | {P : Type*} [NormedAddCommGroup P] [NormedSpace ℝ P] [CompleteSpace P] |
| 23 | {f : P × ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 24 | {J : Set ℝ} (hJ : IsOpen J) {τ d : P → ℝ} {c : ℝ} |
| 25 | (hmem : ∀ p, τ p ∈ J) (hvalue : ∀ p, f (p, τ p) = c) |
| 26 | (hderiv : ∀ p, HasDerivAt (fun t => f (p, t)) (d p) (τ p)) |
| 27 | (hd : ∀ p, d p ≠ 0) |
| 28 | (hunique : ∀ p t, t ∈ J → f (p, t) = c → t = τ p) : |
| 29 | ContDiff ℝ ∞ τ := by |
| 30 | rw [contDiff_iff_contDiffAt] |
| 31 | intro p |
| 32 | have hc := hf.contDiffAt (x := (p, τ p)) |
| 33 | have hinv : (fderiv ℝ f (p, τ p) ∘L ContinuousLinearMap.inr ℝ P ℝ).IsInvertible := by |
| 34 | have heq := ((hf.differentiable (by simp) (p, τ p)).hasFDerivAt.comp |
| 35 | (τ p) (hasFDerivAt_prodMk_right p (τ p))).unique (hderiv p).hasFDerivAt |
| 36 | rw [heq] |
| 37 | apply ContinuousLinearMap.IsInvertible.of_inverse |
| 38 | (g := (d p)⁻¹ • ContinuousLinearMap.id ℝ ℝ) |
| 39 | · ext |
| 40 | simp [smul_eq_mul, hd p] |
| 41 | · ext |
| 42 | simp [smul_eq_mul, hd p] |
| 43 | let ψ : P → ℝ := hc.implicitFunction (by simp) hinv |
| 44 | have hψ : ContDiffAt ℝ ∞ ψ p := hc.contDiffAt_implicitFunction (by simp) hinv |
| 45 | have hψp : ψ p = τ p := hc.implicitFunction_apply_self (by simp) hinv |
| 46 | have hψJ : ∀ᶠ q in 𝓝 p, ψ q ∈ J := |
| 47 | hψ.continuousAt.preimage_mem_nhds (hψp ▸ hJ.mem_nhds (hmem p)) |
| 48 | apply hψ.congr_of_eventuallyEq |
| 49 | filter_upwards [hψJ, hc.eventually_apply_implicitFunction (by simp) hinv] with q hq heq |
| 50 | exact (hunique q (ψ q) hq (heq.trans (hvalue p))).symm |
| 51 | |
| 52 | end Poincare.Analysis |