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.Cylinders.CylinderSphereOrder |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Cylinders.CylinderUniformScalar |
| 4 | import PoincareLib.Geometry.RicciFlow.CanonicalNeighborhood.Neck.Separation.Connected |
| 5 | |
| 6 | /-! |
| 7 | # Selected necks and a fixed back side inside the positive recut |
| 8 | |
| 9 | Scalar divergence on the actual cylinder and the selected-neck scalar |
| 10 | ratio place a whole selected neck beyond any prescribed height. The |
| 11 | actual selected-sphere isotopy then fixes one oriented back wall whose |
| 12 | nonnegative side has a uniform interior height bound. |
| 13 | Source: Morgan--Tian Claim 10.3, pp. 248-249, and Claims 10.13-10.14, |
| 14 | pp. 256-258; M28 derivation 131, Sections 2 and 4. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Bundle Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M28 |
| 25 | |
| 26 | variable {M : Type u} [TopologicalSpace M] [T2Space M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 28 | [IsManifold (𝓡 3) ∞ M] {g : RiemannianMetric 3 M} {X : Set M} |
| 29 | |
| 30 | /-- A single height threshold places every selected neck containing a |
| 31 | point beyond it above the prescribed level. The threshold precedes both |
| 32 | the selected neck and its tested point. Source: Claim 10.3, pp. 248-249; |
| 33 | derivation 131, uniform scalar barrier. -/ |
| 34 | theorem exists_selected_chain_tail_above_cylinder_level |
| 35 | [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 36 | (T : EpsilonTubeCertificate g X) (A : OpenCylinderModel T.carrier) |
| 37 | (R : M → ℝ) (hR : ContinuousOn R T.carrier) |
| 38 | (hratio : ∀ i ∈ T.chain.shape.active, |
| 39 | ∀ y ∈ (T.chain.neck i).carrier, ∀ z ∈ (T.chain.neck i).carrier, |
| 40 | R y ≤ 2 * R z) |
| 41 | (hdiverge : ∀ B : ℝ, ∃ d : ℝ, 1 / 2 < d ∧ d < 1 ∧ |
| 42 | ∀ x ∈ T.carrier, d < (A.inverse x).2 → B < R x) |
| 43 | {c : ℝ} (hc : 1 / 2 < c) (hc1 : c < 1) : |
| 44 | ∃ d : ℝ, 1 / 2 < d ∧ d < 1 ∧ |
| 45 | ∀ i ∈ T.chain.shape.active, ∀ y ∈ (T.chain.neck i).carrier, |
| 46 | d < (A.inverse y).2 → (T.chain.neck i).carrier ⊆ A.tail true c := by |
| 47 | have hc0 : 0 < c := lt_trans (by norm_num) hc |
| 48 | have hsection := A.isCompact_compactSlab hc0 hc1 |
| 49 | obtain ⟨B, hB⟩ := hsection.bddAbove_image |
| 50 | (hR.mono (A.compactSlab_subset hc0 hc1)) |
| 51 | obtain ⟨d, hd, hd1, hhigh⟩ := hdiverge (2 * B) |
| 52 | refine ⟨max c d, lt_max_of_lt_left hc, max_lt hc1 hd1, ?_⟩ |
| 53 | intro i hi y hyN hy |
| 54 | have hNV : (T.chain.neck i).carrier ⊆ T.carrier := by |
| 55 | rw [T.carrier_eq_chain_union] |
| 56 | exact subset_iUnion_of_subset ⟨i, hi⟩ Subset.rfl |
| 57 | have hyc : c < (A.inverse y).2 := (le_max_left _ _).trans_lt hy |
| 58 | have hyR : 2 * B < R y := |
| 59 | hhigh y (hNV hyN) ((le_max_right _ _).trans_lt hy) |
| 60 | have hheight : ContinuousOn (fun x => (A.inverse x).2) (T.chain.neck i).carrier := |
| 61 | (continuous_snd.comp_continuousOn A.inverse_smooth.continuousOn).mono hNV |
| 62 | have havoid : ∀ z ∈ (T.chain.neck i).carrier, (A.inverse z).2 ≠ c := by |
| 63 | intro z hz heq |
| 64 | have hzsection : z ∈ A.compactSlab c c := |
| 65 | (A.mem_compactSlab_iff hc0 hc1).mpr ⟨hNV hz, heq.ge, heq.le⟩ |
| 66 | have hzB : R z ≤ B := hB (mem_image_of_mem R hzsection) |
| 67 | have hratioz := hratio i hi y hyN z hz |
| 68 | linarith |
| 69 | intro z hz |
| 70 | apply (A.mem_tail_iff_m28 true hc0 hc1).mpr |
| 71 | exact ⟨hNV hz, (T.chain.neck i).isConnected_carrier.isPreconnected.lt_of_ne |
| 72 | hheight havoid ⟨y, hyN, hyc⟩ hz⟩ |
| 73 | |
| 74 | /-- A compact scalar barrier and the chain cover select a whole neck |
| 75 | beyond any fixed interior height. The selected index retains its sphere |
| 76 | isotopy in the original tube. Source: Claim 10.3, pp. 248-249; |
| 77 | derivation 131. -/ |
| 78 | theorem exists_selected_chain_neck_above_cylinder_level |
| 79 | [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 80 | (T : EpsilonTubeCertificate g X) (A : OpenCylinderModel T.carrier) |
| 81 | (R : M → ℝ) (hR : ContinuousOn R T.carrier) |
| 82 | (hratio : ∀ i ∈ T.chain.shape.active, |
| 83 | ∀ y ∈ (T.chain.neck i).carrier, ∀ z ∈ (T.chain.neck i).carrier, |
| 84 | R y ≤ 2 * R z) |
| 85 | (hdiverge : ∀ B : ℝ, ∃ d : ℝ, 1 / 2 < d ∧ d < 1 ∧ |
| 86 | ∀ x ∈ T.carrier, d < (A.inverse x).2 → B < R x) |
| 87 | {c : ℝ} (hc : 1 / 2 < c) (hc1 : c < 1) : |
| 88 | ∃ i ∈ T.chain.shape.active, (T.chain.neck i).carrier ⊆ A.tail true c := by |
| 89 | obtain ⟨d, hd, hd1, htail⟩ := |
| 90 | exists_selected_chain_tail_above_cylinder_level T A R hR hratio hdiverge hc hc1 |
| 91 | have hd0 : 0 < d := lt_trans (by norm_num) hd |
| 92 | obtain ⟨y, hy⟩ := A.tail_nonempty true hd0 hd1 |
| 93 | have hyread := (A.mem_tail_iff_m28 true hd0 hd1).mp hy |
| 94 | obtain ⟨i, hyN⟩ := mem_iUnion.mp (T.carrier_eq_chain_union ▸ hyread.1) |
| 95 | exact ⟨i.1, i.2, htail i.1 i.2 y hyN hyread.2⟩ |
| 96 | |
| 97 | omit [T2Space M] in |
| 98 | /-- A selected sphere above a fixed cylinder level determines one signed |
| 99 | height, oriented by the original two ends. Its entire nonnegative side |
| 100 | stays above that level, before any endpoint pair is chosen. |
| 101 | Source: Claim 10.3, pp. 248-249; derivation 131, Section 2. -/ |
| 102 | theorem exists_fixed_positive_side_above_cylinder_level |
| 103 | {V : TopologicalSpace.Opens M} (A : OpenCylinderModel (V : Set M)) |
| 104 | (N : EpsilonNeck g) {lambda : ℝ} |
| 105 | (hlambda : 1 / 2 < lambda) (hlambda1 : lambda < 1) |
| 106 | (hN : N.carrier ⊆ A.tail true lambda) |
| 107 | (hisotopy : SmoothSphereIsotopicIn (V : Set M) N.central_sphere A.middleSphere) : |
| 108 | ∃ (phi : V ≃ₜ (UnitTwoSphere × Ioo (0 : ℝ) 1)) (a b : ℝ), |
| 109 | 0 < a ∧ a < 1 / 2 ∧ 1 / 2 < b ∧ b < 1 ∧ |
| 110 | (∀ x ∈ V, ambientCylinderSignedHeight phi x = 0 ↔ x ∈ N.central_sphere) ∧ |
| 111 | (∀ x ∈ V, (A.inverse x).2 < a ∨ b < (A.inverse x).2 → |
| 112 | ambientCylinderSignedHeight phi x = (A.inverse x).2 - 1 / 2) ∧ |
| 113 | ∀ x ∈ V, 0 ≤ ambientCylinderSignedHeight phi x → lambda ≤ (A.inverse x).2 := by |
| 114 | obtain ⟨phi, a, b, ha, hahalf, hbhalf, hb, hzero, hread⟩ := |
| 115 | A.exists_isotopic_sphere_coordinates hisotopy |
| 116 | have hlambda0 : 0 < lambda := lt_trans (by norm_num) hlambda |
| 117 | have hz (x : M) (hx : x ∈ V) : |
| 118 | ambientCylinderSignedHeight phi x = 0 ↔ x ∈ N.central_sphere := by |
| 119 | rw [ambientCylinderSignedHeight_apply phi hx] |
| 120 | exact sub_eq_zero.trans (hzero ⟨x, hx⟩) |
| 121 | have ht (x : M) (hx : x ∈ V) |
| 122 | (hh : (A.inverse x).2 < a ∨ b < (A.inverse x).2) : |
| 123 | ambientCylinderSignedHeight phi x = (A.inverse x).2 - 1 / 2 := by |
| 124 | rw [ambientCylinderSignedHeight_apply phi hx] |
| 125 | change ((phi ⟨x, hx⟩).2 : ℝ) - 1 / 2 = _ |
| 126 | rw [hread ⟨x, hx⟩ hh] |
| 127 | have hLsub : A.tail false lambda ⊆ (V : Set M) := |
| 128 | A.tail_subset_m28 false hlambda0 hlambda1 |
| 129 | have havoid : ∀ x ∈ A.tail false lambda, ambientCylinderSignedHeight phi x ≠ 0 := by |
| 130 | intro x hx heq |
| 131 | have hxlow := (A.mem_tail_iff_m28 false hlambda0 hlambda1).mp hx |
| 132 | have hxhigh := (A.mem_tail_iff_m28 true hlambda0 hlambda1).mp |
| 133 | (hN (N.central_sphere_subset ((hz x hxlow.1).mp heq))) |
| 134 | exact (not_lt_of_ge hxhigh.2.le) hxlow.2 |
| 135 | obtain ⟨y, hy⟩ := A.tail_nonempty false (lt_min ha hlambda0) |
| 136 | ((min_le_left _ _).trans_lt (hahalf.trans (by norm_num))) |
| 137 | have hyread := (A.mem_tail_iff_m28 false (lt_min ha hlambda0) |
| 138 | ((min_le_left _ _).trans_lt (hahalf.trans (by norm_num)))).mp hy |
| 139 | have hyL : y ∈ A.tail false lambda := |
| 140 | (A.mem_tail_iff_m28 false hlambda0 hlambda1).mpr |
| 141 | ⟨hyread.1, hyread.2.trans_le (min_le_right _ _)⟩ |
| 142 | have hyneg : ambientCylinderSignedHeight phi y < 0 := by |
| 143 | rw [ht y hyread.1 (Or.inl (hyread.2.trans_le (min_le_left _ _)))] |
| 144 | exact sub_neg.mpr ((hyread.2.trans_le (min_le_left _ _)).trans hahalf) |
| 145 | have hnegative : ∀ x ∈ A.tail false lambda, ambientCylinderSignedHeight phi x < 0 := |
| 146 | fun _ hx => (A.isPreconnected_tail false hlambda0 hlambda1).gt_of_ne |
| 147 | ((continuousOn_ambientCylinderSignedHeight phi).mono hLsub) |
| 148 | havoid ⟨y, hyL, hyneg⟩ hx |
| 149 | refine ⟨phi, a, b, ha, hahalf, hbhalf, hb, hz, ht, ?_⟩ |
| 150 | intro x hx hpos |
| 151 | apply le_of_not_gt |
| 152 | intro hlow |
| 153 | exact (not_lt_of_ge hpos) |
| 154 | (hnegative x ((A.mem_tail_iff_m28 false hlambda0 hlambda1).mpr ⟨hx, hlow⟩)) |
| 155 | |
| 156 | end PoincareMT.M28 |