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 Mathlib.Geometry.Manifold.IntegralCurve.ExistUnique |
| 2 | import Mathlib.Geometry.Manifold.ContMDiffMFDeriv |
| 3 | import Mathlib.Geometry.Manifold.Instances.Real |
| 4 | /-! |
| 5 | # Uniqueness for time-dependent manifold integral curves |
| 6 | |
| 7 | Suspending the field to spacetime gives local uniqueness; connectedness |
| 8 | extends equality over the whole common open time domain. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | open Set Filter Bundle |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | namespace Poincare.Manifold |
| 17 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 18 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 19 | /-- Local solutions of a jointly C1 time-dependent field with the same |
| 20 | initial value agree on a neighborhood of the initial time. -/ |
| 21 | theorem timeDependent_integralCurve_eventuallyEq |
| 22 | {X : ℝ → (x : M) → TangentSpace (𝓡 n) x} |
| 23 | {γ η : ℝ → M} {s : ℝ} |
| 24 | (hX : ContMDiffAt (𝓘(ℝ, ℝ).prod (𝓡 n)) ((𝓡 n).prod (𝓡 n)) 1 |
| 25 | (fun tx : ℝ × M => (⟨tx.2, X tx.1 tx.2⟩ : TangentBundle (𝓡 n) M)) |
| 26 | (s, γ s)) |
| 27 | (hγ : ∀ᶠ t in 𝓝 s, HasMFDerivAt 𝓘(ℝ, ℝ) (𝓡 n) γ t |
| 28 | ((1 : ℝ →L[ℝ] ℝ).smulRight (X t (γ t)))) |
| 29 | (hη : ∀ᶠ t in 𝓝 s, HasMFDerivAt 𝓘(ℝ, ℝ) (𝓡 n) η t |
| 30 | ((1 : ℝ →L[ℝ] ℝ).smulRight (X t (η t)))) |
| 31 | (he : γ s = η s) : γ =ᶠ[𝓝 s] η := by |
| 32 | let Y : (z : ℝ × M) → TangentSpace (𝓘(ℝ, ℝ).prod (𝓡 n)) z := |
| 33 | fun z => (1, X z.1 z.2) |
| 34 | have hY : ContMDiffAt (𝓘(ℝ, ℝ).prod (𝓡 n)) |
| 35 | (𝓘(ℝ, ℝ).prod (𝓡 n)).tangent 1 |
| 36 | (fun z => (⟨z, Y z⟩ : TangentBundle (𝓘(ℝ, ℝ).prod (𝓡 n)) (ℝ × M))) |
| 37 | (s, γ s) := by |
| 38 | have htime : ContMDiffAt (𝓘(ℝ, ℝ).prod (𝓡 n)) (𝓘(ℝ, ℝ).tangent) 1 |
| 39 | (fun z : ℝ × M => (⟨z.1, (1 : ℝ)⟩ : TangentBundle 𝓘(ℝ, ℝ) ℝ)) |
| 40 | (s, γ s) := by |
| 41 | exact ((contMDiffAt_vectorSpace_iff_contDiffAt).mpr |
| 42 | (contDiffAt_const (c := (1 : ℝ)))).comp (s, γ s) contMDiffAt_fst |
| 43 | exact (contMDiff_equivTangentBundleProd_symm |
| 44 | (I := 𝓘(ℝ, ℝ)) (M := ℝ) (I' := 𝓡 n) (M' := M)).contMDiffAt.comp (s, γ s) |
| 45 | (htime.prodMk hX) |
| 46 | have hcurve {f : ℝ → M} |
| 47 | (hf : ∀ᶠ t in 𝓝 s, HasMFDerivAt 𝓘(ℝ, ℝ) (𝓡 n) f t |
| 48 | ((1 : ℝ →L[ℝ] ℝ).smulRight (X t (f t)))) : |
| 49 | IsMIntegralCurveAt (I := 𝓘(ℝ, ℝ).prod (𝓡 n)) (fun t => (t, f t)) Y s := by |
| 50 | filter_upwards [hf] with t ht |
| 51 | have h := (hasMFDerivAt_id (I := 𝓘(ℝ, ℝ)) t).prodMk ht |
| 52 | convert! h using 1 |
| 53 | apply ContinuousLinearMap.ext |
| 54 | intro r |
| 55 | change (r * 1, r • X t (f t)) = (r, r • X t (f t)) |
| 56 | rw [mul_one] |
| 57 | have h := isMIntegralCurveAt_eventuallyEq_of_contMDiffAt_boundaryless |
| 58 | hY (hcurve hγ) (hcurve hη) (Prod.ext rfl he) |
| 59 | exact h.mono (fun t ht => congrArg Prod.snd ht) |
| 60 | |
| 61 | /-- Solutions of a jointly C1 time-dependent field agree on a connected open |
| 62 | time domain if they have the same value at one time. -/ |
| 63 | theorem timeDependent_integralCurve_eqOn [T2Space M] |
| 64 | {I : Set ℝ} (hI : IsOpen I) (hcI : IsPreconnected I) |
| 65 | {X : ℝ → (x : M) → TangentSpace (𝓡 n) x} |
| 66 | (hX : ContMDiffOn (𝓘(ℝ, ℝ).prod (𝓡 n)) ((𝓡 n).prod (𝓡 n)) 1 |
| 67 | (fun tx : ℝ × M => (⟨tx.2, X tx.1 tx.2⟩ : TangentBundle (𝓡 n) M)) |
| 68 | (I ×ˢ univ)) |
| 69 | {γ η : ℝ → M} |
| 70 | (hγ : ∀ t ∈ I, HasMFDerivAt 𝓘(ℝ, ℝ) (𝓡 n) γ t |
| 71 | ((1 : ℝ →L[ℝ] ℝ).smulRight (X t (γ t)))) |
| 72 | (hη : ∀ t ∈ I, HasMFDerivAt 𝓘(ℝ, ℝ) (𝓡 n) η t |
| 73 | ((1 : ℝ →L[ℝ] ℝ).smulRight (X t (η t)))) |
| 74 | {s : ℝ} (hs : s ∈ I) (he : γ s = η s) : EqOn γ η I := by |
| 75 | let S := {t | γ t = η t} ∩ I |
| 76 | suffices hsub : I ⊆ S from fun t ht => (hsub ht).1 |
| 77 | apply hcI.subset_of_closure_inter_subset (s := I) (u := S) _ |
| 78 | ⟨s, ⟨hs, he, hs⟩⟩ |
| 79 | · dsimp only [S] |
| 80 | rw [inter_comm, ← Subtype.image_preimage_val, inter_comm, ← Subtype.image_preimage_val, |
| 81 | image_subset_image_iff Subtype.val_injective, preimage_ofPred_eq] |
| 82 | intro t ht |
| 83 | rw [mem_preimage, ← closure_subtype] at ht |
| 84 | revert ht t |
| 85 | apply IsClosed.closure_subset (isClosed_eq _ _) |
| 86 | · rw [continuous_iff_continuousAt] |
| 87 | rintro ⟨t, ht⟩ |
| 88 | exact (hγ t ht).continuousAt.comp continuousAt_subtype_val |
| 89 | · rw [continuous_iff_continuousAt] |
| 90 | rintro ⟨t, ht⟩ |
| 91 | exact (hη t ht).continuousAt.comp continuousAt_subtype_val |
| 92 | · rw [isOpen_iff_mem_nhds] |
| 93 | intro t ht |
| 94 | have heq : γ =ᶠ[𝓝 t] η := timeDependent_integralCurve_eventuallyEq |
| 95 | (hX.contMDiffAt ((hI.prod isOpen_univ).mem_nhds ⟨ht.2, mem_univ _⟩)) |
| 96 | (Filter.Eventually.mono (hI.mem_nhds ht.2) (fun r hr => hγ r hr)) |
| 97 | (Filter.Eventually.mono (hI.mem_nhds ht.2) (fun r hr => hη r hr)) ht.1 |
| 98 | exact heq.and (hI.mem_nhds ht.2) |
| 99 | |
| 100 | end Poincare.Manifold |