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.Real.Sqrt |
| 2 | import Mathlib.Tactic.FieldSimp |
| 3 | import Mathlib.Tactic.Ring |
| 4 | |
| 5 | /-! |
| 6 | # The three reduced-length residuals |
| 7 | |
| 8 | Morgan-Tian Corollary 6.51: the residuals are respectively minus the |
| 9 | Laplacian defect, the defect, and minus twice the defect. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | namespace PoincareMT.ReducedLength |
| 15 | |
| 16 | theorem residual_identities {n : ℕ} {t l R K d G D : ℝ} (ht : 0 < t) |
| 17 | (hd : d = R - l / t + K / (2 * t * Real.sqrt t)) |
| 18 | (hG : G = l / t - K / (t * Real.sqrt t) - R) : |
| 19 | let δ := (n : ℝ) / (2 * t) - R - K / (2 * t * Real.sqrt t) - D |
| 20 | d + D - ((n : ℝ) / 2 - l) / t = -δ ∧ |
| 21 | d - D + G - R + (n : ℝ) / (2 * t) = δ ∧ |
| 22 | 2 * D - G + R + (l - (n : ℝ)) / t = -2 * δ := by |
| 23 | dsimp only |
| 24 | rw [hd, hG] |
| 25 | have ht0 := ne_of_gt ht |
| 26 | have hs0 := ne_of_gt (Real.sqrt_pos.mpr ht) |
| 27 | refine ⟨?_, ?_, ?_⟩ <;> field_simp [ht0, hs0] <;> ring |
| 28 | |
| 29 | theorem combined_inequalities {n : ℕ} {t l R K d G D : ℝ} (ht : 0 < t) |
| 30 | (hd : d = R - l / t + K / (2 * t * Real.sqrt t)) |
| 31 | (hG : G = l / t - K / (t * Real.sqrt t) - R) |
| 32 | (hD : D ≤ (n : ℝ) / (2 * t) - R - K / (2 * t * Real.sqrt t)) : |
| 33 | d + D ≤ ((n : ℝ) / 2 - l) / t ∧ |
| 34 | 0 ≤ d - D + G - R + (n : ℝ) / (2 * t) ∧ |
| 35 | 2 * D - G + R + (l - (n : ℝ)) / t ≤ 0 := by |
| 36 | obtain ⟨hfirst, hsecond, hthird⟩ := residual_identities ht hd hG (D := D) |
| 37 | have hδ : 0 ≤ (n : ℝ) / (2 * t) - R - K / (2 * t * Real.sqrt t) - D := |
| 38 | sub_nonneg.mpr hD |
| 39 | refine ⟨?_, ?_, ?_⟩ |
| 40 | · apply sub_nonpos.mp |
| 41 | rw [hfirst] |
| 42 | exact neg_nonpos.mpr hδ |
| 43 | · rw [hsecond] |
| 44 | exact hδ |
| 45 | · rw [hthird] |
| 46 | exact mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr zero_le_two) hδ |
| 47 | |
| 48 | end PoincareMT.ReducedLength |