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.Spacetime.Realization.Interval.Family |
| 2 | import Mathlib.Analysis.Calculus.MeanValue |
| 3 | |
| 4 | /-! |
| 5 | # Constancy from the actual normalized interval derivative |
| 6 | -/ |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open Set Function |
| 12 | open scoped Manifold ContDiff Topology |
| 13 | |
| 14 | open PoincareMT |
| 15 | |
| 16 | namespace Poincare.Spacetime.Realization |
| 17 | |
| 18 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 19 | |
| 20 | theorem interval_function_smoothOn (I : SpacetimeInterval) |
| 21 | {f : (smoothInterval I).Point → E} {g : ℝ → E} |
| 22 | (hf : ContMDiff (𝓡∂ 1) 𝓘(ℝ, E) ∞ f) |
| 23 | (hg : ∀ t : (smoothInterval I).Point, g t.val = f t) : |
| 24 | ContMDiffOn 𝓘(ℝ) 𝓘(ℝ, E) ∞ g I.domain := by |
| 25 | let := intervalChartedSpace I |
| 26 | have h := interval_family_smoothOn (J := 𝓘(ℝ)) I |
| 27 | (f := fun p : (smoothInterval I).Point × ℝ ↦ f p.1) |
| 28 | (g := fun p : ℝ × ℝ ↦ g p.1) (hf.comp contMDiff_fst) (fun t _ ↦ hg t) |
| 29 | exact h.comp (contMDiff_id.prodMk (contMDiff_const (c := (0 : ℝ)))).contMDiffOn |
| 30 | (fun _ ht ↦ ⟨ht, mem_univ _⟩) |
| 31 | |
| 32 | theorem interval_constant_of_derivative_zero (I : SpacetimeInterval) |
| 33 | {f : (smoothInterval I).Point → E} |
| 34 | (hf : ContMDiff (𝓡∂ 1) 𝓘(ℝ, E) ∞ f) |
| 35 | (hz : ∀ t, mfderiv (𝓡∂ 1) 𝓘(ℝ, E) f t |
| 36 | ((smoothInterval I).positiveTangent t) = 0) |
| 37 | (s t : (smoothInterval I).Point) : f s = f t := by |
| 38 | classical |
| 39 | let := intervalChartedSpace I |
| 40 | let g : ℝ → E := fun r ↦ if hr : r ∈ I.domain then f ⟨r, hr⟩ else 0 |
| 41 | have hg (r : (smoothInterval I).Point) : g r.val = f r := by |
| 42 | dsimp [g] |
| 43 | rw [dif_pos r.property] |
| 44 | have hgs := interval_function_smoothOn I hf hg |
| 45 | have hgz (r : ℝ) (hr : r ∈ I.domain) : fderivWithin ℝ g I.domain r = 0 := by |
| 46 | let q : (smoothInterval I).Point := ⟨r, hr⟩ |
| 47 | have hc := mfderivWithin_comp (I := 𝓡∂ 1) (I' := 𝓘(ℝ)) |
| 48 | (I'' := 𝓘(ℝ, E)) (s := univ) (u := I.domain) q |
| 49 | ((hgs r hr).mdifferentiableWithinAt (by simp)) |
| 50 | (((smoothInterval I).inclusion_smooth q).mdifferentiableAt (by simp)).mdifferentiableWithinAt |
| 51 | (fun p _ ↦ p.property) (uniqueMDiffWithinAt_univ (𝓡∂ 1)) |
| 52 | have he : g ∘ (Subtype.val : (smoothInterval I).Point → ℝ) = f := funext hg |
| 53 | simp only [mfderivWithin_univ, mfderivWithin_eq_fderivWithin] at hc |
| 54 | have h := congrArg (fun L ↦ L ((smoothInterval I).positiveTangent q)) hc |
| 55 | have hn : mfderiv (𝓡∂ 1) 𝓘(ℝ) |
| 56 | (Subtype.val : (smoothInterval I).Point → ℝ) q |
| 57 | ((smoothInterval I).positiveTangent q) = 1 := by |
| 58 | rw [← (smoothInterval I).inclusionDerivative_eq] |
| 59 | exact ((smoothInterval I).inclusionDerivative q).apply_symm_apply 1 |
| 60 | change mfderiv (𝓡∂ 1) 𝓘(ℝ, E) (g ∘ Subtype.val) q |
| 61 | ((smoothInterval I).positiveTangent q) = |
| 62 | fderivWithin ℝ g I.domain r (mfderiv (𝓡∂ 1) 𝓘(ℝ) |
| 63 | (Subtype.val : (smoothInterval I).Point → ℝ) q |
| 64 | ((smoothInterval I).positiveTangent q)) at h |
| 65 | rw [he, hn, hz q] at h |
| 66 | exact ContinuousLinearMap.ext_ring h.symm |
| 67 | rw [← hg s, ← hg t] |
| 68 | exact (interval_convex I).is_const_of_fderivWithin_eq_zero |
| 69 | (fun r hr ↦ ((hgs r hr).mdifferentiableWithinAt (by simp)).differentiableWithinAt) |
| 70 | hgz s.property t.property |
| 71 | |
| 72 | end Poincare.Spacetime.Realization |