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.ShortTime.CanonicalRelatedNeck |
| 2 | import PoincareLib.Geometry.RicciFlow.Blowup.Construction.ShortTime.SelectedStaticStageSlices |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Analysis.Coordinates.FiniteBufferedChartCover |
| 4 | import PoincareLib.Geometry.Riemannian.Distance.CompleteBalls |
| 5 | |
| 6 | /-! |
| 7 | # Related necks on the retained complete static limit |
| 8 | |
| 9 | Morgan--Tian Claims 11.6 and 11.7, pp. 270-271. A finite buffered atlas |
| 10 | and the actual retained source flows supply good canonical slices and |
| 11 | whole source-ball capture. The same maps yield a related neck at each |
| 12 | high-scalar limit point, or compactness of the complete limit. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter Metric |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M30 |
| 24 | |
| 25 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.measurableSpace |
| 26 | FlowCarrier.borelSpace FlowCarrier.chartedSpace FlowCarrier.isManifold |
| 27 | FlowCarrier.t2Space FlowCarrier.t3Space FlowCarrier.secondCountable |
| 28 | |
| 29 | set_option maxHeartbeats 800000 in |
| 30 | -- The finite chart atlas and retained dependent source family are assembled together. |
| 31 | set_option synthInstance.maxHeartbeats 100000 in |
| 32 | -- The actual limit, its open stage and varying generalized slices retain distinct atlases. |
| 33 | /-- The same complete terminal metric limit has related necks at all |
| 34 | high-scalar points, or is compact, at a universal accuracy chosen before |
| 35 | the sequence (Claims 11.6 and 11.7, pp. 270-271). -/ |
| 36 | theorem exists_static_limit_related_neck_threshold : |
| 37 | ∃ epsilon0 : ℝ, 0 < epsilon0 ∧ epsilon0 ≤ 1 / 400 ∧ |
| 38 | ∀ (_hC : RicciFlowCurvatureTheory.{u}) |
| 39 | {S : GeneralizedBlowupSequence.{u}} |
| 40 | {epsilon canonicalConstant kappa r0 mu : ℝ} |
| 41 | (_H : M30CommonBlowupControls S epsilon canonicalConstant kappa r0 mu), |
| 42 | epsilon ≤ epsilon0 → GeneralizedBlowupBoundedDistance S → |
| 43 | ∀ (G : PartialPointedMetricConvergence |
| 44 | (terminalComponentMetric S) (terminalComponentBase S) 1), |
| 45 | G.limitCarrier.metricComplete G.limitMetric → |
| 46 | ∀ (D : LeviCivitaData G.limitMetric) (x : G.limitCarrier.carrier), |
| 47 | 4 < D.scalarCurvature x → |
| 48 | (∃ N : EpsilonNeck G.limitMetric, |
| 49 | N.epsilon = 2 * epsilon ∧ N.connection = D ∧ |
| 50 | D.scalarCurvature x ≤ |
| 51 | max 1 (2 * canonicalConstant) * D.scalarCurvature N.center) ∨ |
| 52 | IsCompact (univ : Set G.limitCarrier.carrier) := by |
| 53 | classical |
| 54 | obtain ⟨epsilon0, hpositive, hsmall, hrelated⟩ := |
| 55 | exists_canonical_slice_related_neck_threshold.{u, 0, 0} |
| 56 | refine ⟨epsilon0, hpositive, hsmall, ?_⟩ |
| 57 | intro hC S epsilon canonicalConstant kappa r0 mu H hepsilon hbound G hcomplete D x hx |
| 58 | let : ConnectedSpace G.limitCarrier.carrier := |
| 59 | connectedSpace_iff_univ.mpr G.limitCarrier.connected |
| 60 | let : MetricSpace G.limitCarrier.carrier := G.limitCarrier.metricSpaceOf G.limitMetric |
| 61 | have hepsilonpos := H.epsilon_pos |
| 62 | let rho := max ((2 * Real.pi + 2 * epsilon⁻¹) / 2) (canonicalConstant / 2) + 1 |
| 63 | have hrho : 0 < rho := by |
| 64 | have hp : 0 < (2 * Real.pi + 2 * epsilon⁻¹) / 2 := by positivity |
| 65 | have hm := le_max_left ((2 * Real.pi + 2 * epsilon⁻¹) / 2) (canonicalConstant / 2) |
| 66 | dsimp only [rho] |
| 67 | linarith |
| 68 | let R := 2 * rho + 1 |
| 69 | have hR : 0 < R := by dsimp only [R]; linarith |
| 70 | have hbuffer : 2 * rho < R := by dsimp only [R]; linarith |
| 71 | have hclosure : IsCompact (closure (G.limitMetric.ball x R)) := by |
| 72 | apply IsCompact.of_isClosed_subset |
| 73 | (G.limitMetric.isCompact_closedBall_of_metricComplete hcomplete x R) isClosed_closure |
| 74 | apply closure_minimal |
| 75 | (fun y (hy : G.limitMetric.edist x y < ENNReal.ofReal R) => hy.le) |
| 76 | exact isClosed_le (continuous_const.edist continuous_id) continuous_const |
| 77 | let K := closure (G.limitMetric.ball x R) ∪ {G.base} |
| 78 | have hK : IsCompact K := hclosure.union isCompact_singleton |
| 79 | have hpK : G.base ∈ K := Or.inr (mem_singleton G.base) |
| 80 | have hxK : x ∈ K := by |
| 81 | apply Or.inl |
| 82 | apply subset_closure |
| 83 | change EDist.edist x x < ENNReal.ofReal R |
| 84 | simpa only [edist_self] using ENNReal.ofReal_pos.mpr hR |
| 85 | obtain ⟨j, hj⟩ := G.exists_exhaustion_superset hK |
| 86 | let Y : TopologicalSpace.Opens G.limitCarrier.carrier := |
| 87 | ⟨G.exhaustion j, G.exhaustion_open j⟩ |
| 88 | obtain ⟨centers, radius, hcenters, hcover⟩ := |
| 89 | hK.exists_finite_buffered_extChart_ball_cover (𝓡 3) (G.exhaustion_open j) hj |
| 90 | let ι := {q : G.limitCarrier.carrier // q ∈ centers} |
| 91 | let q : ι → G.limitCarrier.carrier := Subtype.val |
| 92 | let c (i : ι) := extChartAt (𝓡 3) (q i) |
| 93 | let U (i : ι) := ball (c i (q i)) (2 * radius (q i)) |
| 94 | let L (i : ι) := closedBall (c i (q i)) (radius (q i)) |
| 95 | have hr (i : ι) : 0 < radius (q i) := (hcenters i.val i.property).2.1 |
| 96 | have hU (i : ι) : IsOpen (U i) := isOpen_ball |
| 97 | have hL (i : ι) : IsCompact (L i) := isCompact_closedBall _ _ |
| 98 | have hLU (i : ι) : L i ⊆ U i := |
| 99 | closedBall_subset_ball (by linarith [hr i]) |
| 100 | have hUtarget (i : ι) : U i ⊆ (c i).target := |
| 101 | fun _ hz => ((hcenters i.val i.property).2.2 (ball_subset_closedBall hz)).1 |
| 102 | have hUimage (i : ι) : ∀ z ∈ U i, (c i).symm z ∈ G.exhaustion j := |
| 103 | fun _ hz => ((hcenters i.val i.property).2.2 (ball_subset_closedBall hz)).2 |
| 104 | let psi (i : ι) (z : EuclideanSpace ℝ (Fin 3)) : Y := |
| 105 | if hz : z ∈ U i then ⟨(c i).symm z, hUimage i z hz⟩ |
| 106 | else ⟨G.base, G.base_in_exhaustion j⟩ |
| 107 | have hpsival (i : ι) (z : EuclideanSpace ℝ (Fin 3)) (hz : z ∈ U i) : |
| 108 | (psi i z).val = (c i).symm z := by simp only [psi, dif_pos hz] |
| 109 | have hpsi (i : ι) : ContMDiffOn (𝓡 3) (𝓡 3) ∞ (psi i) (U i) := by |
| 110 | intro z hz |
| 111 | apply (ContMDiffWithinAt.subtypeVal_comp_iff Y (psi i) (U i) z).mp |
| 112 | exact (((contMDiffOn_extChartAt_symm (q i)).mono (hUtarget i)) z hz).congr |
| 113 | (fun y hy => hpsival i y hy) (hpsival i z hz) |
| 114 | have hLtarget (i : ι) : L i ⊆ (c i).target := (hLU i).trans (hUtarget i) |
| 115 | have hLimage (i : ι) : (c i).symm '' L i ⊆ G.exhaustion j := by |
| 116 | rintro _ ⟨z, hz, rfl⟩ |
| 117 | exact hUimage i z (hLU i hz) |
| 118 | have hcover' : K ⊆ ⋃ i : ι, (c i).symm '' L i := by |
| 119 | intro y hy |
| 120 | obtain ⟨z, hz⟩ := mem_iUnion.mp (hcover hy) |
| 121 | obtain ⟨hzmem, hzy⟩ := mem_iUnion.mp hz |
| 122 | refine mem_iUnion.mpr ⟨⟨z, hzmem⟩, ?_⟩ |
| 123 | exact ⟨extChartAt (𝓡 3) z y, ball_subset_closedBall hzy.2, |
| 124 | (extChartAt (𝓡 3) z).left_inv hzy.1⟩ |
| 125 | obtain ⟨W, T, B, _hW, hT, _hB, N, E, P, himage, hP, hterminal, _hcurv⟩ := |
| 126 | exists_source_flows_on_static_stage hC H hbound G hcomplete j |
| 127 | let d := ⌊(2 * epsilon)⁻¹⌋₊ + 1 |
| 128 | obtain ⟨s, hs, _hdelta, hgood, _hjets0, _hscalar0, hjets, hscalar, hmaps⟩ := |
| 129 | exists_good_static_stage_slice_sequence S G j N hT E P himage hP hterminal |
| 130 | D epsilon canonicalConstant (fun k => H.canonical (G.subsequence (k + N))) |
| 131 | q U L hU hUtarget hL hLU psi hpsi hpsival K hK hj hcover' d x hrho hbuffer |
| 132 | (show closure (G.limitMetric.ball x R) ⊆ K from subset_union_left) |
| 133 | let nu (k : ℕ) := G.subsequence (k + N) |
| 134 | let Q (k : ℕ) := S.scale (nu k) |
| 135 | let t (k : ℕ) := (S.base (nu k)).1 + s k / Q k |
| 136 | let f (k : ℕ) (y : G.limitCarrier.carrier) := |
| 137 | (E k).embedding.forward (s k) (hs k) (G.embedding (k + N) y).val |
| 138 | let h : ∀ k, RiemannianMetric 3 ((S.flow (nu k)).slice (t k)).carrier := |
| 139 | fun k => M13.scaleSmoothMetric ((S.flow (nu k)).metric (t k)) (Q k) |
| 140 | (S.base_scalar_pos (nu k)) |
| 141 | change TendstoUniformlyOn |
| 142 | (fun k y => (S.flow (nu k)).scalar ⟨t k, f k y⟩ / Q k) |
| 143 | D.scalarCurvature atTop K at hscalar |
| 144 | have hhigh : ∀ᶠ k in atTop, 4 < (S.flow (nu k)).scalar ⟨t k, f k x⟩ / Q k := |
| 145 | (hscalar.tendsto_at hxK).eventually (Ioi_mem_nhds hx) |
| 146 | have hcanonical : ∀ᶠ k in atTop, Nonempty |
| 147 | (GeneralizedCanonicalControl (F := S.flow (nu k)) |
| 148 | (t k) (f k x) epsilon canonicalConstant) := by |
| 149 | filter_upwards [hhigh] with k hk |
| 150 | exact (hgood k).2 (f k x) ((lt_div_iff₀ (S.base_scalar_pos (nu k))).mp hk).le |
| 151 | have hballK : G.limitMetric.ball x (2 * rho) ⊆ K := by |
| 152 | intro y hy |
| 153 | apply Or.inl |
| 154 | apply subset_closure |
| 155 | exact hy.trans_le (ENNReal.ofReal_le_ofReal hbuffer.le) |
| 156 | have hcapture : ∀ᶠ k in atTop, ∃ e : PartialDiffeomorph (𝓡 3) (𝓡 3) |
| 157 | G.limitCarrier.carrier ((S.flow (nu k)).slice (t k)).carrier ∞, |
| 158 | e.source = G.exhaustion j ∧ |
| 159 | (e : G.limitCarrier.carrier → ((S.flow (nu k)).slice (t k)).carrier) = f k ∧ |
| 160 | (h k).ball (f k x) rho ⊆ f k '' K := by |
| 161 | filter_upwards [hmaps] with k hk |
| 162 | obtain ⟨e, hes, hef, _het, hball⟩ := hk |
| 163 | exact ⟨e, hes, hef, hball.trans (image_mono hballK)⟩ |
| 164 | exact hrelated (ι := ι) G.limitMetric D G.base x |
| 165 | (terminal_static_limit_base_scalar S G D) hx epsilon canonicalConstant |
| 166 | hepsilonpos hepsilon (fun k => S.flow (nu k)) t Q |
| 167 | (fun k => S.base_scalar_pos (nu k)) f (G.exhaustion j) K |
| 168 | (G.exhaustion_open j) (G.exhaustion_connected j).isPreconnected |
| 169 | hK hj hpK hxK q L hL hLtarget hLimage hcover' hscalar hcanonical hcapture hjets |
| 170 | |
| 171 | end PoincareMT.M30 |