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.Existence.InitialEstimates.EndCoordinates |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.RiemannianProper |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Imports.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Calculus.RiemannianProper |
| 4 | |
| 5 | /-! |
| 6 | # Open truncations and compact representative sets of a cap |
| 7 | |
| 8 | Morgan-Tian Theorem 12.5, p. 297. Cutting off a closed cylinder tail |
| 9 | gives the open pieces for the compact double. Cutting off an open tail |
| 10 | gives compact representative sets. These constructions use the supplied |
| 11 | end coordinates and do not assume that an arbitrary coordinate chart |
| 12 | extends its inverse through the cap core. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff |
| 19 | |
| 20 | namespace PoincareMT.M34 |
| 21 | |
| 22 | variable {g : RiemannianMetric 3 StandardCapSpace} |
| 23 | |
| 24 | /-- The cylinder tail with included cutoff cross-section |
| 25 | (Theorem 12.5 compact-double construction, p. 297). -/ |
| 26 | def endClosedTail (e : StandardCylindricalEnd g) (L : ℝ) : Set StandardCapSpace := |
| 27 | e.coordinate '' (univ ×ˢ Ici L) |
| 28 | |
| 29 | /-- The open cap obtained by removing a closed tail |
| 30 | (Theorem 12.5 compact-double construction, p. 297). -/ |
| 31 | def endTruncation (e : StandardCylindricalEnd g) (L : ℝ) : Set StandardCapSpace := |
| 32 | (endClosedTail e L)ᶜ |
| 33 | |
| 34 | /-- The closed cap obtained by removing an open tail |
| 35 | (Theorem 12.5 compact-double construction, p. 297). -/ |
| 36 | def endTruncatedCore (e : StandardCylindricalEnd g) (L : ℝ) : Set StandardCapSpace := |
| 37 | (e.coordinate '' (univ ×ˢ Ioi L))ᶜ |
| 38 | |
| 39 | /-- The supplied end carrier is closed in the original manifold topology |
| 40 | (Theorem 12.5 compact-double construction, p. 297). -/ |
| 41 | theorem end_carrier_isClosed (e : StandardCylindricalEnd g) : IsClosed e.carrier := by |
| 42 | let : MetricSpace StandardCapSpace := Proofs.M09.selectedMetricSpace g |
| 43 | rw [e.carrier_eq, ← compl_eq_univ_sdiff] |
| 44 | apply IsOpen.isClosed_compl |
| 45 | let : PseudoEMetricSpace StandardCapSpace := |
| 46 | (Proofs.M09.selectedMetricSpace g).toPseudoEMetricSpace |
| 47 | let : EDist StandardCapSpace := (Proofs.M09.selectedMetricSpace g).toEDist |
| 48 | change IsOpen {x : StandardCapSpace | edist 0 x < ENNReal.ofReal e.radius} |
| 49 | exact isOpen_lt (continuous_const.edist continuous_id) continuous_const |
| 50 | |
| 51 | /-- Tail membership is exactly end membership and an inverse-height |
| 52 | inequality (Theorem 12.5 compact-double construction, p. 297). -/ |
| 53 | theorem endClosedTail_eq (e : StandardCylindricalEnd g) {L : ℝ} (hL : 0 ≤ L) : |
| 54 | endClosedTail e L = e.carrier ∩ (fun x => (e.inverse x).2) ⁻¹' Ici L := by |
| 55 | ext x |
| 56 | constructor |
| 57 | · rintro ⟨z, hz, rfl⟩ |
| 58 | refine ⟨end_coordinate_mem_carrier e (hL.trans hz.2), ?_⟩ |
| 59 | change L ≤ (e.inverse (e.coordinate z)).2 |
| 60 | rw [e.coordinate_left_inverse ⟨mem_univ _, hL.trans hz.2⟩] |
| 61 | exact hz.2 |
| 62 | · rintro ⟨hx, hheight⟩ |
| 63 | exact ⟨e.inverse x, ⟨mem_univ _, hheight⟩, e.coordinate_right_inverse hx⟩ |
| 64 | |
| 65 | /-- A nonnegative-height closed tail is closed |
| 66 | (Theorem 12.5 compact-double construction, p. 297). -/ |
| 67 | theorem endClosedTail_isClosed (e : StandardCylindricalEnd g) |
| 68 | {L : ℝ} (hL : 0 ≤ L) : IsClosed (endClosedTail e L) := by |
| 69 | rw [endClosedTail_eq e hL] |
| 70 | exact e.inverse_smooth.continuousOn.snd.preimage_isClosed_of_isClosed |
| 71 | (end_carrier_isClosed e) isClosed_Ici |
| 72 | |
| 73 | /-- Positive-height truncations are open in the original cap |
| 74 | (Theorem 12.5 compact-double construction, p. 297). -/ |
| 75 | theorem endTruncation_isOpen (e : StandardCylindricalEnd g) |
| 76 | {L : ℝ} (hL : 0 ≤ L) : IsOpen (endTruncation e L) := |
| 77 | (endClosedTail_isClosed e hL).isOpen_compl |
| 78 | |
| 79 | /-- Increasing the cutoff enlarges the truncated cap |
| 80 | (Theorem 12.5 compact-double construction, p. 297). -/ |
| 81 | theorem endTruncation_mono (e : StandardCylindricalEnd g) |
| 82 | {L R : ℝ} (hLR : L ≤ R) : endTruncation e L ⊆ endTruncation e R := by |
| 83 | apply compl_subset_compl.mpr |
| 84 | exact image_mono (prod_mono_right (Ici_subset_Ici.mpr hLR)) |
| 85 | |
| 86 | /-- Coordinate membership in a truncated cap is the strict height bound |
| 87 | (Theorem 12.5 compact-double construction, p. 297). -/ |
| 88 | theorem endTruncation_coordinate_iff (e : StandardCylindricalEnd g) |
| 89 | {L : ℝ} (hL : 0 ≤ L) {z : StandardCylinderSpace} (hz : 0 ≤ z.2) : |
| 90 | e.coordinate z ∈ endTruncation e L ↔ z.2 < L := by |
| 91 | change e.coordinate z ∉ endClosedTail e L ↔ _ |
| 92 | rw [endClosedTail_eq e hL] |
| 93 | simp only [mem_inter_iff, end_coordinate_mem_carrier e hz, true_and, |
| 94 | mem_preimage, mem_Ici, e.coordinate_left_inverse ⟨mem_univ _, hz⟩, not_le] |
| 95 | |
| 96 | /-- Coordinate membership in the retained closed core includes the cutoff |
| 97 | cross-section (Theorem 12.5 compact-double construction, p. 297). -/ |
| 98 | theorem endTruncatedCore_coordinate_iff (e : StandardCylindricalEnd g) |
| 99 | {L : ℝ} (hL : 0 ≤ L) {z : StandardCylinderSpace} (hz : 0 ≤ z.2) : |
| 100 | e.coordinate z ∈ endTruncatedCore e L ↔ z.2 ≤ L := by |
| 101 | constructor |
| 102 | · intro hx |
| 103 | by_contra h |
| 104 | exact hx ⟨z, ⟨mem_univ _, lt_of_not_ge h⟩, rfl⟩ |
| 105 | · rintro hheight ⟨a, ha, heq⟩ |
| 106 | have haz : a = z := by |
| 107 | have hi := congrArg e.inverse heq |
| 108 | rwa [e.coordinate_left_inverse ⟨mem_univ _, hL.trans ha.2.le⟩, |
| 109 | e.coordinate_left_inverse ⟨mem_univ _, hz⟩] at hi |
| 110 | rw [haz] at ha |
| 111 | exact (not_lt_of_ge hheight) ha.2 |
| 112 | |
| 113 | /-- The retained closed core is compact even without identifying the |
| 114 | original core boundary with an inverse-coordinate level (Theorem 12.5, p. 297). -/ |
| 115 | theorem endTruncatedCore_isCompact (e : StandardCylindricalEnd g) |
| 116 | {L : ℝ} (hL : 0 ≤ L) : IsCompact (endTruncatedCore e L) := by |
| 117 | have hclosed : IsClosed (endTruncatedCore e L) := |
| 118 | (end_isOpen_coordinate_image e (isOpen_univ.prod isOpen_Ioi) |
| 119 | (fun z hz => hL.trans_lt hz.2)).isClosed_compl |
| 120 | have hstrip : IsCompact (e.coordinate '' (univ ×ˢ Icc (0 : ℝ) L)) := by |
| 121 | apply (isCompact_univ.prod isCompact_Icc).image_of_continuousOn |
| 122 | apply e.coordinate_smooth.continuousOn.mono |
| 123 | intro z hz |
| 124 | exact ⟨mem_univ _, by |
| 125 | change -e.collar < z.2 |
| 126 | linarith [hz.2.1, e.collar_pos]⟩ |
| 127 | apply (e.core_compact.union hstrip).of_isClosed_subset hclosed |
| 128 | intro x hx |
| 129 | by_cases hcore : x ∈ e.closed_core |
| 130 | · exact Or.inl hcore |
| 131 | have hcarrier : x ∈ e.carrier := by |
| 132 | rw [e.carrier_eq] |
| 133 | refine ⟨mem_univ _, fun hb => hcore ?_⟩ |
| 134 | rw [e.closed_core_eq] |
| 135 | exact (show g.edist 0 x < ENNReal.ofReal e.radius from hb).le |
| 136 | have hheight : (e.inverse x).2 ≤ L := by |
| 137 | by_contra h |
| 138 | exact hx ⟨e.inverse x, ⟨mem_univ _, lt_of_not_ge h⟩, e.coordinate_right_inverse hcarrier⟩ |
| 139 | exact Or.inr ⟨e.inverse x, |
| 140 | ⟨mem_univ _, e.inverse_domain x hcarrier, hheight⟩, e.coordinate_right_inverse hcarrier⟩ |
| 141 | |
| 142 | /-- A retained closed core lies in every truncation at larger height |
| 143 | (Theorem 12.5 compact-double construction, p. 297). -/ |
| 144 | theorem endTruncatedCore_subset_truncation (e : StandardCylindricalEnd g) |
| 145 | {L R : ℝ} (hLR : L < R) : endTruncatedCore e L ⊆ endTruncation e R := by |
| 146 | intro x hx htail |
| 147 | obtain ⟨z, hz, rfl⟩ := htail |
| 148 | exact hx ⟨z, ⟨mem_univ _, hLR.trans_le hz.2⟩, rfl⟩ |
| 149 | |
| 150 | /-- The truncations eventually contain every compact set of the original |
| 151 | cap, providing the fixed exhaustion charts for the flow limit |
| 152 | (Theorem 12.5 compact-double construction, p. 297). -/ |
| 153 | theorem endTruncation_contains_compact (e : StandardCylindricalEnd g) |
| 154 | {K : Set StandardCapSpace} (hK : IsCompact K) : |
| 155 | ∃ L : ℝ, 1 < L ∧ K ⊆ endTruncation e L := by |
| 156 | have hKC := hK.inter_right (end_carrier_isClosed e) |
| 157 | have hc : ContinuousOn (fun x => (e.inverse x).2) (K ∩ e.carrier) := |
| 158 | e.inverse_smooth.continuousOn.snd.mono inter_subset_right |
| 159 | obtain ⟨C, hC⟩ := (hKC.image_of_continuousOn hc).bddAbove |
| 160 | let L := max 1 C + 1 |
| 161 | have hL : 1 < L := by dsimp [L]; linarith [le_max_left (1 : ℝ) C] |
| 162 | refine ⟨L, hL, ?_⟩ |
| 163 | intro x hx htail |
| 164 | rw [endClosedTail_eq e (by linarith)] at htail |
| 165 | have hb := hC (mem_image_of_mem (fun y : StandardCapSpace => (e.inverse y).2) ⟨hx, htail.1⟩) |
| 166 | have hh : L ≤ (e.inverse x).2 := htail.2 |
| 167 | dsimp [L] at hh |
| 168 | linarith [le_max_right (1 : ℝ) C] |
| 169 | |
| 170 | end PoincareMT.M34 |