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.StandardCap.Persistence.Cylinder.CylinderChart |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Cylinder.Stopping.PreterminalTransport |
| 3 | |
| 4 | /-! |
| 5 | # Extending the tracked cylinder through a retained event |
| 6 | |
| 7 | Whole-region retention at one preterminal reference time extends the |
| 8 | actual cylinder through surgery and along the following ordinary |
| 9 | interval. All frozen slab and surgery compatibility fields are kept. |
| 10 | Morgan--Tian, Proposition 16.5, pp. 374-375; see derivation 54. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M44 |
| 21 | |
| 22 | variable {F : SurgeryFlowData.{u}} {C : GeneralizedSliceCarrier.{u}} |
| 23 | {origin scale c d : ℝ} {U : Set C.carrier} |
| 24 | |
| 25 | /-- Retention of the whole tracked open region extends its actual |
| 26 | cylinder across one surgery and through the following surgery-free |
| 27 | interval. The forward maps agree exactly on the original interval. |
| 28 | Source: Proposition 16.5, pp. 374-375; M44 derivation 54. -/ |
| 29 | theorem exists_cylinder_across_retained_event |
| 30 | (e : SurgeryFlowCylinder F C origin scale (Ico 0 c) U) |
| 31 | (hU : IsOpen U) (hc : 0 < c) (hcd : c < d) |
| 32 | (hT : origin + c / scale ∈ F.surgery_times) |
| 33 | [Nonempty (F.slice (origin + c / scale)).carrier] |
| 34 | (hpre : Disjoint F.surgery_times |
| 35 | (Ioo (F.event (origin + c / scale) hT).tMinus (origin + c / scale))) |
| 36 | (hJ : Ico (origin + c / scale) (origin + d / scale) ⊆ F.time_domain) |
| 37 | (hNo : Disjoint F.surgery_times (Ioo (origin + c / scale) (origin + d / scale))) |
| 38 | (r : ℝ) (hr : r ∈ Ico 0 c) |
| 39 | (hr' : origin + r / scale ∈ |
| 40 | Ico (F.event (origin + c / scale) hT).tMinus (origin + c / scale)) |
| 41 | (hret : ∀ x ∈ U, ((F.event (origin + c / scale) hT).pre_identify |
| 42 | ⟨origin + r / scale, hr'⟩).symm (e.forward r hr x) ∈ |
| 43 | interior (F.event (origin + c / scale) hT).retained_pre) : |
| 44 | ∃ e' : SurgeryFlowCylinder F C origin scale (Ico 0 d) U, |
| 45 | (∀ s (hs : s ∈ Ico 0 c) (hs' : s ∈ Ico 0 d) x, |
| 46 | e'.forward s hs' x = e.forward s hs x) ∧ |
| 47 | ∀ x, e'.forward c ⟨hc.le, hcd⟩ x = |
| 48 | (F.event (origin + c / scale) hT).retention.map |
| 49 | (((F.event (origin + c / scale) hT).pre_identify |
| 50 | ⟨origin + r / scale, hr'⟩).symm (e.forward r hr x)) := by |
| 51 | classical |
| 52 | let bridge := cylinderRetainedChart e hU hT r hr hr' |
| 53 | have hbridge : bridge.source = U := cylinderRetainedChart_source e hU hT r hr hr' hret |
| 54 | have hclock : StrictMono (fun s : ℝ => origin + s / scale) := by |
| 55 | intro s t hst |
| 56 | dsimp only |
| 57 | linarith [(div_lt_div_iff_of_pos_right e.scale_pos).mpr hst] |
| 58 | have hpostTime (s : ℝ) (hs : s < d) (hcs : c ≤ s) : |
| 59 | origin + s / scale ∈ Ico (origin + c / scale) (origin + d / scale) := |
| 60 | ⟨hclock.monotone hcs, hclock hs⟩ |
| 61 | let post (s : ℝ) (hs : s < d) (hcs : c ≤ s) := |
| 62 | F.regularIdentifyIco hJ hNo ⟨origin + s / scale, hpostTime s hs hcs⟩ |
| 63 | let chart (s : ℝ) (hs : s ∈ Ico 0 d) : |
| 64 | PartialDiffeomorph (𝓡 3) (𝓡 3) C.carrier |
| 65 | (F.slice (origin + s / scale)).carrier ∞ := |
| 66 | if hsc : s < c then cylinderSliceChart e hU s ⟨hs.1, hsc⟩ |
| 67 | else bridge.trans (post s hs.2 (le_of_not_gt hsc)).toPartialDiffeomorph |
| 68 | have hsource (s : ℝ) (hs : s ∈ Ico 0 d) : (chart s hs).source = U := by |
| 69 | dsimp only [chart] |
| 70 | split_ifs |
| 71 | · rfl |
| 72 | · change bridge.source ∩ bridge ⁻¹' (univ : Set (F.slice (origin + c / scale)).carrier) = U |
| 73 | simp only [preimage_univ, inter_univ, hbridge] |
| 74 | have hbefore (s : ℝ) (hs : s ∈ Ico 0 d) (hsc : s < c) (x : C.carrier) : |
| 75 | chart s hs x = e.forward s ⟨hs.1, hsc⟩ x := by |
| 76 | dsimp only [chart] |
| 77 | rw [dif_pos hsc] |
| 78 | rfl |
| 79 | have hafter (s : ℝ) (hs : s ∈ Ico 0 d) (hcs : c ≤ s) (x : C.carrier) : |
| 80 | chart s hs x = post s hs.2 hcs (bridge x) := by |
| 81 | dsimp only [chart] |
| 82 | rw [dif_neg (not_lt_of_ge hcs)] |
| 83 | rfl |
| 84 | have hpost_initial (hs : c < d) (y : (F.slice (origin + c / scale)).carrier) : |
| 85 | post c hs le_rfl y = y := by |
| 86 | dsimp only [post, SurgeryFlowData.regularIdentifyIco] |
| 87 | exact SurgeryRegularSlab.initial_identify _ y |
| 88 | have hlater_event (s : ℝ) (hs : s ∈ Ico 0 d) (hcs : c ≤ s) |
| 89 | (hsurgery : origin + s / scale ∈ F.surgery_times) : s = c := by |
| 90 | apply le_antisymm _ hcs |
| 91 | by_contra hsc |
| 92 | exact Set.disjoint_left.mp hNo hsurgery ⟨hclock (lt_of_not_ge hsc), hclock hs.2⟩ |
| 93 | let e' : SurgeryFlowCylinder F C origin scale (Ico 0 d) U := { |
| 94 | scale_pos := e.scale_pos |
| 95 | interval_connected := ordConnected_Ico |
| 96 | time_subset := by |
| 97 | rintro _ ⟨s, hs, rfl⟩ |
| 98 | by_cases hsc : s < c |
| 99 | · exact e.time_subset (mem_image_of_mem _ ⟨hs.1, hsc⟩) |
| 100 | · exact hJ (hpostTime s hs.2 (le_of_not_gt hsc)) |
| 101 | forward := fun s hs => chart s hs |
| 102 | inverse := fun s hs => (chart s hs).symm |
| 103 | forward_smooth := by |
| 104 | intro s hs |
| 105 | simpa only [hsource] using (chart s hs).contMDiffOn |
| 106 | inverse_smooth := by |
| 107 | intro s hs |
| 108 | have himage : chart s hs '' U = (chart s hs).target := by |
| 109 | rw [← hsource s hs] |
| 110 | exact (chart s hs).toPartialEquiv.image_source_eq_target |
| 111 | rw [himage] |
| 112 | exact (chart s hs).contMDiffOn_invFun |
| 113 | left_inverse := by |
| 114 | intro s hs x hx |
| 115 | exact (chart s hs).left_inv (hsource s hs ▸ hx) |
| 116 | right_inverse := by |
| 117 | intro s hs y hy |
| 118 | rcases hy with ⟨x, hx, rfl⟩ |
| 119 | exact (chart s hs).right_inv ((chart s hs).map_source (hsource s hs ▸ hx)) |
| 120 | slab_compatibility := by |
| 121 | intro a b hab hK hfree s hs t ht hs' ht' x hx |
| 122 | by_cases hsc : s < c |
| 123 | · by_cases htc : t < c |
| 124 | · rw [hbefore s hs hsc x, hbefore t ht htc x] |
| 125 | exact e.slab_compatibility a b hab hK hfree |
| 126 | s ⟨hs.1, hsc⟩ t ⟨ht.1, htc⟩ hs' ht' x hx |
| 127 | · exact (Set.disjoint_left.mp hfree hT |
| 128 | ⟨hs'.1.trans_lt (hclock hsc), |
| 129 | (hclock.monotone (le_of_not_gt htc)).trans ht'.2⟩).elim |
| 130 | · by_cases htc : t < c |
| 131 | · exact (Set.disjoint_left.mp hfree hT |
| 132 | ⟨ht'.1.trans_lt (hclock htc), |
| 133 | (hclock.monotone (le_of_not_gt hsc)).trans hs'.2⟩).elim |
| 134 | · rw [hafter s hs (le_of_not_gt hsc) x, hafter t ht (le_of_not_gt htc) x] |
| 135 | exact F.regularIdentifyIco_transport hJ hNo hab hK hfree |
| 136 | ⟨origin + s / scale, hpostTime s hs.2 (le_of_not_gt hsc)⟩ |
| 137 | ⟨origin + t / scale, hpostTime t ht.2 (le_of_not_gt htc)⟩ hs' ht' (bridge x) |
| 138 | retained_at_surgery := by |
| 139 | intro s hs hsurgery _ hearlier |
| 140 | rintro _ ⟨x, hx, rfl⟩ |
| 141 | by_cases hsc : s < c |
| 142 | · rw [hbefore s hs hsc x] |
| 143 | obtain ⟨t, ht, hts⟩ := hearlier |
| 144 | exact e.retained_at_surgery s ⟨hs.1, hsc⟩ hsurgery |
| 145 | ⟨t, ⟨ht.1, hts.trans hsc⟩, hts⟩ (mem_image_of_mem _ hx) |
| 146 | · have hseq := hlater_event s hs (le_of_not_gt hsc) hsurgery |
| 147 | subst s |
| 148 | rw [hafter c hs le_rfl x, hpost_initial hs.2] |
| 149 | exact cylinderRetainedChart_mem_retained e hU hT r hr hr' hret hx |
| 150 | pre_retained_at_surgery := by |
| 151 | intro s hs hsurgery _ t ht ht' x hx |
| 152 | have hts : t < s := hclock.lt_iff_lt.mp ht'.2 |
| 153 | by_cases hsc : s < c |
| 154 | · rw [hbefore t ht (hts.trans hsc) x] |
| 155 | exact e.pre_retained_at_surgery s ⟨hs.1, hsc⟩ hsurgery |
| 156 | t ⟨ht.1, hts.trans hsc⟩ ht' x hx |
| 157 | · have hseq := hlater_event s hs (le_of_not_gt hsc) hsurgery |
| 158 | subst s |
| 159 | rw [hbefore t ht hts x] |
| 160 | rw [cylinder_preterminal_coordinates_eq e hT hpre |
| 161 | t ⟨ht.1, hts⟩ r hr ht' hr' x hx] |
| 162 | exact hret x hx |
| 163 | surgery_compatibility := by |
| 164 | intro s hs hsurgery _ t ht ht' x hx |
| 165 | have hts : t < s := hclock.lt_iff_lt.mp ht'.2 |
| 166 | by_cases hsc : s < c |
| 167 | · rw [hbefore t ht (hts.trans hsc) x, hbefore s hs hsc x] |
| 168 | exact e.surgery_compatibility s ⟨hs.1, hsc⟩ hsurgery |
| 169 | t ⟨ht.1, hts.trans hsc⟩ ht' x hx |
| 170 | · have hseq := hlater_event s hs (le_of_not_gt hsc) hsurgery |
| 171 | subst s |
| 172 | rw [hbefore t ht hts x, hafter c hs le_rfl x, hpost_initial hs.2] |
| 173 | rw [cylinder_preterminal_coordinates_eq e hT hpre |
| 174 | t ⟨ht.1, hts⟩ r hr ht' hr' x hx] |
| 175 | rfl |
| 176 | } |
| 177 | refine ⟨e', ?_, ?_⟩ |
| 178 | · intro s hs hs' x |
| 179 | exact hbefore s hs' hs.2 x |
| 180 | · intro x |
| 181 | change chart c ⟨hc.le, hcd⟩ x = _ |
| 182 | rw [hafter c ⟨hc.le, hcd⟩ le_rfl x, hpost_initial hcd] |
| 183 | rfl |
| 184 | |
| 185 | end PoincareMT.M44 |