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.SourceNames |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Cylinders.CylinderRicciReadout |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Cylinders.CylinderModelRicci |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.NeckGeometry.NeckLengthComparison |
| 6 | |
| 7 | /-! |
| 8 | # The actual uniform Ricci estimate for overlapping necks |
| 9 | |
| 10 | Morgan--Tian, Lemma A.3 and Proposition A.11, pp. 498-504. Continuity |
| 11 | at the fixed literal cylinder two-jet controls all nine Ricci entries. |
| 12 | The checked frozen metric comparison supplies the source jets, and the |
| 13 | actual source Ricci bilinear form reconstructs the quadratic estimate. |
| 14 | The accuracy is chosen before the manifold, neck, point and vector. |
| 15 | -/ |
| 16 | |
| 17 | noncomputable section |
| 18 | set_option autoImplicit false |
| 19 | set_option backward.isDefEq.respectTransparency false |
| 20 | set_option maxSynthPendingDepth 12 |
| 21 | |
| 22 | open Set |
| 23 | open scoped Manifold ContDiff Bundle BigOperators Topology |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.M28.tube |
| 28 | |
| 29 | open PoincareMT.SpacetimeBounds PoincareMT.Proofs.M28.NeckLengthComparison |
| 30 | |
| 31 | private abbrev CE := EuclideanSpace ℝ (Fin 3) |
| 32 | private abbrev SE := EuclideanSpace ℝ (Fin 2) |
| 33 | private abbrev cb := EuclideanSpace.basisFun (Fin 3) ℝ |
| 34 | private abbrev CI := (𝓡 2).prod 𝓘(ℝ, ℝ) |
| 35 | |
| 36 | private theorem exists_cylinder_model_ricci_coefficient_modulus |
| 37 | {delta : ℝ} (hdelta : 0 < delta) : |
| 38 | ∃ eta : ℝ, 0 < eta ∧ ∀ J : MetricTwoJet 3, |
| 39 | dist J cylinderModelTwoJet < eta → ∀ i j : Fin 3, |
| 40 | |jetRicci J (cb i) (cb j) - |
| 41 | inner ℝ (cylinderSphereProjection (cb i)) |
| 42 | (cylinderSphereProjection (cb j))| < delta := by |
| 43 | let f : MetricTwoJet 3 → (Fin 3 × Fin 3) → ℝ := |
| 44 | fun J p => jetRicci J (cb p.1) (cb p.2) |
| 45 | have hf : ContinuousAt f cylinderModelTwoJet := by |
| 46 | apply continuousAt_pi.mpr |
| 47 | intro p |
| 48 | exact (contDiffAt_jetRicci cylinderModelMetricCoefficient_zero_isInvertible |
| 49 | (cb p.1) (cb p.2)).continuousAt |
| 50 | obtain ⟨eta, heta, hnear⟩ := (Metric.continuousAt_iff.mp hf) delta hdelta |
| 51 | refine ⟨eta, heta, ?_⟩ |
| 52 | intro J hJ i j |
| 53 | have h := (dist_le_pi_dist (f J) (f cylinderModelTwoJet) (i, j)).trans_lt |
| 54 | (hnear hJ) |
| 55 | simpa only [f, Real.dist_eq, cylinderModelTwoJet_ricci] using h |
| 56 | |
| 57 | private theorem bilinear_quadratic_le_nine |
| 58 | (E : CE →ₗ[ℝ] CE →ₗ[ℝ] ℝ) {delta : ℝ} |
| 59 | (hentry : ∀ i j : Fin 3, |E (cb i) (cb j)| ≤ delta) (v : CE) : |
| 60 | |E v v| ≤ 9 * delta * ‖v‖ ^ 2 := by |
| 61 | have hrepr : (∑ i : Fin 3, v i • cb i) = v := by |
| 62 | simpa only [EuclideanSpace.basisFun_repr] using cb.sum_repr v |
| 63 | have hexp : E v v = ∑ i : Fin 3, ∑ j : Fin 3, v i * v j * E (cb i) (cb j) := by |
| 64 | calc |
| 65 | E v v = E (∑ i : Fin 3, v i • cb i) (∑ j : Fin 3, v j • cb j) := by |
| 66 | rw [hrepr] |
| 67 | _ = _ := by |
| 68 | simp only [map_sum, LinearMap.sum_apply, map_smul, LinearMap.smul_apply, |
| 69 | smul_eq_mul, Finset.mul_sum, mul_assoc] |
| 70 | rw [Finset.sum_comm] |
| 71 | apply Finset.sum_congr rfl |
| 72 | intro i _ |
| 73 | apply Finset.sum_congr rfl |
| 74 | intro j _ |
| 75 | ring |
| 76 | have hterm (i j : Fin 3) : |
| 77 | |v i * v j * E (cb i) (cb j)| ≤ delta * ‖v‖ ^ 2 := by |
| 78 | rw [abs_mul, abs_mul] |
| 79 | have hi : |v i| ≤ ‖v‖ := by simpa only [Real.norm_eq_abs] using PiLp.norm_apply_le v i |
| 80 | have hj : |v j| ≤ ‖v‖ := by simpa only [Real.norm_eq_abs] using PiLp.norm_apply_le v j |
| 81 | have hmul := mul_le_mul |
| 82 | (mul_le_mul hi hj (abs_nonneg _) (norm_nonneg _)) (hentry i j) |
| 83 | (abs_nonneg _) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) |
| 84 | simpa only [pow_two, mul_comm delta, mul_assoc] using hmul |
| 85 | rw [hexp] |
| 86 | calc |
| 87 | _ ≤ ∑ i : Fin 3, |∑ j : Fin 3, v i * v j * E (cb i) (cb j)| := |
| 88 | Finset.abs_sum_le_sum_abs _ _ |
| 89 | _ ≤ ∑ _i : Fin 3, ∑ _j : Fin 3, delta * ‖v‖ ^ 2 := by |
| 90 | apply Finset.sum_le_sum |
| 91 | intro i _ |
| 92 | exact (Finset.abs_sum_le_sum_abs _ _).trans |
| 93 | (Finset.sum_le_sum (fun j _ => hterm i j)) |
| 94 | _ = _ := by simp; ring |
| 95 | |
| 96 | private theorem norm_sq_le_cylinder_metric (z : RoundCylinderSpace) (v : CE) : |
| 97 | ‖v‖ ^ 2 ≤ EvolvingRoundCylinderMetric 0 z |
| 98 | (cylinderScalarCoordinateEquiv v) (cylinderScalarCoordinateEquiv v) := by |
| 99 | rw [show EvolvingRoundCylinderMetric 0 = RoundCylinderMetric from rfl, |
| 100 | roundCylinderMetric_self_eq, cylinderScalarCoordinateEquiv_apply] |
| 101 | simp only [EuclideanSpace.real_norm_sq_eq, Fin.sum_univ_three, Fin.sum_univ_two, |
| 102 | Matrix.cons_val_zero, Matrix.cons_val_one] |
| 103 | nlinarith [sq_nonneg (v 0), sq_nonneg (v 1)] |
| 104 | |
| 105 | private theorem cylinder_ricci_model_quadratic (z : RoundCylinderSpace) (v : CE) : |
| 106 | (1 / 2 : ℝ) * (EvolvingRoundCylinderMetric 0 z |
| 107 | (cylinderScalarCoordinateEquiv v) (cylinderScalarCoordinateEquiv v) - |
| 108 | (cylinderScalarCoordinateEquiv v).2 ^ 2) = |
| 109 | inner ℝ (cylinderSphereProjection v) (cylinderSphereProjection v) := by |
| 110 | rw [show EvolvingRoundCylinderMetric 0 = RoundCylinderMetric from rfl, |
| 111 | roundCylinderMetric_self_eq, real_inner_self_eq_norm_sq] |
| 112 | change (1 / 2 : ℝ) * |
| 113 | (2 * ‖(cylinderScalarCoordinateEquiv v).1‖ ^ 2 + |
| 114 | (cylinderScalarCoordinateEquiv v).2 ^ 2 - (cylinderScalarCoordinateEquiv v).2 ^ 2) = |
| 115 | ‖(cylinderScalarCoordinateEquiv v).1‖ ^ 2 |
| 116 | ring |
| 117 | |
| 118 | /-- Every sufficiently accurate actual neck satisfies the literal |
| 119 | quadratic Ricci error required by M23's sphere-projection derivative |
| 120 | theorem. The uniform accuracy precedes all geometric data. -/ |
| 121 | theorem exists_neck_ricci_accuracy : |
| 122 | ∃ epsilon₀ : ℝ, 0 < epsilon₀ ∧ epsilon₀ ≤ (1 / 200 : ℝ) ∧ |
| 123 | ∀ (M : Type u) [TopologicalSpace M] |
| 124 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 125 | [IsManifold (𝓡 3) ∞ M] [T2Space M] |
| 126 | (g : RiemannianMetric 3 M) (D : LeviCivitaData g) |
| 127 | (N : EpsilonNeck g), N.epsilon ≤ epsilon₀ → |
| 128 | ∀ z ∈ N.cylinderDomain, ∀ v : RoundCylinderTangent z, |
| 129 | |D.ricci (N.coordinate_map z) |
| 130 | (mfderiv CI (𝓡 3) N.coordinate_map z v) |
| 131 | (mfderiv CI (𝓡 3) N.coordinate_map z v) - |
| 132 | (1 / 2 : ℝ) * (EvolvingRoundCylinderMetric 0 z v v - v.2 ^ 2)| ≤ |
| 133 | (1 / 100 : ℝ) * EvolvingRoundCylinderMetric 0 z v v := by |
| 134 | obtain ⟨eta, heta, hmodulus⟩ := |
| 135 | exists_cylinder_model_ricci_coefficient_modulus (delta := 1 / 900) (by norm_num) |
| 136 | obtain ⟨L, hL, hjet⟩ := exists_cylinder_metricTwoJet_bound.{u} |
| 137 | refine ⟨min (1 / 200) (eta / (2 * L)), |
| 138 | lt_min (by norm_num) (by positivity), min_le_left _ _, ?_⟩ |
| 139 | intro M _ _ _ _ g D N hN z hz v |
| 140 | have heps : N.epsilon ≤ (1 / 200 : ℝ) := hN.trans (min_le_left _ _) |
| 141 | have horder : 2 ≤ ⌊N.epsilon⁻¹⌋₊ := by |
| 142 | apply Nat.le_floor |
| 143 | rw [inv_eq_one_div, le_div_iff₀ N.epsilon_pos] |
| 144 | norm_num |
| 145 | linarith |
| 146 | have hdist : L * N.epsilon < eta := by |
| 147 | have h := hN.trans (min_le_right _ _) |
| 148 | have hm := (le_div_iff₀ (mul_pos (by norm_num : (0 : ℝ) < 2) hL)).mp h |
| 149 | nlinarith |
| 150 | have hentries := hmodulus _ ((hjet M g N horder z hz.2).trans_lt hdist) |
| 151 | let f : CE →L[ℝ] TangentSpace (𝓡 3) (N.coordinate_map z) := |
| 152 | (mfderiv CI (𝓡 3) N.coordinate_map z).comp |
| 153 | cylinderScalarCoordinateEquiv.toContinuousLinearMap |
| 154 | let E : CE →ₗ[ℝ] CE →ₗ[ℝ] ℝ := |
| 155 | (M13.ricciLinear D (N.coordinate_map z)).compl₁₂ f.toLinearMap f.toLinearMap - |
| 156 | (innerₗ SE).compl₁₂ cylinderSphereProjection.toLinearMap |
| 157 | cylinderSphereProjection.toLinearMap |
| 158 | have hE (a b : CE) : E a b = |
| 159 | D.ricci (N.coordinate_map z) |
| 160 | (mfderiv CI (𝓡 3) N.coordinate_map z (cylinderScalarCoordinateEquiv a)) |
| 161 | (mfderiv CI (𝓡 3) N.coordinate_map z (cylinderScalarCoordinateEquiv b)) - |
| 162 | inner ℝ (cylinderSphereProjection a) (cylinderSphereProjection b) := rfl |
| 163 | have hEbound (i j : Fin 3) : |E (cb i) (cb j)| ≤ (1 / 900 : ℝ) := by |
| 164 | rw [hE, ← cylinderNeckCoefficients_ricci_zero N D z.1 hz.2] |
| 165 | exact (hentries i j).le |
| 166 | let w : CE := cylinderScalarCoordinateEquiv.symm v |
| 167 | have hw : cylinderScalarCoordinateEquiv w = v := |
| 168 | cylinderScalarCoordinateEquiv.apply_symm_apply v |
| 169 | have hbound := bilinear_quadratic_le_nine E hEbound w |
| 170 | rw [hE, ← cylinder_ricci_model_quadratic z w, hw] at hbound |
| 171 | have hnorm := norm_sq_le_cylinder_metric z w |
| 172 | rw [hw] at hnorm |
| 173 | exact hbound.trans (by nlinarith) |
| 174 | |
| 175 | end PoincareMT.M28.tube |