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.Analysis.Calculus.Sard.Basic |
| 2 | import PoincareLib.Analysis.Calculus.Sard.LevelSet |
| 3 | |
| 4 | /-! |
| 5 | # Checked branches for the scalar Sard reduction |
| 6 | |
| 7 | The one-dimensional coordinate branch follows from the Jacobian image theorem. |
| 8 | The residual branch follows from a local Holder estimate and Hausdorff dimension |
| 9 | comparison. Regular hypersurface coordinates support the dimension induction. |
| 10 | -/ |
| 11 | |
| 12 | open MeasureTheory Set Function |
| 13 | open scoped ContDiff Topology |
| 14 | |
| 15 | namespace Poincare.Analysis |
| 16 | |
| 17 | /-- The scalar coordinate branch: critical values of a smooth real function |
| 18 | have zero Lebesgue measure. -/ |
| 19 | theorem scalarCriticalImage_null_coordinate |
| 20 | {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) : |
| 21 | volume (f '' {x | ¬ Function.Surjective (fderiv ℝ f x)}) = 0 := by |
| 22 | apply critical_values_null_one_dim volume |
| 23 | · intro x hx |
| 24 | exact ((hf.differentiable (by simp)).differentiableAt).hasFDerivAt.hasFDerivWithinAt |
| 25 | · intro x hx |
| 26 | by_contra hdet |
| 27 | have hnonzero : (fderiv ℝ f x).toLinearMap ≠ 0 := by |
| 28 | intro hz |
| 29 | apply hdet |
| 30 | simp [ContinuousLinearMap.det, hz] |
| 31 | exact hx (LinearMap.surjective hnonzero) |
| 32 | |
| 33 | /-- The residual branch closes whenever the local Taylor remainder has exponent |
| 34 | strictly larger than the source-to-target dimension ratio. -/ |
| 35 | theorem scalarCriticalImage_null_residual |
| 36 | {m : ℕ} {s : Set (EuclideanSpace ℝ (Fin m))} |
| 37 | {n : ℕ} {f : EuclideanSpace ℝ (Fin m) → EuclideanSpace ℝ (Fin n)} |
| 38 | [MeasurableSpace (EuclideanSpace ℝ (Fin m))] |
| 39 | [BorelSpace (EuclideanSpace ℝ (Fin m))] |
| 40 | [MeasurableSpace (EuclideanSpace ℝ (Fin n))] |
| 41 | [BorelSpace (EuclideanSpace ℝ (Fin n))] |
| 42 | (μ : Measure (EuclideanSpace ℝ (Fin n))) [μ.IsAddHaarMeasure] |
| 43 | {r : NNReal} (hr : 0 < r) |
| 44 | (hholder : |
| 45 | ∀ x ∈ s, ∃ C : NNReal, ∃ t ∈ nhdsWithin x s, |
| 46 | HolderOnWith C r f t) |
| 47 | (hdim : |
| 48 | (Module.finrank ℝ (EuclideanSpace ℝ (Fin m)) : ENNReal) / r < |
| 49 | Module.finrank ℝ (EuclideanSpace ℝ (Fin n))) : |
| 50 | μ (f '' s) = 0 := by |
| 51 | apply measure_zero_image_of_locallyHolderOnWith_of_finrank_div_lt |
| 52 | (μ := μ) hr hholder hdim |
| 53 | |
| 54 | /-- Three locally null branch images have a null union. This is the set-theoretic |
| 55 | assembly consumed after the coordinate, hypersurface, and residual producers |
| 56 | have been established. -/ |
| 57 | theorem scalarCriticalImage_null_of_three_branches |
| 58 | {α : Type*} [MeasurableSpace α] |
| 59 | (μ : Measure α) {A B C : Set α} |
| 60 | (hA : μ A = 0) (hB : μ B = 0) (hC : μ C = 0) : |
| 61 | μ (A ∪ B ∪ C) = 0 := by |
| 62 | exact measure_union_null (measure_union_null hA hB) hC |
| 63 | |
| 64 | end Poincare.Analysis |
| 65 |