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.Annulus.SmoothGram |
| 2 | |
| 3 | /-! |
| 4 | # Actual conformal identities on the closed annular rectangle |
| 5 | |
| 6 | Smooth Gram coefficients and their derivatives extend their interior |
| 7 | identities to the closed rectangle. The extension outside the rectangle |
| 8 | need not be conformal. |
| 9 | |
| 10 | Morgan--Tian context: Lemma 19.15 and its annular area-to-energy construction, printed pp. |
| 11 | 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 | /-- The closure of the open angular rectangle is exactly the closed annulus source domain. |
| 25 | Source: Morgan--Tian (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project |
| 26 | derivation |
| 27 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 28 | theorem m64AnnulusInterior_closure : closure m64AnnulusInterior = m64AnnulusDomain := by |
| 29 | let H := PiLp.homeomorph 2 (fun _ : Fin 2 => ℝ) |
| 30 | change closure (H ⁻¹' pi univ (fun i : Fin 2 => Ioo (0 : ℝ) (![curvePeriod, 1] i))) = _ |
| 31 | rw [← H.preimage_closure, closure_pi_set] |
| 32 | have hclosure (i : Fin 2) : closure (Ioo (0 : ℝ) (![curvePeriod, 1] i)) = |
| 33 | Icc (0 : ℝ) (![curvePeriod, 1] i) := by |
| 34 | apply closure_Ioo |
| 35 | fin_cases i |
| 36 | · change 0 ≠ curvePeriod |
| 37 | exact ne_of_lt (by unfold curvePeriod; positivity) |
| 38 | · norm_num |
| 39 | simp_rw [hclosure] |
| 40 | ext p |
| 41 | simp only [mem_preimage, Set.mem_pi, mem_univ, forall_const, Fin.forall_fin_two, mem_Icc, |
| 42 | Matrix.cons_val_zero, Matrix.cons_val_one] |
| 43 | change ((0 ≤ p 0 ∧ p 0 ≤ curvePeriod) ∧ (0 ≤ p 1 ∧ p 1 ≤ 1)) ↔ |
| 44 | (0 ≤ p 0 ∧ p 0 ≤ curvePeriod ∧ 0 ≤ p 1 ∧ p 1 ≤ 1) |
| 45 | tauto |
| 46 | |
| 47 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 48 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 49 | {g : RiemannianMetric n M} {c0 c1 : ℝ → M} |
| 50 | |
| 51 | /-- A.e. conformality of a map smooth near the closed rectangle holds on the whole |
| 52 | rectangle, with no conformality assumption outside it. Source: Morgan--Tian (2007), Lemma |
| 53 | 19.15 and Corollary 19.16, pp. 447-449; project derivation |
| 54 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 55 | theorem m64Annulus_conformal_on_domain_of_ae |
| 56 | (A : M64Annulus g c0 c1) {O : Set LoopPlane} |
| 57 | (hO : IsOpen O) (hdom : m64AnnulusDomain ⊆ O) |
| 58 | (hf : ContMDiffOn (𝓡 2) (𝓡 n) ∞ A.map O) |
| 59 | (hconformal : ∀ᵐ p ∂volume.restrict m64AnnulusDomain, |
| 60 | m60AreaGram g A.map p 0 0 = m60AreaGram g A.map p 1 1 ∧ |
| 61 | m60AreaGram g A.map p 0 1 = 0) : |
| 62 | ∀ p ∈ m64AnnulusDomain, |
| 63 | m60AreaGram g A.map p 0 0 = m60AreaGram g A.map p 1 1 ∧ |
| 64 | m60AreaGram g A.map p 0 1 = 0 := by |
| 65 | have hsub : m64AnnulusInterior ⊆ m64AnnulusDomain := by |
| 66 | rw [← m64AnnulusInterior_closure] |
| 67 | exact subset_closure |
| 68 | have hpoint := m64Annulus_conformal_on_interior_of_ae A |
| 69 | (hf.mono (hsub.trans hdom)) hconformal |
| 70 | have hcont (i j : Fin 2) : |
| 71 | ContinuousOn (fun p => m60AreaGram g A.map p i j) m64AnnulusDomain := by |
| 72 | intro p hp |
| 73 | exact (m64AreaGram_entry_contDiffAt |
| 74 | (hf.contMDiffAt (hO.mem_nhds (hdom hp))) i j).continuousAt.continuousWithinAt |
| 75 | have hclosure : m64AnnulusDomain ⊆ closure m64AnnulusInterior := by |
| 76 | rw [m64AnnulusInterior_closure] |
| 77 | have hdiag : EqOn (fun p => m60AreaGram g A.map p 0 0) |
| 78 | (fun p => m60AreaGram g A.map p 1 1) m64AnnulusInterior := fun p hp => (hpoint p hp).1 |
| 79 | have hcross : EqOn (fun p => m60AreaGram g A.map p 0 1) |
| 80 | (fun _ => (0 : ℝ)) m64AnnulusInterior := fun p hp => (hpoint p hp).2 |
| 81 | exact fun p hp => ⟨hdiag.of_subset_closure (hcont 0 0) (hcont 1 1) hsub hclosure hp, |
| 82 | hcross.of_subset_closure (hcont 0 1) continuousOn_const hsub hclosure hp⟩ |
| 83 | |
| 84 | /-- The differentiated conformal identities also hold on the actual closed rectangle by |
| 85 | continuity of the smooth Gram derivatives. Source: Morgan--Tian (2007), Lemma 19.15 and |
| 86 | Corollary 19.16, pp. 447-449; project derivation |
| 87 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 88 | theorem m64Annulus_conformal_fderiv_on_domain_of_ae |
| 89 | (A : M64Annulus g c0 c1) {O : Set LoopPlane} |
| 90 | (hO : IsOpen O) (hdom : m64AnnulusDomain ⊆ O) |
| 91 | (hf : ContMDiffOn (𝓡 2) (𝓡 n) ∞ A.map O) |
| 92 | (hconformal : ∀ᵐ p ∂volume.restrict m64AnnulusDomain, |
| 93 | m60AreaGram g A.map p 0 0 = m60AreaGram g A.map p 1 1 ∧ |
| 94 | m60AreaGram g A.map p 0 1 = 0) : |
| 95 | ∀ p ∈ m64AnnulusDomain, |
| 96 | fderiv ℝ (fun q => m60AreaGram g A.map q 0 0) p = |
| 97 | fderiv ℝ (fun q => m60AreaGram g A.map q 1 1) p ∧ |
| 98 | fderiv ℝ (fun q => m60AreaGram g A.map q 0 1) p = 0 := by |
| 99 | have hsub : m64AnnulusInterior ⊆ m64AnnulusDomain := by |
| 100 | rw [← m64AnnulusInterior_closure] |
| 101 | exact subset_closure |
| 102 | have hpoint := m64Annulus_conformal_on_interior_of_ae A |
| 103 | (hf.mono (hsub.trans hdom)) hconformal |
| 104 | have hcont (i j : Fin 2) : ContinuousOn |
| 105 | (fun p => fderiv ℝ (fun q => m60AreaGram g A.map q i j) p) m64AnnulusDomain := by |
| 106 | have hGram : ContDiffOn ℝ ∞ (fun q => m60AreaGram g A.map q i j) O := |
| 107 | fun p hp => (m64AreaGram_entry_contDiffAt |
| 108 | (hf.contMDiffAt (hO.mem_nhds hp)) i j).contDiffWithinAt |
| 109 | exact (hGram.fderiv_of_isOpen hO (m := ∞) (by simp)).continuousOn.mono hdom |
| 110 | have hdiag : EqOn |
| 111 | (fun p => fderiv ℝ (fun q => m60AreaGram g A.map q 0 0) p) |
| 112 | (fun p => fderiv ℝ (fun q => m60AreaGram g A.map q 1 1) p) m64AnnulusInterior := by |
| 113 | intro p hp |
| 114 | apply Filter.EventuallyEq.fderiv_eq |
| 115 | filter_upwards [isOpen_m64AnnulusInterior.mem_nhds hp] with q hq |
| 116 | exact (hpoint q hq).1 |
| 117 | have hcross : EqOn |
| 118 | (fun p => fderiv ℝ (fun q => m60AreaGram g A.map q 0 1) p) |
| 119 | (fun _ => (0 : LoopPlane →L[ℝ] ℝ)) m64AnnulusInterior := by |
| 120 | intro p hp |
| 121 | have heq : (fun q => m60AreaGram g A.map q 0 1) =ᶠ[𝓝 p] fun _ => (0 : ℝ) := by |
| 122 | filter_upwards [isOpen_m64AnnulusInterior.mem_nhds hp] with q hq |
| 123 | exact (hpoint q hq).2 |
| 124 | simpa only [fderiv_const_apply] using heq.fderiv_eq (𝕜 := ℝ) |
| 125 | have hclosure : m64AnnulusDomain ⊆ closure m64AnnulusInterior := by |
| 126 | rw [m64AnnulusInterior_closure] |
| 127 | exact fun p hp => ⟨hdiag.of_subset_closure (hcont 0 0) (hcont 1 1) hsub hclosure hp, |
| 128 | hcross.of_subset_closure (hcont 0 1) continuousOn_const hsub hclosure hp⟩ |
| 129 | |
| 130 | end PoincareMT |