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.CurveShortening.Comparison.Compatibility.SourceNames |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.AreaComparison.Periodic.RectangleLipschitz |
| 3 | import PoincareLib.Geometry.Riemannian.LoopSpace.Area.Annular.LengthMap |
| 4 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Compact.ExtendedLipschitz |
| 5 | import Mathlib.Analysis.Calculus.ContDiff.WithLp |
| 6 | |
| 7 | /-! |
| 8 | # The polar collar of a periodic rectangle map |
| 9 | |
| 10 | Local smooth angles and periodic strip bounds yield an actual Lipschitz |
| 11 | map of the closed half annulus. The construction retains both literal |
| 12 | boundary traces; the sharp area identity is a separate change-of-variables |
| 13 | calculation. |
| 14 | |
| 15 | Morgan--Tian context: Section 19.6, Lemmas 19.30-19.31, printed pp. 461-466. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | |
| 20 | open Set Filter Metric |
| 21 | open scoped Topology ContDiff NNReal ENNReal |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | /-- Descend a periodic rectangle map to the half-disk collar using angular and affine radial |
| 26 | coordinates. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar |
| 27 | in `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 28 | noncomputable def m64PolarAnnulusMap {Y : Type*} (f : LoopPlane → Y) |
| 29 | (z : LoopPlane) : Y := |
| 30 | f (annulusPoint (m60PlaneAngle z) (2 * ‖z‖ - 1)) |
| 31 | |
| 32 | /-- Periodicity identifies the descended map with any valid polar angle representative. |
| 33 | Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 34 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 35 | theorem m64PolarAnnulusMap_eq_polar |
| 36 | {Y : Type*} {f : LoopPlane → Y} |
| 37 | (hperiodic : ∀ x s : ℝ, |
| 38 | f (annulusPoint (x + curvePeriod) s) = f (annulusPoint x s)) |
| 39 | {z : LoopPlane} (hz : z ≠ 0) {theta : ℝ} |
| 40 | (htheta : ‖z‖ • Proofs.M58.angularPoint theta = z) : |
| 41 | m64PolarAnnulusMap f z = f (annulusPoint theta (2 * ‖z‖ - 1)) := by |
| 42 | have heq : Proofs.M58.angularPoint (m60PlaneAngle z) = |
| 43 | Proofs.M58.angularPoint theta := by |
| 44 | have h := congrArg (fun w : LoopPlane => ‖z‖⁻¹ • w) |
| 45 | ((m60PlaneAngle_polar z).trans htheta.symm) |
| 46 | simpa only [smul_smul, inv_mul_cancel₀ (norm_ne_zero_iff.mpr hz), one_smul] using h |
| 47 | exact m60Periodic_eq_of_angularPoint_eq |
| 48 | (show Function.Periodic (fun x => f (annulusPoint x (2 * ‖z‖ - 1))) rampPeriod from |
| 49 | fun x => hperiodic x _) heq |
| 50 | |
| 51 | /-- Every periodic strip value has a representative in the closed fundamental rectangle. |
| 52 | Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 53 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 54 | theorem m64_periodic_rectangle_representative |
| 55 | {Y : Type*} {f : LoopPlane → Y} |
| 56 | (hperiodic : ∀ x s : ℝ, |
| 57 | f (annulusPoint (x + curvePeriod) s) = f (annulusPoint x s)) |
| 58 | (x : ℝ) {s : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) : |
| 59 | ∃ p ∈ m64AnnulusDomain, f p = f (annulusPoint x s) := by |
| 60 | let k : ℤ := Int.floor (x / curvePeriod) |
| 61 | let y : ℝ := x - (k : ℝ) * curvePeriod |
| 62 | have hy : y ∈ Icc (0 : ℝ) curvePeriod := by |
| 63 | have h0 := (le_div_iff₀ Real.two_pi_pos).mp (Int.floor_le (x / curvePeriod)) |
| 64 | have h1 := (div_lt_iff₀ Real.two_pi_pos).mp (Int.lt_floor_add_one (x / curvePeriod)) |
| 65 | dsimp only [y, k, curvePeriod] at h0 h1 ⊢ |
| 66 | constructor <;> nlinarith only [h0, h1] |
| 67 | refine ⟨annulusPoint y s, ⟨hy.1, hy.2, hs⟩, ?_⟩ |
| 68 | have hp : Function.Periodic (fun t => f (annulusPoint t s)) curvePeriod := |
| 69 | fun t => hperiodic t s |
| 70 | have h := hp.int_mul k y |
| 71 | simpa only [y, sub_add_cancel] using h.symm |
| 72 | |
| 73 | /-- At positive radius the descended map agrees with the literal angular and affine radial |
| 74 | parameters. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar |
| 75 | in `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 76 | theorem m64PolarAnnulusMap_polar |
| 77 | {Y : Type*} {f : LoopPlane → Y} |
| 78 | (hperiodic : ∀ x s : ℝ, |
| 79 | f (annulusPoint (x + curvePeriod) s) = f (annulusPoint x s)) |
| 80 | {r : ℝ} (hr : 0 < r) (theta : ℝ) : |
| 81 | m64PolarAnnulusMap f (r • Proofs.M58.angularPoint theta) = |
| 82 | f (annulusPoint theta (2 * r - 1)) := by |
| 83 | have hnorm : ‖r • Proofs.M58.angularPoint theta‖ = r := by |
| 84 | rw [norm_smul, Real.norm_eq_abs, abs_of_pos hr, Proofs.M58.norm_angularPoint, mul_one] |
| 85 | have hn : r • Proofs.M58.angularPoint theta ≠ 0 := norm_pos_iff.mp (by rw [hnorm]; exact hr) |
| 86 | have h := m64PolarAnnulusMap_eq_polar hperiodic hn |
| 87 | (theta := theta) (by rw [hnorm]) |
| 88 | simpa only [hnorm] using h |
| 89 | |
| 90 | /-- Periodic strip bounds and local smooth angles give a global Lipschitz map on the closed |
| 91 | half-disk collar. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk |
| 92 | collar in `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 93 | theorem m64PolarAnnulusMap_lipschitz |
| 94 | {Y : Type*} [PseudoEMetricSpace Y] {f : LoopPlane → Y} |
| 95 | (hperiodic : ∀ x s : ℝ, |
| 96 | f (annulusPoint (x + curvePeriod) s) = f (annulusPoint x s)) |
| 97 | {K : ℝ≥0} (hLip : LipschitzOnWith K f m64AnnulusDomain) : |
| 98 | ∃ L : ℝ≥0, LipschitzOnWith L (m64PolarAnnulusMap f) |
| 99 | {z : LoopPlane | 1 / 2 ≤ ‖z‖ ∧ ‖z‖ ≤ 1} := by |
| 100 | let Q : Set LoopPlane := {z | 1 / 2 ≤ ‖z‖ ∧ ‖z‖ ≤ 1} |
| 101 | let T : Set LoopPlane := {p | 0 ≤ p 1 ∧ p 1 ≤ 1} |
| 102 | have hQ : IsCompact Q := by |
| 103 | have heq : Q = closedBall (0 : LoopPlane) 1 ∩ {z : LoopPlane | 1 / 2 ≤ ‖z‖} := by |
| 104 | ext z |
| 105 | simp only [Q, mem_ofPred_eq, mem_inter_iff, mem_closedBall, dist_zero_right] |
| 106 | exact and_comm |
| 107 | rw [heq] |
| 108 | exact (isCompact_closedBall _ _).inter_right (isClosed_le continuous_const continuous_norm) |
| 109 | have hnonzero {z : LoopPlane} (hz : z ∈ Q) : z ≠ 0 := |
| 110 | norm_pos_iff.mp (by linarith [hz.1]) |
| 111 | have hstrip := m64_periodic_rectangle_locally_lipschitz hperiodic hLip |
| 112 | apply M60.exists_lipschitzOnWith_of_compact_edist_ne_top hQ |
| 113 | · intro z hz |
| 114 | obtain ⟨theta, htheta, hpolar⟩ := m60_exists_contDiffAt_planeAngle (hnonzero hz) |
| 115 | let chi : LoopPlane → LoopPlane := fun w => annulusPoint (theta w) (2 * ‖w‖ - 1) |
| 116 | have hchi : ContDiffAt ℝ 1 chi z := by |
| 117 | apply (contDiffAt_piLp 2).mpr |
| 118 | intro i |
| 119 | fin_cases i |
| 120 | · exact htheta |
| 121 | · exact (contDiffAt_const.mul (contDiffAt_norm ℝ (hnonzero hz))).sub contDiffAt_const |
| 122 | have hmaps : MapsTo chi Q T := by |
| 123 | intro w hw |
| 124 | change 0 ≤ 2 * ‖w‖ - 1 ∧ 2 * ‖w‖ - 1 ≤ 1 |
| 125 | constructor <;> linarith [hw.1, hw.2] |
| 126 | obtain ⟨C, V, hV, hCV⟩ := hchi.exists_lipschitzOnWith |
| 127 | obtain ⟨D, W, hW, hDW⟩ := hstrip (hmaps hz) |
| 128 | have hpre : chi ⁻¹' W ∈ 𝓝[Q] z := |
| 129 | hchi.continuousAt.continuousWithinAt.tendsto_nhdsWithin hmaps hW |
| 130 | refine ⟨D * C, (V ∩ chi ⁻¹' W) ∩ Q, |
| 131 | inter_mem (inter_mem (nhdsWithin_le_nhds hV) hpre) self_mem_nhdsWithin, ?_⟩ |
| 132 | have hcomp : LipschitzOnWith (D * C) (f ∘ chi) ((V ∩ chi ⁻¹' W) ∩ Q) := |
| 133 | hDW.comp (hCV.mono (fun _ hw => hw.1.1)) (fun _ hw => hw.1.2) |
| 134 | intro x hx y hy |
| 135 | rw [m64PolarAnnulusMap_eq_polar hperiodic (hnonzero hx.2) (hpolar x), |
| 136 | m64PolarAnnulusMap_eq_polar hperiodic (hnonzero hy.2) (hpolar y)] |
| 137 | exact hcomp hx hy |
| 138 | · intro x hx y hy |
| 139 | obtain ⟨p, hp, hep⟩ := m64_periodic_rectangle_representative hperiodic |
| 140 | (m60PlaneAngle x) (s := 2 * ‖x‖ - 1) |
| 141 | ⟨by linarith [hx.1], by linarith [hx.2]⟩ |
| 142 | obtain ⟨q, hq, heq⟩ := m64_periodic_rectangle_representative hperiodic |
| 143 | (m60PlaneAngle y) (s := 2 * ‖y‖ - 1) |
| 144 | ⟨by linarith [hy.1], by linarith [hy.2]⟩ |
| 145 | change edist (f (annulusPoint (m60PlaneAngle x) (2 * ‖x‖ - 1))) |
| 146 | (f (annulusPoint (m60PlaneAngle y) (2 * ‖y‖ - 1))) ≠ ⊤ |
| 147 | rw [← hep, ← heq] |
| 148 | exact ne_top_of_le_ne_top |
| 149 | (ENNReal.mul_ne_top ENNReal.coe_ne_top (edist_ne_top p q)) (hLip hp hq) |
| 150 | |
| 151 | end PoincareMT |