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.Analysis.Parabolic.Interior.CompactSlices |
| 2 | import PoincareLib.Analysis.Parabolic.Interior.Absorption |
| 3 | import Mathlib.Analysis.Normed.Module.FiniteDimension |
| 4 | import Mathlib.Topology.Order.Compact |
| 5 | |
| 6 | /-! |
| 7 | # Nested interior cylinders and bounded derivative suprema |
| 8 | |
| 9 | The compact cylinders increase inside the unit ball and times between one half |
| 10 | and one. A geometric spatial radius leaves room for a doubled spatial ball and |
| 11 | a backward interval of the radius squared inside the next cylinder. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped ContDiff Topology |
| 20 | |
| 21 | namespace Poincare.Parabolic.Interior |
| 22 | |
| 23 | def nestedSpatialRadius (k : ℕ) : ℝ := 1 - (1 / 2 : ℝ) ^ (k + 1) |
| 24 | |
| 25 | def nestedTimeLower (k : ℕ) : ℝ := 1 / 2 + (1 / 2 : ℝ) ^ (k + 2) |
| 26 | |
| 27 | def nestedRadius (k : ℕ) : ℝ := (1 / 2 : ℝ) ^ (k + 4) |
| 28 | |
| 29 | theorem nestedRadius_pos (k : ℕ) : 0 < nestedRadius k := by |
| 30 | exact pow_pos (by norm_num) _ |
| 31 | |
| 32 | theorem nestedRadius_le_one (k : ℕ) : nestedRadius k ≤ 1 := by |
| 33 | exact pow_le_one₀ (by norm_num) (by norm_num) |
| 34 | |
| 35 | theorem nestedRadius_succ (k : ℕ) : nestedRadius (k + 1) = nestedRadius k / 2 := by |
| 36 | unfold nestedRadius |
| 37 | rw [show k + 1 + 4 = (k + 4) + 1 by omega, pow_succ] |
| 38 | ring |
| 39 | |
| 40 | theorem nestedRadius_inverse_sq (k : ℕ) : 1 / nestedRadius k ^ 2 = 256 * (4 : ℝ) ^ k := by |
| 41 | induction k with |
| 42 | | zero => norm_num [nestedRadius] |
| 43 | | succ k ih => |
| 44 | rw [nestedRadius_succ, div_pow, div_div_eq_mul_div] |
| 45 | calc |
| 46 | _ = 4 * (1 / nestedRadius k ^ 2) := by ring |
| 47 | _ = 4 * (256 * 4 ^ k) := by rw [ih] |
| 48 | _ = _ := by rw [pow_succ]; ring |
| 49 | |
| 50 | theorem nestedSpatialRadius_nonneg (k : ℕ) : 0 ≤ nestedSpatialRadius k := by |
| 51 | have h : (1 / 2 : ℝ) ^ (k + 1) ≤ 1 := pow_le_one₀ (by norm_num) (by norm_num) |
| 52 | exact sub_nonneg.mpr h |
| 53 | |
| 54 | theorem nestedSpatialRadius_lt_one (k : ℕ) : nestedSpatialRadius k < 1 := by |
| 55 | have h : 0 < (1 / 2 : ℝ) ^ (k + 1) := pow_pos (by norm_num) _ |
| 56 | dsimp [nestedSpatialRadius] |
| 57 | linarith |
| 58 | |
| 59 | theorem nestedTimeLower_ge_half (k : ℕ) : 1 / 2 ≤ nestedTimeLower k := by |
| 60 | have h : 0 ≤ (1 / 2 : ℝ) ^ (k + 2) := pow_nonneg (by norm_num) _ |
| 61 | dsimp [nestedTimeLower] |
| 62 | linarith |
| 63 | |
| 64 | theorem nestedTimeLower_le_one (k : ℕ) : nestedTimeLower k ≤ 1 := by |
| 65 | have h : (1 / 2 : ℝ) ^ k ≤ 1 := pow_le_one₀ (by norm_num) (by norm_num) |
| 66 | dsimp [nestedTimeLower] |
| 67 | rw [pow_add] |
| 68 | norm_num |
| 69 | linarith |
| 70 | |
| 71 | theorem nestedSpatialRadius_add_two_radius_le (k : ℕ) : |
| 72 | nestedSpatialRadius k + 2 * nestedRadius k ≤ nestedSpatialRadius (k + 1) := by |
| 73 | have h : 0 ≤ (1 / 2 : ℝ) ^ k := pow_nonneg (by norm_num) _ |
| 74 | simp only [nestedSpatialRadius, nestedRadius, pow_add, pow_one] |
| 75 | norm_num |
| 76 | linarith |
| 77 | |
| 78 | theorem nestedTimeLower_sub_radius_sq_ge (k : ℕ) : |
| 79 | nestedTimeLower (k + 1) ≤ nestedTimeLower k - nestedRadius k ^ 2 := by |
| 80 | have hr := nestedRadius_pos k |
| 81 | have hr1 := nestedRadius_le_one k |
| 82 | have hgap : nestedTimeLower k - nestedTimeLower (k + 1) = 2 * nestedRadius k := by |
| 83 | simp only [nestedTimeLower, nestedRadius, pow_add, pow_one] |
| 84 | norm_num |
| 85 | ring |
| 86 | nlinarith |
| 87 | |
| 88 | variable {E : Type*} [NormedAddCommGroup E] |
| 89 | |
| 90 | def nestedCylinder (k : ℕ) : Set (E × ℝ) := |
| 91 | Metric.closedBall 0 (nestedSpatialRadius k) ×ˢ Icc (nestedTimeLower k) 1 |
| 92 | |
| 93 | def interiorCompactCylinder : Set (E × ℝ) := |
| 94 | Metric.closedBall 0 1 ×ˢ Icc (1 / 2 : ℝ) 1 |
| 95 | |
| 96 | theorem nestedCylinder_zero : nestedCylinder (E := E) 0 = |
| 97 | Metric.closedBall 0 (1 / 2 : ℝ) ×ˢ Icc (3 / 4 : ℝ) 1 := by |
| 98 | norm_num [nestedCylinder, nestedSpatialRadius, nestedTimeLower] |
| 99 | |
| 100 | theorem interiorCompactCylinder_subset_heat_domain : |
| 101 | interiorCompactCylinder (E := E) ⊆ Metric.ball 0 2 ×ˢ Ioo (0 : ℝ) 2 := by |
| 102 | intro p hp |
| 103 | exact ⟨lt_of_le_of_lt hp.1 (by norm_num : (1 : ℝ) < 2), |
| 104 | lt_of_lt_of_le (by norm_num : (0 : ℝ) < 1 / 2) hp.2.1, |
| 105 | lt_of_le_of_lt hp.2.2 (by norm_num : (1 : ℝ) < 2)⟩ |
| 106 | |
| 107 | theorem origin_mem_nestedCylinder (k : ℕ) : (0, (1 : ℝ)) ∈ nestedCylinder (E := E) k := by |
| 108 | exact ⟨by simpa using nestedSpatialRadius_nonneg k, nestedTimeLower_le_one k, le_rfl⟩ |
| 109 | |
| 110 | theorem nestedCylinder_nonempty (k : ℕ) : (nestedCylinder (E := E) k).Nonempty := |
| 111 | ⟨_, origin_mem_nestedCylinder k⟩ |
| 112 | |
| 113 | theorem nestedCylinder_subset_interiorCompactCylinder (k : ℕ) : |
| 114 | nestedCylinder (E := E) k ⊆ interiorCompactCylinder := by |
| 115 | intro p hp |
| 116 | exact ⟨hp.1.trans (nestedSpatialRadius_lt_one k).le, |
| 117 | (nestedTimeLower_ge_half k).trans hp.2.1, hp.2.2⟩ |
| 118 | |
| 119 | theorem mem_nestedCylinder_succ_of_mem_local (k : ℕ) {x y : E} {t s : ℝ} |
| 120 | (hp : (x, t) ∈ nestedCylinder k) |
| 121 | (hy : y ∈ Metric.closedBall x (2 * nestedRadius k)) |
| 122 | (hs : s ∈ Icc (t - nestedRadius k ^ 2) t) : |
| 123 | (y, s) ∈ nestedCylinder (k + 1) := by |
| 124 | refine ⟨?_, ?_, hs.2.trans hp.2.2⟩ |
| 125 | · calc |
| 126 | dist y 0 ≤ dist y x + dist x 0 := dist_triangle _ _ _ |
| 127 | _ ≤ 2 * nestedRadius k + nestedSpatialRadius k := add_le_add hy hp.1 |
| 128 | _ ≤ nestedSpatialRadius (k + 1) := by |
| 129 | simpa only [add_comm] using nestedSpatialRadius_add_two_radius_le k |
| 130 | · have h := nestedTimeLower_sub_radius_sq_ge k |
| 131 | linarith [hp.2.1, hs.1] |
| 132 | |
| 133 | theorem nestedCylinder_subset_succ (k : ℕ) : |
| 134 | nestedCylinder (E := E) k ⊆ nestedCylinder (k + 1) := by |
| 135 | intro p hp |
| 136 | apply mem_nestedCylinder_succ_of_mem_local k hp |
| 137 | · simpa using mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) (nestedRadius_pos k).le |
| 138 | · exact ⟨sub_le_self _ (sq_nonneg _), le_rfl⟩ |
| 139 | |
| 140 | theorem isCompact_nestedCylinder [ProperSpace E] (k : ℕ) : |
| 141 | IsCompact (nestedCylinder (E := E) k) := |
| 142 | (isCompact_closedBall _ _).prod isCompact_Icc |
| 143 | |
| 144 | theorem isCompact_interiorCompactCylinder [ProperSpace E] : |
| 145 | IsCompact (interiorCompactCylinder (E := E)) := |
| 146 | (isCompact_closedBall _ _).prod isCompact_Icc |
| 147 | |
| 148 | variable {F : Type*} [NormedAddCommGroup F] |
| 149 | |
| 150 | def nestedJetSup (g : E × ℝ → F) (k : ℕ) : ℝ := |
| 151 | sSup ((fun p => ‖g p‖) '' nestedCylinder k) |
| 152 | |
| 153 | theorem bddAbove_nestedJet_image [ProperSpace E] {g : E × ℝ → F} |
| 154 | (hg : ContinuousOn g interiorCompactCylinder) (k : ℕ) : |
| 155 | BddAbove ((fun p => ‖g p‖) '' nestedCylinder k) := |
| 156 | (isCompact_nestedCylinder k).bddAbove_image |
| 157 | (hg.mono (nestedCylinder_subset_interiorCompactCylinder k)).norm |
| 158 | |
| 159 | theorem norm_le_nestedJetSup [ProperSpace E] {g : E × ℝ → F} |
| 160 | (hg : ContinuousOn g interiorCompactCylinder) {k : ℕ} {p : E × ℝ} |
| 161 | (hp : p ∈ nestedCylinder k) : ‖g p‖ ≤ nestedJetSup g k := |
| 162 | le_csSup (bddAbove_nestedJet_image hg k) (mem_image_of_mem _ hp) |
| 163 | |
| 164 | theorem nestedJetSup_nonneg [ProperSpace E] {g : E × ℝ → F} |
| 165 | (hg : ContinuousOn g interiorCompactCylinder) (k : ℕ) : 0 ≤ nestedJetSup g k := |
| 166 | (norm_nonneg _).trans (norm_le_nestedJetSup hg (origin_mem_nestedCylinder k)) |
| 167 | |
| 168 | theorem nestedJetSup_le {g : E × ℝ → F} {k : ℕ} {M : ℝ} |
| 169 | (hM : ∀ p ∈ nestedCylinder k, ‖g p‖ ≤ M) : nestedJetSup g k ≤ M := by |
| 170 | apply csSup_le ((nestedCylinder_nonempty k).image _) |
| 171 | rintro _ ⟨p, hp, rfl⟩ |
| 172 | exact hM p hp |
| 173 | |
| 174 | theorem exists_bound_nestedJetSup [ProperSpace E] {g : E × ℝ → F} |
| 175 | (hg : ContinuousOn g interiorCompactCylinder) : |
| 176 | ∃ M : ℝ, 0 ≤ M ∧ ∀ k, nestedJetSup g k ≤ M := by |
| 177 | obtain ⟨M, hM⟩ := isCompact_interiorCompactCylinder.bddAbove_image hg.norm |
| 178 | refine ⟨max 0 M, le_max_left _ _, fun k => nestedJetSup_le fun p hp => ?_⟩ |
| 179 | exact (hM (mem_image_of_mem _ (nestedCylinder_subset_interiorCompactCylinder k hp))).trans |
| 180 | (le_max_right _ _) |
| 181 | |
| 182 | theorem nestedJetSup_mono [ProperSpace E] {g : E × ℝ → F} |
| 183 | (hg : ContinuousOn g interiorCompactCylinder) (k : ℕ) : |
| 184 | nestedJetSup g k ≤ nestedJetSup g (k + 1) := |
| 185 | nestedJetSup_le fun _ hp => norm_le_nestedJetSup hg (nestedCylinder_subset_succ k hp) |
| 186 | |
| 187 | theorem nestedJetSup_zero_le_of_pointwise_recurrence [ProperSpace E] |
| 188 | {g : E × ℝ → F} (hg : ContinuousOn g interiorCompactCylinder) {A θ : ℝ} |
| 189 | (hA : 0 ≤ A) (hθ : 0 ≤ θ) (hsmall : θ * 4 < 1) |
| 190 | (hstep : ∀ k, ∀ p ∈ nestedCylinder k, |
| 191 | ‖g p‖ ≤ A * (4 : ℝ) ^ k + θ * nestedJetSup g (k + 1)) : |
| 192 | nestedJetSup g 0 ≤ A / (1 - θ * 4) := by |
| 193 | obtain ⟨M, _, hM⟩ := exists_bound_nestedJetSup hg |
| 194 | simpa using le_geometric_bound_of_le_add_mul_succ hA (by norm_num : (1 : ℝ) ≤ 4) |
| 195 | hθ hsmall hM (fun k => nestedJetSup_le (hstep k)) 0 |
| 196 | |
| 197 | section Hessian |
| 198 | |
| 199 | variable [NormedSpace ℝ E] [NormedSpace ℝ F] [ProperSpace E] |
| 200 | |
| 201 | theorem exists_bound_nested_spatial_hessian {f : E × ℝ → F} (hf : ContDiff ℝ ∞ f) : |
| 202 | ∃ M : ℝ, 0 ≤ M ∧ ∀ k, nestedJetSup (spatialDerivative (spatialDerivative f)) k ≤ M := |
| 203 | exists_bound_nestedJetSup |
| 204 | (contDiff_spatialDerivative (contDiff_spatialDerivative hf)).continuous.continuousOn |
| 205 | |
| 206 | theorem norm_fderiv_fderiv_origin_le_of_nested_recurrence |
| 207 | {f : E × ℝ → F} (hf : ContDiff ℝ ∞ f) {A θ : ℝ} |
| 208 | (hA : 0 ≤ A) (hθ : 0 ≤ θ) (hsmall : θ * 4 < 1) |
| 209 | (hstep : ∀ k, ∀ p ∈ nestedCylinder k, |
| 210 | ‖spatialDerivative (spatialDerivative f) p‖ ≤ |
| 211 | A * (4 : ℝ) ^ k + θ * nestedJetSup (spatialDerivative (spatialDerivative f)) (k + 1)) |
| 212 | (v w : E) : |
| 213 | ‖fderiv ℝ (fun y => fderiv ℝ (fun z => f (z, 1)) y) 0 v w‖ ≤ |
| 214 | A / (1 - θ * 4) * ‖v‖ * ‖w‖ := by |
| 215 | have hc : ContinuousOn (spatialDerivative (spatialDerivative f)) interiorCompactCylinder := |
| 216 | (contDiff_spatialDerivative (contDiff_spatialDerivative hf)).continuous.continuousOn |
| 217 | have hsup := nestedJetSup_zero_le_of_pointwise_recurrence hc hA hθ hsmall hstep |
| 218 | rw [fderiv_fderiv_spatialSlice hf] |
| 219 | calc |
| 220 | _ ≤ ‖spatialDerivative (spatialDerivative f) (0, 1)‖ * ‖v‖ * ‖w‖ := |
| 221 | ContinuousLinearMap.le_opNorm₂ _ _ _ |
| 222 | _ ≤ nestedJetSup (spatialDerivative (spatialDerivative f)) 0 * ‖v‖ * ‖w‖ := by |
| 223 | gcongr |
| 224 | exact norm_le_nestedJetSup hc (origin_mem_nestedCylinder 0) |
| 225 | _ ≤ _ := by gcongr |
| 226 | |
| 227 | end Hessian |
| 228 | |
| 229 | end Poincare.Parabolic.Interior |