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.Polar.ForwardMap |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.AreaComparison.Projection.Integrability |
| 4 | import PoincareLib.Geometry.Riemannian.LoopSpace.Area.Polar.Integration |
| 5 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Homotopy.Null.Sphere |
| 6 | import Mathlib.MeasureTheory.Function.Jacobian |
| 7 | |
| 8 | /-! |
| 9 | # The polar forward map covers the collar almost everywhere |
| 10 | |
| 11 | The open fundamental rectangle is an injective coordinate domain. Its |
| 12 | image differs from the collar only on a boundary circle and an angular cut, |
| 13 | which are null for the fixed Euclidean volume. |
| 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 | set_option backward.isDefEq.respectTransparency false |
| 20 | |
| 21 | open Set Filter MeasureTheory Metric |
| 22 | open scoped Topology ContDiff ENNReal |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | open Proofs.M58 |
| 27 | |
| 28 | /-- The open fundamental rectangle on which the forward polar coordinate map is injective. |
| 29 | Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 30 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 31 | def m64PolarSource : Set LoopPlane := |
| 32 | {p | 0 < p 0 ∧ p 0 < curvePeriod ∧ 0 < p 1 ∧ p 1 < 1} |
| 33 | |
| 34 | /-- The fundamental polar source rectangle is open. Source: Auxiliary step for MT Lemma |
| 35 | 19.30, p. 462; the actual half-disk collar in |
| 36 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 37 | theorem m64PolarSource_open : IsOpen m64PolarSource := by |
| 38 | have h0 := PiLp.continuous_apply 2 (fun _ : Fin 2 => ℝ) 0 |
| 39 | have h1 := PiLp.continuous_apply 2 (fun _ : Fin 2 => ℝ) 1 |
| 40 | exact (isOpen_lt continuous_const h0).inter |
| 41 | ((isOpen_lt h0 continuous_const).inter |
| 42 | ((isOpen_lt continuous_const h1).inter (isOpen_lt h1 continuous_const))) |
| 43 | |
| 44 | /-- The open polar source lies in the closed annulus domain. Source: Auxiliary step for MT |
| 45 | Lemma 19.30, p. 462; the actual half-disk collar in |
| 46 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 47 | theorem m64PolarSource_subset : m64PolarSource ⊆ m64AnnulusDomain := |
| 48 | fun _ hp => ⟨hp.1.le, hp.2.1.le, hp.2.2.1.le, hp.2.2.2.le⟩ |
| 49 | |
| 50 | /-- Removing the four rectangle boundary edges does not change the domain almost everywhere. |
| 51 | Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 52 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 53 | theorem m64PolarSource_ae_eq_domain : m64PolarSource =ᵐ[volume] m64AnnulusDomain := by |
| 54 | have heq : m64PolarSource = |
| 55 | (@WithLp.ofLp 2 (Fin 2 → ℝ)) ⁻¹' (Set.pi Set.univ |
| 56 | (fun i : Fin 2 => Set.Ioo ((0 : Fin 2 → ℝ) i) (![curvePeriod, 1] i))) := by |
| 57 | ext p |
| 58 | simp [m64PolarSource, Set.mem_pi, Fin.forall_fin_two, and_assoc] |
| 59 | rw [heq] |
| 60 | exact m64AnnulusDomain_ae_eq_boxInterior.symm |
| 61 | |
| 62 | /-- The forward polar map has radius one half times one plus its radial rectangle |
| 63 | coordinate. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar |
| 64 | in `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 65 | theorem m64PolarForwardMap_norm {p : LoopPlane} (hp : -1 < p 1) : |
| 66 | ‖m64PolarForwardMap p‖ = (1 / 2 : ℝ) * (p 1 + 1) := by |
| 67 | have hr : 0 < (1 / 2 : ℝ) * (p 1 + 1) := by linarith |
| 68 | rw [m64PolarForwardMap, norm_smul, Real.norm_eq_abs, abs_of_pos hr, |
| 69 | norm_angularPoint, mul_one] |
| 70 | |
| 71 | /-- Positive radius and an open angular period make the forward polar map injective on its |
| 72 | source. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 73 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 74 | theorem m64PolarForwardMap_injOn : InjOn m64PolarForwardMap m64PolarSource := by |
| 75 | intro p hp q hq heq |
| 76 | have hp1 : -1 < p 1 := by linarith [hp.2.2.1] |
| 77 | have hq1 : -1 < q 1 := by linarith [hq.2.2.1] |
| 78 | have hn := congrArg norm heq |
| 79 | rw [m64PolarForwardMap_norm hp1, m64PolarForwardMap_norm hq1] at hn |
| 80 | have hcoord1 : p 1 = q 1 := by linarith |
| 81 | have hr : (1 / 2 : ℝ) * (p 1 + 1) ≠ 0 := ne_of_gt (by linarith [hp.2.2.1]) |
| 82 | have hang : angularPoint (p 0) = angularPoint (q 0) := by |
| 83 | have heq' : ((1 / 2 : ℝ) * (p 1 + 1)) • angularPoint (p 0) = |
| 84 | ((1 / 2 : ℝ) * (p 1 + 1)) • angularPoint (q 0) := by |
| 85 | simpa only [m64PolarForwardMap, ← hcoord1] using heq |
| 86 | have h := congrArg (fun w : LoopPlane => |
| 87 | (((1 / 2 : ℝ) * (p 1 + 1))⁻¹) • w) heq' |
| 88 | simpa only [smul_smul, inv_mul_cancel₀ hr, one_smul] using h |
| 89 | have hexp : Circle.exp (p 0) = Circle.exp (q 0) := by |
| 90 | rw [← m60LoopCircleHomeomorphCircle_angular, ← m60LoopCircleHomeomorphCircle_angular] |
| 91 | exact congrArg m60LoopCircleHomeomorphCircle (Subtype.ext hang) |
| 92 | have hcoord0 : p 0 = q 0 := |
| 93 | Circle.exp_injOn_Ico (a := 0) (b := curvePeriod) (by simp [curvePeriod]) |
| 94 | ⟨hp.1.le, hp.2.1⟩ ⟨hq.1.le, hq.2.1⟩ hexp |
| 95 | ext i |
| 96 | fin_cases i |
| 97 | · exact hcoord0 |
| 98 | · exact hcoord1 |
| 99 | |
| 100 | /-- The open rectangle maps into the planar half-disk collar. Source: Auxiliary step for MT |
| 101 | Lemma 19.30, p. 462; the actual half-disk collar in |
| 102 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 103 | theorem m64PolarForwardMap_image_subset : |
| 104 | m64PolarForwardMap '' m64PolarSource ⊆ |
| 105 | (closedBall (0 : LoopPlane) (1 / 2))ᶜ ∩ loopDiskSet := by |
| 106 | rintro _ ⟨p, hp, rfl⟩ |
| 107 | have hp1 : -1 < p 1 := by linarith [hp.2.2.1] |
| 108 | have hn := m64PolarForwardMap_norm hp1 |
| 109 | simp only [mem_inter_iff, mem_compl_iff, mem_closedBall, dist_zero_right, |
| 110 | loopDiskSet, not_le, hn] |
| 111 | constructor <;> linarith [hp.2.2.1, hp.2.2.2] |
| 112 | |
| 113 | /-- The horizontal coordinate axis has zero planar volume. Source: Auxiliary step for MT |
| 114 | Lemma 19.30, p. 462; the actual half-disk collar in |
| 115 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 116 | theorem m64_horizontal_line_null : volume {z : LoopPlane | z 1 = 0} = 0 := by |
| 117 | let S : Set (ℝ × ℝ) := univ ×ˢ {(0 : ℝ)} |
| 118 | have hS : NullMeasurableSet S volume := by measurability |
| 119 | have hzero : volume S = 0 := by |
| 120 | rw [Measure.volume_eq_prod, Measure.prod_prod] |
| 121 | simp |
| 122 | have heq : loopPlaneEquivProd ⁻¹' S = {z : LoopPlane | z 1 = 0} := by |
| 123 | ext z |
| 124 | simp [S, loopPlaneEquivProd, MeasurableEquiv.finTwoArrow_apply] |
| 125 | rw [← heq, measurePreserving_loopPlaneEquivProd.measure_preimage hS, hzero] |
| 126 | |
| 127 | /-- Away from the horizontal axis a nonzero point has a polar angle strictly between zero |
| 128 | and one period. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk |
| 129 | collar in `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 130 | theorem m64_exists_open_polar_angle {z : LoopPlane} (hz : z ≠ 0) (hline : z 1 ≠ 0) : |
| 131 | ∃ theta ∈ Ioo (0 : ℝ) curvePeriod, ‖z‖ • angularPoint theta = z := by |
| 132 | have hn : 0 < ‖z‖ := norm_pos_iff.mpr hz |
| 133 | let q : LoopCircle := ⟨‖z‖⁻¹ • z, by |
| 134 | rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hn), inv_mul_cancel₀ hn.ne']⟩ |
| 135 | obtain ⟨theta, htheta, hang⟩ := exists_angularPoint q |
| 136 | have hzero : theta ≠ 0 := by |
| 137 | intro ht |
| 138 | have h := congrArg (fun w : LoopPlane => w 1) hang |
| 139 | change (angularPoint theta) 1 = ‖z‖⁻¹ * z 1 at h |
| 140 | simp only [ht, angularPoint, Matrix.cons_val_one, Matrix.cons_val_fin_one, |
| 141 | Real.sin_zero] at h |
| 142 | exact (mul_ne_zero (inv_ne_zero hn.ne') hline) h.symm |
| 143 | have hperiod : theta ≠ curvePeriod := by |
| 144 | intro ht |
| 145 | have h := congrArg (fun w : LoopPlane => w 1) hang |
| 146 | change (angularPoint theta) 1 = ‖z‖⁻¹ * z 1 at h |
| 147 | simp only [ht, angularPoint, Matrix.cons_val_one, Matrix.cons_val_fin_one, |
| 148 | curvePeriod, Real.sin_two_pi] at h |
| 149 | exact (mul_ne_zero (inv_ne_zero hn.ne') hline) h.symm |
| 150 | refine ⟨theta, ⟨lt_of_le_of_ne htheta.1 hzero.symm, |
| 151 | lt_of_le_of_ne htheta.2 hperiod⟩, ?_⟩ |
| 152 | rw [hang] |
| 153 | exact smul_inv_smul₀ hn.ne' z |
| 154 | |
| 155 | /-- The forward polar image covers the collar except for null angular and circular boundary |
| 156 | sets. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 157 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 158 | theorem m64PolarForwardMap_image_ae_eq : |
| 159 | m64PolarForwardMap '' m64PolarSource =ᵐ[volume] |
| 160 | ((closedBall (0 : LoopPlane) (1 / 2))ᶜ ∩ loopDiskSet : Set LoopPlane) := by |
| 161 | filter_upwards [compl_mem_ae_iff.mpr m64_horizontal_line_null, |
| 162 | M60.haar_ball_ae_eq_closedBall volume (0 : LoopPlane) 1] with z hline hball |
| 163 | apply propext |
| 164 | refine ⟨fun hz => m64PolarForwardMap_image_subset hz, ?_⟩ |
| 165 | intro hz |
| 166 | have hlo : 1 / 2 < ‖z‖ := by |
| 167 | simpa only [mem_compl_iff, mem_closedBall, dist_zero_right, not_le] using hz.1 |
| 168 | have hhi : ‖z‖ < 1 := mem_ball_zero_iff.mp (hball.mpr hz.2) |
| 169 | have hn : z ≠ 0 := norm_pos_iff.mp (by linarith) |
| 170 | obtain ⟨theta, htheta, hang⟩ := m64_exists_open_polar_angle hn hline |
| 171 | refine ⟨annulusPoint theta (2 * ‖z‖ - 1), |
| 172 | ⟨htheta.1, htheta.2, by change 0 < 2 * ‖z‖ - 1; linarith, |
| 173 | by change 2 * ‖z‖ - 1 < 1; linarith⟩, ?_⟩ |
| 174 | change ((1 / 2 : ℝ) * (2 * ‖z‖ - 1 + 1)) • angularPoint theta = z |
| 175 | have hrad : (1 / 2 : ℝ) * (2 * ‖z‖ - 1 + 1) = ‖z‖ := by ring |
| 176 | rw [hrad] |
| 177 | exact hang |
| 178 | |
| 179 | end PoincareMT |