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.C2FirstVariation |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Finite.C2CurvatureCurrent |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Finite.RicciBound |
| 4 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Plateau.Weighted.AnnulusEnergyIdentity |
| 5 | |
| 6 | /-! Actual future competitors from a finite-regularity immersed minimum. |
| 7 | The checked first variation and boundary estimate control the literal |
| 8 | moving energy. Each actual motion is admitted as an annulus, and the |
| 9 | proved zero-area collars restore the original boundary labels. |
| 10 | Source: MT Lemma 19.15, pp. 447-449; M64 finite forward derivation. -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | set_option autoImplicit false |
| 14 | set_option warningAsError true |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter MeasureTheory |
| 18 | open scoped Topology ContDiff Manifold |
| 19 | |
| 20 | namespace PoincareMT.M64 |
| 21 | |
| 22 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] [T2Space M] [CompactSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | {a b : ℝ} |
| 25 | |
| 26 | local notation "S" => Set.ofPred (fun p : LoopPlane => p 1 ∈ Icc (0 : ℝ) 1) |
| 27 | |
| 28 | /-- An actual closed-C1 immersed conformal minimum supplies literal future competitors with |
| 29 | the boundary-plus-Ricci rate and arbitrary positive slack. No smooth extension across either |
| 30 | boundary is required. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. |
| 31 | 447-449; project derivation |
| 32 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 33 | theorem c2_annulus_finite_exists_forward (F : RicciFlow n M (Icc a b)) |
| 34 | (c : Bool → ℝ → ℝ → M) (hc : ∀ u, M63C2ShrinkingCurveOn F (c u) (Icc a b)) |
| 35 | {t : ℝ} (ht : t ∈ Ioo a b) (sigma : Bool → M64PeriodicDegreeOneLift) |
| 36 | (hsigma : ∀ u, ContDiff ℝ 1 (sigma u).map) |
| 37 | (A : M64Annulus (F.metric t) |
| 38 | ((fun x => c false x t) ∘ (sigma false).map) |
| 39 | ((fun x => c true x t) ∘ (sigma true).map)) |
| 40 | {r : ℝ} (hr : 0 < r) |
| 41 | (hminimum : A.area = m64LeastAnnulusArea (F.metric t) |
| 42 | (fun x => c false x t) (fun x => c true x t)) |
| 43 | (hAc : ContMDiffOn (𝓡 2) (𝓡 n) 1 A.map S) |
| 44 | (hAi : ContMDiffOn (𝓡 2) (𝓡 n) ∞ A.map m64AnnulusOpenStrip) |
| 45 | (hconformal : ∀ᵐ p ∂volume.restrict m64AnnulusDomain, |
| 46 | r * m60AreaGram (F.metric t) A.map p 0 0 = |
| 47 | r⁻¹ * m60AreaGram (F.metric t) A.map p 1 1 ∧ |
| 48 | m60AreaGram (F.metric t) A.map p 0 1 = 0) |
| 49 | (hinj : ∀ p ∈ m64AnnulusDomain, |
| 50 | Function.Injective (mfderivWithin (𝓡 2) (𝓡 n) A.map m64AnnulusDomain p)) |
| 51 | {K R : ℝ} (hK : 0 ≤ K) |
| 52 | (hsec : ∀ p ∈ m64AnnulusInterior, (F.connection t).sectionalCurvature (A.map p) |
| 53 | (mfderiv (𝓡 2) (𝓡 n) A.map p (EuclideanSpace.single (0 : Fin 2) 1)) |
| 54 | (mfderiv (𝓡 2) (𝓡 n) A.map p (EuclideanSpace.single (1 : Fin 2) 1)) ≤ K) |
| 55 | (hRic : ∀ (q : M) (v : TangentSpace (𝓡 n) q), |
| 56 | -(F.connection t).ricci q v v ≤ R * (F.metric t).inner q v v) : |
| 57 | ∀ eta : ℝ, 0 < eta → ∀ᶠ h : ℝ in 𝓝[>] 0, |
| 58 | ∃ B : M64Annulus (F.metric (t + h)) |
| 59 | (fun x => c false x (t + h)) (fun x => c true x (t + h)), |
| 60 | B.area ≤ A.area + h * ((K + 2 * R) * A.area + eta) := by |
| 61 | have hAd : ContMDiffOn (𝓡 2) (𝓡 n) 1 A.map m64AnnulusDomain := |
| 62 | hAc.mono (fun _ hp => hp.2.2) |
| 63 | obtain ⟨epsilon, hepsilon, htime, v, hbase, -, -, -, hvel0, hvel1, hfamily, hder⟩ := |
| 64 | m64C2Annulus_exists_finite_first_variation F (hc false) (hc true) ht |
| 65 | (sigma false) (sigma true) (hsigma false) (hsigma true) A hAd hAi hr hminimum hconformal |
| 66 | let energy := fun s => ∫ p in m64AnnulusDomain, |
| 67 | m64ModulusEnergyDensity (F.metric (t + s)) r (v s) p |
| 68 | let flux := r⁻¹ * ∫ x in Icc (0 : ℝ) curvePeriod, |
| 69 | m64FiniteAnnulusCurrent (F.metric t) v 1 (annulusPoint x 1) - |
| 70 | m64FiniteAnnulusCurrent (F.metric t) v 1 (annulusPoint x 0) |
| 71 | let T := fun p => |
| 72 | r * (F.connection t).ricci (A.map p) |
| 73 | (mfderiv (𝓡 2) (𝓡 n) A.map p (EuclideanSpace.basisFun (Fin 2) ℝ 0)) |
| 74 | (mfderiv (𝓡 2) (𝓡 n) A.map p (EuclideanSpace.basisFun (Fin 2) ℝ 0)) + |
| 75 | r⁻¹ * (F.connection t).ricci (A.map p) |
| 76 | (mfderiv (𝓡 2) (𝓡 n) A.map p (EuclideanSpace.basisFun (Fin 2) ℝ 1)) |
| 77 | (mfderiv (𝓡 2) (𝓡 n) A.map p (EuclideanSpace.basisFun (Fin 2) ℝ 1)) |
| 78 | let d := flux - ∫ p in m64AnnulusDomain, T p |
| 79 | have hd : HasDerivAt energy d 0 := by |
| 80 | dsimp only at hder |
| 81 | rw [show v 0 = A.map from funext hbase] at hder |
| 82 | exact hder |
| 83 | have hvelocity (u : Bool) (x : ℝ) : |
| 84 | curveVelocity (n := n) (fun s => v s (annulusPoint x (if u then 1 else 0))) 0 = |
| 85 | m62CurvatureVector F (c u) t ((sigma u).map x) := by |
| 86 | cases u |
| 87 | · exact hvel0 x |
| 88 | · exact hvel1 x |
| 89 | have hflux : flux ≤ K * A.area := |
| 90 | (c2_annulus_motion_current_flux_le F c hc ht sigma hsigma A hr hminimum hAc hAi |
| 91 | hconformal hinj hK hsec v hbase hvelocity).2 |
| 92 | have hR : -(∫ p in m64AnnulusDomain, T p) ≤ 2 * R * A.area := |
| 93 | m64Annulus_modulusRicci_neg_integral_le (F.connection t) A hr hAd hconformal hRic |
| 94 | have hrate : d ≤ (K + 2 * R) * A.area := by |
| 95 | dsimp only [d] |
| 96 | nlinarith only [hflux, hR] |
| 97 | have hcenter : energy 0 = A.area := by |
| 98 | dsimp only [energy] |
| 99 | rw [add_zero, show v 0 = A.map from funext hbase] |
| 100 | exact m64_weightedEnergy_eq_area_of_ae_modulus_conformal A hr hconformal |
| 101 | have hfuture (s : ℝ) (hs : s ∈ Ioo (-epsilon) epsilon) : |
| 102 | ∃ B : M64Annulus (F.metric (t + s)) |
| 103 | (fun x => c false x (t + s)) (fun x => c true x (t + s)), |
| 104 | B.area ≤ energy s := by |
| 105 | obtain ⟨B, hmap, -⟩ := hfamily s hs (F.metric (t + s)) |
| 106 | have hB := B.area_le_weightedGramEnergy hr (B.weightedGramEnergy_integrable r) |
| 107 | have hE : (∫ p in m64AnnulusDomain, |
| 108 | m64ModulusEnergyDensity (F.metric (t + s)) r B.map p) = energy s := |
| 109 | integral_congr_ae (m64ModulusEnergyDensity_ae_eq_of_eqOn (F.metric (t + s)) r hmap) |
| 110 | obtain ⟨C, hC⟩ := m64C2ShrinkingCurves_freeBoundaryAreaTransport F (hc false) (hc true) |
| 111 | (Ioo_subset_Icc_self (htime s hs)) (sigma false) (sigma true) B |
| 112 | exact ⟨C, hC.trans_le (hB.trans_eq hE)⟩ |
| 113 | have hquot : Tendsto (fun h => (energy h - energy 0) / h) (𝓝[>] 0) (𝓝 d) := by |
| 114 | simpa only [zero_add, smul_eq_mul, ← div_eq_inv_mul] using hd.tendsto_slope_zero_right |
| 115 | have hsmall : ∀ᶠ h : ℝ in 𝓝[>] 0, h ∈ Ioo (-epsilon) epsilon := |
| 116 | nhdsWithin_le_nhds (isOpen_Ioo.mem_nhds ⟨by linarith, hepsilon⟩) |
| 117 | intro eta heta |
| 118 | have hevent := hquot.eventually (Iio_mem_nhds (lt_add_of_pos_right d heta)) |
| 119 | filter_upwards [hevent, hsmall, self_mem_nhdsWithin] with h hh hs hpos |
| 120 | obtain ⟨B, hB⟩ := hfuture h hs |
| 121 | refine ⟨B, hB.trans ?_⟩ |
| 122 | have hdiff := (div_le_iff₀ hpos).mp hh.le |
| 123 | rw [hcenter] at hdiff |
| 124 | have hinc := mul_le_mul_of_nonneg_left hrate hpos.le |
| 125 | linarith |
| 126 | |
| 127 | end PoincareMT.M64 |