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.Topology.Manifold.Poincare.Final.Compatibility.Metric |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Metric.Neck.NeckCoordinates |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.Noncollapse.Assembly.NeckPatch |
| 4 | |
| 5 | /-! |
| 6 | # Distances through the actual retained neck coordinates |
| 7 | |
| 8 | Theorem 13.2, pp. 332-333, and Proposition 16.3, p. 368. The smooth |
| 9 | collar contains the closed negative half-neck, where the metric is |
| 10 | retained exactly. The differential comparison therefore controls both |
| 11 | central-sphere distances and short negative axial segments in the actual |
| 12 | output metric. See the reviewed retained-neck-volume derivation. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Bundle ENNReal |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.Proofs.M47 |
| 24 | |
| 25 | variable {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 27 | {g : RiemannianMetric 3 M} {g0 : StandardInitialMetric} |
| 28 | {K : MetricSurgeryConstants} {I : MetricSurgeryInput K g} |
| 29 | |
| 30 | private theorem neck_inv_epsilon_gt_one : 1 < I.neck.epsilon⁻¹ := by |
| 31 | rw [inv_eq_one_div] |
| 32 | apply (lt_div_iff₀ I.neck.epsilon_pos).mpr |
| 33 | linarith [I.neck.epsilon_lt_half] |
| 34 | |
| 35 | private theorem retained_coordinate_smooth_at (R : MetricSurgeryResult g0 I) |
| 36 | {z : RoundCylinderSpace} (hz : z.2 ∈ Ioo (-I.neck.epsilon⁻¹) 1) : |
| 37 | ContMDiffAt ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) ∞ |
| 38 | (R.collapse ∘ I.neck.coordinate_map) z := by |
| 39 | have hdom : z ∈ I.neck.cylinderDomain := |
| 40 | ⟨mem_univ _, hz.1, hz.2.trans neck_inv_epsilon_gt_one⟩ |
| 41 | have hx : I.neck.coordinate_map z ∈ I.neck.region (-I.neck.epsilon⁻¹) 1 := by |
| 42 | refine ⟨M36.neck_coordinate_mem I.neck z hdom, ?_⟩ |
| 43 | simpa only [M36.neck_inverse_coordinate I.neck z hdom, mem_Ioo] using hz |
| 44 | exact (R.retained_smooth.contMDiffAt |
| 45 | ((M36.neck_region_isOpen I.neck _ _).mem_nhds hx)).comp z |
| 46 | (M36.neck_coordinate_contMDiffAt I.neck hdom) |
| 47 | |
| 48 | private theorem retained_coordinate_pullback (R : MetricSurgeryResult g0 I) |
| 49 | {z : RoundCylinderSpace} (hz : z.2 ∈ Ioc (-I.neck.epsilon⁻¹) 0) |
| 50 | (v : RoundCylinderTangent z) : |
| 51 | roundCylinderPullback R.metric (R.collapse ∘ I.neck.coordinate_map) z v v = |
| 52 | roundCylinderPullback g I.neck.coordinate_map z v v := by |
| 53 | have hdom : z ∈ I.neck.cylinderDomain := |
| 54 | ⟨mem_univ _, hz.1, hz.2.trans_lt (inv_pos.mpr I.neck.epsilon_pos)⟩ |
| 55 | have hx : I.neck.coordinate_map z ∈ I.neck.region (-I.neck.epsilon⁻¹) 1 := by |
| 56 | refine ⟨M36.neck_coordinate_mem I.neck z hdom, ?_⟩ |
| 57 | simpa only [M36.neck_inverse_coordinate I.neck z hdom, mem_Ioo] using |
| 58 | (show z.2 ∈ Ioo (-I.neck.epsilon⁻¹) 1 from ⟨hz.1, hz.2.trans_lt zero_lt_one⟩) |
| 59 | have hret : I.neck.coordinate_map z ∈ |
| 60 | I.neck.region (-I.neck.epsilon⁻¹) 0 ∪ I.neck.central_sphere := by |
| 61 | apply (M36.neck_retained_iff I.neck).mpr |
| 62 | refine ⟨hx.1, ?_⟩ |
| 63 | simpa only [M36.neck_inverse_coordinate I.neck z hdom] using hz.2 |
| 64 | have hf := (R.retained_smooth.contMDiffAt |
| 65 | ((M36.neck_region_isOpen I.neck _ _).mem_nhds hx)).mdifferentiableAt (by simp) |
| 66 | have hi := (M36.neck_coordinate_contMDiffAt I.neck hdom).mdifferentiableAt (by simp) |
| 67 | have hd := mfderiv_comp_apply z hf hi v |
| 68 | dsimp only [roundCylinderPullback] |
| 69 | rw [hd] |
| 70 | exact R.retained_metric _ hret _ _ |
| 71 | |
| 72 | variable [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 73 | |
| 74 | /-- Retention preserves the central-sphere differential comparison with |
| 75 | its actual spherical distance, Theorem 13.2 and Proposition 16.3. -/ |
| 76 | theorem retained_central_distance (R : MetricSurgeryResult g0 I) |
| 77 | (q r : UnitTwoSphere) : |
| 78 | R.metric.edist (R.collapse (I.neck.coordinate_map (q, 0))) |
| 79 | (R.collapse (I.neck.coordinate_map (r, 0))) ≤ |
| 80 | ENNReal.ofReal (I.neck.scale * Real.sqrt (1 + I.neck.epsilon)) * |
| 81 | M46.canonicalSphereMetric.edist q r := by |
| 82 | let N := I.neck |
| 83 | let theta := R.collapse ∘ N.coordinate_map |
| 84 | have hzero : (0 : ℝ) ∈ Ioc (-N.epsilon⁻¹) 0 := |
| 85 | ⟨neg_neg_of_pos (inv_pos.mpr N.epsilon_pos), le_rfl⟩ |
| 86 | have hcoord (q : UnitTwoSphere) : |
| 87 | ContMDiffAt ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) ∞ theta (q, 0) := |
| 88 | retained_coordinate_smooth_at R ⟨hzero.1, zero_lt_one⟩ |
| 89 | let F : UnitTwoSphere → R.output.carrier := fun q => theta (q, 0) |
| 90 | have hF : ContMDiff (𝓡 2) (𝓡 3) 1 F := by |
| 91 | intro q |
| 92 | exact ((hcoord q).comp q |
| 93 | (contMDiffAt_id.prodMk contMDiffAt_const)).of_le |
| 94 | (show (1 : ℕ∞ω) ≤ (∞ : ℕ∞ω) by simp) |
| 95 | have hderiv (q : UnitTwoSphere) (v : TangentSpace (𝓡 2) q) : |
| 96 | mfderiv (𝓡 2) (𝓡 3) F q v = |
| 97 | mfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) theta (q, 0) (v, 0) := by |
| 98 | dsimp only [TangentSpace] at v ⊢ |
| 99 | change mfderiv (𝓡 2) (𝓡 3) |
| 100 | (theta ∘ fun q : UnitTwoSphere => (q, (0 : ℝ))) q v = _ |
| 101 | have h := mfderiv_comp_apply q ((hcoord q).mdifferentiableAt (by simp)) |
| 102 | (mdifferentiableAt_id.prodMk mdifferentiableAt_const) v |
| 103 | simp only [id_eq, mfderiv_prod_left] at h |
| 104 | exact h |
| 105 | let C := N.scale * Real.sqrt (1 + N.epsilon) |
| 106 | have hplus : 0 ≤ 1 + N.epsilon := by linarith [N.epsilon_pos] |
| 107 | have hC : 0 < C := mul_pos N.scale_pos |
| 108 | (Real.sqrt_pos.mpr (by linarith [N.epsilon_pos])) |
| 109 | have hCsq : C ^ 2 = (1 + N.epsilon) * N.scale ^ 2 := by |
| 110 | dsimp [C] |
| 111 | rw [mul_pow, Real.sq_sqrt hplus] |
| 112 | ring |
| 113 | have hbound (q : UnitTwoSphere) (v : TangentSpace (𝓡 2) q) : |
| 114 | R.metric.inner (F q) (mfderiv (𝓡 2) (𝓡 3) F q v) |
| 115 | (mfderiv (𝓡 2) (𝓡 3) F q v) ≤ |
| 116 | C ^ 2 * M46.canonicalSphereMetric.inner q v v := by |
| 117 | have h := (N.pullback_metric_bounds (z := (q, 0)) |
| 118 | ⟨hzero.1, inv_pos.mpr N.epsilon_pos⟩ (v, 0)).2 |
| 119 | rw [← retained_coordinate_pullback R hzero (v, 0)] at h |
| 120 | rw [hderiv, hCsq] |
| 121 | simpa only [F, theta, M46.canonicalSphereMetric, rescaledMetric_inner, |
| 122 | roundCylinderPullback, EvolvingRoundCylinderMetric, |
| 123 | Poincare.Geometry.Riemannian.SpaceForm.roundSphereMetric_inner, |
| 124 | RiemannianMetric.euclideanMetric_inner, sub_zero, mul_one, zero_mul, |
| 125 | add_zero, mul_assoc] using h |
| 126 | exact M46.canonicalSphereMetric.edist_le_mul_of_inner_mfderiv_le R.metric hF hC hbound q r |
| 127 | |
| 128 | /-- A short negative axial segment stays within its original length |
| 129 | bound in the actual surgery output, including the central endpoint. -/ |
| 130 | theorem retained_axial_distance (R : MetricSurgeryResult g0 I) |
| 131 | (q : UnitTwoSphere) {z : ℝ} (hz : z ∈ Icc (-1 : ℝ) 0) : |
| 132 | R.metric.edist (R.collapse (I.neck.coordinate_map (q, 0))) |
| 133 | (R.collapse (I.neck.coordinate_map (q, z))) ≤ |
| 134 | ENNReal.ofReal (I.neck.scale * Real.sqrt (1 + I.neck.epsilon) * |z|) := by |
| 135 | let N := I.neck |
| 136 | let theta := R.collapse ∘ N.coordinate_map |
| 137 | let gamma : ℝ → R.output.carrier := fun t => theta (q, t) |
| 138 | let C := N.scale * Real.sqrt (1 + N.epsilon) |
| 139 | have hgamma : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) ∞ gamma (Ioo (-N.epsilon⁻¹) 1) := by |
| 140 | intro t ht |
| 141 | exact ((retained_coordinate_smooth_at R (z := (q, t)) ht).comp t |
| 142 | (contMDiffAt_const.prodMk contMDiffAt_id)).contMDiffWithinAt |
| 143 | have hI : Icc z 0 ⊆ Ioo (-N.epsilon⁻¹) 1 := by |
| 144 | intro t ht |
| 145 | constructor <;> linarith [hz.1, ht.1, ht.2, neck_inv_epsilon_gt_one (I := I)] |
| 146 | have hspeed (t : ℝ) (ht : t ∈ Icc z 0) : |
| 147 | R.metric.tangentNorm (gamma t) (mfderiv 𝓘(ℝ, ℝ) (𝓡 3) gamma t 1) ≤ C := by |
| 148 | have hcoord := retained_coordinate_smooth_at R (z := (q, t)) (hI ht) |
| 149 | have hd : mfderiv 𝓘(ℝ, ℝ) (𝓡 3) gamma t 1 = |
| 150 | mfderiv ((𝓡 2).prod 𝓘(ℝ, ℝ)) (𝓡 3) theta (q, t) (0, 1) := by |
| 151 | change mfderiv 𝓘(ℝ, ℝ) (𝓡 3) (theta ∘ fun t : ℝ => (q, t)) t 1 = _ |
| 152 | rw [mfderiv_comp_apply t (hcoord.mdifferentiableAt (by simp)) |
| 153 | (mdifferentiableAt_const.prodMk mdifferentiableAt_id)] |
| 154 | simp only [mfderiv_prod_right] |
| 155 | rfl |
| 156 | have h := (N.pullback_metric_bounds (z := (q, t)) |
| 157 | ⟨(hI ht).1, ht.2.trans_lt (inv_pos.mpr N.epsilon_pos)⟩ (0, 1)).2 |
| 158 | rw [← retained_coordinate_pullback R ⟨(hI ht).1, ht.2⟩ (0, 1)] at h |
| 159 | have hinner : R.metric.inner (gamma t) |
| 160 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 3) gamma t 1) |
| 161 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 3) gamma t 1) ≤ C ^ 2 := by |
| 162 | rw [hd] |
| 163 | dsimp only [C] |
| 164 | rw [mul_pow, Real.sq_sqrt (by linarith [N.epsilon_pos])] |
| 165 | simpa only [gamma, theta, roundCylinderPullback, EvolvingRoundCylinderMetric, |
| 166 | Poincare.Geometry.Riemannian.SpaceForm.roundSphereMetric_inner, |
| 167 | RiemannianMetric.euclideanMetric_inner, map_zero, inner_zero_left, |
| 168 | mul_zero, zero_mul, zero_add, one_mul, mul_one, mul_comm] using h |
| 169 | exact (Real.sqrt_le_sqrt hinner).trans_eq |
| 170 | (Real.sqrt_sq (mul_nonneg N.scale_pos.le (Real.sqrt_nonneg _))) |
| 171 | have h := R.metric.edist_le_of_tangentNorm_le hz.2 isOpen_Ioo hI hgamma |
| 172 | (mul_nonneg N.scale_pos.le (Real.sqrt_nonneg _)) hspeed |
| 173 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : R.output.carrier → Type _) := |
| 174 | ⟨R.metric.toRiemannianMetric⟩ |
| 175 | change R.metric.edist (gamma 0) (gamma z) ≤ _ |
| 176 | rw [show R.metric.edist (gamma 0) (gamma z) = R.metric.edist (gamma z) (gamma 0) from |
| 177 | Manifold.riemannianEDist_comm] |
| 178 | simpa only [zero_sub, abs_of_nonpos hz.2] using h |
| 179 | |
| 180 | end PoincareMT.Proofs.M47 |