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.RicciFlow.Volume.Surgery.Measure.CalibratedTransport |
| 2 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.Topology.PartialChartMeasurable |
| 3 | import PoincareLib.Geometry.RicciFlow.Volume.Surgery.Topology.SmoothPartialChart |
| 4 | import PoincareLib.Geometry.Riemannian.Coordinates.Transitions |
| 5 | |
| 6 | /-! |
| 7 | Adapted from Mapher `PoincareMT/Proofs/M49/LocalIsometryVolume.lean` at |
| 8 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. |
| 9 | |
| 10 | # Calibrated volume under actual smooth local isometries |
| 11 | |
| 12 | The inserted local cap in Morgan-Tian Theorem 13.2, pp. 332-333, |
| 13 | is embedded in the post-surgery slice without changing its metric. |
| 14 | For the volume comparison of Lemma 17.12, p. 410, actual chart |
| 15 | Jacobians and countable measure gluing give exact image-volume |
| 16 | transport, including for closed sets of infinite volume. |
| 17 | -/ |
| 18 | |
| 19 | set_option autoImplicit false |
| 20 | |
| 21 | open Set MeasureTheory |
| 22 | open scoped Manifold ContDiff Bundle ENNReal |
| 23 | |
| 24 | universe u v |
| 25 | |
| 26 | namespace PoincareMT.SurgeryVolume |
| 27 | |
| 28 | variable {n : ℕ} {M : Type u} {N : Type v} |
| 29 | [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 30 | [IsManifold (𝓡 n) ∞ M] [T3Space M] [MeasurableSpace M] [BorelSpace M] |
| 31 | [SecondCountableTopology M] |
| 32 | [TopologicalSpace N] [ChartedSpace (EuclideanSpace ℝ (Fin n)) N] |
| 33 | [IsManifold (𝓡 n) ∞ N] [T3Space N] [MeasurableSpace N] [BorelSpace N] |
| 34 | |
| 35 | -- Keep the selected tangent metric when expanding the actual pullback form. |
| 36 | set_option backward.isDefEq.respectTransparency false in |
| 37 | /-- A smooth partial isometry preserves calibrated volume on every Borel |
| 38 | source subset (MT Theorem 13.2, p. 333; Lemma 17.12, p. 410). -/ |
| 39 | theorem calibratedMetricVolume_image_eq_of_partial_isometry |
| 40 | (g : RiemannianMetric n M) (h : RiemannianMetric n N) |
| 41 | (e : OpenPartialHomeomorph M N) |
| 42 | (he : ContMDiffOn (𝓡 n) (𝓡 n) 1 e e.source) |
| 43 | (hei : ContMDiffOn (𝓡 n) (𝓡 n) 1 e.symm e.target) |
| 44 | (hmetric : ∀ x ∈ e.source, ∀ a b : TangentSpace (𝓡 n) x, |
| 45 | h.inner (e x) (mfderiv (𝓡 n) (𝓡 n) e x a) |
| 46 | (mfderiv (𝓡 n) (𝓡 n) e x b) = g.inner x a b) |
| 47 | {A : Set M} (hA : MeasurableSet A) (hAs : A ⊆ e.source) : |
| 48 | calibratedMetricVolume h (e '' A) = calibratedMetricVolume g A := by |
| 49 | let μ := ((calibratedMetricVolume h).restrict e.target).map e.symm |
| 50 | have hlocal : ∀ x ∈ e.source, ∃ V : Set M, IsOpen V ∧ x ∈ V ∧ |
| 51 | ∀ B : Set M, MeasurableSet B → B ⊆ V → μ B = calibratedMetricVolume g B := by |
| 52 | intro x hx |
| 53 | let c := chartAt (EuclideanSpace ℝ (Fin n)) x |
| 54 | have hc : ContMDiffOn (𝓡 n) (𝓡 n) 1 c c.source := contMDiffOn_chart |
| 55 | have hci : ContMDiffOn (𝓡 n) (𝓡 n) 1 c.symm c.target := contMDiffOn_chart_symm |
| 56 | refine ⟨c.source ∩ e.source, c.open_source.inter e.open_source, |
| 57 | ⟨mem_chart_source _ _, hx⟩, ?_⟩ |
| 58 | intro B hB hBV |
| 59 | let C := c '' B |
| 60 | have hBc : B ⊆ c.source := hBV.trans inter_subset_left |
| 61 | have hBe : B ⊆ e.source := hBV.trans inter_subset_right |
| 62 | have hC : MeasurableSet C := c.measurableSet_image_of_subset_source hB hBc |
| 63 | have hC0 : C ⊆ c.symm.source := by |
| 64 | rintro _ ⟨z, hz, rfl⟩ |
| 65 | exact c.map_source (hBc hz) |
| 66 | let d := c.symm.trans e |
| 67 | have hC1 : C ⊆ d.source := by |
| 68 | rintro _ ⟨z, hz, rfl⟩ |
| 69 | refine ⟨c.map_source (hBc hz), ?_⟩ |
| 70 | change c.symm (c z) ∈ e.source |
| 71 | rw [c.left_inv (hBc hz)] |
| 72 | exact hBe hz |
| 73 | have hd : ContMDiffOn (𝓡 n) (𝓡 n) 1 d d.source := by |
| 74 | intro y hy |
| 75 | exact ((he.contMDiffAt (e.open_source.mem_nhds hy.2)).comp y |
| 76 | (hci.contMDiffAt (c.open_target.mem_nhds hy.1))).contMDiffWithinAt |
| 77 | have hdi : ContMDiffOn (𝓡 n) (𝓡 n) 1 d.symm d.target := by |
| 78 | intro y hy |
| 79 | exact ((hc.contMDiffAt (c.open_source.mem_nhds hy.2)).comp y |
| 80 | (hei.contMDiffAt (e.open_target.mem_nhds hy.1))).contMDiffWithinAt |
| 81 | have himage0 : c.symm '' C = B := c.symm_image_image_of_subset_source hBc |
| 82 | have himage1 : d '' C = e '' B := by |
| 83 | change (e ∘ c.symm) '' C = e '' B |
| 84 | rw [image_comp, himage0] |
| 85 | have hJ : ∀ y ∈ C, SurgeryVolume.Measure.pullbackJacobian h d y = |
| 86 | SurgeryVolume.Measure.pullbackJacobian g c.symm y := by |
| 87 | intro y hy |
| 88 | have hy0 := hC0 hy |
| 89 | have hy1 := (hC1 hy).2 |
| 90 | have hD : mfderiv (𝓡 n) (𝓡 n) d y = |
| 91 | (mfderiv (𝓡 n) (𝓡 n) e (c.symm y)).comp |
| 92 | (mfderiv (𝓡 n) (𝓡 n) c.symm y) := |
| 93 | mfderiv_comp y |
| 94 | ((he.contMDiffAt (e.open_source.mem_nhds hy1)).mdifferentiableAt one_ne_zero) |
| 95 | ((hci.contMDiffAt (c.open_target.mem_nhds hy0)).mdifferentiableAt one_ne_zero) |
| 96 | have hform (a b : EuclideanSpace ℝ (Fin n)) : |
| 97 | SurgeryVolume.Measure.pullbackMetricForm h d y a b = SurgeryVolume.Measure.pullbackMetricForm g c.symm y a b := by |
| 98 | simpa only [SurgeryVolume.Measure.pullbackMetricForm, ContinuousLinearMap.bilinearComp_apply, |
| 99 | hD, ContinuousLinearMap.comp_apply] using! |
| 100 | hmetric (c.symm y) hy1 (mfderiv (𝓡 n) (𝓡 n) c.symm y a) |
| 101 | (mfderiv (𝓡 n) (𝓡 n) c.symm y b) |
| 102 | unfold SurgeryVolume.Measure.pullbackJacobian |
| 103 | congr 2 |
| 104 | funext i j |
| 105 | exact hform _ _ |
| 106 | rw [SurgeryVolume.Measure.map_inverse_restrict_apply e (calibratedMetricVolume h) hB hBe, |
| 107 | ← himage1, ← himage0, |
| 108 | SurgeryVolume.Measure.calibratedMetricVolume_image_eq_lintegral h d hd hdi hC hC1, |
| 109 | SurgeryVolume.Measure.calibratedMetricVolume_image_eq_lintegral g c.symm hci hc hC hC0] |
| 110 | apply lintegral_congr_ae |
| 111 | filter_upwards [ae_restrict_mem hC] with y hy |
| 112 | rw [hJ y hy] |
| 113 | have hforward : μ A ≤ calibratedMetricVolume g A := by |
| 114 | simpa only [one_mul] using SurgeryVolume.Measure.measure_le_mul_of_local_comparison |
| 115 | (c := 1) (U := e.source) (fun x hx => by |
| 116 | obtain ⟨V, hVo, hxV, hV⟩ := hlocal x hx |
| 117 | exact ⟨V, hVo, hxV, fun B hB hBV => by |
| 118 | simpa only [one_mul] using (hV B hB hBV).le⟩) hA hAs |
| 119 | have hreverse : calibratedMetricVolume g A ≤ μ A := by |
| 120 | simpa only [one_mul] using SurgeryVolume.Measure.measure_le_mul_of_local_comparison |
| 121 | (c := 1) (U := e.source) (fun x hx => by |
| 122 | obtain ⟨V, hVo, hxV, hV⟩ := hlocal x hx |
| 123 | exact ⟨V, hVo, hxV, fun B hB hBV => by |
| 124 | simpa only [one_mul] using (hV B hB hBV).ge⟩) hA hAs |
| 125 | rw [← SurgeryVolume.Measure.map_inverse_restrict_apply e (calibratedMetricVolume h) hA hAs] |
| 126 | exact le_antisymm hforward hreverse |
| 127 | |
| 128 | /-- A globally injective smooth map preserving the selected metric preserves |
| 129 | all Borel image volumes (MT Theorem 13.2, p. 333; Lemma 17.12, p. 410). -/ |
| 130 | theorem calibratedMetricVolume_image_eq_of_injective_isometry |
| 131 | (g : RiemannianMetric n M) (h : RiemannianMetric n N) {f : M → N} |
| 132 | (hf : ContMDiff (𝓡 n) (𝓡 n) ∞ f) (hinj : Function.Injective f) |
| 133 | (hmetric : ∀ x (a b : TangentSpace (𝓡 n) x), |
| 134 | h.inner (f x) (mfderiv (𝓡 n) (𝓡 n) f x a) |
| 135 | (mfderiv (𝓡 n) (𝓡 n) f x b) = g.inner x a b) |
| 136 | {A : Set M} (hA : MeasurableSet A) : |
| 137 | calibratedMetricVolume h (f '' A) = calibratedMetricVolume g A := by |
| 138 | cases isEmpty_or_nonempty M with |
| 139 | | inl hM => |
| 140 | have hAe : A = ∅ := Set.eq_empty_of_isEmpty A |
| 141 | simp only [hAe, image_empty, measure_empty] |
| 142 | | inr hM => |
| 143 | have hfi : ContMDiffOn (𝓡 n) (𝓡 n) 1 (Function.invFun f) (range f) := |
| 144 | (g.contMDiffOn_invFun_of_injective_pullback_eq h hf hinj hmetric).of_le (by simp) |
| 145 | let e := smoothOpenPartialHomeomorph f (Function.invFun f) univ isOpen_univ |
| 146 | hf.contMDiffOn |
| 147 | (by simpa only [image_univ] using |
| 148 | g.contMDiffOn_invFun_of_injective_pullback_eq h hf hinj hmetric) |
| 149 | (fun _ _ => Function.leftInverse_invFun hinj _) |
| 150 | (fun x _ => g.mfderiv_bijective_of_pullback_eq h x (hmetric x)) |
| 151 | exact calibratedMetricVolume_image_eq_of_partial_isometry g h e |
| 152 | (hf.contMDiffOn.of_le (by simp)) |
| 153 | (by |
| 154 | change ContMDiffOn (𝓡 n) (𝓡 n) 1 (Function.invFun f) (f '' univ) |
| 155 | simpa only [image_univ] using hfi) |
| 156 | (fun x _ => hmetric x) hA (subset_univ A) |
| 157 | |
| 158 | end PoincareMT.SurgeryVolume |