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 | /- Adapted from Mapher `PoincareMT/Proofs/M03/Existence/CoordinateEllipticityNative.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Geometry.RicciFlow.Local.Existence.CoordinateMetricRegularity |
| 6 | import Mathlib.Analysis.Normed.Module.RCLike.Basic |
| 7 | import Mathlib.Analysis.Normed.Group.Bounded |
| 8 | import Mathlib.Topology.Order.Compact |
| 9 | |
| 10 | /-! |
| 11 | # Uniform metric-coordinate ellipticity and positive perturbations |
| 12 | |
| 13 | Compactness of the unit sphere turns pointwise positive matrix coefficients |
| 14 | into a uniform quadratic lower bound. The finite coordinate formula gives |
| 15 | a quantitative perturbation estimate in the elementwise matrix norm and |
| 16 | the supremum norm on finite real covectors. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | set_option maxHeartbeats 1600000 |
| 21 | |
| 22 | open scoped Manifold ContDiff BigOperators Matrix.Norms.Elementwise Topology |
| 23 | open Set |
| 24 | |
| 25 | noncomputable section |
| 26 | |
| 27 | universe u |
| 28 | |
| 29 | namespace PoincareMT.DeTurckNative |
| 30 | |
| 31 | variable {n : ℕ} |
| 32 | |
| 33 | theorem continuous_quadratic_joint : |
| 34 | Continuous (fun p : Matrix (Fin n) (Fin n) ℝ × (Fin n → ℝ) => |
| 35 | quadratic p.1 p.2) := by |
| 36 | unfold quadratic |
| 37 | fun_prop |
| 38 | |
| 39 | theorem quadratic_smul_covector (G : Matrix (Fin n) (Fin n) ℝ) |
| 40 | (a : ℝ) (xi : Fin n → ℝ) : |
| 41 | quadratic G (a • xi) = a ^ 2 * quadratic G xi := by |
| 42 | simp only [quadratic, Pi.smul_apply, smul_eq_mul, Finset.mul_sum] |
| 43 | apply Finset.sum_congr rfl |
| 44 | intro i _ |
| 45 | apply Finset.sum_congr rfl |
| 46 | intro j _ |
| 47 | ring |
| 48 | |
| 49 | theorem quadratic_sub_matrix (A G : Matrix (Fin n) (Fin n) ℝ) |
| 50 | (xi : Fin n → ℝ) : |
| 51 | quadratic (A - G) xi = quadratic A xi - quadratic G xi := by |
| 52 | simp only [quadratic, Matrix.sub_apply, sub_mul, Finset.sum_sub_distrib] |
| 53 | |
| 54 | theorem norm_quadratic_le (G : Matrix (Fin n) (Fin n) ℝ) (xi : Fin n → ℝ) : |
| 55 | ‖quadratic G xi‖ ≤ (n : ℝ) ^ 2 * ‖G‖ * ‖xi‖ ^ 2 := by |
| 56 | have hterm (i j : Fin n) : ‖G i j * xi i * xi j‖ ≤ ‖G‖ * ‖xi‖ ^ 2 := by |
| 57 | rw [norm_mul, norm_mul] |
| 58 | calc |
| 59 | ‖G i j‖ * ‖xi i‖ * ‖xi j‖ ≤ ‖G‖ * ‖xi‖ * ‖xi‖ := by |
| 60 | exact mul_le_mul |
| 61 | (mul_le_mul (Matrix.norm_entry_le_entrywise_sup_norm G) |
| 62 | (norm_le_pi_norm xi i) (norm_nonneg _) (norm_nonneg _)) |
| 63 | (norm_le_pi_norm xi j) (norm_nonneg _) (mul_nonneg (norm_nonneg _) (norm_nonneg _)) |
| 64 | _ = _ := by ring |
| 65 | calc |
| 66 | ‖quadratic G xi‖ ≤ ∑ i : Fin n, ∑ j : Fin n, ‖G i j * xi i * xi j‖ := by |
| 67 | exact (norm_sum_le _ _).trans (Finset.sum_le_sum fun i _ => norm_sum_le _ _) |
| 68 | _ ≤ ∑ _i : Fin n, ∑ _j : Fin n, ‖G‖ * ‖xi‖ ^ 2 := by |
| 69 | exact Finset.sum_le_sum fun i _ => Finset.sum_le_sum fun j _ => hterm i j |
| 70 | _ = _ := by simp [pow_two, mul_assoc] |
| 71 | |
| 72 | /-- A continuous positive matrix family has one coercivity constant on a compact set. -/ |
| 73 | theorem exists_uniform_quadratic_lower_bound {X : Type*} [TopologicalSpace X] |
| 74 | (G : X → Matrix (Fin n) (Fin n) ℝ) {K : Set X} (hK : IsCompact K) |
| 75 | (hG : ContinuousOn G K) (hpos : ∀ x ∈ K, (G x).PosDef) : |
| 76 | ∃ c : ℝ, 0 < c ∧ ∀ x ∈ K, ∀ xi : Fin n → ℝ, |
| 77 | c * ‖xi‖ ^ 2 ≤ quadratic (G x) xi := by |
| 78 | let S := K ×ˢ Metric.sphere (0 : Fin n → ℝ) 1 |
| 79 | have hS : IsCompact S := hK.prod (isCompact_sphere _ _) |
| 80 | have hcoeff : ContinuousOn (fun p : X × (Fin n → ℝ) => G p.1) S := |
| 81 | hG.comp continuous_fst.continuousOn (fun _ hp => hp.1) |
| 82 | have hQ : ContinuousOn (fun p : X × (Fin n → ℝ) => quadratic (G p.1) p.2) S := |
| 83 | continuous_quadratic_joint.comp_continuousOn |
| 84 | (hcoeff.prodMk continuous_snd.continuousOn) |
| 85 | have hpositive : ∀ p ∈ S, 0 < quadratic (G p.1) p.2 := by |
| 86 | intro p hp |
| 87 | apply quadratic_pos (G p.1) (hpos p.1 hp.1) |
| 88 | intro hzero |
| 89 | have hn : ‖p.2‖ = 1 := by |
| 90 | simpa only [Metric.mem_sphere, dist_zero_right] using hp.2 |
| 91 | simp only [hzero, norm_zero] at hn |
| 92 | norm_num at hn |
| 93 | obtain ⟨c, hc, hbound⟩ := hS.exists_forall_le' hQ hpositive |
| 94 | refine ⟨c, hc, ?_⟩ |
| 95 | intro x hx xi |
| 96 | by_cases hxi : xi = 0 |
| 97 | · simp [hxi, quadratic] |
| 98 | let eta : Fin n → ℝ := ‖xi‖⁻¹ • xi |
| 99 | have heta : eta ∈ Metric.sphere (0 : Fin n → ℝ) 1 := by |
| 100 | simpa only [eta, Metric.mem_sphere, dist_zero_right, RCLike.ofReal_real_eq_id, id_eq] using |
| 101 | (norm_smul_inv_norm (𝕜 := ℝ) hxi) |
| 102 | have hscale : ‖xi‖ • eta = xi := by |
| 103 | dsimp only [eta] |
| 104 | exact smul_inv_smul₀ (norm_ne_zero_iff.mpr hxi) xi |
| 105 | have hhom := quadratic_smul_covector (G x) ‖xi‖ eta |
| 106 | rw [hscale] at hhom |
| 107 | calc |
| 108 | c * ‖xi‖ ^ 2 ≤ quadratic (G x) eta * ‖xi‖ ^ 2 := |
| 109 | mul_le_mul_of_nonneg_right (hbound (x, eta) ⟨hx, heta⟩) (sq_nonneg _) |
| 110 | _ = quadratic (G x) xi := (mul_comm _ _).trans hhom.symm |
| 111 | |
| 112 | theorem continuousOn_inverse_posDef {X : Type*} [TopologicalSpace X] |
| 113 | (G : X → Matrix (Fin n) (Fin n) ℝ) {K : Set X} |
| 114 | (hG : ContinuousOn G K) (hpos : ∀ x ∈ K, (G x).PosDef) : |
| 115 | ContinuousOn (fun x => (G x)⁻¹) K := by |
| 116 | intro x hx |
| 117 | exact (continuousAt_matrix_inv_of_posDef (G x) (hpos x hx)).comp_continuousWithinAt |
| 118 | (hG x hx) |
| 119 | |
| 120 | theorem exists_uniform_inverse_quadratic_lower_bound {X : Type*} [TopologicalSpace X] |
| 121 | (G : X → Matrix (Fin n) (Fin n) ℝ) {K : Set X} (hK : IsCompact K) |
| 122 | (hG : ContinuousOn G K) (hpos : ∀ x ∈ K, (G x).PosDef) : |
| 123 | ∃ c : ℝ, 0 < c ∧ ∀ x ∈ K, ∀ xi : Fin n → ℝ, |
| 124 | c * ‖xi‖ ^ 2 ≤ quadratic (G x)⁻¹ xi := |
| 125 | exists_uniform_quadratic_lower_bound (fun x => (G x)⁻¹) hK |
| 126 | (continuousOn_inverse_posDef G hG hpos) (fun x hx => (hpos x hx).inv) |
| 127 | |
| 128 | /-- The lower bound survives a sufficiently small coefficient perturbation. -/ |
| 129 | theorem quadratic_lower_bound_of_close (G A : Matrix (Fin n) (Fin n) ℝ) |
| 130 | {c : ℝ} (hc : 0 < c) |
| 131 | (hG : ∀ xi : Fin n → ℝ, c * ‖xi‖ ^ 2 ≤ quadratic G xi) |
| 132 | (hclose : ‖A - G‖ ≤ c / (2 * ((n : ℝ) + 1) ^ 2)) (xi : Fin n → ℝ) : |
| 133 | (c / 2) * ‖xi‖ ^ 2 ≤ quadratic A xi := by |
| 134 | have hden : 0 < 2 * ((n : ℝ) + 1) ^ 2 := by positivity |
| 135 | have hdim : (n : ℝ) ^ 2 ≤ ((n : ℝ) + 1) ^ 2 := by |
| 136 | nlinarith [Nat.cast_nonneg (α := ℝ) n] |
| 137 | have hcoef : (n : ℝ) ^ 2 * ‖A - G‖ ≤ c / 2 := by |
| 138 | calc |
| 139 | (n : ℝ) ^ 2 * ‖A - G‖ ≤ (n : ℝ) ^ 2 * (c / (2 * ((n : ℝ) + 1) ^ 2)) := |
| 140 | mul_le_mul_of_nonneg_left hclose (sq_nonneg _) |
| 141 | _ ≤ ((n : ℝ) + 1) ^ 2 * (c / (2 * ((n : ℝ) + 1) ^ 2)) := |
| 142 | mul_le_mul_of_nonneg_right hdim (div_nonneg hc.le hden.le) |
| 143 | _ = c / 2 := by |
| 144 | have hn : (n : ℝ) + 1 ≠ 0 := by positivity |
| 145 | field_simp |
| 146 | <;> ring |
| 147 | have herr : |quadratic A xi - quadratic G xi| ≤ (c / 2) * ‖xi‖ ^ 2 := by |
| 148 | calc |
| 149 | |quadratic A xi - quadratic G xi| = ‖quadratic (A - G) xi‖ := by |
| 150 | rw [quadratic_sub_matrix, Real.norm_eq_abs] |
| 151 | _ ≤ (n : ℝ) ^ 2 * ‖A - G‖ * ‖xi‖ ^ 2 := norm_quadratic_le _ _ |
| 152 | _ ≤ (c / 2) * ‖xi‖ ^ 2 := mul_le_mul_of_nonneg_right hcoef (sq_nonneg _) |
| 153 | have hneg := (neg_le_abs (quadratic A xi - quadratic G xi)).trans herr |
| 154 | linarith [hG xi] |
| 155 | |
| 156 | theorem posDef_of_close_of_quadratic_lower_bound |
| 157 | (G A : Matrix (Fin n) (Fin n) ℝ) {c : ℝ} (hc : 0 < c) |
| 158 | (hG : ∀ xi : Fin n → ℝ, c * ‖xi‖ ^ 2 ≤ quadratic G xi) |
| 159 | (hA : A.IsSymm) (hclose : ‖A - G‖ ≤ c / (2 * ((n : ℝ) + 1) ^ 2)) : |
| 160 | A.PosDef := by |
| 161 | apply Matrix.PosDef.of_dotProduct_mulVec_pos (by simpa only [Matrix.isHermitian_iff_isSymm] using hA) |
| 162 | intro xi hxi |
| 163 | rw [← quadratic_eq_dotProduct] |
| 164 | exact (mul_pos (div_pos hc (by norm_num)) (sq_pos_of_pos (norm_pos_iff.mpr hxi))).trans_le |
| 165 | (quadratic_lower_bound_of_close G A hc hG hclose xi) |
| 166 | |
| 167 | theorem exists_uniform_posDef_perturbation {X : Type*} [TopologicalSpace X] |
| 168 | (G : X → Matrix (Fin n) (Fin n) ℝ) {K : Set X} (hK : IsCompact K) |
| 169 | (hG : ContinuousOn G K) (hpos : ∀ x ∈ K, (G x).PosDef) : |
| 170 | ∃ delta : ℝ, 0 < delta ∧ ∀ x ∈ K, ∀ A : Matrix (Fin n) (Fin n) ℝ, |
| 171 | A.IsSymm → ‖A - G x‖ ≤ delta → A.PosDef := by |
| 172 | obtain ⟨c, hc, hbound⟩ := exists_uniform_quadratic_lower_bound G hK hG hpos |
| 173 | refine ⟨c / (2 * ((n : ℝ) + 1) ^ 2), by positivity, ?_⟩ |
| 174 | intro x hx A hA hclose |
| 175 | exact posDef_of_close_of_quadratic_lower_bound (G x) A hc (hbound x hx) hA hclose |
| 176 | |
| 177 | variable {M : Type u} [TopologicalSpace M] |
| 178 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 179 | |
| 180 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 181 | |
| 182 | theorem chartMetricCoefficients_continuousOn (g : RiemannianMetric n M) (p : M) : |
| 183 | ContinuousOn (chartMetricCoefficients g p) (extChartAt (𝓡 n) p).target := by |
| 184 | apply continuousOn_pi.mpr |
| 185 | intro i |
| 186 | apply continuousOn_pi.mpr |
| 187 | intro j |
| 188 | exact (chartMetricCoefficients_contDiffOn g p i j).continuousOn |
| 189 | |
| 190 | theorem exists_chartMetric_uniform_ellipticity (g : RiemannianMetric n M) (p : M) |
| 191 | {K : Set E} (hK : IsCompact K) (hKU : K ⊆ (extChartAt (𝓡 n) p).target) : |
| 192 | ∃ c : ℝ, 0 < c ∧ ∀ z ∈ K, ∀ xi : Fin n → ℝ, |
| 193 | c * ‖xi‖ ^ 2 ≤ quadratic (chartMetricCoefficients g p z)⁻¹ xi := |
| 194 | exists_uniform_inverse_quadratic_lower_bound (chartMetricCoefficients g p) hK |
| 195 | ((chartMetricCoefficients_continuousOn g p).mono hKU) |
| 196 | (fun z hz => chartMetricCoefficients_posDef g p (hKU hz)) |
| 197 | |
| 198 | theorem exists_chartMetric_uniform_posDef_perturbation |
| 199 | (g : RiemannianMetric n M) (p : M) {K : Set E} (hK : IsCompact K) |
| 200 | (hKU : K ⊆ (extChartAt (𝓡 n) p).target) : |
| 201 | ∃ delta : ℝ, 0 < delta ∧ ∀ z ∈ K, ∀ A : Matrix (Fin n) (Fin n) ℝ, |
| 202 | A.IsSymm → ‖A - chartMetricCoefficients g p z‖ ≤ delta → A.PosDef := |
| 203 | exists_uniform_posDef_perturbation (chartMetricCoefficients g p) hK |
| 204 | ((chartMetricCoefficients_continuousOn g p).mono hKU) |
| 205 | (fun z hz => chartMetricCoefficients_posDef g p (hKU hz)) |
| 206 | |
| 207 | theorem exists_chartMetric_inverse_norm_bound (g : RiemannianMetric n M) (p : M) |
| 208 | {K : Set E} (hK : IsCompact K) (hKU : K ⊆ (extChartAt (𝓡 n) p).target) : |
| 209 | ∃ B : ℝ, 0 < B ∧ ∀ z ∈ K, ‖(chartMetricCoefficients g p z)⁻¹‖ ≤ B := by |
| 210 | have hcont : ContinuousOn (fun z => (chartMetricCoefficients g p z)⁻¹) K := |
| 211 | continuousOn_inverse_posDef (chartMetricCoefficients g p) |
| 212 | ((chartMetricCoefficients_continuousOn g p).mono hKU) |
| 213 | (fun z hz => chartMetricCoefficients_posDef g p (hKU hz)) |
| 214 | obtain ⟨B, hB, hbound⟩ := (hK.image_of_continuousOn hcont).isBounded.exists_pos_norm_le |
| 215 | exact ⟨B, hB, fun z hz => hbound _ ⟨z, hz, rfl⟩⟩ |
| 216 | |
| 217 | end PoincareMT.DeTurckNative |
| 218 | |
| 219 | end |