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.CanonicalGeometry.CanonicalSliceShape |
| 2 | import PoincareLib.Geometry.RicciFlow.Blowup.Construction.LongTime.GeneralizedLimit.GeneralizedScalarConvergence |
| 3 | import PoincareLib.Geometry.RicciFlow.Blowup.Construction.Generalized.Restriction |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Analysis.Coordinates.FiniteBufferedChartCover |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.PartialLimits.Coordinates.WithinMetricCoefficients |
| 6 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.PartialLimits.Geometry.Parabolic.SpatialContinuity |
| 7 | import PoincareLib.Geometry.RicciFlow.Compactness.SourceMetric |
| 8 | import PoincareLib.Geometry.RicciFlow.Curvature.Evolution.Scalar.Within |
| 9 | import PoincareLib.Geometry.RicciFlow.Compactness.Convergence.Volume.Coverage |
| 10 | |
| 11 | /-! |
| 12 | # Canonical shape at each retained generalized-limit time |
| 13 | |
| 14 | Morgan--Tian Claims 11.14-11.15, pp. 275-276, and Proposition 9.79, |
| 15 | pp. 232-234. The original cylinder maps at whole good slices approaching |
| 16 | an included time retain their compact metric jets and scalar values. |
| 17 | Their inverse differential bounds give source-ball capture, so the |
| 18 | actual neck or cap-side geometry transfers without another extraction. |
| 19 | -/ |
| 20 | |
| 21 | set_option autoImplicit false |
| 22 | set_option backward.isDefEq.respectTransparency false |
| 23 | |
| 24 | open Set Filter Metric |
| 25 | open scoped Manifold ContDiff Topology |
| 26 | |
| 27 | universe u v w |
| 28 | |
| 29 | namespace PoincareMT.M30 |
| 30 | |
| 31 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.chartedSpace |
| 32 | FlowCarrier.isManifold FlowCarrier.t2Space FlowCarrier.t3Space |
| 33 | FlowCarrier.measurableSpace FlowCarrier.borelSpace FlowCarrier.secondCountable |
| 34 | |
| 35 | private theorem shape_uniform_at_moving_time |
| 36 | {Y : Type v} [TopologicalSpace Y] {Z : Type w} [UniformSpace Z] |
| 37 | {I : Set ℝ} {K : Set Y} (hK : IsCompact K) |
| 38 | {A : ℕ → ℝ × Y → Z} {B : ℝ × Y → Z} |
| 39 | (hA : TendstoUniformlyOn A B atTop (I ×ˢ K)) |
| 40 | (hB : ContinuousOn B (I ×ˢ K)) {t : ℝ} (ht : t ∈ I) |
| 41 | {s : ℕ → ℝ} (hs : Tendsto s atTop (𝓝[I] t)) : |
| 42 | TendstoUniformlyOn (fun k y => A k (s k, y)) (fun y => B (t, y)) atTop K := by |
| 43 | intro U hU |
| 44 | obtain ⟨V, hV, hsymm, hcomp⟩ := comp_symm_of_uniformity hU |
| 45 | obtain ⟨O, hO, hclose⟩ := hK.mem_uniformity_of_prod |
| 46 | (f := fun a y => B (a, y)) hB ht hV |
| 47 | filter_upwards [hA V hV, hs.eventually hO, |
| 48 | hs.eventually self_mem_nhdsWithin] with k hk hks hki |
| 49 | intro y hy |
| 50 | exact hcomp (SetRel.prodMk_mem_comp (hsymm (hclose (s k) hks y hy)) |
| 51 | (hk (s k, y) ⟨hki, hy⟩)) |
| 52 | |
| 53 | set_option maxHeartbeats 1200000 in |
| 54 | -- Moving-time jets, the finite atlas and the actual varying source slices are assembled together. |
| 55 | set_option synthInstance.maxHeartbeats 100000 in |
| 56 | -- Preserve the stored limit atlas and each generalized slice's native manifold instances. |
| 57 | /-- Each high point at an included time with a left neighborhood has an |
| 58 | actual centered neck, a quantitative cap side, or a compact limit carrier |
| 59 | (Claims 11.14-11.15, pp. 275-276; Proposition 9.79, pp. 232-234). -/ |
| 60 | theorem exists_generalized_canonical_slice_shape_threshold : |
| 61 | ∃ epsilon0 : ℝ, 0 < epsilon0 ∧ epsilon0 ≤ 1 / 400 ∧ |
| 62 | ∀ {S : GeneralizedBlowupSequence.{u}} {J : Set ℝ} |
| 63 | (G : GeneralizedBlowupConvergence S J) |
| 64 | (epsilon C : ℝ), 0 < epsilon → epsilon ≤ epsilon0 → |
| 65 | (∀ k, generalizedEarlierDenseStrongCanonicalNeighborhoods |
| 66 | (S.flow (G.subsequence k)) epsilon C |
| 67 | (S.base (G.subsequence k)).1 (S.base (G.subsequence k)).2) → |
| 68 | ∀ (t : ℝ), t ∈ J → |
| 69 | (∃ delta : ℝ, 0 < delta ∧ Icc (t - delta) t ⊆ J) → |
| 70 | ∀ x : G.limit.carrier.carrier, |
| 71 | let g := G.limit.flow.metric t |
| 72 | let D := G.limit.flow.connection t |
| 73 | 4 < D.scalarCurvature x → |
| 74 | (∃ N : EpsilonNeck g, |
| 75 | N.epsilon = 2 * epsilon ∧ N.connection = D ∧ N.center = x) ∨ |
| 76 | (∃ N : EpsilonNeck g, ∃ W : Set G.limit.carrier.carrier, |
| 77 | N.epsilon = 2 * epsilon ∧ N.connection = D ∧ |
| 78 | IsOpen W ∧ IsCompact (closure W) ∧ x ∈ W ∧ x ∉ N.carrier ∧ |
| 79 | frontier W = N.central_sphere ∧ |
| 80 | W ∩ N.carrier = N.region (-N.epsilon⁻¹) 0 ∧ |
| 81 | closure W ⊆ g.ball x |
| 82 | (8 * max 1 C * D.scalarCurvature x ^ (-1 / 2 : ℝ)) ∧ |
| 83 | (4 * max 1 C * D.scalarCurvature x)⁻¹ ≤ N.scale ^ 2 ∧ |
| 84 | N.scale ^ 2 ≤ 4 * max 1 C / D.scalarCurvature x) ∨ |
| 85 | IsCompact (univ : Set G.limit.carrier.carrier) := by |
| 86 | classical |
| 87 | obtain ⟨epsilon0, hpositive, hsmall, hshape⟩ := |
| 88 | exists_canonical_slice_shape_threshold.{u, u, u} |
| 89 | refine ⟨epsilon0, hpositive, hsmall, ?_⟩ |
| 90 | intro S J G epsilon C hepsilon hepsilon0 hdense t ht hleft x |
| 91 | dsimp only |
| 92 | intro hx |
| 93 | let g := G.limit.flow.metric t |
| 94 | let D := G.limit.flow.connection t |
| 95 | let : ConnectedSpace G.limit.carrier.carrier := G.limit.connectedSpace |
| 96 | let : MetricSpace G.limit.carrier.carrier := G.limit.carrier.metricSpaceOf g |
| 97 | let rho := max (max ((2 * Real.pi + 2 * epsilon⁻¹) / 2) (C / 2)) 8 + 1 |
| 98 | have hrho : 0 < rho := by |
| 99 | dsimp only [rho] |
| 100 | linarith [le_max_right (max ((2 * Real.pi + 2 * epsilon⁻¹) / 2) (C / 2)) 8] |
| 101 | let R := 2 * rho + 1 |
| 102 | have hR : 0 < R := by dsimp only [R]; linarith |
| 103 | have hbuffer : 2 * rho < R := by dsimp only [R]; linarith |
| 104 | let K := closure (g.ball x R) |
| 105 | have hK : IsCompact K := by |
| 106 | apply IsCompact.of_isClosed_subset |
| 107 | (g.isCompact_closedBall_of_metricComplete (G.limit.complete t ht) x R) isClosed_closure |
| 108 | apply closure_minimal |
| 109 | (fun y (hy : g.edist x y < ENNReal.ofReal R) => hy.le) |
| 110 | exact isClosed_le (continuous_const.edist continuous_id) continuous_const |
| 111 | have hxK : x ∈ K := by |
| 112 | apply subset_closure |
| 113 | change EDist.edist x x < ENNReal.ofReal R |
| 114 | simpa only [edist_self] using ENNReal.ofReal_pos.mpr hR |
| 115 | obtain ⟨j, hj⟩ := exists_generalized_exhaustion_stage G hK |
| 116 | let Y : TopologicalSpace.Opens G.limit.sliceCarrier.carrier := |
| 117 | ⟨G.exhaustion.space j, G.exhaustion.space_open j⟩ |
| 118 | obtain ⟨centers, radius, hcenters, hcover⟩ := |
| 119 | hK.exists_finite_buffered_extChart_ball_cover (𝓡 3) (G.exhaustion.space_open j) hj |
| 120 | let ι := {q : G.limit.carrier.carrier // q ∈ centers} |
| 121 | let q : ι → G.limit.carrier.carrier := Subtype.val |
| 122 | let c (i : ι) := extChartAt (𝓡 3) (q i) |
| 123 | let V (i : ι) := ball (c i (q i)) (2 * radius (q i)) |
| 124 | let L (i : ι) := closedBall (c i (q i)) (radius (q i)) |
| 125 | have hr (i : ι) : 0 < radius (q i) := (hcenters i.val i.property).2.1 |
| 126 | have hV (i : ι) : IsOpen (V i) := isOpen_ball |
| 127 | have hL (i : ι) : IsCompact (L i) := isCompact_closedBall _ _ |
| 128 | have hLV (i : ι) : L i ⊆ V i := closedBall_subset_ball (by linarith [hr i]) |
| 129 | have hVtarget (i : ι) : V i ⊆ (c i).target := |
| 130 | fun _ hz => ((hcenters i.val i.property).2.2 (ball_subset_closedBall hz)).1 |
| 131 | have hVimage (i : ι) : ∀ z ∈ V i, (c i).symm z ∈ G.exhaustion.space j := |
| 132 | fun _ hz => ((hcenters i.val i.property).2.2 (ball_subset_closedBall hz)).2 |
| 133 | have hLtarget (i : ι) : L i ⊆ (c i).target := (hLV i).trans (hVtarget i) |
| 134 | have hLimage (i : ι) : (c i).symm '' L i ⊆ G.exhaustion.space j := by |
| 135 | rintro _ ⟨z, hz, rfl⟩ |
| 136 | exact hVimage i z (hLV i hz) |
| 137 | have hcover' : K ⊆ ⋃ i : ι, (c i).symm '' L i := by |
| 138 | intro y hy |
| 139 | obtain ⟨z, hz⟩ := mem_iUnion.mp (hcover hy) |
| 140 | obtain ⟨hzmem, hzy⟩ := mem_iUnion.mp hz |
| 141 | exact mem_iUnion.mpr ⟨⟨z, hzmem⟩, extChartAt (𝓡 3) z y, |
| 142 | ball_subset_closedBall hzy.2, (extChartAt (𝓡 3) z).left_inv hzy.1⟩ |
| 143 | obtain ⟨delta, hdelta, hIJ⟩ := hleft |
| 144 | let I : Set ℝ := Icc (t - delta) t |
| 145 | have htI : t ∈ I := ⟨by linarith, le_rfl⟩ |
| 146 | have hIdiff : UniqueDiffOn ℝ I := uniqueDiffOn_Icc (by linarith) |
| 147 | let W : SpacetimeInterval := { |
| 148 | domain := I |
| 149 | ordConnected := ordConnected_Icc |
| 150 | nontrivial := ⟨t - delta, ⟨le_rfl, by linarith⟩, |
| 151 | t, htI, (show t - delta < t by linarith).ne⟩ } |
| 152 | obtain ⟨N, hN⟩ := eventually_atTop.mp |
| 153 | ((G.exhaustion.time_cofinal I isCompact_Icc hIJ).and (eventually_ge_atTop j)) |
| 154 | have htime (k : ℕ) : I ⊆ Icc (-G.exhaustion.time (k + N)) 0 := |
| 155 | (hN (k + N) (Nat.le_add_left N k)).1 |
| 156 | have hstage (k : ℕ) : j ≤ k + N := (hN (k + N) (Nat.le_add_left N k)).2 |
| 157 | let nu (k : ℕ) := G.subsequence (k + N) |
| 158 | let Q (k : ℕ) := S.scale (nu k) |
| 159 | have hQ (k : ℕ) : 0 < Q k := S.base_scalar_pos (nu k) |
| 160 | let a (k : ℕ) := (S.base (nu k)).1 |
| 161 | let E (k : ℕ) : GeneralizedFlowCylinder (S.flow (nu k)) G.limit.sliceCarrier |
| 162 | (a k) (Q k) W.domain Y := |
| 163 | Cylinder.restrict (G.embedding (k + N)) (htime k) |
| 164 | (G.exhaustion.space_increasing (hstage k)) |
| 165 | have htPhysical (k : ℕ) : a k + t / Q k ∈ (S.flow (nu k)).interval := by |
| 166 | apply ((S.flow (nu k)).slice_nonempty_iff _).mp |
| 167 | exact ⟨(E k).forward t htI G.limit.base⟩ |
| 168 | have htzero : t ≤ 0 := (htime 0 htI).2 |
| 169 | have hchoice (k : ℕ) : ∃ s : ℝ, s ∈ I ∧ |
| 170 | t - 1 / ((k : ℝ) + 1) < s ∧ s ≤ t ∧ |
| 171 | generalizedSliceStrongCanonicalNeighborhoods (S.flow (nu k)) epsilon C |
| 172 | (4 * Q k) (a k + s / Q k) := by |
| 173 | let b := min delta (1 / ((k : ℝ) + 1)) |
| 174 | have hb : 0 < b := by dsimp only [b]; positivity |
| 175 | have hbdelta : b ≤ delta := min_le_left _ _ |
| 176 | have hbsmall : b ≤ 1 / ((k : ℝ) + 1) := min_le_right _ _ |
| 177 | obtain ⟨u, _hu, hlower, hupper, hgood⟩ := |
| 178 | hdense (k + N) (a k + t / Q k) (htPhysical k) |
| 179 | (add_le_of_nonpos_right (div_nonpos_of_nonpos_of_nonneg htzero (hQ k).le)) |
| 180 | (a k + (t - b) / Q k) |
| 181 | (by linarith only [div_lt_div_of_pos_right (sub_lt_self t hb) (hQ k)]) |
| 182 | let s := Q k * (u - a k) |
| 183 | have hslower : t - b < s := by |
| 184 | have hh := (div_lt_iff₀ (hQ k)).mp (show (t - b) / Q k < u - a k by linarith) |
| 185 | dsimp only [s] |
| 186 | nlinarith |
| 187 | have hsupper : s ≤ t := by |
| 188 | have hh := (le_div_iff₀ (hQ k)).mp (show u - a k ≤ t / Q k by linarith) |
| 189 | dsimp only [s] |
| 190 | nlinarith |
| 191 | have hclock : a k + s / Q k = u := by |
| 192 | dsimp only [s] |
| 193 | field_simp [(hQ k).ne'] |
| 194 | ring |
| 195 | refine ⟨s, ⟨by linarith, hsupper⟩, by linarith, hsupper, ?_⟩ |
| 196 | rw [hclock] |
| 197 | exact hgood |
| 198 | choose s hs hslower hsupper hgood using hchoice |
| 199 | have hsLimit : Tendsto s atTop (𝓝[I] t) := by |
| 200 | apply tendsto_nhdsWithin_iff.mpr |
| 201 | refine ⟨Metric.tendsto_nhds.mpr ?_, Eventually.of_forall hs⟩ |
| 202 | intro eta heta |
| 203 | filter_upwards [tendsto_one_div_add_atTop_nhds_zero_nat.eventually (Iio_mem_nhds heta)] |
| 204 | with k hk |
| 205 | rw [Real.dist_eq, abs_of_nonpos (sub_nonpos.mpr (hsupper k))] |
| 206 | linarith [hslower k] |
| 207 | let time (k : ℕ) := a k + s k / Q k |
| 208 | let h (k : ℕ) : RiemannianMetric 3 ((S.flow (nu k)).slice (time k)).carrier := |
| 209 | M13.scaleSmoothMetric ((S.flow (nu k)).metric (time k)) (Q k) (hQ k) |
| 210 | let e (k : ℕ) : PartialDiffeomorph (𝓡 3) (𝓡 3) G.limit.carrier.carrier |
| 211 | ((S.flow (nu k)).slice (time k)).carrier ∞ := { |
| 212 | toPartialEquiv := (Cylinder.spatialHomeomorph (E k) ⟨s k, hs k⟩).toPartialEquiv |
| 213 | open_source := Y.isOpen |
| 214 | open_target := Cylinder.isOpen_spatial_image (E k) ⟨s k, hs k⟩ |
| 215 | contMDiffOn_toFun := (E k).forward_smooth (s k) (hs k) |
| 216 | contMDiffOn_invFun := (E k).inverse_smooth (s k) (hs k) } |
| 217 | let f (k : ℕ) : G.limit.carrier.carrier → ((S.flow (nu k)).slice (time k)).carrier := e k |
| 218 | have hsource (k : ℕ) : (e k).source = G.exhaustion.space j := rfl |
| 219 | have hjets (i : ι) (m : ℕ) : TendstoUniformlyOn |
| 220 | (fun k => iteratedFDeriv ℝ m ((h k).pullbackCoefficients (f k ∘ (c i).symm))) |
| 221 | (iteratedFDeriv ℝ m (g.pullbackCoefficients (c i).symm)) atTop (L i) := by |
| 222 | have hfull := (tendstoUniformlyOn_generalized_bilinear_spatial_jets G (q i) m |
| 223 | (isCompact_Icc.prod (hL i)) (Set.prod_mono hIJ (hLtarget i))).seq_tendstoUniformlyOn |
| 224 | (fun k => k + N) (tendsto_add_atTop_nat N) |
| 225 | have hcoeff := G.limit.flow.smooth.contDiffOn_spacetime_pullbackCoefficients_within |
| 226 | (hV i) ((contMDiffOn_extChartAt_symm (q i)).mono (hVtarget i)) |
| 227 | have hcontinuous := M28.continuousOn_spatialJet_of_within hIdiff (hV i) |
| 228 | (hcoeff.mono (Set.prod_mono hIJ (Subset.rfl))) m |
| 229 | have hh := shape_uniform_at_moving_time (hL i) hfull |
| 230 | (hcontinuous.mono (Set.prod_mono_right (hLV i))) htI hsLimit |
| 231 | convert hh using 1 |
| 232 | funext k z |
| 233 | have heq : (fun y => generalizedPullbackCoefficients G (k + N) (q i) (s k, y)) = |
| 234 | (h k).pullbackCoefficients (f k ∘ (c i).symm) := by |
| 235 | funext y |
| 236 | simp only [generalizedPullbackCoefficients, dif_pos (htime k (hs k))] |
| 237 | rfl |
| 238 | rw [heq] |
| 239 | have hscalar : TendstoUniformlyOn |
| 240 | (fun k y => (S.flow (nu k)).scalar ⟨time k, f k y⟩ / Q k) |
| 241 | D.scalarCurvature atTop K := by |
| 242 | let A (k : ℕ) (p : ℝ × G.limit.carrier.carrier) : ℝ := |
| 243 | if hp : p.1 ∈ Icc (-G.exhaustion.time (k + N)) 0 then |
| 244 | (S.flow (nu k)).scalar ((G.embedding (k + N)).pointMap p.1 hp p.2) / Q k |
| 245 | else 0 |
| 246 | let B (p : ℝ × G.limit.carrier.carrier) := |
| 247 | (G.limit.flow.connection p.1).scalarCurvature p.2 |
| 248 | have hfull : TendstoUniformlyOn A B atTop (I ×ˢ K) := by |
| 249 | apply Metric.tendstoUniformlyOn_iff.mpr |
| 250 | intro eta heta |
| 251 | filter_upwards [(tendsto_add_atTop_nat N).eventually |
| 252 | (eventually_generalized_scalar_error G isCompact_Icc hIJ hK heta)] with k hk |
| 253 | intro p hp |
| 254 | have hh := hk.2.2 p.1 hp.1 (htime k hp.1) p.2 hp.2 |
| 255 | simpa only [A, B, dif_pos (htime k hp.1), Real.dist_eq, abs_sub_comm] using hh |
| 256 | have hcont : ContinuousOn B (I ×ˢ K) := |
| 257 | G.limit.flow.contMDiffOn_scalarCurvature.continuousOn.mono |
| 258 | (Set.prod_mono hIJ (subset_univ K)) |
| 259 | have hh := shape_uniform_at_moving_time hK hfull hcont htI hsLimit |
| 260 | convert hh using 1 |
| 261 | funext k y |
| 262 | simp only [A, dif_pos (htime k (hs k))] |
| 263 | rfl |
| 264 | have hhigh : ∀ᶠ k in atTop, 4 < (S.flow (nu k)).scalar ⟨time k, f k x⟩ / Q k := |
| 265 | (hscalar.tendsto_at hxK).eventually (Ioi_mem_nhds hx) |
| 266 | have hcanonical : ∀ᶠ k in atTop, Nonempty |
| 267 | (GeneralizedCanonicalControl (F := S.flow (nu k)) (time k) (f k x) epsilon C) := by |
| 268 | filter_upwards [hhigh] with k hk |
| 269 | exact hgood k (f k x) ((lt_div_iff₀ (hQ k)).mp hk).le |
| 270 | have hinverse := eventually_inverse_tangent_bound_of_finite_chart_jets g h e K |
| 271 | (fun k => (hsource k).symm ▸ hj) q L hL hLtarget hcover' (fun i => hjets i 0) |
| 272 | have hmaps : ∀ᶠ k in atTop, ∃ e' : PartialDiffeomorph (𝓡 3) (𝓡 3) |
| 273 | G.limit.carrier.carrier ((S.flow (nu k)).slice (time k)).carrier ∞, |
| 274 | e'.source = G.exhaustion.space j ∧ |
| 275 | (e' : G.limit.carrier.carrier → ((S.flow (nu k)).slice (time k)).carrier) = f k ∧ |
| 276 | (h k).ball (f k x) rho ⊆ f k '' K := by |
| 277 | filter_upwards [hinverse] with k hk |
| 278 | refine ⟨e k, hsource k, rfl, ?_⟩ |
| 279 | have hh := g.ball_subset_image_ball_of_inverse_tangentNorm_le (h k) |
| 280 | (e k).toOpenPartialHomeomorph x hR (by norm_num : (0 : ℝ) < 2) hbuffer hK |
| 281 | ((hsource k).symm ▸ hj) |
| 282 | (fun z hz => ((e k).contMDiffOn_invFun.contMDiffAt |
| 283 | ((e k).open_target.mem_nhds hz)).of_le (by simp)) hk |
| 284 | apply hh.trans |
| 285 | apply image_mono |
| 286 | intro z hz |
| 287 | exact subset_closure (hz.trans_le (ENNReal.ofReal_le_ofReal hbuffer.le)) |
| 288 | exact hshape (ι := ι) g D x hx epsilon C hepsilon hepsilon0 |
| 289 | (fun k => S.flow (nu k)) time Q hQ f (G.exhaustion.space j) K |
| 290 | (G.exhaustion.space_open j) hK hj hxK q L hL hLtarget hLimage hcover' |
| 291 | hscalar hcanonical hmaps (fun i m _ => hjets i m) |
| 292 | |
| 293 | end PoincareMT.M30 |