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.Plateau.Local.HarmonicStress |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Plateau.Boundary.SourceRescaling |
| 3 | |
| 4 | /-! |
| 5 | # Genuine stress identities under the modulus rescaling |
| 6 | |
| 7 | The reciprocal source factors transport the actual Gram matrix and its |
| 8 | derivatives. Source: Lemaire 1982, Lemma 5.1, p. 99; M64 derivation |
| 9 | `2026-09-26-raw-harmonic-stress.md`. |
| 10 | |
| 11 | Morgan--Tian context: Lemma 19.15 and its annular area-to-energy construction, printed pp. |
| 12 | 447-449. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option warningAsError true |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | noncomputable section |
| 20 | |
| 21 | open Set Filter |
| 22 | open scoped Manifold ContDiff Topology |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 28 | |
| 29 | /-- The actual Gram entries acquire exactly the two source scale factors. Source: Lemaire, |
| 30 | Lemma 5.1, p. 99; raw-harmonic-stress derivation. Exact proof derivation: |
| 31 | `2026-09-26-raw-harmonic-stress.md`. -/ |
| 32 | theorem m64AreaGram_sourceScale (g : RiemannianMetric n M) (s : ℝ) (hs : s ≠ 0) |
| 33 | {f : LoopPlane → M} {p : LoopPlane} |
| 34 | (hf : MDifferentiableAt (𝓡 2) (𝓡 n) f (m64SourceScale s hs p)) (i j : Fin 2) : |
| 35 | m60AreaGram g (f ∘ m64SourceScale s hs) p i j = |
| 36 | m64SourceScaleFactor s i * m64SourceScaleFactor s j * |
| 37 | m60AreaGram g f (m64SourceScale s hs p) i j := by |
| 38 | let D := m64SourceScale s hs |
| 39 | have hD : MDifferentiableAt (𝓡 2) (𝓡 2) D p := |
| 40 | mdifferentiableAt_iff_differentiableAt.mpr D.differentiableAt |
| 41 | have hd := mfderiv_comp p hf hD |
| 42 | rw [mfderiv_eq_fderiv, D.fderiv] at hd |
| 43 | have hbase (i : Fin 2) : D (EuclideanSpace.basisFun (Fin 2) ℝ i) = |
| 44 | m64SourceScaleFactor s i • EuclideanSpace.basisFun (Fin 2) ℝ i := by |
| 45 | simpa only [EuclideanSpace.basisFun_apply] using m64SourceScale_basis s hs i |
| 46 | have hv (i : Fin 2) : mfderiv (𝓡 2) (𝓡 n) (f ∘ D) p |
| 47 | (EuclideanSpace.basisFun (Fin 2) ℝ i) = |
| 48 | m64SourceScaleFactor s i • mfderiv (𝓡 2) (𝓡 n) f (D p) |
| 49 | (EuclideanSpace.basisFun (Fin 2) ℝ i) := by |
| 50 | rw [hd] |
| 51 | change mfderiv (𝓡 2) (𝓡 n) f (D p) |
| 52 | (D (EuclideanSpace.basisFun (Fin 2) ℝ i)) = _ |
| 53 | rw [hbase, map_smul] |
| 54 | change g.inner (f (D p)) |
| 55 | (mfderiv (𝓡 2) (𝓡 n) (f ∘ D) p (EuclideanSpace.basisFun (Fin 2) ℝ i)) |
| 56 | (mfderiv (𝓡 2) (𝓡 n) (f ∘ D) p (EuclideanSpace.basisFun (Fin 2) ℝ j)) = _ |
| 57 | rw [hv i, hv j] |
| 58 | simp only [map_smul, smul_apply, smul_eq_mul] |
| 59 | change _ = _ * _ * g.inner (f (D p)) _ _ |
| 60 | ring |
| 61 | |
| 62 | /-- Undoing the genuine harmonic rescaling gives the two weighted Hopf identities at the |
| 63 | original point. Source: Lemaire, Lemma 5.1, p. 99; raw-harmonic-stress derivation. Exact |
| 64 | proof derivation: `2026-09-26-raw-harmonic-stress.md`. -/ |
| 65 | theorem m64WeightedStress_of_rescaled (g : RiemannianMetric n M) |
| 66 | {f : LoopPlane → M} {O : Set LoopPlane} (hO : IsOpen O) |
| 67 | (hf : ContMDiffOn (𝓡 2) (𝓡 n) ∞ f O) {p : LoopPlane} (hp : p ∈ O) |
| 68 | {r : ℝ} (hr : 0 < r) |
| 69 | (hcr : let D := m64SourceScale (Real.sqrt r) (Real.sqrt_pos.mpr hr).ne' |
| 70 | let G := m60AreaGram g (f ∘ D) |
| 71 | let e := EuclideanSpace.basisFun (Fin 2) ℝ |
| 72 | fderiv ℝ (fun z => G z 0 0 - G z 1 1) (D.symm p) (e 0) = |
| 73 | fderiv ℝ (fun z => -2 * G z 0 1) (D.symm p) (e 1) ∧ |
| 74 | fderiv ℝ (fun z => G z 0 0 - G z 1 1) (D.symm p) (e 1) = |
| 75 | -fderiv ℝ (fun z => -2 * G z 0 1) (D.symm p) (e 0)) : |
| 76 | let G := m60AreaGram g f |
| 77 | let U := fun z => r * G z 0 0 - r⁻¹ * G z 1 1 |
| 78 | let W := fun z => -2 * G z 0 1 |
| 79 | let e := EuclideanSpace.basisFun (Fin 2) ℝ |
| 80 | fderiv ℝ U p (e 0) = r⁻¹ * fderiv ℝ W p (e 1) ∧ |
| 81 | fderiv ℝ U p (e 1) = -r * fderiv ℝ W p (e 0) := by |
| 82 | let s := Real.sqrt r |
| 83 | have hs : s ≠ 0 := (Real.sqrt_pos.mpr hr).ne' |
| 84 | have hs2 : s ^ 2 = r := Real.sq_sqrt hr.le |
| 85 | have hss : s * s = r := by nlinarith only [hs2] |
| 86 | have his : s⁻¹ * s⁻¹ = r⁻¹ := by rw [← mul_inv_rev, hss] |
| 87 | have hfac0 : m64SourceScaleFactor s 0 = s := rfl |
| 88 | have hfac1 : m64SourceScaleFactor s 1 = s⁻¹ := rfl |
| 89 | let D := m64SourceScale s hs |
| 90 | let G := m60AreaGram g f |
| 91 | let U := fun z => r * G z 0 0 - r⁻¹ * G z 1 1 |
| 92 | let W := fun z => -2 * G z 0 1 |
| 93 | let e := EuclideanSpace.basisFun (Fin 2) ℝ |
| 94 | have hpair (i j : Fin 2) : |
| 95 | (fun z => m60AreaGram g (f ∘ D) z i j) =ᶠ[𝓝 (D.symm p)] |
| 96 | (fun z => m64SourceScaleFactor s i * m64SourceScaleFactor s j * G (D z) i j) := by |
| 97 | have hn : D ⁻¹' O ∈ 𝓝 (D.symm p) := |
| 98 | D.continuous.continuousAt.preimage_mem_nhds |
| 99 | (by simpa only [D.apply_symm_apply] using hO.mem_nhds hp) |
| 100 | filter_upwards [hn] with z hz |
| 101 | exact m64AreaGram_sourceScale g s hs |
| 102 | ((hf.contMDiffAt (hO.mem_nhds hz)).mdifferentiableAt (by simp)) i j |
| 103 | have hA : (fun z => m60AreaGram g (f ∘ D) z 0 0 - |
| 104 | m60AreaGram g (f ∘ D) z 1 1) =ᶠ[𝓝 (D.symm p)] U ∘ D := by |
| 105 | filter_upwards [hpair 0 0, hpair 1 1] with z h0 h1 |
| 106 | rw [h0, h1, hfac0, hfac1, hss, his] |
| 107 | rfl |
| 108 | have hC : (fun z => -2 * m60AreaGram g (f ∘ D) z 0 1) =ᶠ[𝓝 (D.symm p)] |
| 109 | W ∘ D := by |
| 110 | filter_upwards [hpair 0 1] with z h01 |
| 111 | rw [h01, hfac0, hfac1, mul_inv_cancel₀ hs, one_mul] |
| 112 | rfl |
| 113 | have hfp := hf.contMDiffAt (hO.mem_nhds hp) |
| 114 | have hU : DifferentiableAt ℝ U p := |
| 115 | ((m64AreaGram_entry_contDiffAt (g := g) hfp 0 0).differentiableAt (by simp)).const_mul r |>.sub |
| 116 | (((m64AreaGram_entry_contDiffAt (g := g) hfp 1 1).differentiableAt (by simp)).const_mul r⁻¹) |
| 117 | have hW : DifferentiableAt ℝ W p := |
| 118 | ((m64AreaGram_entry_contDiffAt (g := g) hfp 0 1).differentiableAt (by simp)).const_mul (-2) |
| 119 | have hd (F : LoopPlane → ℝ) (hF : DifferentiableAt ℝ F p) (i : Fin 2) : |
| 120 | fderiv ℝ (F ∘ D) (D.symm p) (e i) = |
| 121 | m64SourceScaleFactor s i * fderiv ℝ F p (e i) := by |
| 122 | have hF' : DifferentiableAt ℝ F (D (D.symm p)) := by |
| 123 | simpa only [D.apply_symm_apply] using hF |
| 124 | rw [fderiv_comp (D.symm p) hF' D.differentiableAt, D.fderiv, |
| 125 | ContinuousLinearMap.comp_apply] |
| 126 | have hbase : D (e i) = m64SourceScaleFactor s i • e i := by |
| 127 | simpa only [e, EuclideanSpace.basisFun_apply] using m64SourceScale_basis s hs i |
| 128 | change fderiv ℝ F (D (D.symm p)) (D (e i)) = _ |
| 129 | rw [hbase, map_smul, D.apply_symm_apply] |
| 130 | rfl |
| 131 | change fderiv ℝ _ (D.symm p) (e 0) = _ ∧ |
| 132 | fderiv ℝ _ (D.symm p) (e 1) = _ at hcr |
| 133 | rw [hA.fderiv_eq (𝕜 := ℝ), hC.fderiv_eq (𝕜 := ℝ), |
| 134 | hd U hU 0, hd U hU 1, hd W hW 0, hd W hW 1] at hcr |
| 135 | rw [hfac0, hfac1] at hcr |
| 136 | change fderiv ℝ U p (e 0) = r⁻¹ * fderiv ℝ W p (e 1) ∧ |
| 137 | fderiv ℝ U p (e 1) = -r * fderiv ℝ W p (e 0) |
| 138 | rw [← hs2] |
| 139 | constructor |
| 140 | · have h := hcr.1 |
| 141 | field_simp [hs] at h ⊢ |
| 142 | nlinarith only [h] |
| 143 | · have h := hcr.2 |
| 144 | field_simp [hs] at h |
| 145 | nlinarith only [h] |
| 146 | |
| 147 | end PoincareMT |