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.Riemannian.Curvature.Basic |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Basic |
| 3 | |
| 4 | /-! Source: Mapher06/Poincare-MorganTian, `PoincareMT/Definitions/Ch03/RicciFlow.lean`, |
| 5 | revision `b2c3c64781fee22edfd683a224d4f8d280e2e9ce`. Only imports and module placement are changed. |
| 6 | See `references/ricci-flow/mapher/shared-foundations.json`. -/ |
| 7 | |
| 8 | |
| 9 | /-! |
| 10 | # Ordinary Ricci flow on a fixed manifold |
| 11 | |
| 12 | Morgan-Tian, Definitions 3.1-3.2, printed p. 35, specifies a smooth evolving |
| 13 | metric on a nondegenerate interval. The total metric and connection families |
| 14 | are representatives; joint smoothness and the equation concern only the time |
| 15 | domain. Included endpoints use within-interval derivatives. No flow or |
| 16 | connection is constructed from an admitted existence theorem. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | |
| 21 | open scoped Manifold ContDiff Bundle |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT |
| 26 | |
| 27 | /-- Joint within-domain smoothness of an evolving metric's bilinear section. -/ |
| 28 | def RiemannianMetric.IsSmoothFamilyOn {n : ℕ} {M : Type u} |
| 29 | [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 30 | [IsManifold (𝓡 n) ∞ M] |
| 31 | (g : ℝ → RiemannianMetric n M) (J : Set ℝ) : Prop := |
| 32 | ContMDiffOn (𝓘(ℝ, ℝ).prod (𝓡 n)) |
| 33 | ((𝓡 n).prod 𝓘(ℝ, |
| 34 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ)) ∞ |
| 35 | (fun p : ℝ × M ↦ Bundle.TotalSpace.mk' |
| 36 | (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 37 | (E := fun x : M ↦ TangentSpace (𝓡 n) x →L[ℝ] TangentSpace (𝓡 n) x →L[ℝ] ℝ) |
| 38 | p.2 ((g p.1).inner p.2)) (J ×ˢ Set.univ) |
| 39 | |
| 40 | /-- Ordinary Ricci flow on a nondegenerate real interval and a fixed manifold. -/ |
| 41 | structure RicciFlow (n : ℕ) (M : Type u) [TopologicalSpace M] |
| 42 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 43 | (J : Set ℝ) where |
| 44 | /-- Total representatives of the smooth spatial metrics on J. -/ |
| 45 | metric : ℝ → RiemannianMetric n M |
| 46 | /-- Compatible connection data, retained without an existence construction. -/ |
| 47 | connection (t : ℝ) : LeviCivitaData (metric t) |
| 48 | /-- The time domain is an interval. -/ |
| 49 | interval : J.OrdConnected |
| 50 | /-- The interval contains at least two distinct times. -/ |
| 51 | nontrivial : J.Nontrivial |
| 52 | /-- Joint smoothness of the actual metric on the specified spacetime domain. -/ |
| 53 | smooth : RiemannianMetric.IsSmoothFamilyOn metric J |
| 54 | /-- The metric evolution equation, including one-sided endpoint derivatives. -/ |
| 55 | equation (t : ℝ) (ht : t ∈ J) (x : M) (u v : TangentSpace (𝓡 n) x) : |
| 56 | HasDerivWithinAt (fun s ↦ (metric s).inner x u v) |
| 57 | (-2 * (connection t).ricci x u v) J t |
| 58 | |
| 59 | end PoincareMT |