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.Modulus.MinimumStationarity |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Modulus.ChartEnergyVariation |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Plateau.Supported.ChartAnnulusVariation |
| 4 | |
| 5 | /-! |
| 6 | # Actual coordinate tests at the conformal modulus |
| 7 | |
| 8 | Admitted supported chart perturbations and actual area minimality give |
| 9 | the weighted covariant test identity. The two domain directions retain |
| 10 | the factors of the chosen modulus. Source: the local first variation |
| 11 | underlying Morgan--Tian Lemma 19.15, pp. 447-449. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter MeasureTheory |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | open CoordinateExponential ConnectionVariation |
| 25 | |
| 26 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] [T2Space M] [CompactSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 28 | [IsManifold (𝓡 n) ∞ M] |
| 29 | {g : RiemannianMetric n M} {c0 c1 : ℝ → M} |
| 30 | |
| 31 | /-- The actual weighted chart-test integral vanishes at an attained modulus-conformal |
| 32 | annular minimum, with no assumed weak equation. Source: Morgan--Tian (2007), Lemma 19.15 and |
| 33 | Corollary 19.16, pp. 447-449; project derivation |
| 34 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 35 | theorem m64Annulus_chart_test_integral_eq_zero_of_modulus_minimum |
| 36 | (A : M64Annulus g c0 c1) {r : ℝ} (hr : 0 < r) |
| 37 | (hminimum : A.area = m64LeastAnnulusArea g c0 c1) |
| 38 | (hconformal : ∀ᵐ p ∂volume.restrict m64AnnulusDomain, |
| 39 | r * m60AreaGram g A.map p 0 0 = r⁻¹ * m60AreaGram g A.map p 1 1 ∧ |
| 40 | m60AreaGram g A.map p 0 1 = 0) |
| 41 | (b : M) {U : Set LoopPlane} (hU : IsOpen U) |
| 42 | (hUinside : U ⊆ m64AnnulusInterior) |
| 43 | (hf : ContMDiffOn (𝓡 2) (𝓡 n) ∞ A.map U) |
| 44 | (hfU : MapsTo A.map U (extChartAt (𝓡 n) b).source) |
| 45 | (V : LoopPlane → EuclideanSpace ℝ (Fin n)) (hV : ContDiff ℝ ∞ V) |
| 46 | (hcompact : HasCompactSupport V) (hsupport : tsupport V ⊆ U) : |
| 47 | let u := (extChartAt (𝓡 n) b) ∘ A.map |
| 48 | let B := g.pullbackCoefficients (extChartAt (𝓡 n) b).symm |
| 49 | let e := EuclideanSpace.basisFun (Fin 2) ℝ |
| 50 | (∫ z : LoopPlane, |
| 51 | r * B (u z) (covDerivAlong (christoffelBilinear B) u V (e 0) z) |
| 52 | (fderiv ℝ u z (e 0)) + |
| 53 | r⁻¹ * B (u z) (covDerivAlong (christoffelBilinear B) u V (e 1) z) |
| 54 | (fderiv ℝ u z (e 1))) = 0 := by |
| 55 | let u := (extChartAt (𝓡 n) b) ∘ A.map |
| 56 | let B := g.pullbackCoefficients (extChartAt (𝓡 n) b).symm |
| 57 | let e := EuclideanSpace.basisFun (Fin 2) ℝ |
| 58 | let J := fun z => |
| 59 | r * B (u z) (covDerivAlong (christoffelBilinear B) u V (e 0) z) |
| 60 | (fderiv ℝ u z (e 0)) + |
| 61 | r⁻¹ * B (u z) (covDerivAlong (christoffelBilinear B) u V (e 1) z) |
| 62 | (fderiv ℝ u z (e 1)) |
| 63 | let c := chartAt (EuclideanSpace ℝ (Fin n)) b |
| 64 | let v := M60.supportedChartVariation c U A.map V |
| 65 | have hfU' : MapsTo A.map U c.source := by |
| 66 | simpa only [c, extChartAt_source] using hfU |
| 67 | obtain ⟨epsilon, hepsilon, hv, hchart, hadmissible⟩ := |
| 68 | m64SupportedChartVariation_exists_admissible_interval A b hU hUinside hf hfU' |
| 69 | V hV hcompact hsupport |
| 70 | have hcenter : ∀ p, v (0, p) = A.map p := |
| 71 | M60.supportedChartVariation_zero c U A.map V hfU' |
| 72 | have hfixall (s : ℝ) (z : LoopPlane) (hz : z ∉ tsupport V) : |
| 73 | v (s, z) = A.map z := |
| 74 | m64SupportedChartVariation_eq_of_notMem_tsupport A b hfU' V s hz |
| 75 | have hfix (s : ℝ) (_hs : s ∈ Ioo (-epsilon) epsilon) |
| 76 | (z : LoopPlane) (hz : z ∉ tsupport V) : v (s, z) = v (0, z) := by |
| 77 | rw [hcenter] |
| 78 | exact hfixall s z hz |
| 79 | have hKdomain : tsupport V ⊆ m64AnnulusDomain := |
| 80 | (hsupport.trans hUinside).trans m64AnnulusInterior_subset_domain |
| 81 | have hstat := m64Annulus_supported_modulus_stationarity_of_minimum_of_eqOn |
| 82 | A hr hminimum hconformal hepsilon hU hcompact hsupport hKdomain hv |
| 83 | hadmissible hcenter hfix |
| 84 | have hint (s : ℝ) (hs : s ∈ Ioo (-epsilon) epsilon) : |
| 85 | IntegrableOn (m64ModulusEnergyDensity g r (fun z => v (s, z))) |
| 86 | m64AnnulusDomain volume := by |
| 87 | obtain ⟨C, hC⟩ := hadmissible s hs |
| 88 | exact (C.weightedGramEnergy_integrable r).congr |
| 89 | (m64ModulusEnergyDensity_ae_eq_of_eqOn g r hC) |
| 90 | have htotal := m64ModulusEnergy_hasDerivAt_of_supported_variation g r |
| 91 | hepsilon hU hcompact hsupport hKdomain hv hfix hint |
| 92 | let E := fun q : ℝ × LoopPlane => m64ModulusEnergyDensity g r (fun z => v (q.1, z)) q.2 |
| 93 | let D := fun q : ℝ × LoopPlane => E q - E (0, q.2) |
| 94 | have hzero : (0 : ℝ) ∈ Ioo (-epsilon) epsilon := ⟨by linarith, hepsilon⟩ |
| 95 | have hcoord : ∀ s ∈ Ioo (-epsilon) epsilon, ∀ z ∈ U, |
| 96 | v (s, z) ∈ (extChartAt (𝓡 n) b).source ∧ |
| 97 | extChartAt (𝓡 n) b (v (s, z)) = |
| 98 | extChartAt (𝓡 n) b (A.map z) + s • V z := by |
| 99 | simpa only [extChartAt_source, extChartAt_coe, modelWithCornersSelf_coe, |
| 100 | Function.id_comp] using hchart |
| 101 | have hDzero (s : ℝ) (z : LoopPlane) (hz : z ∉ tsupport V) : D (s, z) = 0 := by |
| 102 | apply sub_eq_zero.mpr |
| 103 | apply m64ModulusEnergyDensity_congr_of_eventuallyEq g r |
| 104 | filter_upwards [(isClosed_tsupport V).isOpen_compl.mem_nhds hz] with y hy |
| 105 | exact (hfixall s y hy).trans (hcenter y).symm |
| 106 | have hderiv (z : LoopPlane) : fderiv ℝ D (0, z) (1, 0) = J z := by |
| 107 | by_cases hz : z ∈ U |
| 108 | · have hEp : ContDiffAt ℝ ∞ E (0, z) := |
| 109 | m64ModulusEnergyDensity_family_contDiffAt g r |
| 110 | (hv.contMDiffAt ((isOpen_Ioo.prod hU).mem_nhds ⟨hzero, hz⟩)) |
| 111 | have hproj : ContDiffAt ℝ ∞ (fun q : ℝ × LoopPlane => ((0 : ℝ), q.2)) |
| 112 | (0, z) := contDiffAt_const.prodMk contDiffAt_snd |
| 113 | have hEcomp : ContDiffAt ℝ ∞ (fun q : ℝ × LoopPlane => E (0, q.2)) |
| 114 | (0, z) := ContDiffAt.comp (f := fun q : ℝ × LoopPlane => (0, q.2)) |
| 115 | (g := E) (0, z) hEp hproj |
| 116 | have hDp : ContDiffAt ℝ ∞ D (0, z) := hEp.sub hEcomp |
| 117 | have hpoint := m64ModulusEnergyDensity_hasDerivAt_of_affine_chart g r b A.map hU |
| 118 | hf hfU V hV hepsilon hv hcoord z hz |
| 119 | exact ((hDp.differentiableAt (by simp)).hasFDerivAt.comp_hasDerivAt |
| 120 | (l := D) (f := fun s : ℝ => (s, z)) 0 |
| 121 | ((hasDerivAt_id (0 : ℝ)).prodMk (hasDerivAt_const (0 : ℝ) z))).unique |
| 122 | (hpoint.sub_const (E (0, z))) |
| 123 | · have hout : z ∉ tsupport V := fun h => hz (hsupport h) |
| 124 | have hJ : J z = 0 := by |
| 125 | simp only [J, covDerivAlong, image_eq_zero_of_notMem_tsupport hout, |
| 126 | fderiv_of_notMem_tsupport (𝕜 := ℝ) hout, zero_apply, |
| 127 | map_zero, add_zero, mul_zero] |
| 128 | have hDeq : D =ᶠ[𝓝 (0, z)] (fun _ => (0 : ℝ)) := by |
| 129 | filter_upwards [continuous_snd.continuousAt.preimage_mem_nhds |
| 130 | ((isClosed_tsupport V).isOpen_compl.mem_nhds hout)] with q hq |
| 131 | exact hDzero q.1 q.2 hq |
| 132 | simp only [hDeq.fderiv_eq, fderiv_const_apply, zero_apply, hJ] |
| 133 | change (∫ z : LoopPlane, J z) = 0 |
| 134 | calc |
| 135 | _ = ∫ z : LoopPlane, fderiv ℝ D (0, z) (1, 0) := by |
| 136 | apply integral_congr_ae |
| 137 | exact Eventually.of_forall fun z => (hderiv z).symm |
| 138 | _ = 0 := htotal.2.unique hstat |
| 139 | |
| 140 | end PoincareMT |