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.Volume.Surgery.Neck.NeckCoordinates |
| 2 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.Analysis.EuclideanBox |
| 3 | |
| 4 | /-! |
| 5 | Adapted from Mapher `PoincareMT/Proofs/M49/CylinderCoordinateBox.lean` at |
| 6 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 7 | |
| 8 | # A fixed-area box in cylinder coordinates |
| 9 | |
| 10 | Morgan-Tian Definition 2.18, p. 31, and Lemma 17.12, p. 410. The first |
| 11 | two coordinate intervals lie strictly inside the specified sphere-chart |
| 12 | ball. The line interval has its full displayed length. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set MeasureTheory |
| 18 | open scoped ENNReal BigOperators |
| 19 | |
| 20 | namespace PoincareMT.SurgeryVolume |
| 21 | |
| 22 | /-- A fixed square of side `r`, extended along the positive line interval |
| 23 | (MT Definition 2.18, p. 31; Lemma 17.12, p. 410). -/ |
| 24 | def cylinderCoordinateBox (p : EuclideanSpace ℝ (Fin 2)) (r t : ℝ) : |
| 25 | Set (EuclideanSpace ℝ (Fin 3)) := |
| 26 | {x | x 0 ∈ Ioo (p 0 - r / 2) (p 0 + r / 2) ∧ |
| 27 | x 1 ∈ Ioo (p 1 - r / 2) (p 1 + r / 2) ∧ x 2 ∈ Ioo 0 t} |
| 28 | |
| 29 | /-- The coordinate box is open, including when an interval is empty |
| 30 | (MT Lemma 17.12, p. 410, coordinate-integration expansion). -/ |
| 31 | theorem isOpen_cylinderCoordinateBox (p : EuclideanSpace ℝ (Fin 2)) (r t : ℝ) : |
| 32 | IsOpen (cylinderCoordinateBox p r t) := by |
| 33 | exact (isOpen_Ioo.preimage (by fun_prop : Continuous |
| 34 | (fun x : EuclideanSpace ℝ (Fin 3) => x 0))).inter |
| 35 | ((isOpen_Ioo.preimage (by fun_prop : Continuous |
| 36 | (fun x : EuclideanSpace ℝ (Fin 3) => x 1))).inter |
| 37 | (isOpen_Ioo.preimage (by fun_prop : Continuous |
| 38 | (fun x : EuclideanSpace ℝ (Fin 3) => x 2)))) |
| 39 | |
| 40 | /-- The coordinate box has its square area times its positive line length |
| 41 | (MT Lemma 17.12, p. 410); nonpositive line lengths give an empty box. -/ |
| 42 | theorem volume_cylinderCoordinateBox (p : EuclideanSpace ℝ (Fin 2)) |
| 43 | {r : ℝ} (hr : 0 ≤ r) (t : ℝ) : |
| 44 | volume (cylinderCoordinateBox p r t) = ENNReal.ofReal (r ^ 2 * t) := by |
| 45 | let a : Fin 3 → ℝ := ![p 0 - r / 2, p 1 - r / 2, 0] |
| 46 | let b : Fin 3 → ℝ := ![p 0 + r / 2, p 1 + r / 2, t] |
| 47 | have hset : cylinderCoordinateBox p r t = |
| 48 | {x : EuclideanSpace ℝ (Fin 3) | ∀ i, x i ∈ Ioo (a i) (b i)} := by |
| 49 | ext x |
| 50 | simp [cylinderCoordinateBox, a, b, Fin.forall_fin_succ] |
| 51 | rw [hset, EuclideanSpace.volume_coordinate_Ioo] |
| 52 | have h0 : b 0 - a 0 = r := by dsimp [a, b]; ring |
| 53 | have h1 : b 1 - a 1 = r := by dsimp [a, b]; ring |
| 54 | have h2 : b 2 - a 2 = t := by simp [a, b] |
| 55 | rw [Fin.prod_univ_three, h0, h1, h2, ← ENNReal.ofReal_mul hr, |
| 56 | ← ENNReal.ofReal_mul (mul_nonneg hr hr)] |
| 57 | congr 1 |
| 58 | ring |
| 59 | |
| 60 | /-- The square of side `r` lies strictly inside the actual Euclidean |
| 61 | two-dimensional radius-`r` ball (MT Definition 2.18, p. 31). -/ |
| 62 | theorem cylinderCoordinateBox_subset (p : EuclideanSpace ℝ (Fin 2)) |
| 63 | {r : ℝ} (hr : 0 < r) (t : ℝ) : |
| 64 | cylinderCoordinateBox p r t ⊆ cylinderCoordinateEquiv ⁻¹' |
| 65 | (Metric.ball p r ×ˢ Ioo 0 t) := by |
| 66 | intro x hx |
| 67 | rcases hx with ⟨h0, h1, h2⟩ |
| 68 | have hsq0 : (x 0 - p 0) ^ 2 < (r / 2) ^ 2 := by |
| 69 | nlinarith [mul_pos (sub_pos.mpr h0.1) (sub_pos.mpr h0.2)] |
| 70 | have hsq1 : (x 1 - p 1) ^ 2 < (r / 2) ^ 2 := by |
| 71 | nlinarith [mul_pos (sub_pos.mpr h1.1) (sub_pos.mpr h1.2)] |
| 72 | have hnorm : ‖(cylinderCoordinateEquiv x).1 - p‖ ^ 2 = |
| 73 | (x 0 - p 0) ^ 2 + (x 1 - p 1) ^ 2 := by |
| 74 | simp [EuclideanSpace.real_norm_sq_eq, Fin.sum_univ_two, cylinderCoordinateEquiv_apply] |
| 75 | refine ⟨?_, ?_⟩ |
| 76 | · rw [Metric.mem_ball, dist_eq_norm] |
| 77 | nlinarith [norm_nonneg ((cylinderCoordinateEquiv x).1 - p)] |
| 78 | · simpa only [cylinderCoordinateEquiv_apply] using h2 |
| 79 | |
| 80 | end PoincareMT.SurgeryVolume |