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.RicciFlow.Area.MinimalSphere.HarmonicSphereCharts |
| 2 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Covariant.IntegrationByParts |
| 3 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Covariant.IntegrationByPartsTests |
| 4 | |
| 5 | /-! |
| 6 | # The chart harmonic equation from first-variation tests |
| 7 | |
| 8 | Morgan-Tian Claim 18.12, printed pp. 426-427. Covariant integration by |
| 9 | parts and supported scalar tests give zero tension in every actual target |
| 10 | chart. The test-integral premise is supplied separately by energy |
| 11 | stationarity using actual smooth sphere variations. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set MeasureTheory |
| 20 | open scoped Manifold ContDiff BigOperators |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | open CoordinateExponential ConnectionVariation ConjugateVariation |
| 27 | |
| 28 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 30 | |
| 31 | /-- Vanishing of all supported coordinate first variations gives the |
| 32 | actual chart harmonic equation. Source: MT Claim 18.12, pp. 426-427. -/ |
| 33 | theorem m60SphereChartHarmonic_of_test_integrals |
| 34 | (g : RiemannianMetric n M) (f : UnitTwoSphere → M) |
| 35 | (hf : ContMDiff (𝓡 2) (𝓡 n) ∞ f) |
| 36 | (htest : ∀ (b : M) (V : LoopPlane → EuclideanSpace ℝ (Fin n)), |
| 37 | ContDiff ℝ ∞ V → HasCompactSupport V → |
| 38 | tsupport V ⊆ (f ∘ m60SphereParameter) ⁻¹' (extChartAt (𝓡 n) b).source → |
| 39 | let u := (extChartAt (𝓡 n) b) ∘ (f ∘ m60SphereParameter) |
| 40 | let B := g.pullbackCoefficients (extChartAt (𝓡 n) b).symm |
| 41 | ∫ z, ∑ i : Fin 2, B (u z) |
| 42 | (covDerivAlong (christoffelBilinear B) u V (EuclideanSpace.basisFun (Fin 2) ℝ i) z) |
| 43 | (fderiv ℝ u z (EuclideanSpace.basisFun (Fin 2) ℝ i)) = 0) : |
| 44 | M60SphereChartHarmonic g f := by |
| 45 | intro b z hz |
| 46 | let φ := f ∘ m60SphereParameter |
| 47 | let c := extChartAt (𝓡 n) b |
| 48 | let O := φ ⁻¹' c.source |
| 49 | let u := c ∘ φ |
| 50 | let B := g.pullbackCoefficients c.symm |
| 51 | let Γ := christoffelBilinear B |
| 52 | let e := EuclideanSpace.basisFun (Fin 2) ℝ |
| 53 | let τ : LoopPlane → EuclideanSpace ℝ (Fin n) := fun x => |
| 54 | ∑ i : Fin 2, covDerivAlong Γ u (fun y => fderiv ℝ u y (e i)) (e i) x |
| 55 | have hφ : ContMDiff (𝓡 2) (𝓡 n) ∞ φ := hf.comp m60SphereParameter_contMDiff |
| 56 | have hO : IsOpen O := hφ.continuous.isOpen_preimage _ (isOpen_extChartAt_source b) |
| 57 | have hu : ContDiffOn ℝ ∞ u O := by |
| 58 | intro x hx |
| 59 | have hx' : φ x ∈ (extChartAt (𝓡 n) b).source := hx |
| 60 | have hc : ContMDiffAt (𝓡 n) (𝓡 n) ∞ c (φ x) := |
| 61 | contMDiffAt_extChartAt' (by simpa only [extChartAt_source] using hx') |
| 62 | exact (contMDiffAt_iff_contDiffAt.mp (hc.comp x hφ.contMDiffAt)).contDiffWithinAt |
| 63 | have htarget (x : LoopPlane) (hx : x ∈ O) : u x ∈ c.target := c.map_source hx |
| 64 | have hB (x : LoopPlane) (hx : x ∈ O) : ContDiffAt ℝ ∞ B (u x) := |
| 65 | (g.contDiffOn_chartCoefficients b).contDiffAt |
| 66 | ((isOpen_extChartAt_target b).mem_nhds (htarget x hx)) |
| 67 | have hΓ (x : LoopPlane) (hx : x ∈ O) : ContDiffAt ℝ ∞ Γ (u x) := |
| 68 | contDiffAt_christoffelBilinear (hB x hx) |
| 69 | (g.isInvertible_chartCoefficients b (htarget x hx)) |
| 70 | have hcompat (x : LoopPlane) (hx : x ∈ O) : IsMetricCompatibleAt B Γ (u x) := |
| 71 | isMetricCompatibleAt_chartCoefficients g b (htarget x hx) |
| 72 | have hτ : ContDiffOn ℝ ∞ τ O := by |
| 73 | apply ContDiffOn.sum |
| 74 | intro i _ x hx |
| 75 | have hup := hu.contDiffAt (hO.mem_nhds hx) |
| 76 | exact (contDiffAt_covDerivAlong (hΓ x hx) hup |
| 77 | ((hup.fderiv_right (m := ∞) (by simp)).clm_apply contDiffAt_const) (e i)).contDiffWithinAt |
| 78 | have hpair (w : EuclideanSpace ℝ (Fin n)) : |
| 79 | EqOn (fun x => B (u x) w (τ x)) (fun _ => 0) O := by |
| 80 | apply M60.eqOn_zero_of_integral_contDiff_smul_eq_zero |
| 81 | (μ := (volume : Measure LoopPlane)) hO |
| 82 | · intro x hx |
| 83 | exact ((((hB x hx).comp x (hu.contDiffAt (hO.mem_nhds hx))).clm_apply |
| 84 | contDiffAt_const).clm_apply |
| 85 | (hτ.contDiffAt (hO.mem_nhds hx))).continuousAt.continuousWithinAt |
| 86 | · intro ψ hψ hψc hψO |
| 87 | let V : LoopPlane → EuclideanSpace ℝ (Fin n) := fun x => ψ x • w |
| 88 | have hV : ContDiff ℝ ∞ V := hψ.smul contDiff_const |
| 89 | have hVc : HasCompactSupport V := hψc.smul_right |
| 90 | have hVO : tsupport V ⊆ O := (tsupport_smul_subset_left ψ (fun _ => w)).trans hψO |
| 91 | have hi := M60.covDerivAlong_trace_integration_by_parts (μ := volume) e |
| 92 | hO hu hV.contDiffOn hB hΓ hcompat hVc hVO |
| 93 | have ht := htest b V hV hVc hVO |
| 94 | change (∫ x, ∑ i : Fin 2, B (u x) (covDerivAlong Γ u V (e i) x) |
| 95 | (fderiv ℝ u x (e i))) = 0 at ht |
| 96 | have hz' : (∫ x, B (u x) (V x) (τ x)) = 0 := by |
| 97 | have hi' := hi.2.2 |
| 98 | change _ = -(∫ x, B (u x) (V x) (τ x)) at hi' |
| 99 | linarith [hi'] |
| 100 | simpa only [V, map_smul, smul_apply, smul_eq_mul] using hz' |
| 101 | have hzero : τ z = 0 := by |
| 102 | apply (g.isInvertible_chartCoefficients b (htarget z hz)).injective |
| 103 | ext w |
| 104 | simp only [map_zero, zero_apply] |
| 105 | change B (u z) (τ z) w = 0 |
| 106 | have hs : B (u z) (τ z) w = B (u z) w (τ z) := g.symm _ _ _ |
| 107 | rw [hs] |
| 108 | exact hpair w hz |
| 109 | simpa only [τ, Fin.sum_univ_two] using hzero |
| 110 | |
| 111 | end PoincareMT |