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.Annulus |
| 2 | import PoincareLib.Geometry.Riemannian.LoopSpace.Area.AreaMeasurability |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.AreaComparison.Projection.Pointwise |
| 4 | |
| 5 | /-! |
| 6 | Removing the null rectangular boundary and dominating the actual projected area density by the |
| 7 | integrable product area density. |
| 8 | |
| 9 | Morgan--Tian context: Section 19.6, Lemmas 19.30-19.31, printed pp. 461-466. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open MeasureTheory Set |
| 15 | open scoped Manifold ContDiff Bundle ENNReal |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT |
| 20 | |
| 21 | /-- The closed annulus rectangle and its open coordinate box agree almost everywhere. |
| 22 | Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 23 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 24 | theorem m64AnnulusDomain_ae_eq_boxInterior : |
| 25 | m64AnnulusDomain =ᵐ[volume] |
| 26 | (@WithLp.ofLp 2 (Fin 2 → ℝ)) ⁻¹' (Set.pi Set.univ |
| 27 | (fun i : Fin 2 => Set.Ioo ((0 : Fin 2 → ℝ) i) |
| 28 | (![curvePeriod, 1] i))) := by |
| 29 | let e : LoopPlane → (Fin 2 → ℝ) := @WithLp.ofLp 2 (Fin 2 → ℝ) |
| 30 | let lo : Fin 2 → ℝ := 0 |
| 31 | let hi : Fin 2 → ℝ := ![curvePeriod, 1] |
| 32 | have hbox : (Set.pi Set.univ (fun i : Fin 2 => Set.Ioo (lo i) (hi i))) =ᵐ[ |
| 33 | (Measure.pi fun _ : Fin 2 => (volume : Measure ℝ))] |
| 34 | Set.pi Set.univ (fun i : Fin 2 => Set.Icc (lo i) (hi i)) := |
| 35 | by |
| 36 | simpa only [pi_univ_Icc] using |
| 37 | (Measure.univ_pi_Ioo_ae_eq_Icc (μ := fun _ : Fin 2 => (volume : Measure ℝ)) |
| 38 | (f := lo) (g := hi)) |
| 39 | have hpre : e ⁻¹' (Set.pi Set.univ (fun i : Fin 2 => Set.Ioo (lo i) (hi i))) =ᵐ[volume] |
| 40 | e ⁻¹' (Set.pi Set.univ (fun i : Fin 2 => Set.Icc (lo i) (hi i))) := |
| 41 | (PiLp.volume_preserving_ofLp (ι := Fin 2)).quasiMeasurePreserving.preimage_ae_eq hbox |
| 42 | have hdom : m64AnnulusDomain = |
| 43 | e ⁻¹' (Set.pi Set.univ (fun i : Fin 2 => Set.Icc (lo i) (hi i))) := by |
| 44 | ext p |
| 45 | simp only [m64AnnulusDomain, Set.mem_ofPred_eq, Set.mem_preimage, Set.mem_pi, |
| 46 | Set.mem_univ, Set.mem_Icc] |
| 47 | dsimp [e] |
| 48 | simp only [true_implies] |
| 49 | change (0 ≤ p 0 ∧ p 0 ≤ curvePeriod ∧ 0 ≤ p 1 ∧ p 1 ≤ 1) ↔ |
| 50 | (∀ i : Fin 2, lo i ≤ p i ∧ p i ≤ hi i) |
| 51 | constructor |
| 52 | · intro hp i |
| 53 | fin_cases i |
| 54 | · exact ⟨hp.1, hp.2.1⟩ |
| 55 | · exact ⟨hp.2.2.1, hp.2.2.2⟩ |
| 56 | · intro hp |
| 57 | have h0 := hp 0 |
| 58 | have h1 := hp 1 |
| 59 | simpa [lo, hi] using ⟨h0.1, h0.2, h1.1, h1.2⟩ |
| 60 | rw [hdom] |
| 61 | simpa only [e, lo, hi] using hpre.symm |
| 62 | |
| 63 | /-- The actual projected density is measurable and dominated by the integrable source area |
| 64 | density. Source: Auxiliary step for MT Lemma 19.30, p. 462; the actual half-disk collar in |
| 65 | `proof-work/tasks/M64/reports/2026-09-24-sharp-polar-collar.md`. -/ |
| 66 | theorem m64ProjectedDensity_integrable |
| 67 | {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 68 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 69 | {a b : ℝ} {F : RicciFlow n M (Set.Icc a b)} |
| 70 | {circumference : ℝ} (P : M62.CircleProductData F circumference) |
| 71 | (t : ℝ) (c0 c1 : ℝ → P.charts.Point) |
| 72 | (A : M64Annulus (P.flow.metric t) c0 c1) : |
| 73 | IntegrableOn |
| 74 | (m60AreaDensity (F.metric t) (fun z => (A.map z).1)) |
| 75 | m64AnnulusDomain volume := by |
| 76 | let e : LoopPlane → (Fin 2 → ℝ) := @WithLp.ofLp 2 (Fin 2 → ℝ) |
| 77 | let lo : Fin 2 → ℝ := 0 |
| 78 | let hi : Fin 2 → ℝ := ![curvePeriod, 1] |
| 79 | let S : Set LoopPlane := e ⁻¹' (Set.pi Set.univ |
| 80 | (fun i : Fin 2 => Set.Ioo (lo i) (hi i))) |
| 81 | have hS : IsOpen S := by |
| 82 | apply (isOpen_set_pi Set.finite_univ (fun _ _ => isOpen_Ioo)).preimage |
| 83 | exact PiLp.continuous_ofLp 2 _ |
| 84 | have hSdom : S ⊆ m64AnnulusDomain := by |
| 85 | intro p hp |
| 86 | simp only [S, e, Set.mem_preimage, Set.mem_pi, Set.mem_univ, Set.mem_Ioo] at hp |
| 87 | change 0 ≤ p 0 ∧ p 0 ≤ curvePeriod ∧ 0 ≤ p 1 ∧ p 1 ≤ 1 |
| 88 | have h0 := hp 0 trivial |
| 89 | have h1 := hp 1 trivial |
| 90 | simpa [lo, hi] using ⟨h0.1.le, h0.2.le, h1.1.le, h1.2.le⟩ |
| 91 | have hcont : ContinuousOn (fun z => (A.map z).1) S := |
| 92 | continuous_fst.continuousOn.comp (A.continuous_on_domain.mono hSdom) |
| 93 | (fun _ _ => mem_univ _) |
| 94 | have hmeas := m60AreaDensity_aestronglyMeasurableOn (F.metric t) hS hcont |
| 95 | have hfullS : IntegrableOn (m60AreaDensity (P.flow.metric t) A.map) S volume := |
| 96 | A.area_integrable.mono_set hSdom |
| 97 | have hpoint : ∀ᵐ z ∂volume.restrict S, |
| 98 | m60AreaDensity (F.metric t) (fun w => (A.map w).1) z ≤ |
| 99 | m60AreaDensity (P.flow.metric t) A.map z := by |
| 100 | filter_upwards [ae_restrict_mem hS.measurableSet, |
| 101 | ae_restrict_of_ae A.ae_manifold_differentiable] with z hzdom hz |
| 102 | exact m64CircleProduct_projected_density_le P t A.map z (hz (hSdom hzdom)) |
| 103 | have hintS : IntegrableOn |
| 104 | (m60AreaDensity (F.metric t) (fun z => (A.map z).1)) S volume := |
| 105 | hfullS.mono' hmeas (by |
| 106 | simpa only [Real.norm_eq_abs, |
| 107 | abs_of_nonneg (m60AreaDensity_nonneg (F.metric t) |
| 108 | (fun z => (A.map z).1) _)] using hpoint) |
| 109 | have hae : m64AnnulusDomain =ᵐ[volume] S := by |
| 110 | simpa only [S, e, lo, hi] using m64AnnulusDomain_ae_eq_boxInterior |
| 111 | exact (integrableOn_congr_set_ae hae).mpr hintS |
| 112 | |
| 113 | end PoincareMT |