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 Mathlib.Geometry.Manifold.Instances.Real |
| 3 | |
| 4 | /-! |
| 5 | # Scalar regular values on smooth manifolds |
| 6 | |
| 7 | A null set of critical values has dense complement. These lemmas select |
| 8 | regular values from that complement; scalar Sard supplies nullity separately. |
| 9 | -/ |
| 10 | |
| 11 | open MeasureTheory Set Function |
| 12 | open scoped ContDiff Manifold Topology |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | namespace Poincare.Manifold |
| 17 | |
| 18 | open Poincare.Analysis |
| 19 | |
| 20 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 21 | [FiniteDimensional ℝ E] {M : Type*} [TopologicalSpace M] |
| 22 | [ChartedSpace E M] [IsManifold 𝓘(ℝ, E) ∞ M] |
| 23 | [T2Space M] [SecondCountableTopology M] |
| 24 | |
| 25 | /-- A null critical-value image gives a dense set of regular scalar values on |
| 26 | the smooth manifold. -/ |
| 27 | theorem dense_regular_values_of_manifold_critical_image_null |
| 28 | {f : M → ℝ} (hf : ContMDiff 𝓘(ℝ, E) 𝓘(ℝ, ℝ) ∞ f) |
| 29 | (hcrit : volume (f '' {x | ¬ Function.Surjective |
| 30 | (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, ℝ) f x)}) = 0) : |
| 31 | Dense {c : ℝ | ∀ x, f x = c → Function.Surjective |
| 32 | (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, ℝ) f x)} := by |
| 33 | let C : Set ℝ := f '' {x | ¬ Function.Surjective |
| 34 | (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, ℝ) f x)} |
| 35 | have hC : Dense Cᶜ := dense_compl_of_measure_zero_image volume hcrit |
| 36 | have hregular : |
| 37 | {c : ℝ | ∀ x, f x = c → Function.Surjective |
| 38 | (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, ℝ) f x)} = Cᶜ := by |
| 39 | ext c |
| 40 | constructor |
| 41 | · intro hc ⟨x, hx, hfx⟩ |
| 42 | exact hx (hc x hfx) |
| 43 | · intro hc x hfx |
| 44 | by_contra hns |
| 45 | exact hc ⟨x, hns, hfx⟩ |
| 46 | rw [hregular] |
| 47 | exact hC |
| 48 | |
| 49 | /-- Every nonempty open interval contains a regular value once the scalar |
| 50 | critical-value image is null. -/ |
| 51 | theorem exists_regular_value_in_interval_of_manifold_critical_image_null |
| 52 | {f : M → ℝ} (hf : ContMDiff 𝓘(ℝ, E) 𝓘(ℝ, ℝ) ∞ f) |
| 53 | (hcrit : volume (f '' {x | ¬ Function.Surjective |
| 54 | (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, ℝ) f x)}) = 0) |
| 55 | {I : Set ℝ} (hI : IsOpen I) (hIn : I.Nonempty) : |
| 56 | ∃ c ∈ I, ∀ x, f x = c → Function.Surjective |
| 57 | (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, ℝ) f x) := by |
| 58 | rcases (dense_iff_inter_open.mp |
| 59 | (dense_regular_values_of_manifold_critical_image_null hf hcrit) I hI hIn) with |
| 60 | ⟨c, hcI, hc⟩ |
| 61 | exact ⟨c, hcI, hc⟩ |
| 62 | |
| 63 | /-- The positive cutoff interval used by the compact regular-domain consumer |
| 64 | has a regular scalar level under the same nullity hypothesis. -/ |
| 65 | theorem exists_regular_value_unit_interval_of_manifold_critical_image_null |
| 66 | {f : M → ℝ} (hf : ContMDiff 𝓘(ℝ, E) 𝓘(ℝ, ℝ) ∞ f) |
| 67 | (hcrit : volume (f '' {x | ¬ Function.Surjective |
| 68 | (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, ℝ) f x)}) = 0) : |
| 69 | ∃ c ∈ Set.Ioo (0 : ℝ) 1, ∀ x, f x = c → Function.Surjective |
| 70 | (mfderiv 𝓘(ℝ, E) 𝓘(ℝ, ℝ) f x) := by |
| 71 | exact exists_regular_value_in_interval_of_manifold_critical_image_null hf hcrit |
| 72 | isOpen_Ioo ⟨(1 / 2 : ℝ), by norm_num, by norm_num⟩ |
| 73 | |
| 74 | end Poincare.Manifold |
| 75 |