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 PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.C2.GaugeWitnesses |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.Data |
| 3 | import Mathlib.Analysis.Calculus.Deriv.MeanValue |
| 4 | |
| 5 | /-! |
| 6 | # Pure-normal curve solutions fix their initial labels |
| 7 | |
| 8 | The actual moving-label chain rule and spatial curvature invariance |
| 9 | force the label velocity to vanish. Closed continuity extends that |
| 10 | identity to included endpoints. MT2007 Claim 19.1, p. 437; |
| 11 | `2026-09-21-uniqueness-normal-labels.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M63 |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | {a b : ℝ} {F : RicciFlow n M (Icc a b)} |
| 27 | |
| 28 | /-- An increasing moving relabeling between two actual pure-normal |
| 29 | C2 solutions has zero witnessed time derivative. MT2007 Claim 19.1, |
| 30 | p. 437; normal-label derivation, section 1. The literal second curve |
| 31 | keeps all tangent vectors in the same actual fiber. -/ |
| 32 | theorem normal_relabeling_derivative_eq_zero |
| 33 | {c : ℝ → ℝ → M} {psi : ℝ → ℝ → ℝ} {J : Set ℝ} |
| 34 | (hc : M63C2ShrinkingCurveOn F c J) |
| 35 | (hcomp : M63C2ShrinkingCurveOn F (fun x t => c (psi x t) t) J) |
| 36 | {t x w : ℝ} (ht : t ∈ interior J) |
| 37 | (hpsi : Differentiable ℝ (fun y => psi y t)) |
| 38 | (hpos : ∀ y, 0 < deriv (fun z => psi z t) y) |
| 39 | (htime : HasDerivAt (psi x) w t) : w = 0 := by |
| 40 | have htJ : t ∈ J := interior_subset ht |
| 41 | have hq : MDifferentiableAt ((𝓘(ℝ, ℝ)).prod 𝓘(ℝ, ℝ)) (𝓡 n) |
| 42 | (fun z : ℝ × ℝ => c z.1 z.2) (psi x t, t) := by |
| 43 | rw [← modelWithCornersSelf_prod, chartedSpaceSelf_prod] |
| 44 | exact ((hc.joint_c1 (psi x t, t) ⟨mem_univ _, ht⟩).contMDiffAt |
| 45 | ((isOpen_univ.prod isOpen_interior).mem_nhds ⟨mem_univ _, ht⟩)).mdifferentiableAt |
| 46 | (by simp) |
| 47 | have hS := unitTangent_contMDiff_of_c2 F c (hc.spatial_regular t htJ) (hc.immersed t htJ) |
| 48 | have hcurvature : m62CurvatureVector F (fun y s => c (psi y s) s) t x = |
| 49 | m62CurvatureVector F c t (psi x t) := |
| 50 | curvatureVector_comp F c |
| 51 | ((hc.spatial_regular t htJ).mdifferentiable (by norm_num)) hpsi hpos |
| 52 | ((hS (psi x t)).mdifferentiableAt (by simp)) |
| 53 | have hchain := curveVelocity_moving_labels c hq htime |
| 54 | rw [hcomp.equation t ht x, hc.equation t ht (psi x t), hcurvature] at hchain |
| 55 | have hzero : w • curveVelocity (n := n) (fun y => c y t) (psi x t) = 0 := |
| 56 | add_eq_right.mp hchain.symm |
| 57 | exact (smul_eq_zero.mp hzero).resolve_right (hc.immersed t htJ (psi x t)) |
| 58 | |
| 59 | /-- A closed-continuous increasing label map between actual pure-normal |
| 60 | C2 solutions remains the identity when it starts at the identity. |
| 61 | Time derivatives are required only strictly inside the interval. |
| 62 | MT2007 Claim 19.1, p. 437; normal-label derivation, section 2. -/ |
| 63 | theorem normal_relabeling_eq_initial_labels |
| 64 | {c : ℝ → ℝ → M} {psi : ℝ → ℝ → ℝ} {s T : ℝ} |
| 65 | (hc : M63C2ShrinkingCurveOn F c (Icc s T)) |
| 66 | (hcomp : M63C2ShrinkingCurveOn F (fun x t => c (psi x t) t) (Icc s T)) |
| 67 | (hcont : ∀ x, ContinuousOn (psi x) (Icc s T)) |
| 68 | (htime : ∀ x t, t ∈ Ioo s T → DifferentiableAt ℝ (psi x) t) |
| 69 | (hspace : ∀ t ∈ Ioo s T, Differentiable ℝ (fun x => psi x t)) |
| 70 | (hpos : ∀ t ∈ Ioo s T, ∀ x, 0 < deriv (fun y => psi y t) x) |
| 71 | (hinit : ∀ x, psi x s = x) : |
| 72 | ∀ t ∈ Icc s T, ∀ x, psi x t = x := by |
| 73 | intro t ht x |
| 74 | have hderiv (r : ℝ) (hr : r ∈ interior (Icc s T)) : |
| 75 | HasDerivWithinAt (psi x) 0 (interior (Icc s T)) r := by |
| 76 | have hr' : r ∈ Ioo s T := by simpa only [interior_Icc] using hr |
| 77 | have hd := (htime x r hr').hasDerivAt |
| 78 | have hzero := normal_relabeling_derivative_eq_zero hc hcomp hr |
| 79 | (hspace r hr') (hpos r hr') hd |
| 80 | rw [hzero] at hd |
| 81 | exact hd.hasDerivWithinAt |
| 82 | have hm : MonotoneOn (psi x) (Icc s T) := |
| 83 | monotoneOn_of_hasDerivWithinAt_nonneg (convex_Icc s T) (hcont x) hderiv |
| 84 | (fun _ _ => le_rfl) |
| 85 | have ha : AntitoneOn (psi x) (Icc s T) := |
| 86 | antitoneOn_of_hasDerivWithinAt_nonpos (convex_Icc s T) (hcont x) hderiv |
| 87 | (fun _ _ => le_rfl) |
| 88 | have hs : s ∈ Icc s T := ⟨le_rfl, ht.1.trans ht.2⟩ |
| 89 | exact (le_antisymm (ha hs ht ht.1) (hm hs ht ht.1)).trans (hinit x) |
| 90 | |
| 91 | end PoincareMT.M63 |