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.CurrentTraces |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Annulus.CirclePeriodicity |
| 3 | |
| 4 | /-! Literal periodicity cancels the finite conormal current at the |
| 5 | angular cut. Source: MT Lemma 19.15, pp. 447-449. Interior strip |
| 6 | derivatives determine the endpoint traces by continuity. -/ |
| 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 | {g : RiemannianMetric n M} {c0 c1 : ℝ → M} |
| 21 | |
| 22 | /-- The actual within current agrees at both angular faces, including the corners. Only the |
| 23 | base annulus is smooth on the open covering strip. Source: Morgan--Tian (2007), Lemma 19.15 |
| 24 | and Corollary 19.16, pp. 447-449; project derivation |
| 25 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 26 | theorem m64FiniteAnnulusCurrent_seam |
| 27 | (A : M64Annulus g c0 c1) {v : ℝ → LoopPlane → M} |
| 28 | (hbase : ∀ p, v 0 p = A.map p) |
| 29 | (hperiodic : ∀ t x y, v t (annulusPoint (x + curvePeriod) y) = |
| 30 | v t (annulusPoint x y)) |
| 31 | (hc : ∀ i : Fin 2, ContinuousOn (m64FiniteAnnulusCurrent g v i) m64AnnulusDomain) |
| 32 | (hA : ContMDiffOn (𝓡 2) (𝓡 n) ∞ A.map |
| 33 | {p : LoopPlane | p 1 ∈ Ioo (0 : ℝ) 1}) (i : Fin 2) : |
| 34 | ∀ y ∈ Icc (0 : ℝ) 1, |
| 35 | m64FiniteAnnulusCurrent g v i (annulusPoint curvePeriod y) = |
| 36 | m64FiniteAnnulusCurrent g v i (annulusPoint 0 y) := by |
| 37 | have hperiod : 0 ≤ curvePeriod := by unfold curvePeriod; positivity |
| 38 | have hstrip : IsOpen {p : LoopPlane | p 1 ∈ Ioo (0 : ℝ) 1} := |
| 39 | isOpen_Ioo.preimage (by fun_prop) |
| 40 | have hline (x : ℝ) : Continuous (fun y : ℝ => annulusPoint x y) := by |
| 41 | unfold annulusPoint |
| 42 | fun_prop |
| 43 | have hclosed (x : ℝ) (hx : x ∈ Icc (0 : ℝ) curvePeriod) : |
| 44 | ContinuousOn (fun y => m64FiniteAnnulusCurrent g v i (annulusPoint x y)) |
| 45 | (Icc (0 : ℝ) 1) := |
| 46 | (hc i).comp (hline x).continuousOn (fun _ hy => ⟨hx.1, hx.2, hy.1, hy.2⟩) |
| 47 | have heq : EqOn |
| 48 | (fun y => m64FiniteAnnulusCurrent g v i (annulusPoint curvePeriod y)) |
| 49 | (fun y => m64FiniteAnnulusCurrent g v i (annulusPoint 0 y)) (Ioo (0 : ℝ) 1) := by |
| 50 | intro y hy |
| 51 | have hcol (x : ℝ) (hx : x ∈ Icc (0 : ℝ) curvePeriod) : |
| 52 | mfderivWithin (𝓡 2) (𝓡 n) (v 0) m64AnnulusDomain (annulusPoint x y) |
| 53 | (EuclideanSpace.basisFun (Fin 2) ℝ i) = |
| 54 | mfderiv (𝓡 2) (𝓡 n) A.map (annulusPoint x y) |
| 55 | (EuclideanSpace.basisFun (Fin 2) ℝ i) := by |
| 56 | rw [show v 0 = A.map from funext hbase] |
| 57 | rw [mfderivWithin_eq_mfderiv |
| 58 | (m64AnnulusDomain_uniqueDiffOn.uniqueMDiffOn _ ⟨hx.1, hx.2, hy.1.le, hy.2.le⟩) |
| 59 | ((hA.contMDiffAt (hstrip.mem_nhds (show annulusPoint x y ∈ |
| 60 | {p : LoopPlane | p 1 ∈ Ioo (0 : ℝ) 1} from hy))).mdifferentiableAt (by simp))] |
| 61 | have hshift : annulusPoint curvePeriod 0 + annulusPoint 0 y = |
| 62 | annulusPoint curvePeriod y := by |
| 63 | ext j |
| 64 | fin_cases j <;> simp [annulusPoint] |
| 65 | have hd := m64Annulus_mfderiv_periodic A (annulusPoint 0 y) |
| 66 | rw [hshift] at hd |
| 67 | have htime : (fun t => v t (annulusPoint curvePeriod y)) = |
| 68 | fun t => v t (annulusPoint 0 y) := by |
| 69 | funext t |
| 70 | simpa only [zero_add] using hperiodic t 0 y |
| 71 | have hvelocity := congrArg (fun f : ℝ → M => |
| 72 | (curveVelocity (n := n) f 0 : EuclideanSpace ℝ (Fin n))) htime |
| 73 | have hdata : (v 0 (annulusPoint curvePeriod y), |
| 74 | (curveVelocity (fun t => v t (annulusPoint curvePeriod y)) 0 : |
| 75 | EuclideanSpace ℝ (Fin n)), |
| 76 | (mfderivWithin (𝓡 2) (𝓡 n) (v 0) m64AnnulusDomain (annulusPoint curvePeriod y) |
| 77 | (EuclideanSpace.basisFun (Fin 2) ℝ i) : EuclideanSpace ℝ (Fin n))) = |
| 78 | (v 0 (annulusPoint 0 y), |
| 79 | (curveVelocity (fun t => v t (annulusPoint 0 y)) 0 : EuclideanSpace ℝ (Fin n)), |
| 80 | (mfderivWithin (𝓡 2) (𝓡 n) (v 0) m64AnnulusDomain (annulusPoint 0 y) |
| 81 | (EuclideanSpace.basisFun (Fin 2) ℝ i) : EuclideanSpace ℝ (Fin n))) := by |
| 82 | refine Prod.ext (congrFun htime 0) (Prod.ext hvelocity ?_) |
| 83 | rw [hcol curvePeriod ⟨hperiod, le_rfl⟩, hcol 0 ⟨le_rfl, hperiod⟩, hd] |
| 84 | rfl |
| 85 | exact congrArg (fun q : M × EuclideanSpace ℝ (Fin n) × EuclideanSpace ℝ (Fin n) => |
| 86 | g.inner q.1 q.2.1 q.2.2) hdata |
| 87 | exact heq.of_subset_closure (hclosed curvePeriod ⟨hperiod, le_rfl⟩) |
| 88 | (hclosed 0 ⟨le_rfl, hperiod⟩) Ioo_subset_Icc_self |
| 89 | (by rw [closure_Ioo (show (0 : ℝ) ≠ 1 by norm_num)]) |
| 90 | |
| 91 | end PoincareMT |