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.BoundaryMotion |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Finite.C2BoundaryReference |
| 3 | |
| 4 | /-! Actual C2 boundary evolution supplies finite annulus motion, |
| 5 | classical competitors and differentiable weighted energy. Source: |
| 6 | MT Lemma 19.15, pp. 447-449; finite-boundary-motion 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 MeasureTheory |
| 14 | open scoped Manifold ContDiff Topology |
| 15 | |
| 16 | namespace PoincareMT |
| 17 | |
| 18 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] [T2Space M] [CompactSpace M] |
| 19 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 20 | {a b : ℝ} |
| 21 | |
| 22 | /-- The actual C2 boundary flows move a closed-C1 annulus with its original fixed C1 free |
| 23 | labels. The original curvature velocities, classical competitors and literal energy |
| 24 | derivative are all supplied. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, |
| 25 | pp. 447-449; project derivation |
| 26 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 27 | theorem m64C2Annulus_exists_finite_energy_motion |
| 28 | (F : RicciFlow n M (Icc a b)) {c0 c1 : ℝ → ℝ → M} |
| 29 | (hc0 : M63C2ShrinkingCurveOn F c0 (Icc a b)) |
| 30 | (hc1 : M63C2ShrinkingCurveOn F c1 (Icc a b)) {t : ℝ} (ht : t ∈ Ioo a b) |
| 31 | (sigma0 sigma1 : M64PeriodicDegreeOneLift) |
| 32 | (hsigma0 : ContDiff ℝ 1 sigma0.map) (hsigma1 : ContDiff ℝ 1 sigma1.map) |
| 33 | (A : M64Annulus (F.metric t) |
| 34 | ((fun x => c0 x t) ∘ sigma0.map) ((fun x => c1 x t) ∘ sigma1.map)) |
| 35 | (hA : ContMDiffOn (𝓡 2) (𝓡 n) 1 A.map m64AnnulusDomain) : |
| 36 | ∃ epsilon : ℝ, 0 < epsilon ∧ |
| 37 | (∀ s ∈ Ioo (-epsilon) epsilon, t + s ∈ Ioo a b) ∧ |
| 38 | ∃ v : ℝ → LoopPlane → M, |
| 39 | (∀ p, v 0 p = A.map p) ∧ |
| 40 | (∀ s x y, v s (annulusPoint (x + curvePeriod) y) = v s (annulusPoint x y)) ∧ |
| 41 | (∀ s ∈ Ioo (-epsilon) epsilon, ∀ x, |
| 42 | v s (annulusPoint x 0) = c0 (sigma0.map x) (t + s)) ∧ |
| 43 | (∀ s ∈ Ioo (-epsilon) epsilon, ∀ x, |
| 44 | v s (annulusPoint x 1) = c1 (sigma1.map x) (t + s)) ∧ |
| 45 | (∀ x, curveVelocity (n := n) (fun s => v s (annulusPoint x 0)) 0 = |
| 46 | m62CurvatureVector F c0 t (sigma0.map x)) ∧ |
| 47 | (∀ x, curveVelocity (n := n) (fun s => v s (annulusPoint x 1)) 0 = |
| 48 | m62CurvatureVector F c1 t (sigma1.map x)) ∧ |
| 49 | (∀ s ∈ Ioo (-epsilon) epsilon, ∀ g' : RiemannianMetric n M, |
| 50 | ∃ B : M64Annulus g' ((fun x => c0 x (t + s)) ∘ sigma0.map) |
| 51 | ((fun x => c1 x (t + s)) ∘ sigma1.map), |
| 52 | EqOn B.map (v s) m64AnnulusDomain ∧ B.area = m64AnnulusArea g' (v s)) ∧ |
| 53 | (∀ r : ℝ, |
| 54 | let E := fun s p => m64ModulusEnergyDensity (F.metric (t + s)) r (v s) p |
| 55 | IntegrableOn (fun p => deriv (fun s => E s p) 0) m64AnnulusDomain volume ∧ |
| 56 | HasDerivAt (fun s => ∫ p in m64AnnulusDomain, E s p) |
| 57 | (∫ p in m64AnnulusDomain, deriv (fun s => E s p) 0) 0) ∧ |
| 58 | ∃ d : ℕ, ∃ h : LoopPlane → EuclideanSpace ℝ (Fin d), |
| 59 | ContDiffOn ℝ 1 h m64AnnulusDomain ∧ |
| 60 | ∃ O : Set (EuclideanSpace ℝ (Fin d)), IsOpen O ∧ MapsTo h m64AnnulusDomain O ∧ |
| 61 | ∃ Phi : ℝ × EuclideanSpace ℝ (Fin d) → M, |
| 62 | ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓡 d)) (𝓡 n) ∞ Phi |
| 63 | (Ioo (-epsilon) epsilon ×ˢ O) ∧ v = fun s p => Phi (s, h p) := by |
| 64 | obtain ⟨epsilon0, hepsilon0, htime0, L0, hL0, f0, hf0, hp0, htrace0, hvelocity0⟩ := |
| 65 | m64C2ShrinkingCurve_exists_finite_reference F hc0 ht sigma0 hsigma0 |
| 66 | obtain ⟨epsilon1, hepsilon1, -, L1, hL1, f1, hf1, hp1, htrace1, hvelocity1⟩ := |
| 67 | m64C2ShrinkingCurve_exists_finite_reference F hc1 ht sigma1 hsigma1 |
| 68 | let epsilon := min epsilon0 epsilon1 |
| 69 | have hepsilon : 0 < epsilon := lt_min hepsilon0 hepsilon1 |
| 70 | have hsmall0 : Ioo (-epsilon) epsilon ⊆ Ioo (-epsilon0) epsilon0 := by |
| 71 | intro s hs |
| 72 | exact ⟨(neg_le_neg (min_le_left _ _)).trans_lt hs.1, hs.2.trans_le (min_le_left _ _)⟩ |
| 73 | have hsmall1 : Ioo (-epsilon) epsilon ⊆ Ioo (-epsilon1) epsilon1 := by |
| 74 | intro s hs |
| 75 | exact ⟨(neg_le_neg (min_le_right _ _)).trans_lt hs.1, hs.2.trans_le (min_le_right _ _)⟩ |
| 76 | have hzero : (0 : ℝ) ∈ Ioo (-epsilon) epsilon := ⟨by linarith, hepsilon⟩ |
| 77 | have hinit0 : f0 0 ∘ L0.map = (fun x => c0 x t) ∘ sigma0.map := by |
| 78 | funext x |
| 79 | simpa only [Function.comp_apply, add_zero] using htrace0 0 (hsmall0 hzero) x |
| 80 | have hinit1 : f1 0 ∘ L1.map = (fun x => c1 x t) ∘ sigma1.map := by |
| 81 | funext x |
| 82 | simpa only [Function.comp_apply, add_zero] using htrace1 0 (hsmall1 hzero) x |
| 83 | have hstart : ∃ B : M64Annulus (F.metric t) (f0 0 ∘ L0.map) (f1 0 ∘ L1.map), |
| 84 | B.map = A.map := by |
| 85 | rw [hinit0, hinit1] |
| 86 | exact ⟨A, rfl⟩ |
| 87 | obtain ⟨A', hA'⟩ := hstart |
| 88 | have hAreg : ContMDiffOn (𝓡 2) (𝓡 n) 1 A'.map m64AnnulusDomain := by |
| 89 | rw [hA'] |
| 90 | exact hA |
| 91 | obtain ⟨d, h, hh, delta, hdelta, O, hO, hmap, Phi, hPhi, hbase, hperiod, |
| 92 | hlower, hupper, hfamily⟩ := m64Annulus_exists_finite_boundary_motion f0 f1 L0 L1 |
| 93 | hL0 hL1 A' hAreg hepsilon (hf0.mono (prod_mono_left hsmall0)) |
| 94 | (hf1.mono (prod_mono_left hsmall1)) hp0 hp1 |
| 95 | let eta := min delta epsilon |
| 96 | have heta : 0 < eta := lt_min hdelta hepsilon |
| 97 | have hdelta' : Ioo (-eta) eta ⊆ Ioo (-delta) delta := by |
| 98 | intro s hs |
| 99 | exact ⟨(neg_le_neg (min_le_left _ _)).trans_lt hs.1, hs.2.trans_le (min_le_left _ _)⟩ |
| 100 | have hepsilon' : Ioo (-eta) eta ⊆ Ioo (-epsilon) epsilon := by |
| 101 | intro s hs |
| 102 | exact ⟨(neg_le_neg (min_le_right _ _)).trans_lt hs.1, hs.2.trans_le (min_le_right _ _)⟩ |
| 103 | have htime (s : ℝ) (hs : s ∈ Ioo (-eta) eta) : t + s ∈ Ioo a b := |
| 104 | htime0 s (hsmall0 (hepsilon' hs)) |
| 105 | let v := fun s p => Phi (s, h p) |
| 106 | refine ⟨eta, heta, htime, v, ?_, hperiod, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ |
| 107 | · intro p |
| 108 | exact (hbase p).trans (congrFun hA' p) |
| 109 | · intro s hs x |
| 110 | exact (hlower s x).trans (htrace0 s (hsmall0 (hepsilon' hs)) x) |
| 111 | · intro s hs x |
| 112 | exact (hupper s x).trans (htrace1 s (hsmall1 (hepsilon' hs)) x) |
| 113 | · intro x |
| 114 | have heq : (fun s => v s (annulusPoint x 0)) = fun s => f0 s (L0.map x) := |
| 115 | funext fun s => hlower s x |
| 116 | exact (congrArg (fun f : ℝ → M => |
| 117 | (curveVelocity (n := n) f 0 : EuclideanSpace ℝ (Fin n))) heq).trans (hvelocity0 x) |
| 118 | · intro x |
| 119 | have heq : (fun s => v s (annulusPoint x 1)) = fun s => f1 s (L1.map x) := |
| 120 | funext fun s => hupper s x |
| 121 | exact (congrArg (fun f : ℝ → M => |
| 122 | (curveVelocity (n := n) f 0 : EuclideanSpace ℝ (Fin n))) heq).trans (hvelocity1 x) |
| 123 | · intro s hs g' |
| 124 | have hlo : f0 s ∘ L0.map = (fun x => c0 x (t + s)) ∘ sigma0.map := |
| 125 | funext fun x => htrace0 s (hsmall0 (hepsilon' hs)) x |
| 126 | have hhi : f1 s ∘ L1.map = (fun x => c1 x (t + s)) ∘ sigma1.map := |
| 127 | funext fun x => htrace1 s (hsmall1 (hepsilon' hs)) x |
| 128 | have hB := hfamily s (hdelta' hs) g' |
| 129 | rw [hlo, hhi] at hB |
| 130 | exact hB |
| 131 | · intro r |
| 132 | exact m64AnnulusMotionEnergy_hasDerivAt F t heta htime hO Phi |
| 133 | (hPhi.mono (prod_mono_left hdelta')) r hh.contMDiffOn hmap |
| 134 | · exact ⟨d, h, hh, O, hO, hmap, Phi, hPhi.mono (prod_mono_left hdelta'), rfl⟩ |
| 135 | |
| 136 | end PoincareMT |