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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.SourceGeometry.Ends.SourceTubeVolume |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.NeckGeometry.NeckPairCoreCapture |
| 4 | |
| 5 | /-! |
| 6 | # Compact middle and literal end tails of the retained source tube |
| 7 | |
| 8 | The actual adjacent edge packets capture every interior outer tail in |
| 9 | a neighboring three-quarter core. The only remaining tails are those |
| 10 | of the first and last selected necks. Morgan--Tian Claim 10.8, p. 254, |
| 11 | and Appendix A.11; M28 derivation 89. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M28.SourceTubeData |
| 23 | |
| 24 | variable {epsilon C A D₀ D : ℝ} |
| 25 | {E : SameTimeCounterexample.{u} epsilon C A D₀ D} |
| 26 | {S : CounterexampleNeckSegment E} |
| 27 | |
| 28 | /-- The finite union of closed cores of the same selected oriented necks |
| 29 | (Claim 10.8; derivation 89). -/ |
| 30 | def coreUnion (T : SourceTubeData S) (theta : ℝ) : Set (E.flow.slice E.time).carrier := |
| 31 | ⋃ i ∈ Finset.range T.list.nodes.length, |
| 32 | (T.list.node (i : ℤ)).2.coordinate_map '' |
| 33 | (univ ×ˢ Icc (-(theta * epsilon⁻¹)) (theta * epsilon⁻¹)) |
| 34 | |
| 35 | /-- Every buffered closed core is compact and belongs to the actual tube |
| 36 | (Claim 10.8; derivation 89). No uniform neck count is needed. -/ |
| 37 | theorem coreUnion_compact_subset (T : SourceTubeData S) {theta : ℝ} |
| 38 | (htheta : theta < 1) : |
| 39 | IsCompact (T.coreUnion theta) ∧ T.coreUnion theta ⊆ T.carrierOpen := by |
| 40 | have hA : 0 < epsilon⁻¹ := inv_pos.mpr (S.cover_epsilon ▸ S.cover.epsilon_pos) |
| 41 | have hwidth : theta * epsilon⁻¹ < epsilon⁻¹ := by nlinarith only [htheta, hA] |
| 42 | have hactive (i : ℕ) (hi : i ∈ Finset.range T.list.nodes.length) : |
| 43 | (i : ℤ) ∈ T.list.active := by |
| 44 | change 0 ≤ (i : ℤ) ∧ (i : ℤ) ≤ (T.list.nodes.length : ℤ) - 1 |
| 45 | have := Finset.mem_range.mp hi |
| 46 | omega |
| 47 | constructor |
| 48 | · apply (Finset.range T.list.nodes.length).isCompact_biUnion |
| 49 | intro i hi |
| 50 | apply (T.list.node (i : ℤ)).2.isCompact_coordinate_slab_intrinsic |
| 51 | · rw [T.list.node_epsilon (hactive i hi)] |
| 52 | linarith only [hwidth] |
| 53 | · rw [T.list.node_epsilon (hactive i hi)] |
| 54 | exact hwidth |
| 55 | · intro x hx |
| 56 | obtain ⟨i, hi, hx⟩ := mem_iUnion₂.mp hx |
| 57 | have hxN : x ∈ (T.list.node (i : ℤ)).2.carrier := by |
| 58 | apply (T.list.node (i : ℤ)).2.coordinate_slab_subset_carrier_m28 _ _ hx |
| 59 | · rw [T.list.node_epsilon (hactive i hi)] |
| 60 | linarith only [hwidth] |
| 61 | · rw [T.list.node_epsilon (hactive i hi)] |
| 62 | exact hwidth |
| 63 | rw [T.carrier_eq_iUnion_nodes] |
| 64 | exact mem_iUnion₂.mpr ⟨i, hi, hxN⟩ |
| 65 | |
| 66 | /-- Outside the finite closed cores, a point of the retained tube lies |
| 67 | in the literal first negative or last positive tail. The actual forward |
| 68 | and reciprocal edge packets prove this alternative (Claim 10.8; |
| 69 | Appendix A.11; derivation 89). -/ |
| 70 | theorem subset_coreUnion_end_tails (T : SourceTubeData S) |
| 71 | (hepsilon : epsilon ≤ (1 / 1000 : ℝ)) {theta : ℝ} |
| 72 | (htheta : (3 / 4 : ℝ) ≤ theta) : |
| 73 | (T.carrierOpen : Set _) ⊆ T.coreUnion theta ∪ |
| 74 | (T.list.node 0).2.region (-epsilon⁻¹) (-(theta * epsilon⁻¹)) ∪ |
| 75 | (T.list.node ((T.list.nodes.length - 1 : ℕ) : ℤ)).2.region |
| 76 | (theta * epsilon⁻¹) epsilon⁻¹ := by |
| 77 | have hA : 0 < epsilon⁻¹ := inv_pos.mpr (S.cover_epsilon ▸ S.cover.epsilon_pos) |
| 78 | have hwidth : 3 * epsilon⁻¹ / 4 ≤ theta * epsilon⁻¹ := by |
| 79 | nlinarith only [mul_le_mul_of_nonneg_right htheta hA.le] |
| 80 | have hactive (i : ℕ) (hi : i < T.list.nodes.length) : |
| 81 | (i : ℤ) ∈ T.list.active := by |
| 82 | change 0 ≤ (i : ℤ) ∧ (i : ℤ) ≤ (T.list.nodes.length : ℤ) - 1 |
| 83 | omega |
| 84 | have hcore (i : ℕ) (hi : i < T.list.nodes.length) |
| 85 | {x : (E.flow.slice E.time).carrier} (hx : x ∈ (T.list.node (i : ℤ)).2.carrier) |
| 86 | (hlo : -(theta * epsilon⁻¹) ≤ ((T.list.node (i : ℤ)).2.coordinate_inverse x).2) |
| 87 | (hhi : ((T.list.node (i : ℤ)).2.coordinate_inverse x).2 ≤ theta * epsilon⁻¹) : |
| 88 | x ∈ T.coreUnion theta := |
| 89 | mem_iUnion₂.mpr ⟨i, Finset.mem_range.mpr hi, |
| 90 | (T.list.node (i : ℤ)).2.coordinate_inverse x, ⟨mem_univ _, hlo, hhi⟩, |
| 91 | (T.list.node (i : ℤ)).2.coordinate_map_coordinate_inverse hx⟩ |
| 92 | intro x hx |
| 93 | rw [T.carrier_eq_iUnion_nodes] at hx |
| 94 | obtain ⟨i, hi, hx⟩ := mem_iUnion₂.mp hx |
| 95 | have hi' : i < T.list.nodes.length := Finset.mem_range.mp hi |
| 96 | have heps := T.list.node_epsilon (hactive i hi') |
| 97 | have hcoord := ((T.list.node (i : ℤ)).2.coordinate_inverse_mem x hx).2 |
| 98 | by_cases hlo : -(theta * epsilon⁻¹) ≤ |
| 99 | ((T.list.node (i : ℤ)).2.coordinate_inverse x).2 |
| 100 | · by_cases hhi : ((T.list.node (i : ℤ)).2.coordinate_inverse x).2 ≤ theta * epsilon⁻¹ |
| 101 | · exact Or.inl (Or.inl (hcore i hi' hx hlo hhi)) |
| 102 | · have hhigh := lt_of_not_ge hhi |
| 103 | by_cases hlast : i = T.list.nodes.length - 1 |
| 104 | · apply Or.inr |
| 105 | subst i |
| 106 | exact ⟨hx, hhigh, by simpa only [heps] using hcoord.2⟩ |
| 107 | · have hnext : i + 1 < T.list.nodes.length := by omega |
| 108 | have hindex : ((i + 1 : ℕ) : ℤ) = (i : ℤ) + 1 := by omega |
| 109 | obtain ⟨_, _, Hedge, _⟩ := T.list.node_edge (hactive i hi') |
| 110 | (by simpa only [hindex] using hactive (i + 1) hnext) |
| 111 | have hsmall : (T.list.node (i : ℤ)).2.epsilon ≤ 1 / 1000 := by |
| 112 | rw [heps] |
| 113 | exact hepsilon |
| 114 | have htail : x ∈ (T.list.node (i : ℤ)).2.region |
| 115 | ((T.list.node (i : ℤ)).2.epsilon⁻¹ / 2) |
| 116 | (T.list.node (i : ℤ)).2.epsilon⁻¹ := by |
| 117 | refine ⟨hx, ?_, hcoord.2⟩ |
| 118 | rw [heps] |
| 119 | linarith only [hhigh, hwidth, hA] |
| 120 | have hcapture := Hedge.forward_core hsmall htail |
| 121 | rw [← hindex] at hcapture |
| 122 | have hepsNext := T.list.node_epsilon (hactive (i + 1) hnext) |
| 123 | rw [hepsNext] at hcapture |
| 124 | exact Or.inl (Or.inl (hcore (i + 1) hnext hcapture.1 |
| 125 | (by linarith only [hcapture.2.1, hwidth]) |
| 126 | (by linarith only [hcapture.2.2, hwidth]))) |
| 127 | · have hlow := lt_of_not_ge hlo |
| 128 | by_cases hzero : i = 0 |
| 129 | · apply Or.inl ∘ Or.inr |
| 130 | subst i |
| 131 | have heps0 : (T.list.node 0).2.epsilon = epsilon := by |
| 132 | simpa only [Nat.cast_zero] using heps |
| 133 | exact ⟨hx, by simpa only [Nat.cast_zero, heps0] using hcoord.1, hlow⟩ |
| 134 | · have hprev : i - 1 < T.list.nodes.length := by omega |
| 135 | have hindex : ((i - 1 : ℕ) : ℤ) + 1 = (i : ℤ) := by omega |
| 136 | obtain ⟨_, _, Hedge, _⟩ := T.list.node_edge (hactive (i - 1) hprev) |
| 137 | (by simpa only [hindex] using hactive i hi') |
| 138 | rw [hindex] at Hedge |
| 139 | have htail : x ∈ (T.list.node (i : ℤ)).2.region |
| 140 | (-(T.list.node (i : ℤ)).2.epsilon⁻¹) |
| 141 | (-(T.list.node (i : ℤ)).2.epsilon⁻¹ / 2) := by |
| 142 | refine ⟨hx, hcoord.1, ?_⟩ |
| 143 | rw [heps] |
| 144 | linarith only [hlow, hwidth, hA] |
| 145 | have hcapture := Hedge.reciprocal_core htail |
| 146 | rw [T.list.node_epsilon (hactive (i - 1) hprev)] at hcapture |
| 147 | exact Or.inl (Or.inl (hcore (i - 1) hprev hcapture.1 |
| 148 | (by linarith only [hcapture.2.1, hwidth]) |
| 149 | (by linarith only [hcapture.2.2, hwidth]))) |
| 150 | |
| 151 | /-- The ambient frontier can only be approached through the two retained |
| 152 | end tails: the finite compact middle is closed inside the open tube |
| 153 | (Claim 10.8; derivation 89). -/ |
| 154 | theorem frontier_subset_end_tail_closures (T : SourceTubeData S) |
| 155 | (hepsilon : epsilon ≤ (1 / 1000 : ℝ)) {theta : ℝ} |
| 156 | (htheta : (3 / 4 : ℝ) ≤ theta) (htheta' : theta < 1) : |
| 157 | frontier (T.carrierOpen : Set _) ⊆ |
| 158 | closure ((T.list.node 0).2.region (-epsilon⁻¹) (-(theta * epsilon⁻¹))) ∪ |
| 159 | closure ((T.list.node ((T.list.nodes.length - 1 : ℕ) : ℤ)).2.region |
| 160 | (theta * epsilon⁻¹) epsilon⁻¹) := by |
| 161 | obtain ⟨hcompact, hsubset⟩ := T.coreUnion_compact_subset htheta' |
| 162 | intro x hx |
| 163 | have hclosure := closure_mono (T.subset_coreUnion_end_tails hepsilon htheta) hx.1 |
| 164 | rw [closure_union, closure_union, hcompact.isClosed.closure_eq] at hclosure |
| 165 | have hout : x ∉ (T.carrierOpen : Set _) := by |
| 166 | simpa only [T.carrierOpen.isOpen.interior_eq] using hx.2 |
| 167 | rcases hclosure with (hcore | hleft) | hright |
| 168 | · exact False.elim (hout (hsubset hcore)) |
| 169 | · exact Or.inl hleft |
| 170 | · exact Or.inr hright |
| 171 | |
| 172 | end PoincareMT.M28.SourceTubeData |