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.Annulus |
| 2 | import PoincareLib.Geometry.Riemannian.LoopSpace.Area.PlaneReflection |
| 3 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Derivative.Manifold.Equiv |
| 4 | |
| 5 | /-! |
| 6 | # Radial reflection of the annulus rectangle |
| 7 | |
| 8 | The affine involution fixes the angular coordinate and sends the radial |
| 9 | coordinate to its complement. It preserves both volume and the rectangle. |
| 10 | |
| 11 | Morgan--Tian context: Section 19.6, Lemmas 19.30-19.31, printed pp. 461-466. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set MeasureTheory |
| 18 | open scoped Manifold |
| 19 | |
| 20 | namespace PoincareMT |
| 21 | |
| 22 | /-- The affine reflection fixing the angular coordinate and sending the radial coordinate to |
| 23 | one minus itself. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk |
| 24 | collar in `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 25 | noncomputable def m64AnnulusFlip : LoopPlane ≃ₜ LoopPlane := |
| 26 | m60PlaneReflection.toHomeomorph.trans (Homeomorph.addRight (annulusPoint 0 1)) |
| 27 | |
| 28 | /-- The affine annulus reflection equals the explicit coordinate formula. Source: Auxiliary |
| 29 | 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 | theorem m64AnnulusFlip_apply (p : LoopPlane) : |
| 32 | m64AnnulusFlip p = m60PlaneReflection p + annulusPoint 0 1 := rfl |
| 33 | |
| 34 | /-- Annulus reflection fixes the angular coordinate. 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 m64AnnulusFlip_coord_zero (p : LoopPlane) : m64AnnulusFlip p 0 = p 0 := by |
| 38 | simp [m64AnnulusFlip_apply, m60PlaneReflection_apply, annulusPoint] |
| 39 | |
| 40 | /-- Annulus reflection reverses the unit radial coordinate. Source: Auxiliary step for MT |
| 41 | Lemma 19.30, p. 462; the actual half-disk collar in |
| 42 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 43 | theorem m64AnnulusFlip_coord_one (p : LoopPlane) : m64AnnulusFlip p 1 = 1 - p 1 := by |
| 44 | simp [m64AnnulusFlip_apply, m60PlaneReflection_apply, annulusPoint] |
| 45 | ring |
| 46 | |
| 47 | /-- Reflection sends a displayed annulus point to the same angle at the reversed radius. |
| 48 | Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 49 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 50 | theorem m64AnnulusFlip_annulusPoint (x s : ℝ) : |
| 51 | m64AnnulusFlip (annulusPoint x s) = annulusPoint x (1 - s) := by |
| 52 | ext i |
| 53 | fin_cases i <;> |
| 54 | simp [m64AnnulusFlip_coord_zero, m64AnnulusFlip_coord_one, annulusPoint] |
| 55 | |
| 56 | /-- Applying annulus reflection twice returns the original point. Source: Auxiliary step for |
| 57 | MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 58 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 59 | theorem m64AnnulusFlip_involutive : Function.Involutive m64AnnulusFlip := by |
| 60 | intro p |
| 61 | ext i |
| 62 | fin_cases i <;> simp [m64AnnulusFlip_coord_zero, m64AnnulusFlip_coord_one] |
| 63 | |
| 64 | /-- The annulus reflection is a Euclidean isometry. Source: Auxiliary step for MT Lemma |
| 65 | 19.30, p. 462; the actual half-disk collar in |
| 66 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 67 | theorem m64AnnulusFlip_isometry : Isometry m64AnnulusFlip := |
| 68 | (isometry_add_right (annulusPoint 0 1)).comp m60PlaneReflection.isometry |
| 69 | |
| 70 | /-- The affine radial reflection preserves planar volume. Source: Auxiliary step for MT |
| 71 | Lemma 19.30, p. 462; the actual half-disk collar in |
| 72 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 73 | theorem m64AnnulusFlip_measurePreserving : |
| 74 | MeasurePreserving m64AnnulusFlip (volume : Measure LoopPlane) volume := |
| 75 | (measurePreserving_add_right volume (annulusPoint 0 1)).comp |
| 76 | m60PlaneReflection.measurePreserving |
| 77 | |
| 78 | /-- A point lies in the annulus rectangle exactly when its reflection does. Source: |
| 79 | Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 80 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 81 | theorem m64AnnulusFlip_mem_domain (p : LoopPlane) : |
| 82 | m64AnnulusFlip p ∈ m64AnnulusDomain ↔ p ∈ m64AnnulusDomain := by |
| 83 | change (0 ≤ m64AnnulusFlip p 0 ∧ m64AnnulusFlip p 0 ≤ curvePeriod ∧ |
| 84 | 0 ≤ m64AnnulusFlip p 1 ∧ m64AnnulusFlip p 1 ≤ 1) ↔ _ |
| 85 | rw [m64AnnulusFlip_coord_zero, m64AnnulusFlip_coord_one] |
| 86 | change (0 ≤ p 0 ∧ p 0 ≤ curvePeriod ∧ 0 ≤ 1 - p 1 ∧ 1 - p 1 ≤ 1) ↔ |
| 87 | (0 ≤ p 0 ∧ p 0 ≤ curvePeriod ∧ 0 ≤ p 1 ∧ p 1 ≤ 1) |
| 88 | constructor <;> intro h <;> refine ⟨h.1, h.2.1, ?_, ?_⟩ <;> linarith [h.2.2.1, h.2.2.2] |
| 89 | |
| 90 | /-- The annulus domain is its own preimage under radial reflection. Source: Auxiliary step |
| 91 | for MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 92 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 93 | theorem m64AnnulusFlip_preimage_domain : |
| 94 | m64AnnulusFlip ⁻¹' m64AnnulusDomain = m64AnnulusDomain := |
| 95 | Set.ext m64AnnulusFlip_mem_domain |
| 96 | |
| 97 | /-- The reflection has the constant derivative fixing the angular column and negating the |
| 98 | radial column. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk |
| 99 | collar in `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 100 | theorem m64AnnulusFlip_hasFDerivAt (p : LoopPlane) : |
| 101 | HasFDerivAt m64AnnulusFlip |
| 102 | m60PlaneReflection.toContinuousLinearEquiv.toContinuousLinearMap p := by |
| 103 | exact m60PlaneReflection.toContinuousLinearEquiv.hasFDerivAt.add_const |
| 104 | (annulusPoint 0 1) |
| 105 | |
| 106 | /-- The actual manifold derivative obeys the reflection chain rule in both differentiable |
| 107 | and totalized cases. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk |
| 108 | collar in `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 109 | theorem mfderiv_comp_m64AnnulusFlip |
| 110 | {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 111 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 112 | (f : LoopPlane → M) (p : LoopPlane) : |
| 113 | mfderiv (𝓡 2) (𝓡 n) (fun z => f (m64AnnulusFlip z)) p = |
| 114 | (mfderiv (𝓡 2) (𝓡 n) f (m64AnnulusFlip p)).comp |
| 115 | m60PlaneReflection.toContinuousLinearEquiv.toContinuousLinearMap := by |
| 116 | have he := (m64AnnulusFlip_hasFDerivAt p).hasMFDerivAt |
| 117 | by_cases hf : MDifferentiableAt (𝓡 2) (𝓡 n) f (m64AnnulusFlip p) |
| 118 | · change mfderiv (𝓡 2) (𝓡 n) (f ∘ m64AnnulusFlip) p = _ |
| 119 | erw [mfderiv_comp p hf he.mdifferentiableAt, he.mfderiv] |
| 120 | · have hcomp : ¬MDifferentiableAt (𝓡 2) (𝓡 n) |
| 121 | (fun z => f (m64AnnulusFlip z)) p := by |
| 122 | intro h |
| 123 | have hback := h.comp_of_eq (m64AnnulusFlip p) |
| 124 | (m64AnnulusFlip_hasFDerivAt (m64AnnulusFlip p)).hasMFDerivAt.mdifferentiableAt |
| 125 | (m64AnnulusFlip_involutive p) |
| 126 | apply hf |
| 127 | have hfun : (fun x => f (m64AnnulusFlip (m64AnnulusFlip x))) = f := |
| 128 | funext (fun x => congrArg f (m64AnnulusFlip_involutive x)) |
| 129 | simpa only [Function.comp_def, hfun] using hback |
| 130 | rw [mfderiv_zero_of_not_mdifferentiableAt hcomp, |
| 131 | mfderiv_zero_of_not_mdifferentiableAt hf, ContinuousLinearMap.zero_comp] |
| 132 | |
| 133 | end PoincareMT |