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.Analysis.Geometry.RelativeBilinearComparison |
| 3 | import Mathlib.Topology.UniformSpace.UniformConvergence |
| 4 | import Mathlib.Topology.Order.Basic |
| 5 | |
| 6 | /-! |
| 7 | # Relative quadratic bounds through scalar comparison factors |
| 8 | |
| 9 | Uniform convergence of one elliptic coefficient family, combined with |
| 10 | two scalar comparison factors tending to one, yields mutual quadratic |
| 11 | comparison for a second family. No derivatives of that second family |
| 12 | or operator-norm convergence of it are required. |
| 13 | Source: Morgan--Tian pp. 263-265; M28 derivation 141. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Topology |
| 21 | |
| 22 | /-- Relative scalar bounds on an intermediate uniformly convergent |
| 23 | elliptic family suffice for the final mutual quadratic comparison. |
| 24 | The points and vectors are tested after one common index tail. |
| 25 | Source: MT pp. 263-265; M28 derivation 141. -/ |
| 26 | theorem ContinuousLinearMap.eventually_mutual_quadratic_bounds_of_uniform_squeeze |
| 27 | {E X I : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 28 | {l : Filter I} {S : Set X} |
| 29 | (A : X → E →L[ℝ] E →L[ℝ] ℝ) |
| 30 | (B C : I → X → E →L[ℝ] E →L[ℝ] ℝ) |
| 31 | {alpha : ℝ} (halpha : 0 < alpha) |
| 32 | (hlower : ∀ x ∈ S, ∀ v, alpha * ‖v‖ ^ 2 ≤ A x v v) |
| 33 | (hlimit : TendstoUniformlyOn B A l S) |
| 34 | (lower upper : I → ℝ) |
| 35 | (hlowerLimit : Tendsto lower l (𝓝 1)) |
| 36 | (hupperLimit : Tendsto upper l (𝓝 1)) |
| 37 | (hsqueeze : ∀ᶠ i in l, ∀ x ∈ S, ∀ v, |
| 38 | lower i * B i x v v ≤ C i x v v ∧ C i x v v ≤ upper i * B i x v v) : |
| 39 | ∀ c : ℝ, 1 < c → ∀ᶠ i in l, ∀ x ∈ S, ∀ v, |
| 40 | C i x v v ≤ c ^ 2 * A x v v ∧ A x v v ≤ c ^ 2 * C i x v v := by |
| 41 | intro c hc |
| 42 | have hcpos : 0 < c := zero_lt_one.trans hc |
| 43 | have htau : 0 < c - 1 := sub_pos.mpr hc |
| 44 | have hconstant : 1 + (c - 1) = c := by ring |
| 45 | have htol : 0 < ((c - 1) / (1 + (c - 1))) * alpha := by |
| 46 | rw [hconstant] |
| 47 | exact mul_pos (div_pos htau hcpos) halpha |
| 48 | have hinv : c⁻¹ < 1 := (inv_lt_one₀ hcpos).mpr hc |
| 49 | filter_upwards [(Metric.tendstoUniformlyOn_iff |
| 50 | (α := E →L[ℝ] E →L[ℝ] ℝ) (β := X) (ι := I)).mp hlimit _ htol, |
| 51 | (tendsto_order.mp hlowerLimit).1 (c⁻¹) hinv, |
| 52 | (tendsto_order.mp hupperLimit).2 c hc, hsqueeze] with i hclose hlo hup hsq |
| 53 | intro x hx v |
| 54 | have hrelative := ContinuousLinearMap.relative_quadratic_bounds_of_norm_sub_le |
| 55 | (A x) (B i x) halpha htau (hlower x hx) |
| 56 | (by |
| 57 | have hnorm := dist_eq_norm' (A x) (B i x) |
| 58 | simpa only [hnorm] using (hclose x hx).le) v |
| 59 | rw [hconstant] at hrelative |
| 60 | have hAnonneg : 0 ≤ A x v v := |
| 61 | (mul_nonneg halpha.le (sq_nonneg ‖v‖)).trans (hlower x hx v) |
| 62 | have hBnonneg : 0 ≤ B i x v v := |
| 63 | (mul_nonneg (inv_nonneg.mpr hcpos.le) hAnonneg).trans hrelative.1 |
| 64 | constructor |
| 65 | · calc |
| 66 | C i x v v ≤ upper i * B i x v v := (hsq x hx v).2 |
| 67 | _ ≤ c * B i x v v := mul_le_mul_of_nonneg_right hup.le hBnonneg |
| 68 | _ ≤ c * (c * A x v v) := mul_le_mul_of_nonneg_left hrelative.2 hcpos.le |
| 69 | _ = c ^ 2 * A x v v := by ring |
| 70 | · have hlow : c⁻¹ * (c⁻¹ * A x v v) ≤ C i x v v := |
| 71 | (mul_le_mul_of_nonneg_left hrelative.1 (inv_nonneg.mpr hcpos.le)).trans |
| 72 | ((mul_le_mul_of_nonneg_right hlo.le hBnonneg).trans (hsq x hx v).1) |
| 73 | have hmul := mul_le_mul_of_nonneg_left hlow (sq_nonneg c) |
| 74 | have hcancel : c ^ 2 * (c⁻¹ * (c⁻¹ * A x v v)) = A x v v := by |
| 75 | field_simp [hcpos.ne'] |
| 76 | rwa [hcancel] at hmul |