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.IntrinsicGeometry.IntrinsicMinimizerSubsegments |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.SourceGeometry.Geometry.SourceEdgeMinimizerOverlap |
| 4 | |
| 5 | /-! |
| 6 | # A backward anchor lies below the center of a positive transition |
| 7 | |
| 8 | Morgan--Tian Claim 10.4, printed pp. 249-251. The actual positive transition |
| 9 | and whole regional minimum force the backward anchor into the negative |
| 10 | coordinate half. The checked anchor estimate then gives its quantitative |
| 11 | height. See the cap-topology record `2026-09-24-source-backward-anchor.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M28 |
| 22 | |
| 23 | variable {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 25 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 26 | [T2Space M] [T3Space M] {g : RiemannianMetric 3 M} |
| 27 | |
| 28 | /-- The exact backward anchor of a finite regional minimizer lies in the |
| 29 | actual neck and below height `-0.292 / epsilon` when the later path reaches |
| 30 | the positive transition height (Claim 10.4, pp. 249-251). -/ |
| 31 | theorem backward_anchor_height_le_of_positive_transition |
| 32 | (N : EpsilonNeck g) (hε : N.epsilon ≤ 1 / 1000) |
| 33 | {U : Set M} (hNU : N.carrier ⊆ U) |
| 34 | {γ : ℝ → M} {a b t₁ tN v : ℝ} |
| 35 | (ha₁ : a ≤ t₁) (h₁ : t₁ < tN) (hNv : tN < v) (hvb : v ≤ b) |
| 36 | (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Icc a b)) |
| 37 | (hγU : MapsTo γ (Icc a b) U) |
| 38 | (hfinite : g.pathELength γ a b ≠ ⊤) |
| 39 | (hmin : g.pathELength γ a b = intrinsicEDist g U (γ a) (γ b)) |
| 40 | (hcN : γ tN = N.center) |
| 41 | (hγN : MapsTo γ (Icc tN v) N.carrier) |
| 42 | (hlevel : (N.coordinate_inverse (γ v)).2 = |
| 43 | (509 : ℝ) * N.epsilon⁻¹ / 512) |
| 44 | (hanchor : g.pathELength γ t₁ tN = |
| 45 | ENNReal.ofReal ((0.3 : ℝ) * N.scale * N.epsilon⁻¹)) : |
| 46 | γ t₁ ∈ N.carrier ∧ |
| 47 | (N.coordinate_inverse (γ t₁)).2 ≤ -(0.292 : ℝ) * N.epsilon⁻¹ := by |
| 48 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 49 | ⟨g.toRiemannianMetric⟩ |
| 50 | have hscale : 0 < N.scale := N.scale_pos |
| 51 | have hApos : 0 < N.epsilon⁻¹ := inv_pos.mpr N.epsilon_pos |
| 52 | have hA : (1000 : ℝ) ≤ N.epsilon⁻¹ := by |
| 53 | have h := mul_le_mul_of_nonneg_right hε hApos.le |
| 54 | rw [mul_inv_cancel₀ N.epsilon_pos.ne'] at h |
| 55 | linarith |
| 56 | have hdist : g.edist N.center (γ t₁) ≤ g.pathELength γ t₁ tN := by |
| 57 | rw [← hcN] |
| 58 | change Manifold.riemannianEDist (𝓡 3) (γ tN) (γ t₁) ≤ _ |
| 59 | rw [Manifold.riemannianEDist_comm] |
| 60 | exact Manifold.riemannianEDist_le_pathELength |
| 61 | (hγ.mono (Icc_subset_Icc ha₁ (hNv.le.trans hvb))) rfl rfl h₁.le |
| 62 | rw [hanchor] at hdist |
| 63 | have hslab := mem_middle_slab_of_edist_center_le N hε hdist |
| 64 | have hanchorMin : ENNReal.ofReal ((0.3 : ℝ) * N.scale * N.epsilon⁻¹) = |
| 65 | intrinsicEDist g U (γ t₁) N.center := by |
| 66 | calc |
| 67 | _ = g.pathELength γ t₁ tN := hanchor.symm |
| 68 | _ = intrinsicEDist g U (γ t₁) N.center := by |
| 69 | simpa only [hcN] using pathELength_eq_intrinsicEDist_subsegment g |
| 70 | ha₁ h₁.le (hNv.le.trans hvb) hγ hγU hfinite hmin |
| 71 | have hheight : (0.292 : ℝ) * N.epsilon⁻¹ ≤ |
| 72 | |(N.coordinate_inverse (γ t₁)).2| := by |
| 73 | apply anchor_height_lower N hε hA hNU hslab.1 |
| 74 | rw [intrinsicEDist_comm_set] |
| 75 | exact hanchorMin.le |
| 76 | have hnegative : (N.coordinate_inverse (γ t₁)).2 < 0 := by |
| 77 | by_contra hnot |
| 78 | have hpos : 0 ≤ (N.coordinate_inverse (γ t₁)).2 := le_of_not_gt hnot |
| 79 | have hgap : |(N.coordinate_inverse (γ v)).2 - |
| 80 | (N.coordinate_inverse (γ t₁)).2| ≤ (509 : ℝ) * N.epsilon⁻¹ / 512 := by |
| 81 | rw [hlevel, abs_of_nonneg (by nlinarith only [hslab.2.2, hApos])] |
| 82 | linarith only [hpos] |
| 83 | have hupper : intrinsicEDist g U (γ t₁) (γ v) ≤ ENNReal.ofReal |
| 84 | (N.scale * Real.sqrt (1 + N.epsilon) * |
| 85 | (|(N.coordinate_inverse (γ v)).2 - (N.coordinate_inverse (γ t₁)).2| + |
| 86 | Real.sqrt 2 * (Real.pi + 1))) := by |
| 87 | apply (intrinsicEDist_mono_of_subset (g := g) hNU).trans |
| 88 | exact N.intrinsicEDist_le_axial_add hslab.1 (hγN ⟨hNv.le, le_rfl⟩) |
| 89 | have hrootUpper : Real.sqrt (1 + N.epsilon) ≤ (1.001 : ℝ) := by |
| 90 | have hsquare := Real.sq_sqrt (show 0 ≤ 1 + N.epsilon by |
| 91 | linarith [N.epsilon_pos]) |
| 92 | nlinarith only [hsquare, Real.sqrt_nonneg (1 + N.epsilon), hε] |
| 93 | have hsqrt2 : Real.sqrt 2 ≤ (2 : ℝ) := |
| 94 | (Real.sqrt_le_iff).mpr ⟨by norm_num, by norm_num⟩ |
| 95 | have hsphere : Real.sqrt 2 * (Real.pi + 1) ≤ (10 : ℝ) := by |
| 96 | have h := mul_le_mul_of_nonneg_right hsqrt2 |
| 97 | (by positivity : 0 ≤ Real.pi + 1) |
| 98 | nlinarith only [h, Real.pi_le_four] |
| 99 | have hcoefficient : Real.sqrt (1 + N.epsilon) * |
| 100 | (|(N.coordinate_inverse (γ v)).2 - (N.coordinate_inverse (γ t₁)).2| + |
| 101 | Real.sqrt 2 * (Real.pi + 1)) < |
| 102 | (0.3 : ℝ) * N.epsilon⁻¹ + (0.999 : ℝ) * |
| 103 | ((509 : ℝ) * N.epsilon⁻¹ / 512) := by |
| 104 | calc |
| 105 | _ ≤ (1.001 : ℝ) * ((509 : ℝ) * N.epsilon⁻¹ / 512 + 10) := |
| 106 | mul_le_mul hrootUpper (add_le_add hgap hsphere) (by positivity) (by norm_num) |
| 107 | _ < _ := by linarith only [hA] |
| 108 | have hbudget : N.scale * Real.sqrt (1 + N.epsilon) * |
| 109 | (|(N.coordinate_inverse (γ v)).2 - (N.coordinate_inverse (γ t₁)).2| + |
| 110 | Real.sqrt 2 * (Real.pi + 1)) < |
| 111 | (0.3 : ℝ) * N.scale * N.epsilon⁻¹ + |
| 112 | N.scale * (0.999 : ℝ) * ((509 : ℝ) * N.epsilon⁻¹ / 512) := by |
| 113 | have h := mul_lt_mul_of_pos_left hcoefficient hscale |
| 114 | nlinarith only [h] |
| 115 | have hshort : intrinsicEDist g U (γ t₁) (γ v) < ENNReal.ofReal |
| 116 | ((0.3 : ℝ) * N.scale * N.epsilon⁻¹ + |
| 117 | N.scale * (0.999 : ℝ) * ((509 : ℝ) * N.epsilon⁻¹ / 512)) := |
| 118 | hupper.trans_lt ((ENNReal.ofReal_lt_ofReal_iff (by positivity)).mpr hbudget) |
| 119 | have hrootLower : (0.999 : ℝ) ≤ Real.sqrt (1 - N.epsilon) := by |
| 120 | apply Real.le_sqrt_of_sq_le |
| 121 | nlinarith only [hε] |
| 122 | have hzero : (N.coordinate_inverse N.center).2 = 0 := |
| 123 | (N.mem_central_sphere_iff_of_mem_carrier |
| 124 | (N.central_sphere_subset N.center_on_central_sphere)).mp |
| 125 | N.center_on_central_sphere |
| 126 | have hdisp := N.path_axial_displacement_le_sharp hNv.le |
| 127 | (hγ.mono (Icc_subset_Icc (ha₁.trans h₁.le) hvb)) hγN |
| 128 | rw [hcN, hzero, sub_zero, hlevel, abs_of_pos (by positivity)] at hdisp |
| 129 | have hdispLower : ENNReal.ofReal |
| 130 | (N.scale * (0.999 : ℝ) * ((509 : ℝ) * N.epsilon⁻¹ / 512)) ≤ |
| 131 | g.pathELength γ tN v := by |
| 132 | apply le_trans (ENNReal.ofReal_le_ofReal ?_) hdisp |
| 133 | exact mul_le_mul_of_nonneg_right |
| 134 | (mul_le_mul_of_nonneg_left hrootLower hscale.le) (by positivity) |
| 135 | have hprefixLower : ENNReal.ofReal |
| 136 | ((0.3 : ℝ) * N.scale * N.epsilon⁻¹ + |
| 137 | N.scale * (0.999 : ℝ) * ((509 : ℝ) * N.epsilon⁻¹ / 512)) ≤ |
| 138 | g.pathELength γ t₁ v := by |
| 139 | rw [ENNReal.ofReal_add (by positivity) (by positivity)] |
| 140 | exact (add_le_add hanchor.symm.le hdispLower).trans_eq |
| 141 | (Manifold.pathELength_add h₁.le hNv.le) |
| 142 | have hminimum := pathELength_eq_intrinsicEDist_subsegment g ha₁ |
| 143 | (h₁.trans hNv).le hvb hγ hγU hfinite hmin |
| 144 | rw [hminimum] at hprefixLower |
| 145 | exact (not_lt_of_ge hprefixLower) hshort |
| 146 | refine ⟨hslab.1, ?_⟩ |
| 147 | rw [abs_of_neg hnegative] at hheight |
| 148 | linarith only [hheight] |
| 149 | |
| 150 | end PoincareMT.M28 |