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.Surgery.CanonicalInduction.Limit.Finite.LimitFinitePreservedBounds |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Limit.Finite.LimitFiniteForwardScalar |
| 3 | |
| 4 | /-! |
| 5 | # A uniform bound on the entire preserved endpoint search |
| 6 | |
| 7 | The backward search preserves its supplied future. Forward scalar |
| 8 | comparison controls the short interval after its old bottom; the older |
| 9 | slab controls the remaining future on those same worldlines. |
| 10 | MT Proposition 17.1; limit-finite-uniform-search.md, F7d. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M47 |
| 22 | |
| 23 | private theorem uniform_forward_heq {F : SurgeryFlowData.{u}} |
| 24 | {C : GeneralizedSliceCarrier.{u}} {origin Q : ℝ} {I : Set ℝ} {U : Set C.carrier} |
| 25 | (e : SurgeryFlowCylinder F C origin Q I U) {s t : ℝ} (hs : s ∈ I) (ht : t ∈ I) |
| 26 | (hst : s = t) (x : C.carrier) : HEq (e.forward s hs x) (e.forward t ht x) := by |
| 27 | cases hst |
| 28 | rfl |
| 29 | |
| 30 | private theorem uniform_readout_eq {F : SurgeryFlowData.{u}} {s t : ℝ} |
| 31 | {x : (F.slice s).carrier} {y : (F.slice t).carrier} (hst : s = t) (hxy : HEq x y) : |
| 32 | (F.connection s).scalarCurvature x = (F.connection t).scalarCurvature y ∧ |
| 33 | (F.connection s).curvatureTensorNorm x = (F.connection t).curvatureTensorNorm y ∧ |
| 34 | (F.connection s).negativeCurvaturePart x = (F.connection t).negativeCurvaturePart y := by |
| 35 | cases hst |
| 36 | cases hxy |
| 37 | exact ⟨rfl, rfl, rfl⟩ |
| 38 | |
| 39 | /-- One constructed search has a uniform bound across its new past and |
| 40 | complete retained future, with its literal cap-stop alternative. -/ |
| 41 | theorem limitFinite_exists_uniform_preserved_search |
| 42 | (S : RepairedControlledSchedulesData.{u}) |
| 43 | (B : M47ComponentAnalyticBounds.{u} S.setup.C) |
| 44 | (p : SurgeryParameterPrefix S.constants) |
| 45 | {F : SurgeryFlowData.{u}} (O : SurgeryObservation F) |
| 46 | (hInitial : F.standard_initial = S.setup.standard_initial) |
| 47 | (hConstants : F.local_constants = S.constants) (hC : F.parameters.C = S.setup.C) |
| 48 | {base Q window r shift c d L Bold eta : ℝ} |
| 49 | (hBase : base ∈ Ico (surgeryEpochStart p.i) O.H) |
| 50 | (hwindow : 0 ≤ window) (hScale : 64 * (window + 1) ≤ Q) |
| 51 | (hLarge : B.curvature_threshold ≤ Q) (hThreshold : r⁻¹ ^ 2 ≤ Q) |
| 52 | (hPinched : SurgeryFlowPinched F) |
| 53 | (hEarlier : SurgeryCanonicalOn F (surgeryObservationInterval O ∩ Iio base) r) |
| 54 | (hOverlap : ∀ t ∈ surgeryObservationInterval O ∩ |
| 55 | Ico (surgeryEpochStart (p.i - 1)) O.H, |
| 56 | F.parameters.delta t ≤ B.delta S.setup.standard_initial S.constants) |
| 57 | (P : M46Predecessors.{u}) {C : GeneralizedSliceCarrier.{u}} {U : Set C.carrier} |
| 58 | (e0 : SurgeryFlowCylinder F C (base + shift / Q) Q (Icc c 0) U) |
| 59 | (hshift : shift ≤ 0) (hd : 0 < d) (hc : c + 2 * d ≤ 0) |
| 60 | (hbuffer : -window ≤ shift + c - 4 * d) (hL : 1 ≤ L) |
| 61 | (hShort : 64 * blowupAnalyticConstant S B * L * (4 * d) ≤ 1) |
| 62 | (hU : IsOpen U) (hne : U.Nonempty) |
| 63 | (hEndpoint : ∀ x ∈ U, |
| 64 | (F.connection ((base + shift / Q) + c / Q)).scalarCurvature |
| 65 | (e0.forward c ⟨le_rfl, by linarith only [hc, hd]⟩ x) ≤ L * Q) |
| 66 | (heta : 0 < eta) (hPinchingScale : blowupPinchingThreshold (4 * L) eta ≤ Q) |
| 67 | (hOld : ∀ s (hs : s ∈ Icc (c + d) 0), ∀ x ∈ U, |
| 68 | |(F.connection ((base + shift / Q) + s / Q)).curvatureTensorNorm |
| 69 | (e0.forward s ⟨by linarith only [hs.1, hd], hs.2⟩ x)| ≤ Bold * Q ∧ |
| 70 | (F.connection ((base + shift / Q) + s / Q)).negativeCurvaturePart |
| 71 | (e0.forward s ⟨by linarith only [hs.1, hd], hs.2⟩ x) ≤ eta * Q) : |
| 72 | ∃ (b : ℝ) (hb : b ∈ Icc (c - 4 * d) c), |
| 73 | ∃ E : SurgeryFlowCylinder F C (base + shift / Q) Q (Icc b 0) U, |
| 74 | (∀ s (hs : s ∈ Icc c 0) (hs' : s ∈ Icc b 0) x, |
| 75 | E.forward s hs' x = e0.forward s hs x) ∧ |
| 76 | (∀ s (hs : s ∈ Icc b 0), ∀ x ∈ U, |
| 77 | |(F.connection ((base + shift / Q) + s / Q)).curvatureTensorNorm |
| 78 | (E.forward s hs x)| ≤ max (13 * max (4 * L) 1) Bold * Q ∧ |
| 79 | (F.connection ((base + shift / Q) + s / Q)).negativeCurvaturePart |
| 80 | (E.forward s hs x) ≤ eta * Q) ∧ |
| 81 | (b < c - 2 * d ∨ b ∈ Icc (c - 2 * d) c ∧ |
| 82 | ∃ hEvent : (base + shift / Q) + b / Q ∈ F.surgery_times, |
| 83 | ∀ [Nonempty (F.slice ((base + shift / Q) + b / Q)).carrier], |
| 84 | ∃ i : Fin (F.event ((base + shift / Q) + b / Q) hEvent).cap_count, |
| 85 | (E.forward b ⟨le_rfl, by linarith only [hb.2, hc, hd]⟩ '' U ∩ |
| 86 | ((F.event ((base + shift / Q) + b / Q) hEvent).caps i).carrier).Nonempty) := by |
| 87 | have hQ := e0.scale_pos |
| 88 | have hc0 : c ≤ 0 := by linarith only [hc, hd] |
| 89 | have hbuffer' : -window ≤ shift + c - 2 * (2 * d) := by |
| 90 | nlinarith only [hbuffer] |
| 91 | have hshort' : 64 * blowupAnalyticConstant S B * L * (2 * (2 * d)) ≤ 1 := by |
| 92 | nlinarith only [hShort] |
| 93 | obtain ⟨b, hb, E, hfuture, hpast, hstop⟩ := limitFinite_exists_preserved_bounded_search |
| 94 | S B p O hInitial hConstants hC hBase hwindow hScale hLarge hThreshold |
| 95 | hPinched hEarlier hOverlap P e0 hshift hc0 (mul_pos two_pos hd) |
| 96 | hbuffer' hL hshort' hU hne hEndpoint heta hPinchingScale |
| 97 | have hb' : b ∈ Icc (c - 4 * d) c := by |
| 98 | constructor <;> linarith only [hb.1, hb.2] |
| 99 | have hmem : ∀ u ∈ Icc (-2 * d) 0, c + 2 * d + u ∈ Icc b 0 := by |
| 100 | intro u hu |
| 101 | constructor <;> linarith only [hb.2, hc, hu.1, hu.2] |
| 102 | have hmono : StrictMonoOn (fun u : ℝ => c + 2 * d + u) (Icc (-2 * d) 0) := by |
| 103 | intro u _ v _ huv |
| 104 | simpa only [add_comm] using add_lt_add_left huv (c + 2 * d) |
| 105 | have hclock (u : ℝ) (_hu : u ∈ Icc (-2 * d) 0) : |
| 106 | (base + (shift + c + 2 * d) / Q) + u / Q = |
| 107 | (base + shift / Q) + (c + 2 * d + u) / Q := by ring |
| 108 | let f : SurgeryFlowCylinder F C (base + (shift + c + 2 * d) / Q) Q |
| 109 | (Icc (-2 * d) 0) U := |
| 110 | Proofs.M47.seedCylinderReclock E hQ ordConnected_Icc |
| 111 | (fun u => c + 2 * d + u) hmem hmono hclock |
| 112 | have hread (u : ℝ) (hu : u ∈ Icc (-2 * d) 0) |
| 113 | (s : ℝ) (hs : s ∈ Icc b 0) (heq : c + 2 * d + u = s) (x : C.carrier) := |
| 114 | uniform_readout_eq |
| 115 | ((hclock u hu).trans (congrArg (fun z => (base + shift / Q) + z / Q) heq)) |
| 116 | ((Proofs.M47.seedCylinderReclock_forward_heq E hQ ordConnected_Icc |
| 117 | (fun u => c + 2 * d + u) hmem hmono hclock u hu x).trans |
| 118 | (uniform_forward_heq E _ hs heq x)) |
| 119 | have ha : -2 * d ≤ 0 := by linarith only [hd] |
| 120 | have hbottom (x : C.carrier) (hx : x ∈ U) : |
| 121 | (F.connection ((base + (shift + c + 2 * d) / Q) + (-2 * d) / Q)).scalarCurvature |
| 122 | (f.forward (-2 * d) ⟨le_rfl, ha⟩ x) ≤ L * Q := by |
| 123 | rw [(hread (-2 * d) ⟨le_rfl, ha⟩ c ⟨hb.2, hc0⟩ (by ring) x).1] |
| 124 | rw [hfuture c ⟨le_rfl, hc0⟩ _ x] |
| 125 | exact hEndpoint x hx |
| 126 | have hshift' : shift + c + 2 * d ≤ 0 := by linarith only [hshift, hc] |
| 127 | have hbufferF : -window ≤ (shift + c + 2 * d) + (-2 * d) := by |
| 128 | linarith only [hbuffer, hd] |
| 129 | have hshortF : 64 * blowupAnalyticConstant S B * L * (-(-2 * d)) ≤ 1 := by |
| 130 | apply le_trans _ hShort |
| 131 | apply mul_le_mul_of_nonneg_left (by linarith only [hd]) |
| 132 | have hA := blowupAnalyticConstant_pos S B |
| 133 | have hLp : 0 ≤ L := zero_le_one.trans hL |
| 134 | positivity |
| 135 | have hforward (s : ℝ) (hs : s ∈ Icc c (c + 2 * d)) (x : C.carrier) (hx : x ∈ U) : |
| 136 | |(F.connection ((base + shift / Q) + s / Q)).curvatureTensorNorm |
| 137 | (E.forward s ⟨hb.2.trans hs.1, hs.2.trans hc⟩ x)| ≤ (13 * max (4 * L) 1) * Q ∧ |
| 138 | (F.connection ((base + shift / Q) + s / Q)).negativeCurvaturePart |
| 139 | (E.forward s ⟨hb.2.trans hs.1, hs.2.trans hc⟩ x) ≤ eta * Q := by |
| 140 | have hu : s - (c + 2 * d) ∈ Icc (-2 * d) 0 := by |
| 141 | constructor <;> linarith only [hs.1, hs.2] |
| 142 | have h := limitFinite_shifted_forward_curvature_bounds S B p O |
| 143 | hInitial hConstants hC hBase hwindow hScale hLarge hThreshold hPinched hEarlier |
| 144 | hOverlap P f hshift' ha hbufferF hx hL (hbottom x hx) hshortF heta hPinchingScale |
| 145 | (s - (c + 2 * d)) hu |
| 146 | have hread' := hread _ hu s ⟨hb.2.trans hs.1, hs.2.trans hc⟩ (by ring) x |
| 147 | rw [hread'.2.1, hread'.2.2] at h |
| 148 | exact h |
| 149 | refine ⟨b, hb', E, hfuture, ?_, hstop⟩ |
| 150 | intro s hs x hx |
| 151 | by_cases hsc : s ≤ c |
| 152 | · obtain ⟨_hscalar, hnorm, hneg⟩ := hpast s ⟨hs.1, hsc⟩ x hx |
| 153 | exact ⟨hnorm.trans (mul_le_mul_of_nonneg_right (le_max_left _ _) hQ.le), hneg⟩ |
| 154 | · by_cases hsf : s ≤ c + 2 * d |
| 155 | · obtain ⟨hnorm, hneg⟩ := hforward s ⟨le_of_not_ge hsc, hsf⟩ x hx |
| 156 | exact ⟨hnorm.trans (mul_le_mul_of_nonneg_right (le_max_left _ _) hQ.le), hneg⟩ |
| 157 | · have hsOld : s ∈ Icc (c + d) 0 := |
| 158 | ⟨by linarith only [le_of_not_ge hsf, hd], hs.2⟩ |
| 159 | rw [hfuture s ⟨by linarith only [hsOld.1, hd], hs.2⟩ hs x] |
| 160 | obtain ⟨hnorm, hneg⟩ := hOld s hsOld x hx |
| 161 | exact ⟨hnorm.trans (mul_le_mul_of_nonneg_right (le_max_right _ _) hQ.le), hneg⟩ |
| 162 | |
| 163 | end PoincareMT.M47 |