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.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.GeometricChartEquation |
| 2 | import Mathlib.Analysis.Calculus.ContDiff.Deriv |
| 3 | import Mathlib.Analysis.Calculus.Deriv.Prod |
| 4 | |
| 5 | /-! |
| 6 | # Chart ODE of an actual regularized geometric curve |
| 7 | |
| 8 | The coordinate velocity is the derivative of the chart composite. The |
| 9 | geometric equation identifies its derivative with the actual phase field. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedLength |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 23 | [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | local notation "V" => EuclideanSpace ℝ (Fin n) |
| 26 | |
| 27 | theorem regularizedCurve_chart_hasDerivAt {J : Set ℝ} (F : RicciFlow n M J) |
| 28 | (hM04 : RicciFlowCurvatureTheory.{u}) (T b : ℝ) (hb : 0 < b) |
| 29 | (hwindow : Set.Icc (T - b) T ⊆ J) (p : M) (γ : ℝ → M) |
| 30 | (I : Set ℝ) (hI : IsOpen I) |
| 31 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ I) |
| 32 | (hq : ∀ s ∈ I, γ s ∈ (chartAt V p).source) |
| 33 | (E : ParametricAlongCurveExtensionOn (n := n) I γ (curveVelocityWithin (n := n) γ I)) |
| 34 | (s : ℝ) (hs : s ∈ I) (htime : s ∈ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 35 | (heq : regularizedLGeodesicEquation F T γ I E s) : |
| 36 | let a : ℝ → V := fun t ↦ (chartAt V p) (γ t) |
| 37 | HasDerivAt (fun t ↦ (a t, deriv a t)) |
| 38 | (regularizedCoordinatePhase (squareChartMetric F T p) (squareChartScalar F T p) |
| 39 | (s, (a s, deriv a s))) s := by |
| 40 | let a : ℝ → V := fun t ↦ (chartAt V p) (γ t) |
| 41 | have ha : ContDiffOn ℝ ∞ a I := (contMDiffOn_chart.comp hγ hq).contDiffOn |
| 42 | have hv : ContDiffOn ℝ ∞ (deriv a) I := ha.deriv_of_isOpen hI (by simp) |
| 43 | have had : ∀ t ∈ I, HasDerivAt a (deriv a t) t := |
| 44 | fun t ht ↦ ((ha.contDiffAt (hI.mem_nhds ht)).differentiableAt (by simp)).hasDerivAt |
| 45 | have hgd : ∀ t ∈ I, MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ t := |
| 46 | fun t ht ↦ (hγ.contMDiffAt (hI.mem_nhds ht)).mdifferentiableAt (by simp) |
| 47 | have hvd : HasDerivAt (deriv a) (deriv (deriv a) s) s := |
| 48 | ((hv.contDiffAt (hI.mem_nhds hs)).differentiableAt (by simp)).hasDerivAt |
| 49 | have hw := (regularizedEquation_iff_coordinate_acceleration F hM04 T b hb hwindow |
| 50 | p γ (deriv a) I I hI (Set.Subset.refl I) hI.uniqueDiffOn hv hgd had hq E |
| 51 | s hs htime _ hvd).mp heq |
| 52 | exact (had s hs).prodMk (hvd.congr_deriv hw) |
| 53 | |
| 54 | end PoincareMT.ReducedLength |