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.Induction.Noncollapse.Assembly.Volume.SphereVolume |
| 2 | import PoincareLib.Geometry.RicciFlow.CanonicalNeighborhood.Neck.Separation.Diameter |
| 3 | |
| 4 | /-! |
| 5 | # A coordinate patch inside a tested canonical neck ball |
| 6 | |
| 7 | Morgan--Tian Proposition 16.3, p. 368, and Proposition 2.19, pp. 31-32. |
| 8 | The shared neck library supplies the actual differential and axial distance |
| 9 | bounds. Retaining the sphere distance in its central-slice argument gives |
| 10 | a product patch at every tested radius up to three times the neck scale. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | -- The product-cylinder and frozen Euclidean model use the same linear rechart. |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle ENNReal |
| 19 | |
| 20 | namespace PoincareMT.Proofs.M46 |
| 21 | |
| 22 | variable {M : Type*} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 24 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 25 | [T2Space M] [T3Space M] {g : RiemannianMetric 3 M} (N : EpsilonNeck g) |
| 26 | |
| 27 | /-- The central-slice comparison retains the actual sphere distance, instead |
| 28 | of replacing it by the diameter as in the shared Proposition 2.19 estimate. -/ |
| 29 | theorem canonicalNeck_central_distance (q r : UnitTwoSphere) : |
| 30 | g.edist (N.coordinate_map (q, 0)) (N.coordinate_map (r, 0)) ≤ |
| 31 | ENNReal.ofReal (N.scale * Real.sqrt (1 + N.epsilon)) * |
| 32 | canonicalSphereMetric.edist q r := by |
| 33 | have hzero : (0 : ℝ) ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ := |
| 34 | ⟨neg_neg_of_pos (inv_pos.mpr N.epsilon_pos), inv_pos.mpr N.epsilon_pos⟩ |
| 35 | have hcoord (q : UnitTwoSphere) : |
| 36 | ContMDiffAt ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) ∞ N.coordinate_map (q, 0) := |
| 37 | N.coordinate_map_smooth.contMDiffAt |
| 38 | (N.cylinderDomain_open.mem_nhds ⟨mem_univ q, hzero⟩) |
| 39 | let F : UnitTwoSphere → M := fun q => N.coordinate_map (q, 0) |
| 40 | have hF : ContMDiff (𝓡 2) (𝓡 3) 1 F := by |
| 41 | intro q |
| 42 | exact ((hcoord q).comp q |
| 43 | (contMDiffAt_id.prodMk contMDiffAt_const)).of_le (by simp) |
| 44 | have hderiv (q : UnitTwoSphere) (v : TangentSpace (𝓡 2) q) : |
| 45 | mfderiv (𝓡 2) (𝓡 3) F q v = |
| 46 | mfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) N.coordinate_map (q, 0) (v, 0) := by |
| 47 | dsimp only [TangentSpace] at v ⊢ |
| 48 | change mfderiv (𝓡 2) (𝓡 3) |
| 49 | (N.coordinate_map ∘ fun q : UnitTwoSphere => (q, (0 : ℝ))) q v = _ |
| 50 | have h := mfderiv_comp_apply q ((hcoord q).mdifferentiableAt (by simp)) |
| 51 | (mdifferentiableAt_id.prodMk mdifferentiableAt_const) v |
| 52 | simp only [id_eq, mfderiv_prod_left] at h |
| 53 | exact h |
| 54 | let C := N.scale * Real.sqrt (1 + N.epsilon) |
| 55 | have hplus : 0 ≤ 1 + N.epsilon := by linarith [N.epsilon_pos] |
| 56 | have hC : 0 < C := mul_pos N.scale_pos |
| 57 | (Real.sqrt_pos.mpr (by linarith [N.epsilon_pos])) |
| 58 | have hCsq : C ^ 2 = (1 + N.epsilon) * N.scale ^ 2 := by |
| 59 | dsimp [C] |
| 60 | rw [mul_pow, Real.sq_sqrt hplus] |
| 61 | ring |
| 62 | have hbound (q : UnitTwoSphere) (v : TangentSpace (𝓡 2) q) : |
| 63 | g.inner (F q) (mfderiv (𝓡 2) (𝓡 3) F q v) |
| 64 | (mfderiv (𝓡 2) (𝓡 3) F q v) ≤ |
| 65 | C ^ 2 * canonicalSphereMetric.inner q v v := by |
| 66 | have h := (N.pullback_metric_bounds (z := (q, 0)) hzero (v, 0)).2 |
| 67 | rw [hderiv, hCsq] |
| 68 | simpa only [canonicalSphereMetric, rescaledMetric_inner, roundCylinderPullback, |
| 69 | EvolvingRoundCylinderMetric, |
| 70 | Poincare.Geometry.Riemannian.SpaceForm.roundSphereMetric_inner, |
| 71 | RiemannianMetric.euclideanMetric_inner, sub_zero, mul_one, zero_mul, |
| 72 | add_zero, mul_assoc] using h |
| 73 | exact canonicalSphereMetric.edist_le_mul_of_inner_mfderiv_le g hF hC hbound q r |
| 74 | |
| 75 | /-- Sphere-ball times a short axial interval in the frozen neck coordinates. -/ |
| 76 | noncomputable def canonicalNeckPatch (q : UnitTwoSphere) (a : ℝ) : |
| 77 | Set RoundCylinderSpace := |
| 78 | canonicalSphereMetric.ball q a ×ˢ Ioo (-a) a |
| 79 | |
| 80 | omit [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] in |
| 81 | /-- A patch of dimensionless radius at most one stays in the actual neck. -/ |
| 82 | theorem canonicalNeckPatch_subset_domain (q : UnitTwoSphere) {a : ℝ} |
| 83 | (ha : a ≤ 1) : canonicalNeckPatch q a ⊆ N.cylinderDomain := by |
| 84 | have hinv : 1 < N.epsilon⁻¹ := by |
| 85 | rw [inv_eq_one_div] |
| 86 | apply (lt_div_iff₀ N.epsilon_pos).mpr |
| 87 | linarith [N.epsilon_lt_half] |
| 88 | intro z hz |
| 89 | exact ⟨mem_univ _, ⟨by linarith [hz.2.1], by linarith [hz.2.2]⟩⟩ |
| 90 | |
| 91 | /-- The image patch lies in the tested ambient ball. No containment of an |
| 92 | entire neck, or curvature control on its carrier, is used. -/ |
| 93 | theorem canonicalNeckPatch_image_subset_ball (q : UnitTwoSphere) |
| 94 | (hq : N.coordinate_map (q, 0) = N.center) {a : ℝ} |
| 95 | (ha : 0 < a) (ha1 : a ≤ 1) : |
| 96 | N.coordinate_map '' canonicalNeckPatch q a ⊆ g.ball N.center (4 * N.scale * a) := by |
| 97 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 98 | ⟨g.toRiemannianMetric⟩ |
| 99 | have hzero : (0 : ℝ) ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ := |
| 100 | ⟨neg_neg_of_pos (inv_pos.mpr N.epsilon_pos), inv_pos.mpr N.epsilon_pos⟩ |
| 101 | have hroot : Real.sqrt (1 + N.epsilon) < 2 := by |
| 102 | nlinarith [Real.sq_sqrt (show 0 ≤ 1 + N.epsilon by linarith [N.epsilon_pos]), |
| 103 | Real.sqrt_nonneg (1 + N.epsilon), N.epsilon_lt_half] |
| 104 | let C := N.scale * Real.sqrt (1 + N.epsilon) |
| 105 | have hC : 0 ≤ C := mul_nonneg N.scale_pos.le (Real.sqrt_nonneg _) |
| 106 | rintro x ⟨⟨r, z⟩, hz, rfl⟩ |
| 107 | have hdom := canonicalNeckPatch_subset_domain N q ha1 hz |
| 108 | have hsphere := (canonicalNeck_central_distance N q r).trans |
| 109 | (mul_le_mul' (le_refl (ENNReal.ofReal C)) hz.1.le) |
| 110 | rw [← ENNReal.ofReal_mul hC] at hsphere |
| 111 | have haxis := N.edist_coordinate_map_axis_le r hzero hdom.2 |
| 112 | simp only [sub_zero] at haxis |
| 113 | have habs : |z| ≤ a := (abs_lt.mpr hz.2).le |
| 114 | have haxis' := haxis.trans |
| 115 | (ENNReal.ofReal_le_ofReal (mul_le_mul_of_nonneg_left habs hC)) |
| 116 | change g.edist N.center (N.coordinate_map (r, z)) < ENNReal.ofReal _ |
| 117 | rw [← hq] |
| 118 | calc |
| 119 | _ ≤ g.edist (N.coordinate_map (q, 0)) (N.coordinate_map (r, 0)) + |
| 120 | g.edist (N.coordinate_map (r, 0)) (N.coordinate_map (r, z)) := |
| 121 | Manifold.riemannianEDist_triangle |
| 122 | _ ≤ ENNReal.ofReal (C * a) + ENNReal.ofReal (C * a) := add_le_add hsphere haxis' |
| 123 | _ = ENNReal.ofReal (2 * C * a) := by |
| 124 | rw [← ENNReal.ofReal_add (mul_nonneg hC ha.le) (mul_nonneg hC ha.le)] |
| 125 | congr 1 |
| 126 | ring |
| 127 | _ < ENNReal.ofReal (4 * N.scale * a) := by |
| 128 | apply (ENNReal.ofReal_lt_ofReal_iff |
| 129 | (mul_pos (mul_pos (by norm_num : (0 : ℝ) < 4) N.scale_pos) ha)).mpr |
| 130 | have h := mul_lt_mul_of_pos_right |
| 131 | (mul_lt_mul_of_pos_left hroot N.scale_pos) ha |
| 132 | dsimp [C] |
| 133 | nlinarith |
| 134 | |
| 135 | end PoincareMT.Proofs.M46 |