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.CurrentSlices |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Finite.ParameterEnergy |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Modulus.IntrinsicTension |
| 4 | |
| 5 | /-! The actual weighted energy derivative is the divergence of |
| 6 | the finite conormal current at the attained minimum. Source: |
| 7 | MT Lemma 19.15, pp. 447-449; finite-conormal-variation derivation. -/ |
| 8 | |
| 9 | noncomputable section |
| 10 | set_option autoImplicit false |
| 11 | set_option warningAsError true |
| 12 | set_option backward.isDefEq.respectTransparency false |
| 13 | |
| 14 | open Set Filter MeasureTheory Bundle |
| 15 | open scoped Manifold ContDiff Topology |
| 16 | |
| 17 | namespace PoincareMT |
| 18 | |
| 19 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 20 | {n : ℕ} {M : Type*} [TopologicalSpace M] [T2Space M] [CompactSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | {g : RiemannianMetric n M} {c0 c1 : ℝ → M} |
| 23 | |
| 24 | /-- A smooth parameter motion of the attained annulus has the actual weighted current |
| 25 | divergence even if its parameter map is only C1. Interior harmonicity follows from the |
| 26 | original area minimum. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. |
| 27 | 447-449; project derivation |
| 28 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 29 | theorem m64ParameterAnnulus_modulusEnergyDensity_eq_current_divergence |
| 30 | (D : LeviCivitaData g) (A : M64Annulus g c0 c1) {r : ℝ} (hr : 0 < r) |
| 31 | (hminimum : A.area = m64LeastAnnulusArea g c0 c1) |
| 32 | (hconformal : ∀ᵐ p ∂volume.restrict m64AnnulusDomain, |
| 33 | r * m60AreaGram g A.map p 0 0 = r⁻¹ * m60AreaGram g A.map p 1 1 ∧ |
| 34 | m60AreaGram g A.map p 0 1 = 0) |
| 35 | (hA : ContMDiffOn (𝓡 2) (𝓡 n) ∞ A.map m64AnnulusInterior) |
| 36 | {Phi : ℝ × E → M} {O : Set (ℝ × E)} (hO : IsOpen O) |
| 37 | (hPhi : ContMDiffOn 𝓘(ℝ, ℝ × E) (𝓡 n) ∞ Phi O) |
| 38 | {h : LoopPlane → E} (hh : ContDiffOn ℝ 1 h m64AnnulusDomain) |
| 39 | (hbase : ∀ p, Phi (0, h p) = A.map p) |
| 40 | {x s : ℝ} (hp : (0, h (annulusPoint x s)) ∈ O) |
| 41 | (hinside : annulusPoint x s ∈ m64AnnulusInterior) : |
| 42 | let v := fun t p => Phi (t, h p) |
| 43 | deriv (fun t => m64ModulusEnergyDensity g r (v t) (annulusPoint x s)) 0 = |
| 44 | r * fderiv ℝ (m64FiniteAnnulusCurrent g v 0) (annulusPoint x s) |
| 45 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 46 | r⁻¹ * fderiv ℝ (m64FiniteAnnulusCurrent g v 1) (annulusPoint x s) |
| 47 | (EuclideanSpace.single (1 : Fin 2) 1) := by |
| 48 | let p := annulusPoint x s |
| 49 | let v := fun t q => Phi (t, h q) |
| 50 | change deriv (fun t => m64ModulusEnergyDensity g r (v t) p) 0 = |
| 51 | r * fderiv ℝ (m64FiniteAnnulusCurrent g v 0) p (EuclideanSpace.single (0 : Fin 2) 1) + |
| 52 | r⁻¹ * fderiv ℝ (m64FiniteAnnulusCurrent g v 1) p (EuclideanSpace.single (1 : Fin 2) 1) |
| 53 | have hsub : m64AnnulusInterior ⊆ interior m64AnnulusDomain := |
| 54 | interior_maximal m64AnnulusInterior_subset_domain isOpen_m64AnnulusInterior |
| 55 | have hneigh : m64AnnulusDomain ∈ 𝓝 p := mem_interior_iff_mem_nhds.mp (hsub hinside) |
| 56 | have hhAt : ContDiffAt ℝ 1 h p := hh.contDiffAt hneigh |
| 57 | have hh0 : DifferentiableAt ℝ (fun y => h (annulusPoint y s)) x := |
| 58 | (hhAt.differentiableAt one_ne_zero).comp x |
| 59 | (m64AnnulusPoint_horizontal_hasDerivAt s x).differentiableAt |
| 60 | have hh1 : DifferentiableAt ℝ (fun y => h (annulusPoint x y)) s := |
| 61 | (hhAt.differentiableAt one_ne_zero).comp s |
| 62 | (m64AnnulusPoint_vertical_hasDerivAt x s).differentiableAt |
| 63 | have hAv : ContMDiffOn (𝓡 2) (𝓡 n) ∞ (v 0) m64AnnulusInterior := by |
| 64 | change ContMDiffOn (𝓡 2) (𝓡 n) ∞ (fun q => Phi (0, h q)) m64AnnulusInterior |
| 65 | rw [funext hbase] |
| 66 | exact hA |
| 67 | have hX0 := ((m64Annulus_horizontal_velocity_contMDiffAt |
| 68 | isOpen_m64AnnulusInterior hAv hinside).comp x |
| 69 | (contDiffAt_id.prodMk contDiffAt_const).contMDiffAt).mdifferentiableAt (by simp) |
| 70 | have hX1 := ((m64Annulus_vertical_velocity_contMDiffAt |
| 71 | isOpen_m64AnnulusInterior hAv hinside).comp s |
| 72 | (contDiffAt_const.prodMk contDiffAt_id).contMDiffAt).mdifferentiableAt (by simp) |
| 73 | have h0 := m64ParameterMotion_half_energy_hasDerivAt D hO hPhi hh0 hp |
| 74 | have h1 := m64ParameterMotion_half_energy_hasDerivAt D hO hPhi hh1 hp |
| 75 | have hdiv0 := m64ParameterMotion_energy_derivative_eq_divergence D hO hPhi hh0 hp hX0 |
| 76 | have hdiv1 := m64ParameterMotion_energy_derivative_eq_divergence D hO hPhi hh1 hp hX1 |
| 77 | have hdensity : HasDerivAt |
| 78 | (fun t => m64ModulusEnergyDensity g r (v t) p) |
| 79 | (r * g.inner (v 0 p) |
| 80 | (rampHorizontalCovariantDerivative D (fun y => v 0 (annulusPoint y s)) |
| 81 | (fun y => curveVelocity (fun t => v t (annulusPoint y s)) 0) x) |
| 82 | (curveVelocity (fun y => v 0 (annulusPoint y s)) x) + |
| 83 | r⁻¹ * g.inner (v 0 p) |
| 84 | (rampHorizontalCovariantDerivative D (fun y => v 0 (annulusPoint x y)) |
| 85 | (fun y => curveVelocity (fun t => v t (annulusPoint x y)) 0) s) |
| 86 | (curveVelocity (fun y => v 0 (annulusPoint x y)) s)) 0 := by |
| 87 | apply ((h0.const_mul r).add (h1.const_mul r⁻¹)).congr_of_eventuallyEq |
| 88 | filter_upwards [(continuous_id.prodMk continuous_const).continuousAt |
| 89 | (hO.mem_nhds hp)] with t ht |
| 90 | have hmd : MDifferentiableAt (𝓡 2) (𝓡 n) (v t) p := |
| 91 | ((hPhi.contMDiffAt (hO.mem_nhds ht)).mdifferentiableAt (by simp)).comp p |
| 92 | ((differentiableAt_const t).prodMk |
| 93 | (hhAt.differentiableAt one_ne_zero)).mdifferentiableAt |
| 94 | dsimp only [Pi.add_apply] |
| 95 | rw [m64Annulus_horizontal_velocity hmd, m64Annulus_vertical_velocity hmd] |
| 96 | simp only [m64ModulusEnergyDensity, m60AreaGram, EuclideanSpace.basisFun_apply] |
| 97 | ring |
| 98 | have hV : ContMDiffAt (𝓡 2) ((𝓡 n).prod (𝓡 n)) 1 (fun q => |
| 99 | (⟨v 0 q, curveVelocity (fun t => v t q) 0⟩ : TangentBundle (𝓡 n) M)) p := |
| 100 | ((m64ParameterMotion_timeVelocity_contMDiffAt hO hPhi hp).of_le |
| 101 | (show (1 : ℕ∞ω) ≤ ∞ by simp)).comp p |
| 102 | ((contDiffAt_const.prodMk hhAt).contMDiffAt) |
| 103 | have hJ (i : Fin 2) : DifferentiableAt ℝ (m64FiniteAnnulusCurrent g v i) p := |
| 104 | m64FiniteAnnulusCurrent_differentiableAt g (hsub hinside) |
| 105 | (hAv.contMDiffAt (isOpen_m64AnnulusInterior.mem_nhds hinside)) hV i |
| 106 | have hnear0 : ∀ᶠ y in 𝓝 x, annulusPoint y s ∈ m64AnnulusInterior := |
| 107 | (m64AnnulusPoint_horizontal_hasDerivAt s x).continuousAt |
| 108 | (isOpen_m64AnnulusInterior.mem_nhds hinside) |
| 109 | have hnear1 : ∀ᶠ y in 𝓝 s, annulusPoint x y ∈ m64AnnulusInterior := |
| 110 | (m64AnnulusPoint_vertical_hasDerivAt x s).continuousAt |
| 111 | (isOpen_m64AnnulusInterior.mem_nhds hinside) |
| 112 | have hcur0 := m64FiniteAnnulusCurrent_along_slice_hasDerivAt g (v := v) 0 (hJ 0) |
| 113 | (fun y => by simpa only [EuclideanSpace.basisFun_apply] using |
| 114 | m64AnnulusPoint_horizontal_hasDerivAt s y) |
| 115 | (hnear0.mono fun _ hy => hsub hy) |
| 116 | (hnear0.mono fun _ hy => |
| 117 | (hAv.contMDiffAt (isOpen_m64AnnulusInterior.mem_nhds hy)).mdifferentiableAt (by simp)) |
| 118 | have hcur1 := m64FiniteAnnulusCurrent_along_slice_hasDerivAt g (v := v) 1 (hJ 1) |
| 119 | (fun y => by simpa only [EuclideanSpace.basisFun_apply] using |
| 120 | m64AnnulusPoint_vertical_hasDerivAt x y) |
| 121 | (hnear1.mono fun _ hy => hsub hy) |
| 122 | (hnear1.mono fun _ hy => |
| 123 | (hAv.contMDiffAt (isOpen_m64AnnulusInterior.mem_nhds hy)).mdifferentiableAt (by simp)) |
| 124 | have htension : r • rampHorizontalCovariantDerivative D |
| 125 | (fun y => v 0 (annulusPoint y s)) |
| 126 | (fun y => curveVelocity (fun z => v 0 (annulusPoint z s)) y) x + |
| 127 | r⁻¹ • rampHorizontalCovariantDerivative D (fun y => v 0 (annulusPoint x y)) |
| 128 | (fun y => curveVelocity (fun z => v 0 (annulusPoint x z)) y) s = 0 := by |
| 129 | have htransport := congrArg (fun f : LoopPlane → M => |
| 130 | (r • rampHorizontalCovariantDerivative D (fun y => f (annulusPoint y s)) |
| 131 | (fun y => curveVelocity (fun z => f (annulusPoint z s)) y) x + |
| 132 | r⁻¹ • rampHorizontalCovariantDerivative D (fun y => f (annulusPoint x y)) |
| 133 | (fun y => curveVelocity (fun z => f (annulusPoint x z)) y) s : |
| 134 | EuclideanSpace ℝ (Fin n))) (funext hbase) |
| 135 | exact htransport.trans (m64Annulus_intrinsic_tension_eq_zero_of_modulus_minimum |
| 136 | D A hr hminimum hconformal hA hinside) |
| 137 | have hpair := congrArg (fun w : TangentSpace (𝓡 n) (v 0 p) => |
| 138 | g.inner (v 0 p) (curveVelocity (fun t => v t p) 0) w) htension |
| 139 | simp only [map_add, map_smul, map_zero, smul_eq_mul] at hpair |
| 140 | rw [h0.deriv] at hdiv0 |
| 141 | rw [h1.deriv] at hdiv1 |
| 142 | rw [hcur0.deriv] at hdiv0 |
| 143 | rw [hcur1.deriv] at hdiv1 |
| 144 | rw [hdensity.deriv] |
| 145 | simp only [EuclideanSpace.basisFun_apply] at * |
| 146 | dsimp only [v, p] at * |
| 147 | linear_combination r * hdiv0 + r⁻¹ * hdiv1 - hpair |
| 148 | |
| 149 | end PoincareMT |