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 Mathlib.Analysis.InnerProductSpace.PiL2 |
| 2 | |
| 3 | /-! |
| 4 | # Transverse control of conformal columns in a positive metric |
| 5 | |
| 6 | The two conformal columns are controlled by their coordinates transverse |
| 7 | to any chosen axis, in every finite dimension and including zero columns. |
| 8 | Source: Heinz 1970, pp. 100-101; the finite-dimensional generalization of |
| 9 | M65's `m65Boundary_transverse_derivative_bound_axis`; the M64 transverse |
| 10 | conformality derivation for MT Lemma 19.15, pp. 447-449. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option warningAsError true |
| 15 | |
| 16 | noncomputable section |
| 17 | |
| 18 | namespace PoincareMT |
| 19 | |
| 20 | open Classical in |
| 21 | /-- Conformality controls the full column energy by its transverse energy |
| 22 | for every finite coordinate type, without a nonbranching hypothesis. |
| 23 | Source: Heinz 1970, pp. 100-101; the M64 transverse-conformality derivation. -/ |
| 24 | theorem m64Conformal_transverse_bound {ι : Type*} [Fintype ι] |
| 25 | (G : EuclideanSpace ℝ ι →L[ℝ] EuclideanSpace ℝ ι →L[ℝ] ℝ) |
| 26 | (hsymm : ∀ v w, G v w = G w v) {lower upper : ℝ} |
| 27 | (hlower : 0 < lower) (hupper : 0 ≤ upper) |
| 28 | (hlo : ∀ z : EuclideanSpace ℝ ι, lower * ‖z‖ ^ 2 ≤ G z z) |
| 29 | (hhi : ∀ z : EuclideanSpace ℝ ι, G z z ≤ upper * ‖z‖ ^ 2) |
| 30 | (j : ι) (v w : EuclideanSpace ℝ ι) |
| 31 | (hdiag : G v v = G w w) (hmixed : G v w = 0) : |
| 32 | ‖v‖ ^ 2 + ‖w‖ ^ 2 ≤ (2 * upper / lower) * |
| 33 | ∑ i : ι, if i = j then 0 else v i ^ 2 + w i ^ 2 := by |
| 34 | classical |
| 35 | let A := v j ^ 2 + w j ^ 2 |
| 36 | let T := ∑ i : ι, if i = j then 0 else v i ^ 2 + w i ^ 2 |
| 37 | have hA : 0 ≤ A := add_nonneg (sq_nonneg _) (sq_nonneg _) |
| 38 | have hdecomp : ‖v‖ ^ 2 + ‖w‖ ^ 2 = A + T := by |
| 39 | rw [EuclideanSpace.real_norm_sq_eq, EuclideanSpace.real_norm_sq_eq, |
| 40 | ← Finset.sum_add_distrib] |
| 41 | calc |
| 42 | _ = ∑ i : ι, ((if i = j then A else 0) + |
| 43 | (if i = j then 0 else v i ^ 2 + w i ^ 2)) := by |
| 44 | apply Finset.sum_congr rfl |
| 45 | intro i _ |
| 46 | by_cases hij : i = j <;> simp only [hij, ite_true, ite_false, A, |
| 47 | add_zero, zero_add] |
| 48 | _ = A + T := by rw [Finset.sum_add_distrib]; simp only [Finset.sum_ite_eq', |
| 49 | Finset.mem_univ, if_true, T] |
| 50 | have hfactor : G v v ≤ upper * T := by |
| 51 | by_cases hzero : A = 0 |
| 52 | · have hv : ‖v‖ ^ 2 ≤ T := by |
| 53 | rw [hzero, zero_add] at hdecomp |
| 54 | nlinarith [sq_nonneg ‖w‖] |
| 55 | exact (hhi v).trans (mul_le_mul_of_nonneg_left hv hupper) |
| 56 | · have hpos : 0 < A := lt_of_le_of_ne hA (Ne.symm hzero) |
| 57 | let q : EuclideanSpace ℝ ι := w j • v - v j • w |
| 58 | have hrev : G w v = 0 := (hsymm w v).trans hmixed |
| 59 | have hq : G q q = A * G v v := by |
| 60 | dsimp only [q, A] |
| 61 | simp only [map_sub, map_smul, sub_apply, smul_apply, |
| 62 | smul_eq_mul, ← hdiag, hmixed, hrev] |
| 63 | ring |
| 64 | have hqi (i : ι) : q i ^ 2 ≤ A * (if i = j then 0 else v i ^ 2 + w i ^ 2) := by |
| 65 | change (w j * v i - v j * w i) ^ 2 ≤ _ |
| 66 | by_cases hij : i = j |
| 67 | · subst i |
| 68 | simp only [ite_true, mul_comm (w j) (v j), sub_self, zero_pow two_ne_zero, |
| 69 | mul_zero, le_refl] |
| 70 | · rw [if_neg hij] |
| 71 | dsimp only [A] |
| 72 | nlinarith [sq_nonneg (v j * v i + w j * w i)] |
| 73 | have hqnorm : ‖q‖ ^ 2 ≤ A * T := by |
| 74 | rw [EuclideanSpace.real_norm_sq_eq] |
| 75 | calc |
| 76 | _ ≤ ∑ i : ι, A * (if i = j then 0 else v i ^ 2 + w i ^ 2) := |
| 77 | Finset.sum_le_sum fun i _ => hqi i |
| 78 | _ = A * T := (Finset.mul_sum _ _ _).symm |
| 79 | have hh : A * G v v ≤ A * (upper * T) := by |
| 80 | calc |
| 81 | _ = G q q := hq.symm |
| 82 | _ ≤ upper * ‖q‖ ^ 2 := hhi q |
| 83 | _ ≤ upper * (A * T) := mul_le_mul_of_nonneg_left hqnorm hupper |
| 84 | _ = _ := by ring |
| 85 | nlinarith |
| 86 | have hsum := add_le_add (hlo v) (hlo w) |
| 87 | rw [← hdiag] at hsum |
| 88 | rw [div_mul_eq_mul_div] |
| 89 | apply (le_div_iff₀ hlower).mpr |
| 90 | change (‖v‖ ^ 2 + ‖w‖ ^ 2) * lower ≤ 2 * upper * T |
| 91 | nlinarith |
| 92 | |
| 93 | end PoincareMT |