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 | # Finite closed chart-flow descent |
| 8 | |
| 9 | Actual chart flows on a closed finite interval descend through a fixed spatial |
| 10 | cover to the original interior carrier. Continuity gives compatibility at both |
| 11 | endpoints, where the descended flow retains the within-interval equation. |
| 12 | |
| 13 | Reference: Morgan--Tian, Proposition 5.14, printed pp. 90-91. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Bundle Topology |
| 21 | |
| 22 | universe uI uU uM |
| 23 | |
| 24 | namespace PoincareMT.M30 |
| 25 | |
| 26 | /-- Closed chart flows extending the same interior flow descend on its actual |
| 27 | carrier and preserve the fixed chart maps through both endpoints |
| 28 | (Morgan--Tian, Proposition 5.14, printed pp. 90-91). -/ |
| 29 | theorem exists_finite_extension_of_covering_chart_flows |
| 30 | {n : ℕ} {ι : Type uI} [Nonempty ι] |
| 31 | {U : ι → Type uU} {M : Type uM} |
| 32 | [∀ i, TopologicalSpace (U i)] [TopologicalSpace M] |
| 33 | [∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (U i)] |
| 34 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 35 | [∀ i, IsManifold (𝓡 n) ∞ (U i)] [IsManifold (𝓡 n) ∞ M] |
| 36 | {a b : ℝ} (hab : a < b) |
| 37 | (F : RicciFlow n M (Ioo a b)) |
| 38 | (Fchart : ∀ i, RicciFlow n (U i) (Icc a b)) |
| 39 | (q : ∀ i, U i → M) |
| 40 | (hq : ∀ i, IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ (q i)) |
| 41 | (hcover : ∀ y, ∃ i x, q i x = y) |
| 42 | (hinterior : ∀ t ∈ Ioo a b, ∀ i (x : U i) |
| 43 | (v w : TangentSpace (𝓡 n) x), |
| 44 | ((Fchart i).metric t).inner x v w = (F.metric t).inner (q i x) |
| 45 | (mfderiv (𝓡 n) (𝓡 n) (q i) x v) |
| 46 | (mfderiv (𝓡 n) (𝓡 n) (q i) x w)) : |
| 47 | ∃ G : RicciFlow n M (Icc a b), |
| 48 | (∀ t ∈ Ioo a b, G.metric t = F.metric t) ∧ |
| 49 | ∀ t ∈ Icc a b, ∀ i (x : U i) |
| 50 | (v w : TangentSpace (𝓡 n) x), |
| 51 | ((Fchart i).metric t).inner x v w = (G.metric t).inner (q i x) |
| 52 | (mfderiv (𝓡 n) (𝓡 n) (q i) x v) |
| 53 | (mfderiv (𝓡 n) (𝓡 n) (q i) x w) := by |
| 54 | classical |
| 55 | have hinv (t : ℝ) (ht : t ∈ Icc a b) (i j : ι) (x : U i) (y : U j) |
| 56 | (hxy : q i x = q j y) |
| 57 | (v w : TangentSpace (𝓡 n) x) (v' w' : TangentSpace (𝓡 n) y) |
| 58 | (hv : mfderiv (𝓡 n) (𝓡 n) (q i) x v = mfderiv (𝓡 n) (𝓡 n) (q j) y v') |
| 59 | (hw : mfderiv (𝓡 n) (𝓡 n) (q i) x w = mfderiv (𝓡 n) (𝓡 n) (q j) y w') : |
| 60 | ((Fchart i).metric t).inner x v w = ((Fchart j).metric t).inner y v' w' := by |
| 61 | have hpast : EqOn (fun s => ((Fchart i).metric s).inner x v w) |
| 62 | (fun s => ((Fchart j).metric s).inner y v' w') (Ioo a b) := by |
| 63 | intro s hs |
| 64 | dsimp only |
| 65 | rw [hinterior s hs, hinterior s hs] |
| 66 | have hform : ((F.metric s).inner (q i x) : EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 67 | EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) = (F.metric s).inner (q j y) := |
| 68 | congrArg (fun z : M => show EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 69 | EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ from (F.metric s).inner z) hxy |
| 70 | have hvec : ((mfderiv (𝓡 n) (𝓡 n) (q i) x v, |
| 71 | mfderiv (𝓡 n) (𝓡 n) (q i) x w) : |
| 72 | EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n)) = |
| 73 | (mfderiv (𝓡 n) (𝓡 n) (q j) y v', mfderiv (𝓡 n) (𝓡 n) (q j) y w') := |
| 74 | Prod.ext hv hw |
| 75 | exact congrArg₂ (fun (B : EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 76 | EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 77 | (z : EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n)) => B z.1 z.2) |
| 78 | hform hvec |
| 79 | exact hpast.of_subset_closure |
| 80 | (fun s hs => ((Fchart i).equation s hs x v w).continuousWithinAt) |
| 81 | (fun s hs => ((Fchart j).equation s hs y v' w').continuousWithinAt) |
| 82 | Ioo_subset_Icc_self (by rw [closure_Ioo hab.ne]) ht |
| 83 | let clamp (t : ℝ) := max a (min t b) |
| 84 | have hclamp (t : ℝ) : clamp t ∈ Icc a b := |
| 85 | ⟨le_max_left _ _, max_le hab.le (min_le_right _ _)⟩ |
| 86 | have hclamp_eq (t : ℝ) (ht : t ∈ Icc a b) : clamp t = t := by |
| 87 | dsimp only [clamp] |
| 88 | rw [min_eq_left ht.2, max_eq_right ht.1] |
| 89 | have hex (t : ℝ) := Poincare.Gluing.exists_unique_metric_of_covering_local_diffeomorphisms |
| 90 | (fun i => (Fchart i).metric (clamp t)) q hq hcover (hinv (clamp t) (hclamp t)) |
| 91 | let g (t : ℝ) := Classical.choose (hex t) |
| 92 | have hpres (t : ℝ) (ht : t ∈ Icc a b) (i : ι) (x : U i) |
| 93 | (v w : TangentSpace (𝓡 n) x) : |
| 94 | ((Fchart i).metric t).inner x v w = (g t).inner (q i x) |
| 95 | (mfderiv (𝓡 n) (𝓡 n) (q i) x v) (mfderiv (𝓡 n) (𝓡 n) (q i) x w) := by |
| 96 | have h := (Classical.choose_spec (hex t)).1 i x v w |
| 97 | change ((Fchart i).metric (clamp t)).inner x v w = (g t).inner (q i x) |
| 98 | (mfderiv (𝓡 n) (𝓡 n) (q i) x v) (mfderiv (𝓡 n) (𝓡 n) (q i) x w) at h |
| 99 | rwa [hclamp_eq t ht] at h |
| 100 | have heq (t : ℝ) (ht : t ∈ Ioo a b) : g t = F.metric t := by |
| 101 | symm |
| 102 | apply (Classical.choose_spec (hex t)).2 (F.metric t) |
| 103 | intro i x v w |
| 104 | simpa only [hclamp_eq t (Ioo_subset_Icc_self ht)] using hinterior t ht i x v w |
| 105 | have hsmooth : RiemannianMetric.IsSmoothFamilyOn g (Icc a b) := |
| 106 | Poincare.Gluing.isSmoothFamilyOn_of_local_diffeomorphisms |
| 107 | (fun i => (Fchart i).metric) g (fun i => (Fchart i).smooth) q hq hcover hpres |
| 108 | obtain ⟨G, hG⟩ := RicciFlow.exists_of_covering_local_diffeomorphisms |
| 109 | Fchart g hsmooth a (g a).leviCivitaData q hq hcover hpres |
| 110 | refine ⟨G, ?_, ?_⟩ |
| 111 | · simpa only [hG] using heq |
| 112 | · simpa only [hG] using hpres |
| 113 | |
| 114 | end PoincareMT.M30 |