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.Induction.Noncollapse.Assembly.PositiveComponents.PositiveLocalIsometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Noncollapse.Assembly.SurgeryComponentLabels |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Limit.Retained.RetainedChart |
| 4 | |
| 5 | /-! |
| 6 | # Positive sectional curvature on actual surgery pieces |
| 7 | |
| 8 | Morgan--Tian pp. 361-363 and the positive-component argument on p. 393. |
| 9 | The stored whole-output preservation gives positivity on closed caps. |
| 10 | The actual retained metric identification is used on its open interior. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.Proofs.M46 |
| 22 | |
| 23 | variable {g0 : StandardInitialMetric} {K : MetricSurgeryConstants} {P : SurgeryParameters} |
| 24 | {slice : ℝ → GeneralizedSliceCarrier.{u}} |
| 25 | {metric : ∀ t, RiemannianMetric 3 (slice t).carrier} {T : ℝ} |
| 26 | |
| 27 | /-- Positivity of the entire terminal input neck gives positivity on |
| 28 | the actual closed cap, including its attachment frontier, p. 393. -/ |
| 29 | theorem positive_sectional_on_surgery_cap |
| 30 | (event : SurgeryEventData g0 K P slice metric T) |
| 31 | (D : LeviCivitaData (metric T)) (i : Fin event.cap_count) |
| 32 | (hneck : ∀ x ∈ (event.necks i).neck.carrier, |
| 33 | ∀ u v : TangentSpace (𝓡 3) x, |
| 34 | LeviCivitaData.IsOrthonormalPair event.limit_metric x u v → |
| 35 | 0 < event.limit_connection.sectionalCurvature x u v) : |
| 36 | ∀ y ∈ (event.caps i).carrier, ∀ u v : TangentSpace (𝓡 3) y, |
| 37 | LeviCivitaData.IsOrthonormalPair (metric T) y u v → |
| 38 | 0 < D.sectionalCurvature y u v := by |
| 39 | have hlocal := (event.local_result i).positive_sectional_preserved |
| 40 | (fun x hx => (sectional_positive_iff_connection event.limit_connection |
| 41 | (event.necks i).neck.connection x).mp (hneck x hx)) |
| 42 | intro y hy |
| 43 | rw [← event.local_cap_image i] at hy |
| 44 | obtain ⟨x, _, rfl⟩ := hy |
| 45 | exact (sectional_positive_iff_of_local_isometry (event.local_result i).connection D |
| 46 | isOpen_univ (event.local_embed_smooth i).contMDiffOn |
| 47 | (fun z _ u v => (event.local_metric i z u v).symm) (mem_univ x)).mp (hlocal x) |
| 48 | |
| 49 | /-- Outside every closed cap, a retained preimage is in the retained |
| 50 | interior; attachment-frontier points have already been covered by caps. -/ |
| 51 | theorem retained_interior_of_not_in_caps |
| 52 | (event : SurgeryEventData g0 K P slice metric T) |
| 53 | {x : (slice event.tMinus).carrier} (hx : x ∈ event.retained_pre) |
| 54 | (hcap : ∀ i, event.retention.map x ∉ (event.caps i).carrier) : |
| 55 | x ∈ interior event.retained_pre := by |
| 56 | by_contra hnot |
| 57 | have hb : x ∈ frontier event.retained_pre := by |
| 58 | rw [frontier, event.retained_pre_compact.isClosed.closure_eq] |
| 59 | exact ⟨hx, hnot⟩ |
| 60 | rw [event.pre_boundary] at hb |
| 61 | obtain ⟨i, hi⟩ := mem_iUnion.mp hb |
| 62 | have hfront : event.retention.map x ∈ frontier (event.caps i).carrier := |
| 63 | event.boundary_correspondence i ▸ mem_image_of_mem event.retention.map hi |
| 64 | exact hcap i ((event.caps i).carrier_compact.isClosed.frontier_subset hfront) |
| 65 | |
| 66 | /-- The actual retained map, viewed from the terminal carrier, is |
| 67 | smooth and preserves the metric on the open retained interior. -/ |
| 68 | theorem retained_terminal_metric_identification |
| 69 | (event : SurgeryEventData g0 K P slice metric T) : |
| 70 | let U := event.limit_identify.inverse ⁻¹' interior event.retained_pre |
| 71 | let f := event.retention.map ∘ event.limit_identify.inverse |
| 72 | IsOpen U ∧ ContMDiffOn (𝓡 3) (𝓡 3) ∞ f U ∧ |
| 73 | ∀ y ∈ U, ∀ u v : TangentSpace (𝓡 3) y, |
| 74 | event.limit_metric.inner y u v = (metric T).inner (f y) |
| 75 | (mfderiv (𝓡 3) (𝓡 3) f y u) (mfderiv (𝓡 3) (𝓡 3) f y v) := by |
| 76 | dsimp only |
| 77 | let U := event.limit_identify.inverse ⁻¹' interior event.retained_pre |
| 78 | have hinv : ContMDiff (𝓡 3) (𝓡 3) ∞ event.limit_identify.inverse := |
| 79 | contMDiffOn_univ.mp event.limit_identify.inverse_smooth |
| 80 | have hU : IsOpen U := isOpen_interior.preimage hinv.continuous |
| 81 | have hret : ContMDiffOn (𝓡 3) (𝓡 3) ∞ event.retention.map |
| 82 | (interior event.retained_pre) := event.retention.map_smooth.mono interior_subset |
| 83 | have hf : ContMDiffOn (𝓡 3) (𝓡 3) ∞ |
| 84 | (event.retention.map ∘ event.limit_identify.inverse) U := |
| 85 | hret.comp hinv.contMDiffOn (fun _ hy => hy) |
| 86 | refine ⟨hU, hf, ?_⟩ |
| 87 | intro y hy u v |
| 88 | have hiy : event.limit_identify.inverse y ∈ interior event.retained_pre := hy |
| 89 | have hr : event.limit_identify.inverse y ∈ event.regular_limit := |
| 90 | event.retained_pre_subset (interior_subset hiy) |
| 91 | have hdret := (hret.contMDiffAt (isOpen_interior.mem_nhds hiy)).mdifferentiableAt |
| 92 | (by simp) |
| 93 | have hdlim := (event.limit_identify.map_smooth.contMDiffAt |
| 94 | (event.regular_limit_open.mem_nhds hr)).mdifferentiableAt (by simp) |
| 95 | have hdinv := (hinv y).mdifferentiableAt (by simp) |
| 96 | have hright : event.limit_identify.map ∘ event.limit_identify.inverse = id := |
| 97 | funext (fun z => event.limit_identify.right_inverse (mem_univ z)) |
| 98 | have hpull : |
| 99 | event.limit_metric.inner |
| 100 | ((event.limit_identify.map ∘ event.limit_identify.inverse) y) |
| 101 | (mfderiv (𝓡 3) (𝓡 3) |
| 102 | (event.limit_identify.map ∘ event.limit_identify.inverse) y u) |
| 103 | (mfderiv (𝓡 3) (𝓡 3) |
| 104 | (event.limit_identify.map ∘ event.limit_identify.inverse) y v) = |
| 105 | event.limit_metric.inner y u v := by |
| 106 | rw [hright] |
| 107 | simp only [id_eq, mfderiv_id, ContinuousLinearMap.id_apply] |
| 108 | rw [mfderiv_comp y hdlim hdinv] at hpull |
| 109 | rw [mfderiv_comp y hdret hdinv] |
| 110 | change event.limit_metric.inner y u v = (metric T).inner |
| 111 | (event.retention.map (event.limit_identify.inverse y)) |
| 112 | (mfderiv (𝓡 3) (𝓡 3) event.retention.map (event.limit_identify.inverse y) |
| 113 | (mfderiv (𝓡 3) (𝓡 3) event.limit_identify.inverse y u)) |
| 114 | (mfderiv (𝓡 3) (𝓡 3) event.retention.map (event.limit_identify.inverse y) |
| 115 | (mfderiv (𝓡 3) (𝓡 3) event.limit_identify.inverse y v)) |
| 116 | rw [event.retained_metric _ (interior_subset hiy)] |
| 117 | exact hpull.symm |
| 118 | |
| 119 | /-- The open retained interior inherits terminal strict positivity. -/ |
| 120 | theorem positive_sectional_on_retained_interior |
| 121 | (event : SurgeryEventData g0 K P slice metric T) |
| 122 | (D : LeviCivitaData (metric T)) |
| 123 | {x : (slice event.tMinus).carrier} (hx : x ∈ interior event.retained_pre) |
| 124 | (hpos : ∀ u v : TangentSpace (𝓡 3) (event.limit_identify.map x), |
| 125 | LeviCivitaData.IsOrthonormalPair event.limit_metric (event.limit_identify.map x) u v → |
| 126 | 0 < event.limit_connection.sectionalCurvature (event.limit_identify.map x) u v) : |
| 127 | ∀ u v : TangentSpace (𝓡 3) (event.retention.map x), |
| 128 | LeviCivitaData.IsOrthonormalPair (metric T) (event.retention.map x) u v → |
| 129 | 0 < D.sectionalCurvature (event.retention.map x) u v := by |
| 130 | obtain ⟨hU, hf, hm⟩ := retained_terminal_metric_identification event |
| 131 | have hreg := event.retained_pre_subset (interior_subset hx) |
| 132 | have hleft := event.limit_identify.left_inverse hreg |
| 133 | have hy : event.limit_identify.map x ∈ |
| 134 | event.limit_identify.inverse ⁻¹' interior event.retained_pre := by |
| 135 | change event.limit_identify.inverse (event.limit_identify.map x) ∈ |
| 136 | interior event.retained_pre |
| 137 | rwa [hleft] |
| 138 | have h := (sectional_positive_iff_of_local_isometry event.limit_connection D |
| 139 | hU hf hm hy).mp hpos |
| 140 | exact congrArg event.retention.map hleft ▸ h |
| 141 | |
| 142 | /-- Every actual post-point with a positive old label is positive, |
| 143 | including points on the cap attachment frontier, p. 393. -/ |
| 144 | theorem positive_sectional_on_postLabel |
| 145 | (event : SurgeryEventData g0 K P slice metric T) |
| 146 | (D : LeviCivitaData (metric T)) |
| 147 | {S : Set (slice event.tMinus).carrier} (hS : IsClopen S) |
| 148 | (hterminal : ∀ x ∈ S, x ∈ event.regular_limit → |
| 149 | ∀ u v : TangentSpace (𝓡 3) (event.limit_identify.map x), |
| 150 | LeviCivitaData.IsOrthonormalPair event.limit_metric |
| 151 | (event.limit_identify.map x) u v → |
| 152 | 0 < event.limit_connection.sectionalCurvature (event.limit_identify.map x) u v) : |
| 153 | ∀ y ∈ surgeryPostLabel event S, ∀ u v : TangentSpace (𝓡 3) y, |
| 154 | LeviCivitaData.IsOrthonormalPair (metric T) y u v → |
| 155 | 0 < D.sectionalCurvature y u v := by |
| 156 | have hcappos (i : Fin event.cap_count) (hi : preAttachment event i ⊆ S) : |
| 157 | ∀ y ∈ (event.caps i).carrier, ∀ u v : TangentSpace (𝓡 3) y, |
| 158 | LeviCivitaData.IsOrthonormalPair (metric T) y u v → |
| 159 | 0 < D.sectionalCurvature y u v := by |
| 160 | apply positive_sectional_on_surgery_cap event D i |
| 161 | intro z hz |
| 162 | have hlabel := inverse_neck_subset_of_attachment_label event hS i hi |
| 163 | (mem_image_of_mem event.limit_identify.inverse hz) |
| 164 | have hreg : event.limit_identify.inverse z ∈ event.regular_limit := |
| 165 | event.limit_identify.inverse_image.subset |
| 166 | (mem_image_of_mem event.limit_identify.inverse (mem_univ z)) |
| 167 | have h := hterminal _ hlabel hreg |
| 168 | rwa [event.limit_identify.right_inverse (mem_univ z)] at h |
| 169 | intro y hy |
| 170 | by_cases hcap : ∃ i, y ∈ (event.caps i).carrier |
| 171 | · obtain ⟨i, hi⟩ := hcap |
| 172 | rcases disjoint_or_subset_of_isClopen |
| 173 | (preAttachment_isConnected event i).isPreconnected hS with hd | hl |
| 174 | · have hother : preAttachment event i ⊆ Sᶜ := fun x hx hxs => |
| 175 | Set.disjoint_left.mp hd hx hxs |
| 176 | exact False.elim (Set.disjoint_left.mp (surgeryPostLabel_disjoint event S) |
| 177 | hy (Or.inr (mem_iUnion.mpr ⟨⟨i, hother⟩, hi⟩))) |
| 178 | · exact hcappos i hl y hi |
| 179 | · rcases hy with ⟨x, hx, rfl⟩ | hy |
| 180 | · have hnocap : ∀ i, event.retention.map x ∉ (event.caps i).carrier := |
| 181 | fun i hi => hcap ⟨i, hi⟩ |
| 182 | exact positive_sectional_on_retained_interior event D |
| 183 | (retained_interior_of_not_in_caps event hx.1 hnocap) |
| 184 | (hterminal x hx.2 (event.retained_pre_subset hx.1)) |
| 185 | · obtain ⟨⟨i, _⟩, hi⟩ := mem_iUnion.mp hy |
| 186 | exact False.elim (hcap ⟨i, hi⟩) |
| 187 | |
| 188 | /-- The connected child of a retained positive old component is |
| 189 | positive throughout; the clopen post label excludes merging, p. 393. -/ |
| 190 | theorem positive_sectional_child_component |
| 191 | (event : SurgeryEventData g0 K P slice metric T) |
| 192 | (D : LeviCivitaData (metric T)) |
| 193 | {S : Set (slice event.tMinus).carrier} (hS : IsClopen S) |
| 194 | (hterminal : ∀ x ∈ S, x ∈ event.regular_limit → |
| 195 | ∀ u v : TangentSpace (𝓡 3) (event.limit_identify.map x), |
| 196 | LeviCivitaData.IsOrthonormalPair event.limit_metric |
| 197 | (event.limit_identify.map x) u v → |
| 198 | 0 < event.limit_connection.sectionalCurvature (event.limit_identify.map x) u v) |
| 199 | {x : (slice event.tMinus).carrier} (hx : x ∈ event.retained_pre ∩ S) : |
| 200 | ∀ y ∈ connectedComponent (event.retention.map x), |
| 201 | ∀ u v : TangentSpace (𝓡 3) y, |
| 202 | LeviCivitaData.IsOrthonormalPair (metric T) y u v → |
| 203 | 0 < D.sectionalCurvature y u v := by |
| 204 | have hxLabel : event.retention.map x ∈ surgeryPostLabel event S := |
| 205 | Or.inl ⟨x, hx, rfl⟩ |
| 206 | have hC := (surgeryPostLabel_isClopen event hS).connectedComponent_subset hxLabel |
| 207 | exact fun y hy => positive_sectional_on_postLabel event D hS hterminal y (hC hy) |
| 208 | |
| 209 | end PoincareMT.Proofs.M46 |