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.Induction |
| 2 | import PoincareLib.Geometry.Manifold.Sard.ChartReduction |
| 3 | |
| 4 | /-! |
| 5 | # Scalar Sard theorem |
| 6 | |
| 7 | A smooth real-valued function on a finite-dimensional second-countable smooth |
| 8 | manifold has a null set of critical values. This is the scalar specialization |
| 9 | of Lee, Theorem 6.10, printed pp. 129-131. |
| 10 | -/ |
| 11 | |
| 12 | open MeasureTheory Set Function |
| 13 | open scoped ContDiff Manifold Topology |
| 14 | |
| 15 | namespace Poincare.Manifold |
| 16 | |
| 17 | open Poincare.Analysis |
| 18 | |
| 19 | /-- The critical values of a smooth scalar function on a manifold are null. -/ |
| 20 | theorem scalarCriticalImage_null_manifold |
| 21 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 22 | [FiniteDimensional ℝ E] {M : Type*} [TopologicalSpace M] |
| 23 | [ChartedSpace E M] [IsManifold 𝓘(ℝ, E) ∞ M] |
| 24 | [T2Space M] [SecondCountableTopology M] |
| 25 | {f : M → ℝ} (hf : ContMDiff 𝓘(ℝ, E) 𝓘(ℝ, ℝ) ∞ f) : |
| 26 | volume (f '' {x | ¬ Function.Surjective |
| 27 | (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, ℝ) f x)}) = 0 := by |
| 28 | apply manifold_criticalImage_null_of_euclidean ?_ hf |
| 29 | intro V g hV hg |
| 30 | apply measure_mono_null _ (scalarCriticalImage_null_on hV hg) |
| 31 | rintro y ⟨x, ⟨hx, hcrit⟩, rfl⟩ |
| 32 | refine ⟨x, ⟨hx, ?_⟩, rfl⟩ |
| 33 | by_contra hn |
| 34 | apply hcrit |
| 35 | apply LinearMap.surjective (f := (fderiv ℝ g x).toLinearMap) |
| 36 | intro hz |
| 37 | apply hn |
| 38 | ext v |
| 39 | exact congrArg (fun L => L v) hz |
| 40 | |
| 41 | /-- Every nonempty open interval contains a regular value of a smooth scalar |
| 42 | function on a finite-dimensional second-countable manifold. -/ |
| 43 | theorem exists_regular_value_in_interval_of_smooth |
| 44 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 45 | [FiniteDimensional ℝ E] {M : Type*} [TopologicalSpace M] |
| 46 | [ChartedSpace E M] [IsManifold 𝓘(ℝ, E) ∞ M] |
| 47 | [T2Space M] [SecondCountableTopology M] |
| 48 | {f : M → ℝ} (hf : ContMDiff 𝓘(ℝ, E) 𝓘(ℝ, ℝ) ∞ f) |
| 49 | {I : Set ℝ} (hI : IsOpen I) (hIn : I.Nonempty) : |
| 50 | ∃ c ∈ I, ∀ x, f x = c → Function.Surjective |
| 51 | (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, ℝ) f x) := by |
| 52 | exact exists_regular_value_in_interval_of_manifold_critical_image_null hf |
| 53 | (scalarCriticalImage_null_manifold hf) hI hIn |
| 54 | |
| 55 | end Poincare.Manifold |
| 56 |