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.Data.ENNReal.Inv |
| 2 | import Mathlib.Tactic.FieldSimp |
| 3 | |
| 4 | /-! |
| 5 | # Cancellation of positive length scales in volume ratios |
| 6 | |
| 7 | The measured quantity may be infinite. Only finite real coefficients |
| 8 | are divided and cancelled. Source: Morgan-Tian Theorem 12.29, pp. 324-325; |
| 9 | volume-ratio-transfer.md. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped ENNReal |
| 15 | |
| 16 | namespace ENNReal |
| 17 | |
| 18 | /-- Cancelling a positive length scale in a dimension-n volume ratio |
| 19 | does not require the measured quantity to be finite. -/ |
| 20 | theorem rescaled_power_volume_ratio (V : ℝ≥0∞) (n : ℕ) |
| 21 | {a q c d : ℝ} (ha : 0 < a) (hq : 0 < q) (hc : 0 ≤ c) (hd : 0 < d) : |
| 22 | (ENNReal.ofReal (c / q) ^ n * V) / ENNReal.ofReal (a / q) ^ n = |
| 23 | ENNReal.ofReal (c * d) ^ n * (V / ENNReal.ofReal (d * a) ^ n) := by |
| 24 | have hreal : (c / q) ^ n / (a / q) ^ n = (c * d) ^ n / (d * a) ^ n := by |
| 25 | rw [← div_pow, ← div_pow] |
| 26 | congr 1 |
| 27 | field_simp |
| 28 | have hcoeff : ENNReal.ofReal (c / q) ^ n / ENNReal.ofReal (a / q) ^ n = |
| 29 | ENNReal.ofReal (c * d) ^ n / ENNReal.ofReal (d * a) ^ n := by |
| 30 | calc |
| 31 | _ = ENNReal.ofReal ((c / q) ^ n / (a / q) ^ n) := by |
| 32 | rw [ENNReal.ofReal_div_of_pos (pow_pos (div_pos ha hq) n), |
| 33 | ENNReal.ofReal_pow (div_nonneg hc hq.le), |
| 34 | ENNReal.ofReal_pow (div_nonneg ha.le hq.le)] |
| 35 | _ = ENNReal.ofReal ((c * d) ^ n / (d * a) ^ n) := congrArg ENNReal.ofReal hreal |
| 36 | _ = _ := by |
| 37 | rw [ENNReal.ofReal_div_of_pos (pow_pos (_root_.mul_pos hd ha) n), |
| 38 | ENNReal.ofReal_pow (_root_.mul_nonneg hc hd.le), |
| 39 | ENNReal.ofReal_pow (_root_.mul_nonneg hd.le ha.le)] |
| 40 | rw [ENNReal.mul_div_right_comm, hcoeff] |
| 41 | simp only [div_eq_mul_inv] |
| 42 | ac_rfl |
| 43 | |
| 44 | end ENNReal |