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.ReducedGeometry.ReducedVolume.Regularity.Lipschitz.ChartLipschitz |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Measure.Calibration.NullTransport |
| 3 | import Mathlib.MeasureTheory.Function.Jacobian |
| 4 | |
| 5 | /-! |
| 6 | # Equal-dimensional Sard nullity for calibrated metric volume |
| 7 | |
| 8 | In each target chart, actual critical differentials have zero determinant. |
| 9 | Mathlib's Euclidean Sard lemma and calibrated inverse-chart transport give |
| 10 | local nullity; second countability assembles the result. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open MeasureTheory Set Filter |
| 16 | open scoped Manifold ContDiff Bundle Topology NNReal ENNReal |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.ReducedVolume |
| 21 | |
| 22 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | [T3Space M] [SecondCountableTopology M] [MeasurableSpace M] [BorelSpace M] |
| 25 | |
| 26 | set_option backward.isDefEq.respectTransparency false in |
| 27 | /-- Critical values of an equal-dimensional differentiable map have calibrated measure zero. -/ |
| 28 | theorem calibratedMetricVolume_criticalValues_eq_zero |
| 29 | (g : RiemannianMetric n M) {f : EuclideanSpace ℝ (Fin n) → M} |
| 30 | (hf : MDifferentiable (𝓡 n) (𝓡 n) f) : |
| 31 | calibratedMetricVolume g (f '' {x | ¬ Function.Bijective (mfderiv (𝓡 n) (𝓡 n) f x)}) = 0 := by |
| 32 | apply measure_null_of_locally_null |
| 33 | intro q _hq |
| 34 | obtain ⟨r, hr, _hrtarget, C, hchart⟩ := inverseChart_local_lipschitz g q |
| 35 | let e := extChartAt (𝓡 n) q |
| 36 | let U := Metric.ball (e q) r |
| 37 | let V := e.source ∩ e ⁻¹' U |
| 38 | have hV : V ∈ 𝓝 q := inter_mem (extChartAt_source_mem_nhds (I := 𝓡 n) q) |
| 39 | ((continuousAt_extChartAt (I := 𝓡 n) q).preimage_mem_nhds |
| 40 | (Metric.ball_mem_nhds _ hr)) |
| 41 | let A := {x | ¬ Function.Bijective (mfderiv (𝓡 n) (𝓡 n) f x) ∧ f x ∈ V} |
| 42 | have hcoord : ∀ x ∈ A, DifferentiableAt ℝ (e ∘ f) x := by |
| 43 | intro x hx |
| 44 | have he : MDifferentiableAt (𝓡 n) (𝓡 n) e (f x) := |
| 45 | mdifferentiableAt_extChartAt (by |
| 46 | simpa only [← extChartAt_source (𝓡 n)] using hx.2.1) |
| 47 | exact (he.comp x (hf x)).differentiableAt |
| 48 | have hdet : ∀ x ∈ A, (fderiv ℝ (e ∘ f) x).det = 0 := by |
| 49 | intro x hx |
| 50 | let : FiniteDimensional ℝ (TangentSpace (𝓡 n) x) := |
| 51 | inferInstanceAs (FiniteDimensional ℝ (EuclideanSpace ℝ (Fin n))) |
| 52 | apply LinearMap.det_eq_zero_iff_ker_ne_bot.mpr |
| 53 | intro hker |
| 54 | have hinj : Function.Injective (fderiv ℝ (e ∘ f) x) := LinearMap.ker_eq_bot.mp hker |
| 55 | have he : MDifferentiableAt (𝓡 n) (𝓡 n) e (f x) := |
| 56 | mdifferentiableAt_extChartAt (by |
| 57 | simpa only [← extChartAt_source (𝓡 n)] using hx.2.1) |
| 58 | have hchain := mfderiv_comp x he (hf x) |
| 59 | rw [mfderiv_eq_fderiv] at hchain |
| 60 | have hdf : Function.Injective (mfderiv (𝓡 n) (𝓡 n) f x) := by |
| 61 | intro v w hvw |
| 62 | apply hinj |
| 63 | rw [hchain] |
| 64 | exact congrArg (mfderiv (𝓡 n) (𝓡 n) e (f x)) hvw |
| 65 | exact hx.1 ⟨hdf, LinearMap.injective_iff_surjective.mp hdf⟩ |
| 66 | have hnull : volume ((e ∘ f) '' A) = 0 := |
| 67 | addHaar_image_eq_zero_of_det_fderivWithin_eq_zero volume |
| 68 | (fun x hx ↦ (hcoord x hx).hasFDerivAt.hasFDerivWithinAt) hdet |
| 69 | have himage : calibratedMetricVolume g (e.symm '' ((e ∘ f) '' A)) = 0 := |
| 70 | calibratedMetricVolume_image_eq_zero_of_lipschitz g |
| 71 | (by rintro _ ⟨x, hx, rfl⟩; exact hx.2.2) hnull hchart |
| 72 | refine ⟨V ∩ f '' {x | ¬ Function.Bijective (mfderiv (𝓡 n) (𝓡 n) f x)}, |
| 73 | inter_mem (mem_nhdsWithin_of_mem_nhds hV) self_mem_nhdsWithin, ?_⟩ |
| 74 | apply measure_mono_null _ himage |
| 75 | rintro y ⟨hyV, x, hx, rfl⟩ |
| 76 | exact ⟨e (f x), ⟨x, ⟨hx, hyV⟩, rfl⟩, e.left_inv hyV.1⟩ |
| 77 | |
| 78 | end PoincareMT.ReducedVolume |