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.AnnularEvolution.Finite.MotionEnergyIntegral |
| 2 | |
| 3 | /-! Actual Euclidean parameters and boundary displacements for the |
| 4 | finite annulus motion. Source: MT Lemma 19.15, pp. 447-449; M64 |
| 5 | finite-boundary-motion derivation. -/ |
| 6 | |
| 7 | noncomputable section |
| 8 | set_option autoImplicit false |
| 9 | set_option warningAsError true |
| 10 | set_option backward.isDefEq.respectTransparency false |
| 11 | |
| 12 | open Set |
| 13 | open scoped Manifold ContDiff Topology |
| 14 | |
| 15 | namespace PoincareMT |
| 16 | |
| 17 | variable {n d : ℕ} {M : Type*} [TopologicalSpace M] |
| 18 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 19 | |
| 20 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 21 | local notation "Z" => EuclideanSpace ℝ (Fin (d + 3)) |
| 22 | |
| 23 | /-- The original observed map, both original labels and the radial coordinate are retained |
| 24 | as independent motion parameters. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary |
| 25 | 19.16, pp. 447-449; project derivation |
| 26 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 27 | def m64BoundaryMotionParameters (e : M → E) (f : LoopPlane → M) |
| 28 | (sigma0 sigma1 : ℝ → ℝ) (p : LoopPlane) : Z := |
| 29 | EuclideanSpace.finAddEquivProd.symm |
| 30 | (e (f p), !₂[sigma0 (p 0), sigma1 (p 0), p 1]) |
| 31 | |
| 32 | /-- The actual independent parameter map is C1 on the closed source rectangle when its |
| 33 | original map and labels have that regularity. Source: Morgan--Tian (2007), Lemma 19.15 and |
| 34 | Corollary 19.16, pp. 447-449; project derivation |
| 35 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 36 | theorem m64BoundaryMotionParameters_contDiffOn {e : M → E} |
| 37 | (he : ContMDiff (𝓡 n) (𝓡 d) ∞ e) {f : LoopPlane → M} |
| 38 | (hf : ContMDiffOn (𝓡 2) (𝓡 n) 1 f m64AnnulusDomain) |
| 39 | {sigma0 sigma1 : ℝ → ℝ} (hsigma0 : ContDiff ℝ 1 sigma0) |
| 40 | (hsigma1 : ContDiff ℝ 1 sigma1) : |
| 41 | ContDiffOn ℝ 1 (m64BoundaryMotionParameters e f sigma0 sigma1) m64AnnulusDomain := by |
| 42 | have hobs : ContDiffOn ℝ 1 (e ∘ f) m64AnnulusDomain := |
| 43 | ((he.of_le (by simp)).comp_contMDiffOn hf).contDiffOn |
| 44 | have hlabels : ContDiff ℝ 1 (fun p : LoopPlane => |
| 45 | (!₂[sigma0 (p 0), sigma1 (p 0), p 1] : EuclideanSpace ℝ (Fin 3))) := by |
| 46 | apply (contDiff_piLp 2).mpr |
| 47 | intro i |
| 48 | fin_cases i |
| 49 | · change ContDiff ℝ 1 (fun p : LoopPlane => sigma0 (p 0)) |
| 50 | fun_prop |
| 51 | · change ContDiff ℝ 1 (fun p : LoopPlane => sigma1 (p 0)) |
| 52 | fun_prop |
| 53 | · change ContDiff ℝ 1 (fun p : LoopPlane => p 1) |
| 54 | fun_prop |
| 55 | exact EuclideanSpace.finAddEquivProd.symm.contDiff.comp_contDiffOn |
| 56 | (hobs.prodMk hlabels.contDiffOn) |
| 57 | |
| 58 | /-- Smooth boundary displacements use independent labels, so repeated visits to one target |
| 59 | point need not have the same velocity. Source: Morgan--Tian (2007), Lemma 19.15 and |
| 60 | Corollary 19.16, pp. 447-449; project derivation |
| 61 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 62 | def m64BoundaryDisplacement (e : M → E) (c0 c1 : ℝ → ℝ → M) |
| 63 | (w : ℝ × Z) : E := |
| 64 | let q := (EuclideanSpace.finAddEquivProd : Z ≃L[ℝ] E × EuclideanSpace ℝ (Fin 3)) w.2 |
| 65 | q.1 + (1 - q.2 2) • (e (c0 w.1 (q.2 0)) - e (c0 0 (q.2 0))) + |
| 66 | q.2 2 • (e (c1 w.1 (q.2 1)) - e (c1 0 (q.2 1))) |
| 67 | |
| 68 | omit [TopologicalSpace M] in |
| 69 | /-- The independent displacement is exactly the original observed parameter at time zero. |
| 70 | Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project |
| 71 | derivation |
| 72 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 73 | theorem m64BoundaryDisplacement_zero (e : M → E) (c0 c1 : ℝ → ℝ → M) (q : Z) : |
| 74 | m64BoundaryDisplacement e c0 c1 (0, q) = |
| 75 | (EuclideanSpace.finAddEquivProd q : E × EuclideanSpace ℝ (Fin 3)).1 := by |
| 76 | simp only [m64BoundaryDisplacement, sub_self, smul_zero, add_zero] |
| 77 | |
| 78 | omit [TopologicalSpace M] in |
| 79 | /-- Substituting the actual parameters gives the literal two-boundary displacement formula |
| 80 | with the original labels and source coordinate. Source: Morgan--Tian (2007), Lemma 19.15 and |
| 81 | Corollary 19.16, pp. 447-449; project derivation |
| 82 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 83 | theorem m64BoundaryDisplacement_parameters (e : M → E) (c0 c1 : ℝ → ℝ → M) |
| 84 | (f : LoopPlane → M) (sigma0 sigma1 : ℝ → ℝ) (s : ℝ) (p : LoopPlane) : |
| 85 | m64BoundaryDisplacement e c0 c1 (s, m64BoundaryMotionParameters e f sigma0 sigma1 p) = |
| 86 | e (f p) + (1 - p 1) • (e (c0 s (sigma0 (p 0))) - e (c0 0 (sigma0 (p 0)))) + |
| 87 | p 1 • (e (c1 s (sigma1 (p 0))) - e (c1 0 (sigma1 (p 0)))) := by |
| 88 | simp [m64BoundaryDisplacement, m64BoundaryMotionParameters] |
| 89 | |
| 90 | /-- The independent displacement is smooth on the original time interval and all parameter |
| 91 | vectors. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project |
| 92 | derivation |
| 93 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 94 | theorem m64BoundaryDisplacement_contDiffOn {e : M → E} |
| 95 | (he : ContMDiff (𝓡 n) (𝓡 d) ∞ e) {T : Set ℝ} (hzero : (0 : ℝ) ∈ T) |
| 96 | (c0 c1 : ℝ → ℝ → M) |
| 97 | (hc0 : ContMDiffOn 𝓘(ℝ, ℝ × ℝ) (𝓡 n) ∞ (Function.uncurry c0) (T ×ˢ univ)) |
| 98 | (hc1 : ContMDiffOn 𝓘(ℝ, ℝ × ℝ) (𝓡 n) ∞ (Function.uncurry c1) (T ×ˢ univ)) : |
| 99 | ContDiffOn ℝ ∞ (m64BoundaryDisplacement e c0 c1) (T ×ˢ univ) := by |
| 100 | let D : Z ≃L[ℝ] E × EuclideanSpace ℝ (Fin 3) := EuclideanSpace.finAddEquivProd |
| 101 | have hbase : ContDiff ℝ ∞ (fun w : ℝ × Z => (D w.2).1) := by fun_prop |
| 102 | have hcoord (i : Fin 3) : ContDiff ℝ ∞ (fun w : ℝ × Z => (D w.2).2 i) := by fun_prop |
| 103 | have hpair (i : Fin 3) := (contDiff_fst.prodMk (hcoord i)).contMDiff |
| 104 | have hpair0 (i : Fin 3) := ((contDiff_const (c := (0 : ℝ))).prodMk (hcoord i)).contMDiff |
| 105 | have hmaps (i : Fin 3) : MapsTo (fun w : ℝ × Z => (w.1, (D w.2).2 i)) |
| 106 | (T ×ˢ univ) (T ×ˢ univ) := fun _ hw => ⟨hw.1, mem_univ _⟩ |
| 107 | have hmaps0 (i : Fin 3) : MapsTo (fun w : ℝ × Z => ((0 : ℝ), (D w.2).2 i)) |
| 108 | (T ×ˢ univ) (T ×ˢ univ) := fun _ _ => ⟨hzero, mem_univ _⟩ |
| 109 | have h00 := (he.comp_contMDiffOn (hc0.comp (hpair 0).contMDiffOn (hmaps 0))).contDiffOn |
| 110 | have h01 := (he.comp_contMDiffOn (hc0.comp (hpair0 0).contMDiffOn (hmaps0 0))).contDiffOn |
| 111 | have h10 := (he.comp_contMDiffOn (hc1.comp (hpair 1).contMDiffOn (hmaps 1))).contDiffOn |
| 112 | have h11 := (he.comp_contMDiffOn (hc1.comp (hpair0 1).contMDiffOn (hmaps0 1))).contDiffOn |
| 113 | exact (hbase.contDiffOn.add |
| 114 | ((contDiffOn_const.sub (hcoord 2).contDiffOn).smul (h00.sub h01))).add |
| 115 | ((hcoord 2).contDiffOn.smul (h10.sub h11)) |
| 116 | |
| 117 | end PoincareMT |