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.RicciFlow.Generalized.ReducedGeometry.Calculus.Differential.PullbackSectionSmooth |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Extension.ProductExtension |
| 3 | import Mathlib.Geometry.Manifold.PartitionOfUnity |
| 4 | |
| 5 | /-! |
| 6 | # Gluing horizontal extensions along a closed graph |
| 7 | |
| 8 | Morgan-Tian Lemmas 6.4 and 6.8, pp. 107-109. Apply smooth convex-section |
| 9 | gluing to the horizontal bundle pulled back to parameter times spacetime. |
| 10 | The closed graph prescribes the field, and outside it there is no constraint. |
| 11 | The global smooth section supplies one common spatial extension domain. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | noncomputable section |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M14 |
| 23 | |
| 24 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 25 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 26 | {γ : ℝ → G.Point} {J : Set ℝ} {Y : ∀ s, G.Horizontal (γ s)} |
| 27 | |
| 28 | -- The pulled-back horizontal fiber is the original fiber at the second projection. |
| 29 | set_option backward.isDefEq.respectTransparency false in |
| 30 | set_option maxHeartbeats 800000 in |
| 31 | -- Convex-section gluing unfolds the product pullback and its dependent fiber instances. |
| 32 | /-- Local extensions along a closed parameterized graph glue to an actual |
| 33 | extension on a common spatial domain, Lemmas 6.4 and 6.8, pp. 107-109. -/ |
| 34 | theorem exists_pullbackExtension_of_closed_local |
| 35 | (hJ : IsClosed J) (hγ : ContinuousOn γ J) |
| 36 | (hloc : ∀ s ∈ J, ∃ U : Set ℝ, IsOpen U ∧ s ∈ U ∧ |
| 37 | Nonempty (M14PullbackExtension G γ (J ∩ U) Y)) : |
| 38 | Nonempty (M14PullbackExtension G γ J Y) := by |
| 39 | classical |
| 40 | let : LocallyCompactSpace (EuclideanHalfSpace 1) := by |
| 41 | change LocallyCompactSpace {v : EuclideanSpace ℝ (Fin 1) // 0 ≤ v 0} |
| 42 | have hc : Continuous (fun v : EuclideanSpace ℝ (Fin 1) => v 0) := by |
| 43 | fun_prop |
| 44 | exact (isClosed_le continuous_const hc).locallyCompactSpace |
| 45 | let : LocallyCompactSpace |
| 46 | (ModelProd (EuclideanHalfSpace 1) (EuclideanSpace ℝ (Fin n))) := |
| 47 | inferInstanceAs (LocallyCompactSpace |
| 48 | (EuclideanHalfSpace 1 × EuclideanSpace ℝ (Fin n))) |
| 49 | let : LocallyCompactSpace G.Point := ChartedSpace.locallyCompactSpace |
| 50 | (ModelProd (EuclideanHalfSpace 1) (EuclideanSpace ℝ (Fin n))) G.Point |
| 51 | let f : ContMDiffMap ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 52 | (spacetimeModel n) (ℝ × G.Point) G.Point ∞ := |
| 53 | ⟨Prod.snd, contMDiff_snd⟩ |
| 54 | let : ∀ z, AddCommGroup (((f : ℝ × G.Point → G.Point) *ᵖ G.Horizontal) z) := |
| 55 | fun z => inferInstanceAs (AddCommGroup (G.Horizontal (f z))) |
| 56 | let A : Set (ℝ × G.Point) := {z | z.1 ∈ J ∧ γ z.1 = z.2} |
| 57 | have hA : IsClosed A := |
| 58 | (hJ.preimage continuous_fst).isClosed_eq |
| 59 | (hγ.comp continuous_fst.continuousOn (fun _ hz => hz)) |
| 60 | continuous_snd.continuousOn |
| 61 | let t (z : ℝ × G.Point) : Set (((f : ℝ × G.Point → G.Point) *ᵖ G.Horizontal) z) := |
| 62 | {v | ∀ h : γ z.1 = z.2, z.1 ∈ J → v = (h ▸ Y z.1 : G.Horizontal z.2)} |
| 63 | have ht (z : ℝ × G.Point) : Convex ℝ (t z) := by |
| 64 | intro v hv w hw a b _ _ hab h hzJ |
| 65 | rw [hv h hzJ, hw h hzJ, ← add_smul, hab, one_smul] |
| 66 | have hlocal (z : ℝ × G.Point) : ∃ U ∈ 𝓝 z, |
| 67 | ∃ v : ∀ w, ((f : ℝ × G.Point → G.Point) *ᵖ G.Horizontal) w, |
| 68 | ContMDiffOn ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 69 | (((𝓘(ℝ, ℝ)).prod (spacetimeModel n)).prod |
| 70 | 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 71 | (fun w => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) w (v w)) U ∧ |
| 72 | ∀ w ∈ U, v w ∈ t w := by |
| 73 | by_cases hz : z ∈ A |
| 74 | · rcases z with ⟨s, p⟩ |
| 75 | rcases hz with ⟨hsJ, hsp⟩ |
| 76 | change γ s = p at hsp |
| 77 | subst p |
| 78 | obtain ⟨U, hU, hsU, ⟨L⟩⟩ := hloc s hsJ |
| 79 | obtain ⟨D, hD, hgraph, hsm⟩ := L.joint_smooth |
| 80 | let N := (U ×ˢ Set.univ) ∩ D |
| 81 | have hN : N ∈ 𝓝 (s, γ s) := |
| 82 | ((hU.prod isOpen_univ).inter hD).mem_nhds |
| 83 | ⟨⟨hsU, Set.mem_univ _⟩, hgraph s ⟨hsJ, hsU⟩⟩ |
| 84 | refine ⟨N, hN, (fun w => L.extension w.1 w.2), ?_, ?_⟩ |
| 85 | · intro w hw |
| 86 | exact (Bundle.contMDiffWithinAt_pullback_section_iff f |
| 87 | (fun w => L.extension w.1 w.2) N w).mpr |
| 88 | ((hsm w hw.2).mono Set.inter_subset_right) |
| 89 | · intro w hw h hwJ |
| 90 | rcases w with ⟨r, q⟩ |
| 91 | change γ r = q at h |
| 92 | subst q |
| 93 | exact L.agrees r ⟨hwJ, hw.1.1⟩ |
| 94 | · refine ⟨Aᶜ, hA.isOpen_compl.mem_nhds hz, (fun _ => 0), |
| 95 | (Bundle.contMDiff_zeroSection ℝ _).contMDiffOn, ?_⟩ |
| 96 | intro w hw h hwJ |
| 97 | exact (hw ⟨hwJ, h⟩).elim |
| 98 | obtain ⟨V, hV⟩ := exists_contMDiffSection_forall_mem_convex_of_local |
| 99 | ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 100 | (F_fiber := EuclideanSpace ℝ (Fin n)) |
| 101 | ((f : ℝ × G.Point → G.Point) *ᵖ G.Horizontal) t ht hlocal |
| 102 | have hs : ContMDiff ((𝓘(ℝ, ℝ)).prod (spacetimeModel n)) |
| 103 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 104 | (fun z : ℝ × G.Point => Bundle.TotalSpace.mk' |
| 105 | (EuclideanSpace ℝ (Fin n)) (E := G.Horizontal) z.2 (V z)) := by |
| 106 | intro z |
| 107 | apply contMDiffWithinAt_univ.mp |
| 108 | exact (Bundle.contMDiffWithinAt_pullback_section_iff f V Set.univ z).mp |
| 109 | (V.contMDiff z).contMDiffWithinAt |
| 110 | refine ⟨pullbackExtensionOfGlobalSmooth (fun s p => V (s, p)) hs ?_⟩ |
| 111 | intro s hsJ |
| 112 | exact hV (s, γ s) rfl hsJ |
| 113 | |
| 114 | end PoincareMT.M14 |