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.Harmonic.Minimum |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.Annulus |
| 3 | |
| 4 | /-! |
| 5 | # Actual strong minimum principle for the modulus operator |
| 6 | |
| 7 | Horizontal linear dilation converts `r*d00 + r^-1*d11` to the |
| 8 | ordinary Laplacian. The genuine planar harmonic minimum theorem then |
| 9 | transfers back through its inverse. Source: the harmonic-circle argument |
| 10 | for Morgan--Tian Lemma 19.15, pp. 447-449. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter InnerProductSpace |
| 19 | open scoped Topology ContDiff |
| 20 | |
| 21 | namespace PoincareMT |
| 22 | |
| 23 | /-- The actual horizontal dilation that flattens the modulus operator. Source: Morgan--Tian |
| 24 | (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project derivation |
| 25 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 26 | def m64ModulusSourceDilation (r : ℝ) (hr : r ≠ 0) : LoopPlane ≃L[ℝ] LoopPlane where |
| 27 | toFun p := annulusPoint (r * p 0) (p 1) |
| 28 | invFun p := annulusPoint (r⁻¹ * p 0) (p 1) |
| 29 | map_add' p q := by |
| 30 | ext i |
| 31 | fin_cases i <;> simp [annulusPoint, mul_add] |
| 32 | map_smul' c p := by |
| 33 | ext i |
| 34 | fin_cases i <;> simp [annulusPoint, mul_left_comm] |
| 35 | left_inv p := by |
| 36 | ext i |
| 37 | fin_cases i <;> simp [annulusPoint, hr] |
| 38 | right_inv p := by |
| 39 | ext i |
| 40 | fin_cases i <;> simp [annulusPoint, hr] |
| 41 | continuous_toFun := by unfold annulusPoint; fun_prop |
| 42 | continuous_invFun := by unfold annulusPoint; fun_prop |
| 43 | |
| 44 | /-- The actual Hessian transforms by the columns of the linear dilation. Source: |
| 45 | Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project derivation |
| 46 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 47 | theorem m64ModulusSourceDilation_hessian (r : ℝ) (hr : r ≠ 0) |
| 48 | (f : LoopPlane → ℝ) (p v w : LoopPlane) : |
| 49 | fderiv ℝ (fderiv ℝ (f ∘ m64ModulusSourceDilation r hr)) p v w = |
| 50 | fderiv ℝ (fderiv ℝ f) (m64ModulusSourceDilation r hr p) |
| 51 | (m64ModulusSourceDilation r hr v) (m64ModulusSourceDilation r hr w) := by |
| 52 | let L := m64ModulusSourceDilation r hr |
| 53 | have hi := L.iteratedFDerivWithin_comp_right f uniqueDiffOn_univ |
| 54 | (show L p ∈ (univ : Set LoopPlane) from mem_univ _) 2 |
| 55 | simp only [preimage_univ, iteratedFDerivWithin_univ] at hi |
| 56 | have hv := congrArg (fun T : ContinuousMultilinearMap ℝ (fun _ : Fin 2 => LoopPlane) ℝ => |
| 57 | T ![v, w]) hi |
| 58 | simpa only [ContinuousMultilinearMap.compContinuousLinearMap_apply, |
| 59 | iteratedFDeriv_two_apply, Matrix.cons_val_zero, Matrix.cons_val_one, |
| 60 | Matrix.cons_val_fin_one, ContinuousLinearEquiv.coe_coe] using hv |
| 61 | |
| 62 | /-- The actual Laplacian of the dilated function is the original modulus operator multiplied |
| 63 | by the modulus. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; |
| 64 | project derivation |
| 65 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 66 | theorem m64ModulusSourceDilation_laplacian (r : ℝ) (hr : r ≠ 0) |
| 67 | (f : LoopPlane → ℝ) (p : LoopPlane) : |
| 68 | Laplacian.laplacian (f ∘ m64ModulusSourceDilation r hr) p = |
| 69 | r * (r * fderiv ℝ (fderiv ℝ f) (m64ModulusSourceDilation r hr p) |
| 70 | (EuclideanSpace.single (0 : Fin 2) 1) (EuclideanSpace.single (0 : Fin 2) 1) + |
| 71 | r⁻¹ * fderiv ℝ (fderiv ℝ f) (m64ModulusSourceDilation r hr p) |
| 72 | (EuclideanSpace.single (1 : Fin 2) 1) (EuclideanSpace.single (1 : Fin 2) 1)) := by |
| 73 | let e0 : LoopPlane := EuclideanSpace.single (0 : Fin 2) 1 |
| 74 | let e1 : LoopPlane := EuclideanSpace.single (1 : Fin 2) 1 |
| 75 | have hL0 : m64ModulusSourceDilation r hr e0 = r • e0 := by |
| 76 | ext i |
| 77 | fin_cases i <;> simp [e0, m64ModulusSourceDilation, annulusPoint] |
| 78 | have hL1 : m64ModulusSourceDilation r hr e1 = e1 := by |
| 79 | ext i |
| 80 | fin_cases i <;> simp [e1, m64ModulusSourceDilation, annulusPoint] |
| 81 | rw [laplacian_eq_iteratedFDeriv_orthonormalBasis |
| 82 | (f ∘ m64ModulusSourceDilation r hr) (EuclideanSpace.basisFun (Fin 2) ℝ)] |
| 83 | simp only [Fin.sum_univ_two, iteratedFDeriv_two_apply, Matrix.cons_val_zero, |
| 84 | Matrix.cons_val_one, Matrix.cons_val_fin_one, EuclideanSpace.basisFun_apply, |
| 85 | m64ModulusSourceDilation_hessian] |
| 86 | change fderiv ℝ (fderiv ℝ f) (m64ModulusSourceDilation r hr p) |
| 87 | (m64ModulusSourceDilation r hr e0) (m64ModulusSourceDilation r hr e0) + |
| 88 | fderiv ℝ (fderiv ℝ f) (m64ModulusSourceDilation r hr p) |
| 89 | (m64ModulusSourceDilation r hr e1) (m64ModulusSourceDilation r hr e1) = _ |
| 90 | rw [hL0, hL1] |
| 91 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 92 | field_simp |
| 93 | ring |
| 94 | |
| 95 | /-- A genuine solution of the modulus equation with a local minimum is constant on a |
| 96 | neighborhood of that minimum. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, |
| 97 | pp. 447-449; project derivation |
| 98 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 99 | theorem m64ModulusHarmonicAt_eventually_eq_of_isLocalMin |
| 100 | {r : ℝ} (hr : 0 < r) {f : LoopPlane → ℝ} {p : LoopPlane} |
| 101 | (hf : ContDiffAt ℝ 2 f p) |
| 102 | (heq : ∀ᶠ q in 𝓝 p, |
| 103 | r * fderiv ℝ (fderiv ℝ f) q (EuclideanSpace.single (0 : Fin 2) 1) |
| 104 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 105 | r⁻¹ * fderiv ℝ (fderiv ℝ f) q (EuclideanSpace.single (1 : Fin 2) 1) |
| 106 | (EuclideanSpace.single (1 : Fin 2) 1) = 0) |
| 107 | (hmin : IsLocalMin f p) : f =ᶠ[𝓝 p] fun _ => f p := by |
| 108 | let L := m64ModulusSourceDilation r hr.ne' |
| 109 | let q := L.symm p |
| 110 | have hLp : L q = p := L.apply_symm_apply p |
| 111 | have hh : HarmonicAt (f ∘ L) q := by |
| 112 | refine ⟨(hLp.symm ▸ hf).comp q L.contDiff.contDiffAt, ?_⟩ |
| 113 | have hback := L.continuous.continuousAt.tendsto.eventually (hLp.symm ▸ heq) |
| 114 | filter_upwards [hback] with y hy |
| 115 | change Laplacian.laplacian (f ∘ L) y = 0 |
| 116 | rw [m64ModulusSourceDilation_laplacian, hy, mul_zero] |
| 117 | have hm : IsLocalMin (f ∘ L) q := by |
| 118 | have hm' := L.continuous.continuousAt.tendsto.eventually (hLp.symm ▸ hmin) |
| 119 | exact hm' |
| 120 | have hlocal := m64PlaneHarmonicAt_eventually_eq_of_isLocalMin hh hm |
| 121 | have hback := L.symm.continuous.continuousAt.tendsto.eventually hlocal |
| 122 | change ∀ᶠ x in 𝓝 p, f x = f p |
| 123 | simpa only [Function.comp_apply, hLp, L.apply_symm_apply] using hback |
| 124 | |
| 125 | /-- The genuine weighted equation has the strong minimum property on each connected open |
| 126 | domain. Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project |
| 127 | derivation |
| 128 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 129 | theorem m64ModulusHarmonic_eqOn_of_minimum |
| 130 | {r : ℝ} (hr : 0 < r) {f : LoopPlane → ℝ} {U : Set LoopPlane} |
| 131 | (hU : IsOpen U) (hconn : IsPreconnected U) (hf : ContDiffOn ℝ 2 f U) |
| 132 | (heq : ∀ q ∈ U, |
| 133 | r * fderiv ℝ (fderiv ℝ f) q (EuclideanSpace.single (0 : Fin 2) 1) |
| 134 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 135 | r⁻¹ * fderiv ℝ (fderiv ℝ f) q (EuclideanSpace.single (1 : Fin 2) 1) |
| 136 | (EuclideanSpace.single (1 : Fin 2) 1) = 0) |
| 137 | {p : LoopPlane} (hp : p ∈ U) (hmin : ∀ q ∈ U, f p ≤ f q) : |
| 138 | EqOn f (fun _ => f p) U := by |
| 139 | let : PreconnectedSpace U := isPreconnected_iff_preconnectedSpace.mp hconn |
| 140 | have hc : Continuous (fun q : U => f q) := |
| 141 | continuousOn_iff_continuous_domRestrict.mp hf.continuousOn |
| 142 | have hclosed : IsClosed {q : U | f q = f p} := isClosed_eq hc continuous_const |
| 143 | have hopen : IsOpen {q : U | f q = f p} := by |
| 144 | apply isOpen_iff_mem_nhds.mpr |
| 145 | intro q hq |
| 146 | have hm : IsLocalMin f q := by |
| 147 | filter_upwards [hU.mem_nhds q.property] with y hy |
| 148 | exact hq.symm ▸ hmin y hy |
| 149 | have he : ∀ᶠ y in 𝓝 (q : LoopPlane), |
| 150 | r * fderiv ℝ (fderiv ℝ f) y (EuclideanSpace.single (0 : Fin 2) 1) |
| 151 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 152 | r⁻¹ * fderiv ℝ (fderiv ℝ f) y (EuclideanSpace.single (1 : Fin 2) 1) |
| 153 | (EuclideanSpace.single (1 : Fin 2) 1) = 0 := by |
| 154 | filter_upwards [hU.mem_nhds q.property] with y hy |
| 155 | exact heq y hy |
| 156 | have hconst := m64ModulusHarmonicAt_eventually_eq_of_isLocalMin hr |
| 157 | (hf.contDiffAt (hU.mem_nhds q.property)) he hm |
| 158 | have hback := continuous_subtype_val.continuousAt.tendsto.eventually hconst |
| 159 | filter_upwards [hback] with y hy |
| 160 | exact hy.trans hq |
| 161 | have hall := (show IsClopen {q : U | f q = f p} from ⟨hclosed, hopen⟩).eq_univ |
| 162 | (show ({q : U | f q = f p} : Set U).Nonempty from ⟨⟨p, hp⟩, rfl⟩) |
| 163 | intro q hq |
| 164 | exact (Set.eq_univ_iff_forall.mp hall) ⟨q, hq⟩ |
| 165 | |
| 166 | end PoincareMT |