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.Metric.Gluing.Descent |
| 2 | import PoincareLib.Geometry.Riemannian.Connection.Construction |
| 3 | import PoincareLib.Geometry.RicciFlow.MetricFamily.Descent |
| 4 | import PoincareLib.Geometry.RicciFlow.Limit.Descent |
| 5 | |
| 6 | /-! |
| 7 | # Terminal chart flows on the same interior carrier |
| 8 | |
| 9 | Closed ancient chart flows agreeing with an interior flow descend through the |
| 10 | same spatial cover. Compatibility at zero follows by continuity from negative |
| 11 | times. The resulting metric and Ricci flow extend the original interior flow |
| 12 | on its existing carrier, including the one-sided equation at zero. |
| 13 | |
| 14 | Reference: Morgan--Tian, Theorem 9.64 and Proposition 5.14, pp. 225-229, 90-91. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set |
| 21 | open scoped Manifold ContDiff Bundle Topology |
| 22 | |
| 23 | namespace PoincareMT.RicciFlow |
| 24 | |
| 25 | /-- Closed chart flows extending the same interior flow glue on its original |
| 26 | carrier and preserve each spatial chart through the terminal slice. -/ |
| 27 | theorem exists_terminal_extension_of_covering_chart_flows |
| 28 | {n : ℕ} {ι : Type*} [Nonempty ι] {U : ι → Type*} {M : Type*} |
| 29 | [∀ i, TopologicalSpace (U i)] [TopologicalSpace M] |
| 30 | [∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (U i)] |
| 31 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 32 | [∀ i, IsManifold (𝓡 n) ∞ (U i)] [IsManifold (𝓡 n) ∞ M] |
| 33 | (F : RicciFlow n M (Iio 0)) (Fchart : ∀ i, RicciFlow n (U i) (Iic 0)) |
| 34 | (q : ∀ i, U i → M) |
| 35 | (hq : ∀ i, IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ (q i)) |
| 36 | (hcover : ∀ y, ∃ i x, q i x = y) |
| 37 | (hinterior : ∀ t : ℝ, t < 0 → ∀ i (x : U i) (a b : TangentSpace (𝓡 n) x), |
| 38 | ((Fchart i).metric t).inner x a b = (F.metric t).inner (q i x) |
| 39 | (mfderiv (𝓡 n) (𝓡 n) (q i) x a) |
| 40 | (mfderiv (𝓡 n) (𝓡 n) (q i) x b)) : |
| 41 | ∃ G : RicciFlow n M (Iic 0), |
| 42 | (∀ t : ℝ, t < 0 → G.metric t = F.metric t) ∧ |
| 43 | ∀ t : ℝ, t ≤ 0 → ∀ i (x : U i) (a b : TangentSpace (𝓡 n) x), |
| 44 | ((Fchart i).metric t).inner x a b = (G.metric t).inner (q i x) |
| 45 | (mfderiv (𝓡 n) (𝓡 n) (q i) x a) |
| 46 | (mfderiv (𝓡 n) (𝓡 n) (q i) x b) := by |
| 47 | classical |
| 48 | have hinv (t : ℝ) (ht : t ≤ 0) (i j : ι) (x : U i) (y : U j) |
| 49 | (hxy : q i x = q j y) |
| 50 | (a b : TangentSpace (𝓡 n) x) (c d : TangentSpace (𝓡 n) y) |
| 51 | (ha : mfderiv (𝓡 n) (𝓡 n) (q i) x a = mfderiv (𝓡 n) (𝓡 n) (q j) y c) |
| 52 | (hb : mfderiv (𝓡 n) (𝓡 n) (q i) x b = mfderiv (𝓡 n) (𝓡 n) (q j) y d) : |
| 53 | ((Fchart i).metric t).inner x a b = ((Fchart j).metric t).inner y c d := by |
| 54 | have hpast : EqOn (fun s => ((Fchart i).metric s).inner x a b) |
| 55 | (fun s => ((Fchart j).metric s).inner y c d) (Iio 0) := by |
| 56 | intro s hs |
| 57 | dsimp only |
| 58 | rw [hinterior s hs, hinterior s hs] |
| 59 | have hform : ((F.metric s).inner (q i x) : EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 60 | EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) = (F.metric s).inner (q j y) := |
| 61 | congrArg (fun z : M => show EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 62 | EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ from (F.metric s).inner z) hxy |
| 63 | have hv : ((mfderiv (𝓡 n) (𝓡 n) (q i) x a, |
| 64 | mfderiv (𝓡 n) (𝓡 n) (q i) x b) : |
| 65 | EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n)) = |
| 66 | (mfderiv (𝓡 n) (𝓡 n) (q j) y c, mfderiv (𝓡 n) (𝓡 n) (q j) y d) := |
| 67 | Prod.ext ha hb |
| 68 | exact congrArg₂ (fun (B : EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 69 | EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 70 | (v : EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n)) => B v.1 v.2) hform hv |
| 71 | exact hpast.of_subset_closure |
| 72 | (fun s hs => ((Fchart i).equation s hs x a b).continuousWithinAt) |
| 73 | (fun s hs => ((Fchart j).equation s hs y c d).continuousWithinAt) |
| 74 | Iio_subset_Iic_self (by rw [closure_Iio]) ht |
| 75 | have hex (t : ℝ) := Poincare.Gluing.exists_unique_metric_of_covering_local_diffeomorphisms |
| 76 | (fun i => (Fchart i).metric (min t 0)) q hq hcover |
| 77 | (hinv (min t 0) (min_le_right _ _)) |
| 78 | let g (t : ℝ) := Classical.choose (hex t) |
| 79 | have hpres (t : ℝ) (ht : t ≤ 0) (i : ι) (x : U i) |
| 80 | (a b : TangentSpace (𝓡 n) x) : |
| 81 | ((Fchart i).metric t).inner x a b = (g t).inner (q i x) |
| 82 | (mfderiv (𝓡 n) (𝓡 n) (q i) x a) (mfderiv (𝓡 n) (𝓡 n) (q i) x b) := by |
| 83 | have h := (Classical.choose_spec (hex t)).1 i x a b |
| 84 | change ((Fchart i).metric (min t 0)).inner x a b = (g t).inner (q i x) |
| 85 | (mfderiv (𝓡 n) (𝓡 n) (q i) x a) (mfderiv (𝓡 n) (𝓡 n) (q i) x b) at h |
| 86 | rwa [min_eq_left ht] at h |
| 87 | have heq (t : ℝ) (ht : t < 0) : g t = F.metric t := by |
| 88 | symm |
| 89 | apply (Classical.choose_spec (hex t)).2 (F.metric t) |
| 90 | intro i x a b |
| 91 | simpa only [min_eq_left ht.le] using hinterior t ht i x a b |
| 92 | have hsmooth : RiemannianMetric.IsSmoothFamilyOn g (Iic 0) := |
| 93 | Poincare.Gluing.isSmoothFamilyOn_of_local_diffeomorphisms |
| 94 | (fun i => (Fchart i).metric) g (fun i => (Fchart i).smooth) q hq hcover hpres |
| 95 | obtain ⟨G, hG⟩ := exists_of_covering_local_diffeomorphisms Fchart g hsmooth |
| 96 | 0 (g 0).leviCivitaData q hq hcover hpres |
| 97 | refine ⟨G, ?_, ?_⟩ |
| 98 | · simpa only [hG] using heq |
| 99 | · simpa only [hG] using hpres |
| 100 | |
| 101 | end PoincareMT.RicciFlow |