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.Sweep.Radial.AffineArea |
| 2 | |
| 3 | /-! |
| 4 | # Exact area of the radial annulus join |
| 5 | |
| 6 | The midpoint line has zero plane volume. On each side the actual map is |
| 7 | an affine radial reparameterization of its annulus, so change of variables |
| 8 | gives exactly the sum of the two original areas. |
| 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 ENNReal Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | private theorem m64_radial_line_null (c : ℝ) : |
| 25 | volume {p : LoopPlane | p 1 = c} = 0 := by |
| 26 | let e : LoopPlane → (Fin 2 → ℝ) := @WithLp.ofLp 2 (Fin 2 → ℝ) |
| 27 | let q : (Fin 2 → ℝ) → ℝ × ℝ := MeasurableEquiv.finTwoArrow |
| 28 | have he : MeasurePreserving e volume volume := PiLp.volume_preserving_ofLp _ |
| 29 | have hq : MeasurePreserving q volume volume := |
| 30 | MeasureTheory.volume_preserving_finTwoArrow ℝ |
| 31 | have hcomp : MeasurePreserving (q ∘ e) volume volume := hq.comp he |
| 32 | let S : Set (ℝ × ℝ) := (univ : Set ℝ) ×ˢ {c} |
| 33 | have hS : NullMeasurableSet S volume := by measurability |
| 34 | have hzero : volume S = 0 := by |
| 35 | rw [MeasureTheory.Measure.volume_eq_prod, MeasureTheory.Measure.prod_prod] |
| 36 | simp |
| 37 | have hpre := hcomp.measure_preimage hS |
| 38 | have heq : (q ∘ e) ⁻¹' S = {p : LoopPlane | p 1 = c} := by |
| 39 | ext p |
| 40 | simp [q, e, S, MeasurableEquiv.finTwoArrow_apply] |
| 41 | rw [← heq, hpre, hzero] |
| 42 | |
| 43 | private def lowerHalf : Set LoopPlane := |
| 44 | m64AnnulusDomain ∩ {p | p 1 ≤ (1 / 2 : ℝ)} |
| 45 | |
| 46 | private def upperHalf : Set LoopPlane := |
| 47 | m64AnnulusDomain ∩ {p | (1 / 2 : ℝ) ≤ p 1} |
| 48 | |
| 49 | private theorem lowerHalf_image : |
| 50 | m64RadialAffine 2 0 '' lowerHalf = m64AnnulusDomain := by |
| 51 | ext p |
| 52 | constructor |
| 53 | · rintro ⟨q, hq, rfl⟩ |
| 54 | change 0 ≤ q 0 ∧ q 0 ≤ curvePeriod ∧ 0 ≤ 2 * q 1 + 0 ∧ 2 * q 1 + 0 ≤ 1 |
| 55 | have hhalf : q 1 ≤ (1 / 2 : ℝ) := hq.2 |
| 56 | exact ⟨hq.1.1, hq.1.2.1, by linarith [hq.1.2.2.1], by linarith⟩ |
| 57 | · intro hp |
| 58 | refine ⟨annulusPoint (p 0) (p 1 / 2), ?_, ?_⟩ |
| 59 | · change (0 ≤ p 0 ∧ p 0 ≤ curvePeriod ∧ 0 ≤ p 1 / 2 ∧ p 1 / 2 ≤ 1) ∧ |
| 60 | p 1 / 2 ≤ 1 / 2 |
| 61 | exact ⟨⟨hp.1, hp.2.1, by linarith [hp.2.2.1], by linarith [hp.2.2.2]⟩, |
| 62 | by linarith [hp.2.2.2]⟩ |
| 63 | · ext i |
| 64 | fin_cases i <;> simp [m64RadialAffine, annulusPoint] |
| 65 | ring |
| 66 | |
| 67 | private theorem upperHalf_image : |
| 68 | m64RadialAffine 2 (-1) '' upperHalf = m64AnnulusDomain := by |
| 69 | ext p |
| 70 | constructor |
| 71 | · rintro ⟨q, hq, rfl⟩ |
| 72 | change 0 ≤ q 0 ∧ q 0 ≤ curvePeriod ∧ 0 ≤ 2 * q 1 + -1 ∧ 2 * q 1 + -1 ≤ 1 |
| 73 | have hhalf : (1 / 2 : ℝ) ≤ q 1 := hq.2 |
| 74 | exact ⟨hq.1.1, hq.1.2.1, by linarith, by linarith [hq.1.2.2.2]⟩ |
| 75 | · intro hp |
| 76 | refine ⟨annulusPoint (p 0) ((p 1 + 1) / 2), ?_, ?_⟩ |
| 77 | · change (0 ≤ p 0 ∧ p 0 ≤ curvePeriod ∧ 0 ≤ (p 1 + 1) / 2 ∧ |
| 78 | (p 1 + 1) / 2 ≤ 1) ∧ 1 / 2 ≤ (p 1 + 1) / 2 |
| 79 | exact ⟨⟨hp.1, hp.2.1, by linarith [hp.2.2.1], by linarith [hp.2.2.2]⟩, |
| 80 | by linarith [hp.2.2.1]⟩ |
| 81 | · ext i |
| 82 | fin_cases i <;> simp [m64RadialAffine, annulusPoint] |
| 83 | ring |
| 84 | |
| 85 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] [T2Space M] |
| 86 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 87 | |
| 88 | omit [T2Space M] in |
| 89 | /-- The area of the actual joined annulus is exactly the sum of the two original areas. |
| 90 | Source: MT Lemma 19.15, pp. 447-449, its weak minimum and sweep construction. -/ |
| 91 | theorem m64AnnulusJoin_area {g : RiemannianMetric n M} {c0 c1 c2 : ℝ → M} |
| 92 | (A : M64Annulus g c0 c1) (B : M64Annulus g c1 c2) |
| 93 | (C : M64Annulus g c0 c2) (hmap : C.map = m64AnnulusJoinMap A.map B.map) : |
| 94 | C.area = A.area + B.area := by |
| 95 | have hleft : MeasurableSet lowerHalf := m64AnnulusDomain_measurableSet.inter |
| 96 | (measurableSet_le (by fun_prop) measurable_const) |
| 97 | have hright : MeasurableSet upperHalf := m64AnnulusDomain_measurableSet.inter |
| 98 | (measurableSet_le measurable_const (by fun_prop)) |
| 99 | have hline : ∀ᵐ p ∂(volume : Measure LoopPlane), p 1 ≠ (1 / 2 : ℝ) := |
| 100 | compl_mem_ae_iff.mpr (m64_radial_line_null _) |
| 101 | have hleftDensity : ∀ᵐ p ∂volume.restrict lowerHalf, |
| 102 | m60AreaDensity g C.map p = |
| 103 | m60AreaDensity g (A.map ∘ m64RadialAffine 2 0) p := by |
| 104 | filter_upwards [hline.filter_mono (ae_mono Measure.restrict_le_self), |
| 105 | ae_restrict_mem hleft] with p hp hpd |
| 106 | have hlt : p 1 < (1 / 2 : ℝ) := lt_of_le_of_ne hpd.2 hp |
| 107 | apply m60AreaDensity_congr_of_eventuallyEq g |
| 108 | filter_upwards [(isOpen_lt (PiLp.continuous_apply 2 (fun _ : Fin 2 => ℝ) 1) |
| 109 | continuous_const).mem_nhds hlt] with q hq |
| 110 | rw [hmap] |
| 111 | simp only [m64AnnulusJoinMap, if_pos hq.le, Function.comp_def] |
| 112 | congr 1 |
| 113 | ext i |
| 114 | fin_cases i <;> simp [m64RadialDouble, m64RadialAffine, annulusPoint] |
| 115 | have hrightDensity : ∀ᵐ p ∂volume.restrict upperHalf, |
| 116 | m60AreaDensity g C.map p = |
| 117 | m60AreaDensity g (B.map ∘ m64RadialAffine 2 (-1)) p := by |
| 118 | filter_upwards [hline.filter_mono (ae_mono Measure.restrict_le_self), |
| 119 | ae_restrict_mem hright] with p hp hpd |
| 120 | have hlt : (1 / 2 : ℝ) < p 1 := lt_of_le_of_ne hpd.2 (Ne.symm hp) |
| 121 | apply m60AreaDensity_congr_of_eventuallyEq g |
| 122 | filter_upwards [(isOpen_lt continuous_const |
| 123 | (PiLp.continuous_apply 2 (fun _ : Fin 2 => ℝ) 1)).mem_nhds hlt] with q hq |
| 124 | rw [hmap] |
| 125 | simp only [m64AnnulusJoinMap, if_neg (not_le_of_gt hq), Function.comp_def] |
| 126 | congr 1 |
| 127 | have hleftArea : (∫ p in lowerHalf, m60AreaDensity g C.map p) = A.area := by |
| 128 | rw [integral_congr_ae hleftDensity, |
| 129 | m64AreaIntegral_comp_radialAffine g A.map (by norm_num) 0 hleft, lowerHalf_image] |
| 130 | rfl |
| 131 | have hrightArea : (∫ p in upperHalf, m60AreaDensity g C.map p) = B.area := by |
| 132 | rw [integral_congr_ae hrightDensity, |
| 133 | m64AreaIntegral_comp_radialAffine g B.map (by norm_num) (-1) hright, upperHalf_image] |
| 134 | rfl |
| 135 | have hunion : lowerHalf ∪ upperHalf = m64AnnulusDomain := by |
| 136 | ext p |
| 137 | constructor |
| 138 | · rintro (h | h) <;> exact h.1 |
| 139 | · intro hp |
| 140 | rcases le_total (p 1) (1 / 2 : ℝ) with h | h |
| 141 | · exact Or.inl ⟨hp, h⟩ |
| 142 | · exact Or.inr ⟨hp, h⟩ |
| 143 | have hdis : AEDisjoint volume lowerHalf upperHalf := by |
| 144 | apply measure_mono_null ?_ (m64_radial_line_null (1 / 2)) |
| 145 | intro p hp |
| 146 | exact le_antisymm hp.1.2 hp.2.2 |
| 147 | change (∫ p in m64AnnulusDomain, m60AreaDensity g C.map p) = _ |
| 148 | rw [← hunion, setIntegral_union₀ hdis hright.nullMeasurableSet |
| 149 | (C.area_integrable.mono_set inter_subset_left) |
| 150 | (C.area_integrable.mono_set inter_subset_left), hleftArea, hrightArea] |
| 151 | |
| 152 | /-- Construct an admissible joined annulus with exact area equal to the sum of the input |
| 153 | areas. Source: MT Lemma 19.15, pp. 447-449, its weak minimum and sweep construction. -/ |
| 154 | theorem m64Annulus_join_with_area |
| 155 | {g : RiemannianMetric n M} {c0 c1 c2 : ℝ → M} |
| 156 | (A : M64Annulus g c0 c1) (B : M64Annulus g c1 c2) : |
| 157 | ∃ C : M64Annulus g c0 c2, |
| 158 | C.map = m64AnnulusJoinMap A.map B.map ∧ C.area = A.area + B.area := by |
| 159 | obtain ⟨C, hmap⟩ := m64Annulus_join A B |
| 160 | exact ⟨C, hmap, m64AnnulusJoin_area A B C hmap⟩ |
| 161 | |
| 162 | end PoincareMT |