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.Blowup.Construction.PartialLimits.OpenTimeExtraction |
| 2 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.Assembly |
| 3 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.Complete |
| 4 | import PoincareLib.Geometry.RicciFlow.Compactness.GeometricLimit.Stages.SourceEmbedding.PointedExhaustion |
| 5 | import PoincareLib.Geometry.RicciFlow.Compactness.SourceMetric |
| 6 | import PoincareLib.Geometry.RicciFlow.Compactness.Ancient.Window |
| 7 | |
| 8 | /-! |
| 9 | # One complete reference convergence with its full open-time flow |
| 10 | |
| 11 | Controlled charts give one quotient flow, spatial exhaustion and sequence of |
| 12 | based embeddings. The frozen reference convergence retains this flow's total |
| 13 | metric and all mixed jets on the larger open time interval. |
| 14 | This is the assembly in Morgan--Tian Definition 5.12, Proposition 5.14 and |
| 15 | Theorem 5.15, pp. 90-92, and Theorem 11.8, pp. 272-279. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set Filter Metric Poincare.Gluing Poincare.Analysis.Calculus |
| 22 | open PoincareMT.ChartDistance |
| 23 | open scoped Topology NNReal Manifold ContDiff |
| 24 | |
| 25 | namespace PoincareMT.M30 |
| 26 | |
| 27 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.chartedSpace |
| 28 | FlowCarrier.isManifold |
| 29 | |
| 30 | set_option synthInstance.maxHeartbeats 100000 in |
| 31 | -- The quotient atlas and both retained source reindexings stay explicit. |
| 32 | set_option maxHeartbeats 800000 in |
| 33 | /-- One complete reference limit retains its actual open-time flow and all |
| 34 | mixed source-map jets, as in Morgan--Tian Definition 5.12, Proposition 5.14, |
| 35 | Theorem 5.15, pp. 90-92, and Theorem 11.8, pp. 272-279. -/ |
| 36 | theorem exists_complete_reference_convergence_on_open_time |
| 37 | {n : ℕ} {T' T : ℝ} (S : PointedFlowSequence n T' T) |
| 38 | (hT : T' < 0 ∧ 0 < T) |
| 39 | {W : Set ℝ} (hW : IsOpen W) (hWord : W.OrdConnected) |
| 40 | (hwindow : Ioo T' T ⊆ W) |
| 41 | {J : ℕ → Set ℝ} |
| 42 | (Fseq : ∀ k, RicciFlow n (S.carrier k).carrier (J k)) |
| 43 | (hmetric : ∀ k, (Fseq k).metric = (S.flow k).flow.metric) |
| 44 | (htime : ∀ a b : ℝ, Icc a b ⊆ W → |
| 45 | ∀ᶠ k in atTop, Icc a b ⊆ J k) |
| 46 | (U : ℕ → Set (EuclideanSpace ℝ (Fin n))) (hU : ∀ i, IsOpen (U i)) |
| 47 | [∀ i, Nonempty (Piece U i)] |
| 48 | (e : ∀ k i, Piece U i → (S.carrier k).carrier) |
| 49 | (L : ℕ → ℝ≥0) |
| 50 | (he : letI : ∀ k, MetricSpace (S.carrier k).carrier := |
| 51 | fun k => (S.carrier k).metricSpaceOf ((Fseq k).metric 0) |
| 52 | ∀ k i, LipschitzWith (L i) (e k i)) |
| 53 | (c : ℕ → ℝ) (hc : ∀ i, 0 < c i) |
| 54 | (hlower : letI : ∀ k, MetricSpace (S.carrier k).carrier := |
| 55 | fun k => (S.carrier k).metricSpaceOf ((Fseq k).metric 0) |
| 56 | ∀ k i x y, c i * dist x y ≤ dist (e k i x) (e k i y)) |
| 57 | (hopen : ∀ k i, Topology.IsOpenEmbedding (e k i)) |
| 58 | (hsmooth : letI : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 59 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 60 | ∀ k i, IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ (e k i)) |
| 61 | (hb : letI : ∀ k, MetricSpace (S.carrier k).carrier := |
| 62 | fun k => (S.carrier k).metricSpaceOf ((Fseq k).metric 0) |
| 63 | ∀ i j (x : Piece U i) (y : Piece U j), ∃ B : ℝ, |
| 64 | ∀ k, dist (e k i x) (e k j y) ≤ B) |
| 65 | {i₀ : ℕ} (q : Piece U i₀) |
| 66 | (hbase : ∀ k, e k i₀ q = (S.flow k).base) |
| 67 | (hcover : letI : ∀ k, MetricSpace (S.carrier k).carrier := |
| 68 | fun k => (S.carrier k).metricSpaceOf ((Fseq k).metric 0) |
| 69 | ∀ R : ℝ, 0 < R → ∃ s : Finset ℕ, ∃ K : ∀ i, Set (Piece U i), |
| 70 | (∀ i ∈ s, IsCompact (K i)) ∧ |
| 71 | ∀ᶠ k in atTop, ball (e k i₀ q) R ⊆ ⋃ i ∈ s, e k i '' K i) |
| 72 | (helliptic : ∀ i K, IsCompact K → K ⊆ U i → |
| 73 | ∃ a : ℝ, 0 < a ∧ ∀ᶠ k in atTop, ∀ x ∈ K, ∀ v, |
| 74 | a * ‖v‖ ^ 2 ≤ ((Fseq k).metric 0).pullbackCoefficients |
| 75 | (chartParametrization U hU (e k i)) x v v) |
| 76 | (hjets : ∀ i K, IsCompact K → K ⊆ W ×ˢ U i → ∀ m : ℕ, ∃ B : ℝ, |
| 77 | ∀ᶠ k in atTop, ∀ z ∈ K, |
| 78 | ‖iteratedFDeriv ℝ m (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 79 | ((Fseq k).metric z.1).pullbackCoefficients |
| 80 | (chartParametrization U hU (e k i)) z.2) z‖ ≤ B) |
| 81 | (hpositive : ∀ t ∈ W, ∀ i x, x ∈ U i → ∃ a : ℝ, 0 < a ∧ ∀ᶠ k in atTop, |
| 82 | ∀ v, a * ‖v‖ ^ 2 ≤ ((Fseq k).metric t).pullbackCoefficients |
| 83 | (chartParametrization U hU (e k i)) x v v) : |
| 84 | ∃ G : PointedGeometricConvergence S, |
| 85 | letI : TopologicalSpace G.limitCarrier.carrier := G.limitCarrier.topologicalSpace |
| 86 | letI : ChartedSpace (EuclideanSpace ℝ (Fin n)) G.limitCarrier.carrier := |
| 87 | G.limitCarrier.chartedSpace |
| 88 | letI : IsManifold (𝓡 n) ∞ G.limitCarrier.carrier := G.limitCarrier.isManifold |
| 89 | ∃ F : RicciFlow n G.limitCarrier.carrier W, |
| 90 | F.metric = G.limitFlow.flow.metric ∧ |
| 91 | G.limitCarrier.metricComplete (F.metric 0) ∧ |
| 92 | ∀ q' : G.limitCarrier.carrier, ∀ m : ℕ, |
| 93 | ∀ K : Set (ℝ × EuclideanSpace ℝ (Fin n)), IsCompact K → |
| 94 | K ⊆ W ×ˢ (extChartAt (𝓡 n) q').target → TendstoUniformlyOn |
| 95 | (fun k => iteratedFDeriv ℝ m |
| 96 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 97 | ((Fseq (G.subsequence k)).metric z.1).pullbackCoefficients |
| 98 | ((fun x => ((G.embedding k).toFun (0, x)).2) ∘ |
| 99 | (extChartAt (𝓡 n) q').symm) z.2)) |
| 100 | (iteratedFDeriv ℝ m |
| 101 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 102 | (F.metric z.1).pullbackCoefficients |
| 103 | (extChartAt (𝓡 n) q').symm z.2)) atTop K := by |
| 104 | classical |
| 105 | let : ∀ k, MetricSpace (S.carrier k).carrier := |
| 106 | fun k => (S.carrier k).metricSpaceOf ((Fseq k).metric 0) |
| 107 | let : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 108 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 109 | let : ∀ i, IsManifold (𝓡 n) ∞ (Piece U i) := |
| 110 | fun i => (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 111 | let : ∀ i, LocallyCompactSpace (Piece U i) := fun i => (hU i).locallyCompactSpace |
| 112 | have hconn : ∀ k (x : (S.carrier k).carrier) r, IsPreconnected (ball x r) := by |
| 113 | intro k x r |
| 114 | rw [FlowCarrier.metricBall_eq_metricBallOf] |
| 115 | exact ((Fseq k).metric 0).isPreconnected_ball x r |
| 116 | obtain ⟨ρ, hρ, B, hBsmooth, hBjets, D, hD, hbound, g, hcompat, |
| 117 | F, hF, hcoeff, _hquotientJets⟩ := |
| 118 | exists_quotientFlow_of_controlled_charts_on_open_time U hU e L he c hc hlower |
| 119 | hopen hconn hsmooth hb hW hWord (hwindow hT) Fseq htime helliptic hjets hpositive |
| 120 | let hp := fun i j x y => (hD i j).tendstoLocallyUniformlyOn.tendsto_at (mem_univ (x, y)) |
| 121 | let O := overlapSystem hp L (fun k => he (ρ k)) c hc (fun k => hlower (ρ k)) |
| 122 | (fun k => hopen (ρ k)) (fun k => hconn (ρ k)) |
| 123 | let hO := overlapSystem_smooth U hU hp L (fun k => he (ρ k)) c hc |
| 124 | (fun k => hlower (ρ k)) (fun k => hopen (ρ k)) (fun k => hconn (ρ k)) |
| 125 | (fun k => hsmooth (ρ k)) hbound |
| 126 | let hclosed := overlapSystem_closed hp L (fun k => he (ρ k)) c hc |
| 127 | (fun k => hlower (ρ k)) (fun k => hopen (ρ k)) (fun k => hconn (ρ k)) |
| 128 | let := quotientChartedSpace U hU O |
| 129 | let := quotient_isManifold U hU O hO |
| 130 | have hcover' : ∀ R : ℝ, 0 < R → ∃ s : Finset ℕ, ∃ K : ∀ i, Set (Piece U i), |
| 131 | (∀ i ∈ s, IsCompact (K i)) ∧ |
| 132 | ∀ᶠ k in atTop, ball (e (ρ k) i₀ q) R ⊆ ⋃ i ∈ s, e (ρ k) i '' K i := by |
| 133 | intro R hR |
| 134 | obtain ⟨s, K, hK, hcov⟩ := hcover R hR |
| 135 | exact ⟨s, K, hK, hρ.tendsto_atTop.eventually hcov⟩ |
| 136 | obtain ⟨hconnected, E, hE, hEc, hEp, hEK, hEstep, hEcover, σ, hσ, |
| 137 | f, hf, happrox, hreadout, hescape⟩ := |
| 138 | exists_pointed_source_exhaustion_with_boundary_escape U hU hD L |
| 139 | (fun k => he (ρ k)) c hc (fun k => hlower (ρ k)) (fun k => hopen (ρ k)) |
| 140 | (fun k => hconn (ρ k)) (fun k => hsmooth (ρ k)) hbound q hcover' |
| 141 | let : ConnectedSpace (Quotient O.setoid) := hconnected |
| 142 | have hEmono : Monotone E := monotone_nat_of_le_succ fun j => |
| 143 | subset_closure.trans (hEstep j) |
| 144 | have htime' : ∀ a b : ℝ, Icc a b ⊆ W → |
| 145 | ∀ᶠ k in atTop, Icc a b ⊆ J (ρ (σ k)) := |
| 146 | fun a b hab => (hρ.comp hσ).tendsto_atTop.eventually (htime a b hab) |
| 147 | have hsourceJets : ∀ i m K, IsCompact K → K ⊆ W ×ˢ U i → TendstoUniformlyOn |
| 148 | (fun k => iteratedFDeriv ℝ m |
| 149 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 150 | ((Fseq (ρ (σ k))).metric z.1).pullbackCoefficients |
| 151 | (chartParametrization U hU (f k ∘ O.include i)) z.2)) |
| 152 | (iteratedFDeriv ℝ m (B i)) atTop K := by |
| 153 | apply source_exhaustion_spacetime_pullbackCoefficients_tendsto_jets U hU O hO |
| 154 | hE hEmono hEcover f (fun k => (hf k).2.1) |
| 155 | L (fun k => he (ρ (σ k))) c hc (fun k => hlower (ρ (σ k))) |
| 156 | (fun k => hopen (ρ (σ k))) (fun k => hconn (ρ (σ k))) |
| 157 | (fun k => hsmooth (ρ (σ k))) happrox hreadout |
| 158 | W hW (fun k => (Fseq (ρ (σ k))).metric) B hBsmooth ?_ |
| 159 | (fun i m K hK hKU V hV => |
| 160 | hσ.tendsto_atTop.eventually (hBjets i m K hK hKU V hV)) |
| 161 | intro i z hz |
| 162 | obtain ⟨a, b, _, habnhds, habW⟩ := |
| 163 | exists_Icc_mem_subset_of_mem_nhds (hW.mem_nhds hz.1) |
| 164 | have hab : z.1 ∈ Ioo a b := Icc_mem_nhds_iff.mp habnhds |
| 165 | refine ⟨Ioo a b ×ˢ U i, isOpen_Ioo.prod (hU i), ⟨hab, hz.2⟩, ?_⟩ |
| 166 | filter_upwards [htime' a b habW] with k hk |
| 167 | exact contDiffOn_source_chart_spacetime_pullbackCoefficients U hU |
| 168 | (hsmooth (ρ (σ k)) i).contMDiff |
| 169 | ((Fseq (ρ (σ k))).smooth.mono |
| 170 | (prod_mono (Ioo_subset_Icc_self.trans hk) (Subset.refl _))) isOpen_Ioo |
| 171 | let C := O.flowCarrier U hU hO hclosed |
| 172 | let Fref : BasedFlow n T' T C := |
| 173 | C.basedWindow F (O.include i₀ q) hwindow (hT.1.trans hT.2) |
| 174 | have hreferenceJets : ∀ i m K, IsCompact K → K ⊆ Ioo T' T ×ˢ U i → |
| 175 | TendstoUniformlyOn |
| 176 | (fun k => iteratedFDeriv ℝ m |
| 177 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 178 | ((S.flow (ρ (σ k))).flow.metric z.1).pullbackCoefficients |
| 179 | (chartParametrization U hU (f k ∘ O.include i)) z.2)) |
| 180 | (iteratedFDeriv ℝ m (B i)) atTop K := by |
| 181 | intro i m K hK hKU |
| 182 | simpa only [hmetric] using hsourceJets i m K hK |
| 183 | (hKU.trans (prod_mono hwindow (Subset.refl _))) |
| 184 | let G0 := pointedGeometricConvergence_of_quotient_limit U hU O hO hclosed |
| 185 | (fun k => S.flow (ρ (σ k))) Fref g hcompat hF hE hEc hEK hEmono hEcover |
| 186 | f (fun k => (hf k).1) (fun k => (hf k).2.1) hEp |
| 187 | (fun k => (hf k).2.2.trans (hbase (ρ (σ k)))) B |
| 188 | (fun i => (hBsmooth i).continuousOn.mono (prod_mono hwindow (Subset.refl _))) |
| 189 | (fun t ht => hcoeff t (hwindow ht)) hreferenceJets |
| 190 | have hcomplete : C.metricComplete (F.metric 0) := by |
| 191 | apply G0.metricComplete_zero_of_boundary_escape hT |
| 192 | intro A hA |
| 193 | obtain ⟨j, hj⟩ := hescape A hA |
| 194 | refine ⟨j, hj.mono fun k hk x hx => ?_⟩ |
| 195 | have h := hk x hx |
| 196 | rw [hbase (ρ (σ k))] at h |
| 197 | change ENNReal.ofReal A ≤ |
| 198 | ((S.carrier (ρ (σ k))).metricEMetricSpace ((Fseq (ρ (σ k))).metric 0)).edist |
| 199 | (S.flow (ρ (σ k))).base (f k x) at h |
| 200 | rw [congrArg (fun metric => metric 0) (hmetric (ρ (σ k)))] at h |
| 201 | exact h |
| 202 | let G : PointedGeometricConvergence S := G0.reindex (hρ.comp hσ) |
| 203 | refine ⟨G, F, rfl, hcomplete, ?_⟩ |
| 204 | intro q' m K hK hKchart |
| 205 | obtain ⟨i, _, htarget, hinverse⟩ := exists_chosen_quotient_chart U hU O q' |
| 206 | have hKU : K ⊆ W ×ˢ U i := by |
| 207 | simpa only [htarget] using hKchart |
| 208 | have hlimit : EqOn |
| 209 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 210 | (F.metric z.1).pullbackCoefficients (extChartAt (𝓡 n) q').symm z.2) |
| 211 | (B i) (W ×ˢ U i) := by |
| 212 | rw [hF, hinverse] |
| 213 | exact quotientMetric_family_pullbackCoefficients_eqOn U hU O hO |
| 214 | (fun i t => g t i) hcompat B hcoeff i |
| 215 | have hsource (k : ℕ) := chosenChart_spacetime_pullbackCoefficients_iteratedFDeriv_eq |
| 216 | U hU O q' i hinverse (Fseq (ρ (σ k))).metric (fun _ => f k) m |
| 217 | apply ((hsourceJets i m K hK hKU).congr ?_).congr_right ?_ |
| 218 | · exact Eventually.of_forall fun k p _ => congrFun (hsource k).symm p |
| 219 | · intro p hp |
| 220 | exact ((eqOn_iteratedFDeriv_of_isOpen (hW.prod (hU i)) hlimit m) (hKU hp)).symm |
| 221 | |
| 222 | end PoincareMT.M30 |