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.NeckGeometry.SourceFreshSphereIsotopy |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.SourceGeometry.InitialGeometry.SourceInitialGraphIsotopy |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Cylinders.CylinderMiddleCrossing |
| 5 | |
| 6 | /-! |
| 7 | # Crossing heights from the actual selected high node |
| 8 | |
| 9 | The stored node isotopy, actual fresh-sphere isotopy and original graph |
| 10 | isotopy supply all three spheres. Connectedness propagates the retained |
| 11 | side label over the whole fresh sphere. Source: Morgan--Tian Claim 10.8, |
| 12 | p. 254; M28 derivation 124. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M28 |
| 24 | |
| 25 | /-- A selected high node avoiding the actual connector and the two low |
| 26 | necks produces the crossing height and the whole-sphere side label. |
| 27 | The selected index is retained throughout. Source: Claim 10.8, p. 254; |
| 28 | M28 derivation 124. -/ |
| 29 | theorem exists_source_selected_crossing_height_accuracy : |
| 30 | ∃ epsilon0 : ℝ, 0 < epsilon0 ∧ epsilon0 ≤ (1 / 1000 : ℝ) ∧ |
| 31 | ∀ {epsilon C A D0 D : ℝ} |
| 32 | {E : SameTimeCounterexample.{u} epsilon C A D0 D} |
| 33 | {S : CounterexampleNeckSegment E} (T : SourceTubeData S), |
| 34 | epsilon ≤ epsilon0 → ∀ (f : UnitTwoSphere → ℝ), |
| 35 | ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ f → |
| 36 | (∀ q, |f q| < epsilon⁻¹ / 32) → |
| 37 | ∀ (N : EpsilonNeck (E.flow.metric E.time)), N.epsilon = epsilon → |
| 38 | ∀ (hcenter : N.center ∈ (T.carrierOpen : Set _)), |
| 39 | N.center ∉ (T.list.node 0).2.belowGraph_m28 f → |
| 40 | Disjoint N.carrier |
| 41 | (closure ((T.list.node ((T.list.nodes.length - 1 : ℕ) : ℤ)).2.carrier)) → |
| 42 | Disjoint (range (fun q => (T.list.node 0).2.coordinate_map (q, f q))) |
| 43 | N.central_sphere → |
| 44 | ∀ (i : ℕ), i < T.list.nodes.length → |
| 45 | Disjoint (T.list.node (i : ℤ)).2.carrier (T.list.node 0).2.carrier → |
| 46 | Disjoint (T.list.node (i : ℤ)).2.carrier N.carrier → |
| 47 | ∀ (b p : T.carrierOpen), |
| 48 | b.val ∈ range (fun q => (T.list.node 0).2.coordinate_map (q, f q)) → |
| 49 | p.val ∈ (T.list.node (i : ℤ)).2.carrier → |
| 50 | ∀ (K : Set T.carrierOpen), IsPreconnected K → b ∈ K → |
| 51 | (⟨N.center, hcenter⟩ : T.carrierOpen) ∈ K → |
| 52 | Disjoint (T.list.node (i : ℤ)).2.carrier |
| 53 | ((Subtype.val : T.carrierOpen → _) '' K) → |
| 54 | (∀ y ∈ N.central_sphere, y ∉ (T.list.node 0).2.belowGraph_m28 f) ∧ |
| 55 | ∃ height : T.carrierOpen → ℝ, Continuous height ∧ |
| 56 | (∀ y : T.carrierOpen, height y = 0 ↔ y.val ∈ N.central_sphere) ∧ |
| 57 | height b < 0 ∧ 0 < height p := by |
| 58 | obtain ⟨epsilon0, hpos, hsmall, hfresh⟩ := |
| 59 | exists_source_fresh_sphere_isotopy_accuracy.{u} |
| 60 | refine ⟨epsilon0, hpos, hsmall, ?_⟩ |
| 61 | intro epsilon C A D0 D E S T hepsilon f hf hbound N heps hcenter hside |
| 62 | hterminal hSC i hi hP0 hPN b p hb hp K hK hbK hqK hPK |
| 63 | let P := (T.list.node (i : ℤ)).2 |
| 64 | let S0 := range (fun q => (T.list.node 0).2.coordinate_map (q, f q)) |
| 65 | let F := (T.list.node 0).2.belowGraph_m28 f |
| 66 | have hactive : (i : ℤ) ∈ T.list.active := by |
| 67 | change 0 ≤ (i : ℤ) ∧ (i : ℤ) ≤ (T.list.nodes.length : ℤ) - 1 |
| 68 | omega |
| 69 | have hPT : P.carrier ⊆ (T.carrierOpen : Set _) := by |
| 70 | intro x hx |
| 71 | rw [T.carrier_eq_iUnion_nodes] |
| 72 | exact mem_iUnion₂.mpr ⟨i, Finset.mem_range.mpr hi, hx⟩ |
| 73 | have hS : SmoothSphereIsotopicIn (T.carrierOpen : Set _) S0 |
| 74 | T.tube.cylinder.middleSphere := T.initial_graph_isotopic_middle f hf hbound |
| 75 | have hC := hfresh T hepsilon f hbound N heps hcenter hside hterminal |
| 76 | have hCU : N.central_sphere ⊆ (T.carrierOpen : Set _) := by |
| 77 | obtain ⟨I, _, hI, hzero, _⟩ := hC |
| 78 | rw [← hzero] |
| 79 | exact (hI 0 (left_mem_Icc.mpr zero_le_one)).2 |
| 80 | have hH : SmoothSphereIsotopicIn (T.carrierOpen : Set _) P.central_sphere |
| 81 | T.tube.cylinder.middleSphere := by |
| 82 | change SmoothSphereIsotopicIn T.tube.carrier |
| 83 | (T.list.node (i : ℤ)).2.central_sphere T.tube.cylinder.middleSphere |
| 84 | have hiT : (i : ℤ) ∈ T.tube.chain.shape.active := by |
| 85 | rw [T.tube_chain_readout.1] |
| 86 | exact hactive |
| 87 | have hh := T.tube.central_sphere_isotopy (i : ℤ) hiT |
| 88 | simpa only [T.tube_chain_readout.2] using hh |
| 89 | obtain ⟨hF, _, hcomponent⟩ := T.initial_graph_negative_region f hf.continuous hbound |
| 90 | have hcomponent' : ∀ x ∈ F, |
| 91 | connectedComponentIn ((T.carrierOpen : Set _) \ S0) x = F := hcomponent |
| 92 | have hFU : F ⊆ (T.carrierOpen : Set _) \ S0 := by |
| 93 | intro x hx |
| 94 | have hh : connectedComponentIn ((T.carrierOpen : Set _) \ S0) x ⊆ |
| 95 | (T.carrierOpen : Set _) \ S0 := connectedComponentIn_subset _ _ |
| 96 | rw [hcomponent' x hx] at hh |
| 97 | exact hh hx |
| 98 | have hCsub : N.central_sphere ⊆ (T.carrierOpen : Set _) \ S0 := by |
| 99 | intro y hy |
| 100 | exact ⟨hCU hy, fun hyS => Set.disjoint_left.mp hSC hyS hy⟩ |
| 101 | have hsideAll : ∀ y ∈ N.central_sphere, y ∉ F := by |
| 102 | intro y hy hyF |
| 103 | have hh := N.isConnected_central_sphere.isPreconnected.subset_connectedComponentIn |
| 104 | hy hCsub |
| 105 | rw [hcomponent' y hyF] at hh |
| 106 | exact hside (hh N.center_on_central_sphere) |
| 107 | have heps0 : (T.list.node 0).2.epsilon = epsilon := by |
| 108 | have hlen : 0 < T.list.nodes.length := List.length_pos_iff.mpr T.list.nonempty |
| 109 | apply T.list.node_epsilon |
| 110 | change 0 ≤ (0 : ℤ) ∧ (0 : ℤ) ≤ (T.list.nodes.length : ℤ) - 1 |
| 111 | constructor <;> omega |
| 112 | have hA : 0 < epsilon⁻¹ := inv_pos.mpr (heps ▸ N.epsilon_pos) |
| 113 | have hS0 : S0 ⊆ (T.list.node 0).2.carrier := by |
| 114 | rintro _ ⟨z, rfl⟩ |
| 115 | apply (T.list.node 0).2.coordinate_map_mem_of_axial |
| 116 | rw [heps0] |
| 117 | have hh := abs_lt.mp (hbound z) |
| 118 | constructor <;> linarith [hh.1, hh.2] |
| 119 | have hCH : Disjoint N.central_sphere P.central_sphere := by |
| 120 | apply Set.disjoint_left.mpr |
| 121 | intro y hyN hyP |
| 122 | exact Set.disjoint_left.mp hPN (P.central_sphere_subset hyP) |
| 123 | (N.central_sphere_subset hyN) |
| 124 | have hHoutside : ∀ y ∈ P.central_sphere, y ∉ S0 ∧ y ∉ F := by |
| 125 | intro y hy |
| 126 | have hnot : y ∉ (T.list.node 0).2.carrier := |
| 127 | fun hy0 => Set.disjoint_left.mp hP0 (P.central_sphere_subset hy) hy0 |
| 128 | exact ⟨fun hyS => hnot (hS0 hyS), fun hyF => hnot hyF.1⟩ |
| 129 | have hPrange : P.carrier ⊆ range (Subtype.val : T.carrierOpen → _) := by |
| 130 | intro y hy |
| 131 | exact ⟨⟨y, hPT hy⟩, rfl⟩ |
| 132 | have hPpre : IsPreconnected {y : T.carrierOpen | y.val ∈ P.carrier} := |
| 133 | P.isConnected_carrier.isPreconnected.preimage_of_isOpenMap Subtype.val_injective |
| 134 | T.carrierOpen.isOpen.isOpenMap_subtype_val hPrange |
| 135 | let q : T.carrierOpen := ⟨N.center, hcenter⟩ |
| 136 | let z : T.carrierOpen := |
| 137 | ⟨P.center, hPT (P.central_sphere_subset P.center_on_central_sphere)⟩ |
| 138 | refine ⟨hsideAll, ?_⟩ |
| 139 | exact T.tube.cylinder.exists_middle_sphere_crossing_height hS hC hH hF hFU hcomponent' |
| 140 | hSC hCH hHoutside (b := b) (q := q) (z := z) (p := p) |
| 141 | hb N.center_on_central_sphere hside P.center_on_central_sphere |
| 142 | hK hbK hqK |
| 143 | (fun y hy hyP => Set.disjoint_left.mp hPK (P.central_sphere_subset hyP) |
| 144 | ⟨y, hy, rfl⟩) |
| 145 | hPpre (P.central_sphere_subset P.center_on_central_sphere) hp |
| 146 | (fun y hy hyN => Set.disjoint_left.mp hPN hy (N.central_sphere_subset hyN)) |
| 147 | |
| 148 | end PoincareMT.M28 |