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.MotionTangent |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Finite.ParameterVelocity |
| 3 | |
| 4 | /-! Continuous conormal currents on the actual closed rectangle. |
| 5 | Only within derivatives are used on its boundary. Source: MT Lemma |
| 6 | 19.15, pp. 447-449; finite-conormal-variation derivation. -/ |
| 7 | |
| 8 | noncomputable section |
| 9 | set_option autoImplicit false |
| 10 | set_option warningAsError true |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | open Set Filter Bundle |
| 14 | open scoped Manifold ContDiff Topology |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 19 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 20 | |
| 21 | /-- The genuine time velocity paired with the within spatial column at the base annulus. |
| 22 | This supplies the actual boundary trace. Source: Morgan--Tian (2007), Lemma 19.15 and |
| 23 | Corollary 19.16, pp. 447-449; project derivation |
| 24 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 25 | def m64FiniteAnnulusCurrent (g : RiemannianMetric n M) |
| 26 | (v : ℝ → LoopPlane → M) (i : Fin 2) (p : LoopPlane) : ℝ := |
| 27 | g.inner (v 0 p) (curveVelocity (fun s => v s p) 0) |
| 28 | (mfderivWithin (𝓡 2) (𝓡 n) (v 0) m64AnnulusDomain p |
| 29 | (EuclideanSpace.basisFun (Fin 2) ℝ i)) |
| 30 | |
| 31 | /-- A C1 base map and continuous genuine velocity give continuous current traces on every |
| 32 | face of the closed annulus. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, |
| 33 | pp. 447-449; project derivation |
| 34 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 35 | theorem m64FiniteAnnulusCurrent_continuousOn |
| 36 | (g : RiemannianMetric n M) {v : ℝ → LoopPlane → M} |
| 37 | (hbase : ContMDiffOn (𝓡 2) (𝓡 n) 1 (v 0) m64AnnulusDomain) |
| 38 | (hV : ContinuousOn (fun p => |
| 39 | (⟨v 0 p, curveVelocity (fun s => v s p) 0⟩ : TangentBundle (𝓡 n) M)) |
| 40 | m64AnnulusDomain) (i : Fin 2) : |
| 41 | ContinuousOn (m64FiniteAnnulusCurrent g v i) m64AnnulusDomain := by |
| 42 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 43 | ⟨g.toRiemannianMetric⟩ |
| 44 | exact hV.inner_bundle (m64AnnulusWithinColumn_continuousOn hbase i) |
| 45 | |
| 46 | /-- On the open rectangle the within current is the ordinary intrinsic time-velocity |
| 47 | pairing. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project |
| 48 | derivation |
| 49 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 50 | theorem m64FiniteAnnulusCurrent_eq_pairing |
| 51 | (g : RiemannianMetric n M) (v : ℝ → LoopPlane → M) (i : Fin 2) |
| 52 | {p : LoopPlane} (hp : p ∈ interior m64AnnulusDomain) : |
| 53 | m64FiniteAnnulusCurrent g v i p = |
| 54 | g.inner (v 0 p) (curveVelocity (fun s => v s p) 0) |
| 55 | (mfderiv (𝓡 2) (𝓡 n) (v 0) p (EuclideanSpace.basisFun (Fin 2) ℝ i)) := by |
| 56 | rw [m64FiniteAnnulusCurrent, mfderivWithin_of_mem_nhds (mem_interior_iff_mem_nhds.mp hp)] |
| 57 | |
| 58 | /-- Interior smoothness of the base and C1 of the genuine velocity make the actual current |
| 59 | differentiable inside the rectangle. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary |
| 60 | 19.16, pp. 447-449; project derivation |
| 61 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 62 | theorem m64FiniteAnnulusCurrent_differentiableAt |
| 63 | (g : RiemannianMetric n M) {v : ℝ → LoopPlane → M} {p : LoopPlane} |
| 64 | (hp : p ∈ interior m64AnnulusDomain) |
| 65 | (hbase : ContMDiffAt (𝓡 2) (𝓡 n) ∞ (v 0) p) |
| 66 | (hV : ContMDiffAt (𝓡 2) ((𝓡 n).prod (𝓡 n)) 1 (fun q => |
| 67 | (⟨v 0 q, curveVelocity (fun s => v s q) 0⟩ : TangentBundle (𝓡 n) M)) p) |
| 68 | (i : Fin 2) : DifferentiableAt ℝ (m64FiniteAnnulusCurrent g v i) p := by |
| 69 | have hvec : ContMDiffAt (𝓡 2) ((𝓡 2).prod (𝓡 2)) ∞ |
| 70 | (fun q : LoopPlane => (⟨q, EuclideanSpace.basisFun (Fin 2) ℝ i⟩ : |
| 71 | TangentBundle (𝓡 2) LoopPlane)) p := by |
| 72 | rw [contMDiffAt_totalSpace] |
| 73 | refine ⟨contMDiffAt_id, ?_⟩ |
| 74 | simpa using contMDiffAt_const (c := EuclideanSpace.basisFun (Fin 2) ℝ i) |
| 75 | have hcol := (hbase.mfderiv_const (m := ∞) (by simp)).clm_apply_of_inCoordinates hvec hbase |
| 76 | have hm := (((g.contMDiff (v 0 p)).comp p hbase).of_le (by simp)).clm_bundle_apply₂ |
| 77 | (F₃ := ℝ) (E₃ := Bundle.Trivial M ℝ) hV (hcol.of_le (by simp)) |
| 78 | have hs : ContDiffAt ℝ 1 (fun q => g.inner (v 0 q) |
| 79 | (curveVelocity (fun s => v s q) 0) |
| 80 | (mfderiv (𝓡 2) (𝓡 n) (v 0) q (EuclideanSpace.basisFun (Fin 2) ℝ i))) p := |
| 81 | contMDiffAt_iff_contDiffAt.mp (Bundle.contMDiffAt_totalSpace.mp hm).2 |
| 82 | apply (hs.congr_of_eventuallyEq ?_).differentiableAt one_ne_zero |
| 83 | filter_upwards [isOpen_interior.mem_nhds hp] with q hq |
| 84 | exact m64FiniteAnnulusCurrent_eq_pairing g v i hq |
| 85 | |
| 86 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 87 | |
| 88 | /-- The actual C1 parameter map supplies a C1 time-velocity section on the whole closed |
| 89 | rectangle. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; |
| 90 | project derivation |
| 91 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 92 | theorem m64ParameterAnnulus_timeVelocity_contMDiffOn |
| 93 | {Phi : ℝ × E → M} {T : Set ℝ} {O : Set E} |
| 94 | (hT : IsOpen T) (hO : IsOpen O) |
| 95 | (hPhi : ContMDiffOn 𝓘(ℝ, ℝ × E) (𝓡 n) ∞ Phi (T ×ˢ O)) |
| 96 | {h : LoopPlane → E} (hh : ContDiffOn ℝ 1 h m64AnnulusDomain) |
| 97 | (hmap : MapsTo h m64AnnulusDomain O) {t : ℝ} (ht : t ∈ T) : |
| 98 | ContMDiffOn (𝓡 2) ((𝓡 n).prod (𝓡 n)) 1 (fun p => |
| 99 | (⟨Phi (t, h p), curveVelocity (fun s => Phi (s, h p)) t⟩ : |
| 100 | TangentBundle (𝓡 n) M)) m64AnnulusDomain := by |
| 101 | intro p hp |
| 102 | have hV := (m64ParameterMotion_timeVelocity_contMDiffAt (hT.prod hO) hPhi |
| 103 | (show (t, h p) ∈ T ×ˢ O from ⟨ht, hmap hp⟩)).of_le |
| 104 | (show (1 : ℕ∞ω) ≤ ∞ by simp) |
| 105 | exact hV.comp_contMDiffWithinAt p |
| 106 | ((contDiffWithinAt_const.prodMk (hh p hp)).contMDiffWithinAt) |
| 107 | |
| 108 | end PoincareMT |