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.MeasureTheory.Measure.Haar.InnerProductSpace |
| 2 | import Mathlib.MeasureTheory.Measure.Lebesgue.Basic |
| 3 | |
| 4 | /-! |
| 5 | Adapted from Mapher `PoincareMT/Proofs/M49/Mathlib/EuclideanBox.lean` at |
| 6 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 7 | |
| 8 | # Volume of Euclidean coordinate boxes |
| 9 | |
| 10 | The coordinate integration used to expand Morgan-Tian Lemma 17.12, |
| 11 | p. 410, uses the standard Euclidean volume. Mathlib's volume-preserving |
| 12 | identification with a finite function space gives the box formula, |
| 13 | including empty coordinate intervals and dimension zero. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set MeasureTheory |
| 19 | open scoped BigOperators ENNReal |
| 20 | |
| 21 | namespace EuclideanSpace |
| 22 | |
| 23 | /-- Euclidean coordinate-box volume is the product of interval lengths, |
| 24 | as used in the neck-volume argument of MT Lemma 17.12, p. 410. -/ |
| 25 | theorem volume_coordinate_Ioo {ι : Type*} [Fintype ι] (a b : ι → ℝ) : |
| 26 | volume {x : EuclideanSpace ℝ ι | ∀ i, x i ∈ Ioo (a i) (b i)} = |
| 27 | ∏ i, ENNReal.ofReal (b i - a i) := by |
| 28 | have hset : {x : EuclideanSpace ℝ ι | ∀ i, x i ∈ Ioo (a i) (b i)} = |
| 29 | WithLp.ofLp ⁻¹' (pi univ (fun i => Ioo (a i) (b i))) := by |
| 30 | ext x |
| 31 | simp |
| 32 | rw [hset, (PiLp.volume_preserving_ofLp ι).measure_preimage |
| 33 | (MeasurableSet.univ_pi (fun _ => measurableSet_Ioo)).nullMeasurableSet, |
| 34 | Real.volume_pi_Ioo] |
| 35 | |
| 36 | end EuclideanSpace |