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.First.FirstFailureAttainment |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Prefix.PrefixMonotone |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Canonical.Cap.CanonicalCapSlabStability |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Canonical.Component.CanonicalComponentSlabStability |
| 5 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Canonical.Round.CanonicalRoundSlabStability |
| 6 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Canonical.Neck.CanonicalNeckExposedAlternative |
| 7 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Canonical.Neck.CanonicalNeckCoveredPhysicalCap |
| 8 | |
| 9 | /-! |
| 10 | # Noncanonicity at the actual first-failure limit |
| 11 | |
| 12 | The compact actual slab limit carries its own strict-past control. |
| 13 | All four literal alternatives are excluded at this same point. The |
| 14 | standard setup-epsilon cover is an internal producer still supplied |
| 15 | separately; no global failure-set closedness is presumed. |
| 16 | MT Lemma 17.2; first-failure-actual-limit.md. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | |
| 22 | open Set Filter |
| 23 | open scoped Topology |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.Proofs.M47 |
| 28 | |
| 29 | /-- Actual setup-accuracy standard caps close the exposed-neck case |
| 30 | at the genuine infimum limit. This is an internal cover consumer. -/ |
| 31 | theorem firstFailure_attained_of_standard_cover |
| 32 | (P : M47Predecessors.{u}) (S : RepairedControlledSchedulesData.{u}) |
| 33 | (p : SurgeryParameterPrefix S.constants) (hp : S.SeedCompatible p) |
| 34 | (cover : ∀ s ∈ Ico 0 S.cap_persistence.standard_cap.flow.base.lifetime, |
| 35 | ∀ x : StandardCapSpace, |
| 36 | ((S.cap_persistence.standard_cap.flow.metric s).edist 0 x).toReal * |
| 37 | Real.sqrt ((S.cap_persistence.standard_cap.flow.connection s).scalarCurvature x) ≤ |
| 38 | (57 / 10 : ℝ) * S.setup.epsilon⁻¹ → |
| 39 | ∃ N : CapCertificate (S.cap_persistence.standard_cap.flow.metric s), |
| 40 | N.epsilon = S.setup.epsilon ∧ N.cap_constant ≤ S.setup.C ∧ |
| 41 | N.connection = S.cap_persistence.standard_cap.flow.connection s ∧ x ∈ N.core) |
| 42 | (r : ℝ) (hr : 0 < r) (hle : r ≤ p.r (Fin.last p.i)) : |
| 43 | ∃ delta : ℝ, 0 < delta ∧ delta ≤ p.Delta (Fin.last p.i) ∧ |
| 44 | ∀ (F : SurgeryFlowData.{u}) (O : SurgeryObservation F), |
| 45 | SurgeryObservationIsNextEpoch p O → SurgeryPrefixControls p F O → |
| 46 | SurgeryFlowAdmissible F → SurgeryFlowPinched F → |
| 47 | SurgeryFlowTerminalPolicyOn F (surgeryObservationInterval O) → |
| 48 | SurgeryPostPrefixScales p F O r delta → |
| 49 | (∀ t ∈ surgeryObservationInterval O ∩ |
| 50 | Ico (surgeryEpochStart (p.i - 1)) O.H, F.parameters.delta t ≤ delta) → |
| 51 | ¬ SurgeryCanonicalOn F (surgeryObservationInterval O) r → |
| 52 | ∃ t ∈ Ico (surgeryEpochStart p.i) O.H, |
| 53 | t = sInf (canonicalFailureTimes F O r) ∧ |
| 54 | SurgeryCanonicalOn F (Ico 0 t) r ∧ |
| 55 | ∃ x : (F.slice t).carrier, |
| 56 | r⁻¹ ^ 2 ≤ (F.connection t).scalarCurvature x ∧ |
| 57 | ¬ SurgeryCanonicalControl F t x F.parameters.epsilon F.parameters.C := by |
| 58 | obtain ⟨delta, hdelta, hlast, physical⟩ := |
| 59 | exists_firstFailure_exposed_physical_cap_cutoff_of_standard_cover P S p hp |
| 60 | (zero_lt_one.trans_le S.setup.C_large) cover r hr hle |
| 61 | refine ⟨delta, hdelta, hlast, ?_⟩ |
| 62 | intro F O hnext old admissible pinched _policy scales overlap hfail |
| 63 | have hT0 : 0 ≤ surgeryEpochStart p.i := by unfold surgeryEpochStart; positivity |
| 64 | have hold : SurgeryCanonicalOn F (Ico 0 (surgeryEpochStart p.i)) r := |
| 65 | (old.canonicalOn_prefixFinal hr hle).restrict |
| 66 | (fun _ ht => ⟨⟨ht.1, ht.2.trans hnext.1⟩, ht⟩) |
| 67 | obtain ⟨t, ht, hpast, b, htb, hJ, hfree, hbH, x, hscalar, |
| 68 | times, points, _hanti, htimes, hpoints, hbad⟩ := |
| 69 | exists_canonicalFailureSlabLimit P.m04 hT0 hold hfail |
| 70 | let slab := F.regular_slabs t b htb hJ hfree |
| 71 | let t0 : Icc t b := ⟨t, le_rfl, htb.le⟩ |
| 72 | have htF : t ∈ F.time_domain := hJ ⟨le_rfl, htb.le⟩ |
| 73 | have bad := fun n => (hbad n).2 |
| 74 | have noCap (N : CapCertificate (F.metric t)) |
| 75 | (he : N.epsilon = F.parameters.epsilon) (hC : N.cap_constant ≤ F.parameters.C) : |
| 76 | x ∉ N.core := by |
| 77 | have h := regularSlab_limit_not_cap P.m04 slab htF t0 times points x |
| 78 | htimes hpoints bad N he hC |
| 79 | simpa only [t0, slab.initial_identify] using h |
| 80 | have hnot : ¬ SurgeryCanonicalControl F t x F.parameters.epsilon F.parameters.C := by |
| 81 | intro hcanonical |
| 82 | cases hcanonical with |
| 83 | | cap N he hC _hconnection hx => exact noCap N he hC hx |
| 84 | | component N hx => |
| 85 | have h := regularSlab_limit_not_component P.m04 slab htF t0 times points x |
| 86 | htimes hpoints bad N |
| 87 | have h' : x ∉ N.carrier := by |
| 88 | simpa only [t0, slab.initial_identify] using h |
| 89 | exact h' hx |
| 90 | | round N hx => |
| 91 | have h := regularSlab_limit_not_round slab t0 times points x htimes hpoints bad N |
| 92 | have h' : x ∉ N.carrier := by |
| 93 | simpa only [t0, slab.initial_identify] using h |
| 94 | exact h' hx |
| 95 | | neck N hcenter => |
| 96 | have hhigh : r⁻¹ ^ 2 ≤ (F.connection t).scalarCurvature N.neck.center := by |
| 97 | simpa only [hcenter] using hscalar |
| 98 | have hQ : r⁻¹ ^ 2 ≤ N.neck.scale⁻¹ ^ 2 := by |
| 99 | rw [neck_scale_inverse_square N.neck, N.connection_eq] |
| 100 | exact hhigh |
| 101 | have hbottom := firstFailure_neck_bottom_after_overlap p hr hle ht.1 hQ |
| 102 | have hDomain : Ico (surgeryEpochStart (p.i - 1)) O.H ⊆ F.time_domain := by |
| 103 | intro s hs |
| 104 | apply O.interval_subset |
| 105 | exact ⟨(show 0 ≤ surgeryEpochStart (p.i - 1) by |
| 106 | unfold surgeryEpochStart; positivity).trans hs.1, hs.2⟩ |
| 107 | have hpointsN : Tendsto points atTop (𝓝 N.neck.center) := by |
| 108 | simpa only [hcenter] using hpoints |
| 109 | obtain ⟨E, hagree, hbased, hSurgery, contact⟩ := |
| 110 | regularSlab_limit_strongNeck_exposed_bottom P N hbottom ht.2 hDomain |
| 111 | htb hJ hfree times points htimes hpointsN bad |
| 112 | let U : TopologicalSpace.Opens (F.slice t).carrier := |
| 113 | ⟨N.neck.carrier, N.neck.carrier_open⟩ |
| 114 | let a := -(N.neck.scale⁻¹ ^ 2)⁻¹ |
| 115 | have ha : a ∈ Icc a 0 := |
| 116 | ⟨le_rfl, neg_nonpos.mpr (inv_pos.mpr N.cylinder.scale_pos).le⟩ |
| 117 | let : Nonempty (F.slice (t + a / 1)).carrier := ⟨E.forward a ha N.neck.center⟩ |
| 118 | obtain ⟨i, z, hzImage, hzCap⟩ := contact |
| 119 | obtain ⟨y, hy, hyz⟩ := hzImage |
| 120 | have hyCap : E.forward a ha y ∈ ((F.event (t + a / 1) hSurgery).caps i).carrier := |
| 121 | hyz.symm ▸ hzCap |
| 122 | obtain ⟨H, hHe, hHC, _hHD, hcore⟩ := physical F O hnext.2 old admissible pinched |
| 123 | scales (fun s hs => overlap s ⟨hs.1, hs.2.1, hs.1.2⟩) t ht hpast N hhigh |
| 124 | U rfl E hbased hagree hSurgery i ⟨y, hy⟩ hyCap |
| 125 | have hepsilon : H.epsilon = F.parameters.epsilon := by |
| 126 | rw [old.epsilon_eq, hp.setup_eq] |
| 127 | exact hHe |
| 128 | have hconstant : H.cap_constant ≤ F.parameters.C := by |
| 129 | rw [old.C_eq, hp.setup_eq] |
| 130 | exact hHC |
| 131 | exact noCap H hepsilon hconstant (by simpa only [hcenter] using hcore) |
| 132 | have htbad : t ∈ canonicalFailureTimes F O r := |
| 133 | ⟨⟨hT0.trans ht.1, ht.2⟩, x, hscalar, hnot⟩ |
| 134 | have hbound : ∀ s ∈ canonicalFailureTimes F O r, t ≤ s := |
| 135 | canonicalFailureTimes_lower_bound hpast |
| 136 | have hinf : t = sInf (canonicalFailureTimes F O r) := |
| 137 | le_antisymm (le_csInf ⟨t, htbad⟩ hbound) (csInf_le ⟨t, hbound⟩ htbad) |
| 138 | exact ⟨t, ht, hinf, hpast, x, hscalar, hnot⟩ |
| 139 | |
| 140 | end PoincareMT.Proofs.M47 |