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.Basic |
| 2 | import PoincareLib.Geometry.Riemannian.Connection.ChangeMetric |
| 3 | import PoincareLib.Geometry.Riemannian.Curvature.LocalIsometryRicci |
| 4 | import Mathlib.Geometry.Manifold.LocalDiffeomorph |
| 5 | |
| 6 | /-! |
| 7 | # Ricci flows descended from a local isometry cover |
| 8 | |
| 9 | Local Ricci flows on a fixed covering family of spatial local diffeomorphisms |
| 10 | give the Ricci-flow equation for a jointly smooth metric family on the covered |
| 11 | manifold. One reference Levi-Civita datum supplies total connection data by |
| 12 | changing its metric. Metric preservation is required only on the time domain, |
| 13 | and the equation retains within-domain derivatives at included endpoints. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Bundle |
| 21 | |
| 22 | namespace PoincareMT.RicciFlow |
| 23 | |
| 24 | /-- Descend the local equations to the prescribed metric family. The single |
| 25 | reference connection remains an explicit input for a separate construction |
| 26 | from compatible local connections. -/ |
| 27 | theorem exists_of_covering_local_diffeomorphisms |
| 28 | {n : ℕ} {ι : Type*} [Nonempty ι] {P : ι → Type*} {N : Type*} |
| 29 | [∀ i, TopologicalSpace (P i)] [TopologicalSpace N] |
| 30 | [∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (P i)] |
| 31 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] |
| 32 | [∀ i, IsManifold (𝓡 n) ∞ (P i)] [IsManifold (𝓡 n) ∞ N] |
| 33 | {J : Set ℝ} (F : ∀ i, RicciFlow n (P i) J) |
| 34 | (gN : ℝ → RiemannianMetric n N) |
| 35 | (hgN : RiemannianMetric.IsSmoothFamilyOn gN J) |
| 36 | (t₀ : ℝ) (D₀ : LeviCivitaData (gN t₀)) |
| 37 | (q : ∀ i, P i → N) |
| 38 | (hq : ∀ i, IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ (q i)) |
| 39 | (hcover : ∀ y, ∃ i x, q i x = y) |
| 40 | (hpres : ∀ t ∈ J, ∀ i (x : P i) (a b : TangentSpace (𝓡 n) x), |
| 41 | ((F i).metric t).inner x a b = (gN t).inner (q i x) |
| 42 | (mfderiv (𝓡 n) (𝓡 n) (q i) x a) |
| 43 | (mfderiv (𝓡 n) (𝓡 n) (q i) x b)) : |
| 44 | ∃ FN : RicciFlow n N J, FN.metric = gN := by |
| 45 | classical |
| 46 | let i₀ : ι := Classical.choice inferInstance |
| 47 | let D : ∀ t, LeviCivitaData (gN t) := fun t => D₀.withMetric (gN t) |
| 48 | refine ⟨{ |
| 49 | metric := gN |
| 50 | connection := D |
| 51 | interval := (F i₀).interval |
| 52 | nontrivial := (F i₀).nontrivial |
| 53 | smooth := hgN |
| 54 | equation := ?_ }, rfl⟩ |
| 55 | intro t ht y u v |
| 56 | obtain ⟨i, x, rfl⟩ := hcover y |
| 57 | let A := (hq i x).mfderivToContinuousLinearEquiv (by simp) |
| 58 | obtain ⟨a, ha⟩ := A.surjective u |
| 59 | obtain ⟨b, hb⟩ := A.surjective v |
| 60 | have ha' : mfderiv (𝓡 n) (𝓡 n) (q i) x a = u := ha |
| 61 | have hb' : mfderiv (𝓡 n) (𝓡 n) (q i) x b = v := hb |
| 62 | have hRicci := ((F i).connection t).ricci_eq_of_local_isometry (D t) |
| 63 | isOpen_univ (hq i).contMDiff.contMDiffOn |
| 64 | (fun z _ a b => hpres t ht i z a b) (mem_univ x) a b |
| 65 | have hderiv := (F i).equation t ht x a b |
| 66 | rw [hRicci, ha', hb'] at hderiv |
| 67 | apply hderiv.congr_of_mem ?_ ht |
| 68 | intro s hs |
| 69 | simpa only [ha', hb'] using (hpres s hs i x a b).symm |
| 70 | |
| 71 | end PoincareMT.RicciFlow |