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.Compactness.GeometricLimit.Overlap.CoordinateFamily |
| 2 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.Overlap.MetricFamily |
| 3 | |
| 4 | /-! |
| 5 | # Smooth metric families from spacetime coefficient limits |
| 6 | |
| 7 | Positive limits of the original chart coefficients construct compatible chart |
| 8 | metrics at every time in the time domain. Joint coefficient smoothness supplies |
| 9 | joint smoothness of these actual metric families and of their descended quotient |
| 10 | family. A fixed time in the domain provides compatible total representatives |
| 11 | outside the domain. No evolution equation is asserted. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter Metric Poincare.Gluing Poincare.Analysis.Calculus |
| 18 | open scoped Topology NNReal Manifold ContDiff |
| 19 | |
| 20 | namespace PoincareMT.ChartDistance |
| 21 | |
| 22 | variable {ι : Type*} {n : ℕ} |
| 23 | (U : ι → Set (EuclideanSpace ℝ (Fin n))) (hU : ∀ i, IsOpen (U i)) |
| 24 | [∀ i, Nonempty (Piece U i)] |
| 25 | {M : ℕ → Type*} [∀ k, MetricSpace (M k)] |
| 26 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin n)) (M k)] |
| 27 | [∀ k, IsManifold (𝓡 n) ∞ (M k)] |
| 28 | {e : ∀ k i, Piece U i → M k} |
| 29 | {D : ∀ i j, C(Piece U i × Piece U j, ℝ)} |
| 30 | (hD : ∀ i j x y, Tendsto (fun k => dist (e k i x) (e k j y)) atTop |
| 31 | (𝓝 (D i j (x, y)))) |
| 32 | (L : ι → ℝ≥0) (he : ∀ k i, LipschitzWith (L i) (e k i)) |
| 33 | (c : ι → ℝ) (hc : ∀ i, 0 < c i) |
| 34 | (hlower : ∀ k i x y, c i * dist x y ≤ dist (e k i x) (e k i y)) |
| 35 | (hopen : ∀ k i, Topology.IsOpenEmbedding (e k i)) |
| 36 | (hconn : ∀ k (p : M k) r, IsPreconnected (ball p r)) |
| 37 | (hsmooth : letI : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 38 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 39 | ∀ k i, IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ (e k i)) |
| 40 | |
| 41 | include hD he hc hlower hopen hconn hsmooth in |
| 42 | /-- Positive original coefficient limits with joint smoothness construct a |
| 43 | total compatible chart metric family and its jointly smooth quotient family. |
| 44 | Only times in the given nonempty domain are constrained by the coefficients. -/ |
| 45 | theorem exists_compatibleMetricFamilies_of_spacetime_limits |
| 46 | {J : Set ℝ} (t₀ : ℝ) (ht₀ : t₀ ∈ J) |
| 47 | (g : ∀ k, ℝ → RiemannianMetric n (M k)) |
| 48 | (B : ι → ℝ × EuclideanSpace ℝ (Fin n) → |
| 49 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 50 | (hB : ∀ t ∈ J, ∀ i, TendstoLocallyUniformlyOn |
| 51 | (fun k => (g k t).pullbackCoefficients (chartParametrization U hU (e k i))) |
| 52 | (fun x => B i (t, x)) atTop (U i)) |
| 53 | (hBsmooth : ∀ i, ContDiffOn ℝ ∞ (B i) (J ×ˢ U i)) |
| 54 | (hBlower : ∀ t ∈ J, ∀ i x, x ∈ U i → ∃ a : ℝ, 0 < a ∧ ∀ᶠ k in atTop, |
| 55 | ∀ v, a * ‖v‖ ^ 2 ≤ |
| 56 | (g k t).pullbackCoefficients (chartParametrization U hU (e k i)) x v v) |
| 57 | (hbound : ∀ i j, LocallyEventuallyBoundedDerivatives |
| 58 | (Subtype.val '' overlap (fun i j => D i j) i j) |
| 59 | (fun k => coordinateRepresentative U hU |
| 60 | (fun x => Function.invFun (e k j) (e k i x)))) : |
| 61 | letI : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 62 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 63 | letI : ∀ i, IsManifold (𝓡 n) ∞ (Piece U i) := |
| 64 | fun i => (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 65 | letI : ∀ i, LocallyCompactSpace (Piece U i) := fun i => (hU i).locallyCompactSpace |
| 66 | let O := overlapSystem hD L he c hc hlower hopen hconn |
| 67 | let hO := overlapSystem_smooth U hU hD L he c hc hlower hopen hconn hsmooth hbound |
| 68 | letI := quotientChartedSpace U hU O |
| 69 | letI := quotient_isManifold U hU O hO |
| 70 | ∃ (gLimit : ℝ → ∀ i, CanonicalMetric U hU i) |
| 71 | (hcompat : ∀ t, CompatibleMetrics U hU O (gLimit t)), |
| 72 | (∀ t ∈ J, ∀ i (x : Piece U i) v w, (gLimit t i).inner x v w = B i (t, x) v w) ∧ |
| 73 | (∀ i, RiemannianMetric.IsSmoothFamilyOn (fun t => gLimit t i) J) ∧ |
| 74 | RiemannianMetric.IsSmoothFamilyOn |
| 75 | (fun t => quotientMetric U hU O hO (gLimit t) (hcompat t)) J := by |
| 76 | classical |
| 77 | let : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 78 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 79 | let : ∀ i, IsManifold (𝓡 n) ∞ (Piece U i) := |
| 80 | fun i => (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 81 | let : ∀ i, LocallyCompactSpace (Piece U i) := fun i => (hU i).locallyCompactSpace |
| 82 | let O := overlapSystem hD L he c hc hlower hopen hconn |
| 83 | let hO := overlapSystem_smooth U hU hD L he c hc hlower hopen hconn hsmooth hbound |
| 84 | let := quotientChartedSpace U hU O |
| 85 | let := quotient_isManifold U hU O hO |
| 86 | have hex : ∀ t : J, ∃ gSlice : ∀ i, CanonicalMetric U hU i, |
| 87 | (∀ i (x : Piece U i) v w, (gSlice i).inner x v w = B i (t, x) v w) ∧ |
| 88 | CompatibleMetrics U hU O gSlice := by |
| 89 | intro t |
| 90 | apply exists_compatibleMetrics_of_coordinate_limits U hU hD L he c hc hlower hopen hconn |
| 91 | hsmooth (fun k => g k t) (fun i x => B i (t, x)) (hB t t.property) ?_ |
| 92 | (hBlower t t.property) hbound |
| 93 | intro i |
| 94 | have hmap : ContDiff ℝ ∞ |
| 95 | (fun x : EuclideanSpace ℝ (Fin n) => ((t : ℝ), x)) := |
| 96 | contDiff_const.prodMk contDiff_id |
| 97 | have hmaps : MapsTo (fun x : EuclideanSpace ℝ (Fin n) => ((t : ℝ), x)) |
| 98 | (U i) (J ×ˢ U i) := fun _ hx => ⟨t.property, hx⟩ |
| 99 | exact (hBsmooth i).comp hmap.contDiffOn hmaps |
| 100 | choose gSlice hcoeffSlice hcompatSlice using hex |
| 101 | let gLimit : ℝ → ∀ i, CanonicalMetric U hU i := fun t => |
| 102 | if ht : t ∈ J then gSlice ⟨t, ht⟩ else gSlice ⟨t₀, ht₀⟩ |
| 103 | have hcoeff : ∀ t ∈ J, ∀ i (x : Piece U i) v w, |
| 104 | (gLimit t i).inner x v w = B i (t, x) v w := by |
| 105 | intro t ht i x v w |
| 106 | simpa only [gLimit, dif_pos ht] using hcoeffSlice ⟨t, ht⟩ i x v w |
| 107 | have hcompat : ∀ t, CompatibleMetrics U hU O (gLimit t) := by |
| 108 | intro t |
| 109 | by_cases ht : t ∈ J |
| 110 | · simpa only [gLimit, dif_pos ht] using hcompatSlice ⟨t, ht⟩ |
| 111 | · simpa only [gLimit, dif_neg ht] using hcompatSlice ⟨t₀, ht₀⟩ |
| 112 | have hfamily : ∀ i, RiemannianMetric.IsSmoothFamilyOn (fun t => gLimit t i) J := by |
| 113 | intro i |
| 114 | exact canonicalMetric_isSmoothFamilyOn_of_coefficients U hU i |
| 115 | (fun t => gLimit t i) (B i) (hBsmooth i) (fun t ht => hcoeff t ht i) |
| 116 | refine ⟨gLimit, hcompat, hcoeff, hfamily, ?_⟩ |
| 117 | exact quotientMetric_isSmoothFamilyOn U hU O hO (fun i t => gLimit t i) hfamily hcompat |
| 118 | |
| 119 | end PoincareMT.ChartDistance |