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.LongTime.FiniteSlab.FiniteLeftSourceFlows |
| 2 | import PoincareLib.Geometry.RicciFlow.Blowup.Construction.LongTime.FiniteSlab.FiniteLeftStageLimit |
| 3 | import PoincareLib.Geometry.RicciFlow.Blowup.Construction.LongTime.ClosedLeftDescent |
| 4 | import PoincareLib.Geometry.RicciFlow.Harnack.Regularity |
| 5 | |
| 6 | /-! |
| 7 | # Local finite-left extensions from radius-dependent source cylinders |
| 8 | |
| 9 | Each precompact stage receives an actual Ricci flow through the left |
| 10 | endpoint, agreeing with the retained flow on the old interval. The local |
| 11 | time buffer may depend on the stage. Morgan--Tian Claim 11.17, p. 278. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M30 |
| 24 | |
| 25 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.chartedSpace |
| 26 | FlowCarrier.isManifold FlowCarrier.t2Space FlowCarrier.t3Space FlowCarrier.secondCountable |
| 27 | |
| 28 | private theorem finiteLeftStage_openCodomain |
| 29 | {X Z : Type*} [TopologicalSpace X] [TopologicalSpace Z] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) X] |
| 31 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) Z] |
| 32 | (U : TopologicalSpace.Opens Z) (e : X → U) |
| 33 | (he : IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ ((Subtype.val : U → Z) ∘ e)) : |
| 34 | IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ e := by |
| 35 | have hU := Poincare.isLocalDiffeomorph_opensSubtypeVal (𝓡 3) U |
| 36 | intro x |
| 37 | have hix := hU (e x) |
| 38 | apply ((he x).comp (𝓡 3) U hix.localInverse_isLocalDiffeomorphAt).congr_of_eventuallyEq |
| 39 | filter_upwards [(he x).contMDiffAt.continuousAt.preimage_mem_nhds |
| 40 | (hix.localInverse.open_source.mem_nhds hix.localInverse_mem_source)] with y hy |
| 41 | exact Subtype.ext (hix.localInverse_right_inv hy).symm |
| 42 | |
| 43 | set_option synthInstance.maxHeartbeats 200000 in |
| 44 | -- The retained source, open-stage and selected-chart atlases require extra reduction. |
| 45 | set_option maxHeartbeats 1800000 in |
| 46 | -- The source family and its dependent restriction identities are assembled together. |
| 47 | /-- Radius-dependent source cylinders give an actual extension on each |
| 48 | buffered precompact open stage of the old limit. -/ |
| 49 | theorem exists_nonnegative_left_extension_on_stage |
| 50 | (hShi : LocalCurvatureDerivativeEstimates.{u}) |
| 51 | {S : GeneralizedBlowupSequence.{u}} {T : ℝ} (hT : 0 < T) |
| 52 | (G : GeneralizedBlowupConvergence S (Ioc (-T) 0)) |
| 53 | (hbranch : ∀ k, generalizedPinchedOrNonnegative (S.flow k)) |
| 54 | (hcompact : ∀ A : ℝ, 0 < A → ∀ᶠ k : ℕ in atTop, |
| 55 | IsCompact (closure (S.baseBall (G.subsequence k) A))) |
| 56 | (hcyl : ∀ A : ℝ, 0 < A → |
| 57 | ∃ delta : ℝ, 0 < delta ∧ ∃ B : ℝ, 0 ≤ B ∧ |
| 58 | ∀ᶠ k : ℕ in atTop, |
| 59 | Nonempty (ControlledBlowupCylinder S (G.subsequence k) |
| 60 | A (T + delta) B 1)) |
| 61 | (Y Yplus : TopologicalSpace.Opens G.limit.carrier.carrier) |
| 62 | (hY : IsCompact (closure (Y : Set G.limit.carrier.carrier))) |
| 63 | (hYne : (Y : Set G.limit.carrier.carrier).Nonempty) |
| 64 | (hYplus : IsCompact (closure (Yplus : Set G.limit.carrier.carrier))) |
| 65 | (hbuffer : closure (Y : Set G.limit.carrier.carrier) ⊆ Yplus) : |
| 66 | ∃ delta : ℝ, 0 < delta ∧ ∃ F : RicciFlow 3 Y (Icc (-(T + delta)) 0), |
| 67 | (∀ t ∈ Ioc (-T) 0, ∀ (x : Y) (v w : TangentSpace (𝓡 3) x), |
| 68 | (F.metric t).inner x v w = (G.limit.flow.metric t).inner x.val |
| 69 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : Y → G.limit.carrier.carrier) x v) |
| 70 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : Y → G.limit.carrier.carrier) x w)) ∧ |
| 71 | ∀ t ∈ Icc (-(T + delta)) 0, ∀ x : Y, |
| 72 | (F.connection t).NonnegativeCurvatureOperator x := by |
| 73 | classical |
| 74 | obtain ⟨W, delta, B, _, hdelta, _, N, E, f, P, |
| 75 | _hf, hstage, _hzero, _hball, _hpull, _hnative, hmatch, hcurv, hdefect⟩ := |
| 76 | exists_extended_source_flows_on_generalized_stage hShi hT G hbranch hcompact hcyl |
| 77 | Yplus hYplus |
| 78 | let tau := T + delta / 2 |
| 79 | have hTtau : T < tau := by dsimp [tau]; linarith |
| 80 | have htau : 0 < tau := hT.trans hTtau |
| 81 | have hJsub : Icc (-tau) 0 ⊆ Icc (-(T + delta)) 0 := by |
| 82 | intro t ht |
| 83 | exact ⟨by dsimp [tau] at ht; linarith [ht.1], ht.2⟩ |
| 84 | have hJne : (Icc (-tau) (0 : ℝ)).Nontrivial := |
| 85 | ⟨-tau, ⟨le_rfl, by linarith⟩, 0, ⟨by linarith, le_rfl⟩, by linarith⟩ |
| 86 | let P0 (k : ℕ) : RicciFlow 3 Yplus (Icc (-tau) 0) := |
| 87 | Poincare.Geometry.RicciFlow.Harnack.restrictFlow (P k) hJsub ordConnected_Icc hJne |
| 88 | have hstage0 (k : ℕ) : (Yplus : Set G.limit.carrier.carrier) ⊆ |
| 89 | G.exhaustion.space (k + N) := subset_closure.trans (hstage k) |
| 90 | have hmatch0 : ∀ k s (_hs : s ∈ Icc (-tau) 0) |
| 91 | (hsG : s ∈ Icc (-G.exhaustion.time (k + N)) 0) |
| 92 | (x : Yplus) (v w : TangentSpace (𝓡 3) x), |
| 93 | ((P0 k).metric s).inner x v w = |
| 94 | (G.embedding (k + N)).pullbackInner s hsG x.val |
| 95 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : Yplus → G.limit.carrier.carrier) x v) |
| 96 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : Yplus → G.limit.carrier.carrier) x w) := |
| 97 | fun k s hs hsG x v w => hmatch k s (hJsub hs) hsG x v w |
| 98 | have hdefect0 (eta : ℝ) (heta : 0 < eta) : ∀ᶠ k : ℕ in atTop, |
| 99 | ∀ t ∈ Icc (-tau) 0, ∀ x : Yplus, |
| 100 | ((P0 k).connection t).negativeCurvaturePart x ≤ eta := |
| 101 | (hdefect eta heta).mono fun k hk t ht x => hk t (hJsub ht) x |
| 102 | obtain ⟨L⟩ := exists_finiteLeftStageLimit hT hTtau G Yplus N P0 |
| 103 | hstage0 hmatch0 hcurv hdefect0 (closure (Y : Set G.limit.carrier.carrier)) |
| 104 | hY (hYne.mono subset_closure) hbuffer |
| 105 | let inc : Y → L.domain := fun x => ⟨x.val, L.contains (subset_closure x.property)⟩ |
| 106 | have hinc : IsLocalDiffeomorph (𝓡 3) (𝓡 3) ∞ inc := |
| 107 | finiteLeftStage_openCodomain L.domain inc |
| 108 | (Poincare.isLocalDiffeomorph_opensSubtypeVal (𝓡 3) Y) |
| 109 | have hLinc := Poincare.isLocalDiffeomorph_opensSubtypeVal (𝓡 3) L.domain |
| 110 | let F : RicciFlow 3 Y (Icc (-tau) 0) := L.flow.pullbackWithConnection inc hinc |
| 111 | (fun t => ((L.flow.metric t).pullbackOfLocalDiffeomorph inc hinc).leviCivitaData) |
| 112 | refine ⟨delta / 2, half_pos hdelta, F, ?_, ?_⟩ |
| 113 | · intro t ht x v w |
| 114 | change (L.flow.metric t).inner (inc x) |
| 115 | (mfderiv (𝓡 3) (𝓡 3) inc x v) (mfderiv (𝓡 3) (𝓡 3) inc x w) = _ |
| 116 | rw [L.interior_metric t ht] |
| 117 | have hd := mfderiv_comp x ((hLinc (inc x)).mdifferentiableAt (by simp)) |
| 118 | ((hinc x).mdifferentiableAt (by simp)) |
| 119 | change mfderiv (𝓡 3) (𝓡 3) (Subtype.val : Y → G.limit.carrier.carrier) x = |
| 120 | (mfderiv (𝓡 3) (𝓡 3) |
| 121 | (Subtype.val : L.domain → G.limit.carrier.carrier) (inc x)).comp |
| 122 | (mfderiv (𝓡 3) (𝓡 3) inc x) at hd |
| 123 | exact congrArg₂ (fun a b => (G.limit.flow.metric t).inner x.val a b) |
| 124 | (congrArg (fun A => A v) hd).symm (congrArg (fun A => A w) hd).symm |
| 125 | · intro t ht x |
| 126 | exact ((F.connection t).nonnegativeCurvatureOperator_iff_of_local_isometry |
| 127 | (L.flow.connection t) isOpen_univ hinc.contMDiff.contMDiffOn |
| 128 | (fun _ _ _ _ => rfl) (mem_univ x)).mpr (L.nonnegative t ht (inc x)) |
| 129 | |
| 130 | /-- Terminal metric balls satisfy the compact-buffer hypotheses of the |
| 131 | local extension theorem by completeness of the old finite limit. -/ |
| 132 | theorem exists_nonnegative_left_extension_on_terminal_ball |
| 133 | (hShi : LocalCurvatureDerivativeEstimates.{u}) |
| 134 | {S : GeneralizedBlowupSequence.{u}} {T : ℝ} (hT : 0 < T) |
| 135 | (G : GeneralizedBlowupConvergence S (Ioc (-T) 0)) |
| 136 | (hbranch : ∀ k, generalizedPinchedOrNonnegative (S.flow k)) |
| 137 | (hcompact : ∀ A : ℝ, 0 < A → ∀ᶠ k : ℕ in atTop, |
| 138 | IsCompact (closure (S.baseBall (G.subsequence k) A))) |
| 139 | (hcyl : ∀ A : ℝ, 0 < A → |
| 140 | ∃ delta : ℝ, 0 < delta ∧ ∃ B : ℝ, 0 ≤ B ∧ |
| 141 | ∀ᶠ k : ℕ in atTop, |
| 142 | Nonempty (ControlledBlowupCylinder S (G.subsequence k) |
| 143 | A (T + delta) B 1)) |
| 144 | (A : ℝ) (hA : 0 < A) |
| 145 | (Y : TopologicalSpace.Opens G.limit.carrier.carrier) |
| 146 | (hY : (Y : Set G.limit.carrier.carrier) = |
| 147 | (G.limit.flow.metric 0).ball G.limit.base A) : |
| 148 | ∃ delta : ℝ, 0 < delta ∧ ∃ F : RicciFlow 3 Y (Icc (-(T + delta)) 0), |
| 149 | (∀ t ∈ Ioc (-T) 0, ∀ (x : Y) (v w : TangentSpace (𝓡 3) x), |
| 150 | (F.metric t).inner x v w = (G.limit.flow.metric t).inner x.val |
| 151 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : Y → G.limit.carrier.carrier) x v) |
| 152 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : Y → G.limit.carrier.carrier) x w)) ∧ |
| 153 | ∀ t ∈ Icc (-(T + delta)) 0, ∀ x : Y, |
| 154 | (F.connection t).NonnegativeCurvatureOperator x := by |
| 155 | let g := G.limit.flow.metric 0 |
| 156 | let : MetricSpace G.limit.carrier.carrier := G.limit.carrier.metricSpaceOf g |
| 157 | have hball (r : ℝ) : Metric.ball G.limit.base r = g.ball G.limit.base r := by |
| 158 | simpa only [FlowCarrier.metricBall] using |
| 159 | G.limit.carrier.metricBall_eq_metricBallOf g G.limit.base r |
| 160 | have hcompactBall (r : ℝ) : IsCompact (closure (g.ball G.limit.base r)) := by |
| 161 | apply IsCompact.of_isClosed_subset |
| 162 | (g.isCompact_closedBall_of_metricComplete |
| 163 | (G.limit.complete 0 G.limit.zero_mem) G.limit.base r) isClosed_closure |
| 164 | apply closure_minimal |
| 165 | (fun x (hx : g.edist G.limit.base x < ENNReal.ofReal r) => hx.le) |
| 166 | exact isClosed_le (continuous_const.edist continuous_id) continuous_const |
| 167 | let Yplus : TopologicalSpace.Opens G.limit.carrier.carrier := |
| 168 | ⟨g.ball G.limit.base (A + 1), by rw [← hball]; exact Metric.isOpen_ball⟩ |
| 169 | have hYcompact : IsCompact (closure (Y : Set G.limit.carrier.carrier)) := by |
| 170 | rw [hY] |
| 171 | exact hcompactBall A |
| 172 | have hYne : (Y : Set G.limit.carrier.carrier).Nonempty := by |
| 173 | rw [hY, ← hball] |
| 174 | exact ⟨G.limit.base, Metric.mem_ball_self hA⟩ |
| 175 | have hbuffer : closure (Y : Set G.limit.carrier.carrier) ⊆ Yplus := by |
| 176 | change closure (Y : Set G.limit.carrier.carrier) ⊆ g.ball G.limit.base (A + 1) |
| 177 | rw [hY, ← hball, ← hball] |
| 178 | exact Metric.closure_ball_subset_closedBall.trans (Metric.closedBall_subset_ball (by linarith)) |
| 179 | exact exists_nonnegative_left_extension_on_stage hShi hT G hbranch hcompact hcyl |
| 180 | Y Yplus hYcompact hYne (hcompactBall (A + 1)) hbuffer |
| 181 | |
| 182 | /-- Radius-dependent source control adds a complete, nonnegative left |
| 183 | endpoint to the old limit, while retaining local backward extensions. |
| 184 | No global curvature bound at that endpoint is an input. -/ |
| 185 | theorem exists_complete_closed_left_extension_of_radius_dependent_cylinders |
| 186 | (hShi : LocalCurvatureDerivativeEstimates.{u}) |
| 187 | {S : GeneralizedBlowupSequence.{u}} {T : ℝ} (hT : 0 < T) |
| 188 | (G : GeneralizedBlowupConvergence S (Ioc (-T) 0)) |
| 189 | (hbranch : ∀ k, generalizedPinchedOrNonnegative (S.flow k)) |
| 190 | (hcompact : ∀ A : ℝ, 0 < A → ∀ᶠ k : ℕ in atTop, |
| 191 | IsCompact (closure (S.baseBall (G.subsequence k) A))) |
| 192 | (hcyl : ∀ A : ℝ, 0 < A → |
| 193 | ∃ delta : ℝ, 0 < delta ∧ ∃ B : ℝ, 0 ≤ B ∧ |
| 194 | ∀ᶠ k : ℕ in atTop, |
| 195 | Nonempty (ControlledBlowupCylinder S (G.subsequence k) |
| 196 | A (T + delta) B 1)) : |
| 197 | ∃ Fbar : RicciFlow 3 G.limit.carrier.carrier (Icc (-T) 0), |
| 198 | (∀ t ∈ Ioc (-T) 0, Fbar.metric t = G.limit.flow.metric t) ∧ |
| 199 | (∀ t ∈ Icc (-T) 0, G.limit.carrier.metricComplete (Fbar.metric t)) ∧ |
| 200 | (∀ t ∈ Icc (-T) 0, ∀ x : G.limit.carrier.carrier, |
| 201 | (Fbar.connection t).NonnegativeCurvatureOperator x) ∧ |
| 202 | (∀ (x : G.limit.carrier.carrier) (v : TangentSpace (𝓡 3) x), |
| 203 | (G.limit.flow.metric 0).inner x v v ≤ (Fbar.metric (-T)).inner x v v) ∧ |
| 204 | ∀ A : ℝ, 0 < A → |
| 205 | ∀ U : TopologicalSpace.Opens G.limit.carrier.carrier, |
| 206 | (U : Set G.limit.carrier.carrier) = |
| 207 | (G.limit.flow.metric 0).ball G.limit.base A → |
| 208 | ∃ delta : ℝ, 0 < delta ∧ |
| 209 | ∃ P : RicciFlow 3 U (Icc (-(T + delta)) 0), |
| 210 | (∀ t ∈ Icc (-T) 0, ∀ (x : U) (v w : TangentSpace (𝓡 3) x), |
| 211 | (P.metric t).inner x v w = (Fbar.metric t).inner x.val |
| 212 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : U → G.limit.carrier.carrier) x v) |
| 213 | (mfderiv (𝓡 3) (𝓡 3) (Subtype.val : U → G.limit.carrier.carrier) x w)) ∧ |
| 214 | ∀ t ∈ Icc (-(T + delta)) 0, ∀ x : U, |
| 215 | (P.connection t).NonnegativeCurvatureOperator x := by |
| 216 | exact exists_closed_left_flow_of_local_extensions hT G |
| 217 | (fun A hA U hU => exists_nonnegative_left_extension_on_terminal_ball |
| 218 | hShi hT G hbranch hcompact hcyl A hA U hU) |
| 219 | |
| 220 | end PoincareMT.M30 |