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.Exponential.Domain.JointDomain |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareClockWindows |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Coordinates.GaugeLift |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.ODE.Families.ClosedFamilyNeighborhood |
| 5 | |
| 6 | /-! |
| 7 | # Closed gauge tubes in the joint stable domain |
| 8 | |
| 9 | The frozen relative-interior witness is a relative neighborhood in |
| 10 | the joint domain. The actual clock and joint continuity then give a |
| 11 | convex spatial neighborhood times a closed time interval in one |
| 12 | actual gauge inverse, including a physical endpoint. Morgan-Tian |
| 13 | Proposition 6.28, p. 117; see the derivation |
| 14 | tasks/M14/derivations/2026-09-21-relative-inverse.md. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set Filter Metric |
| 20 | open scoped Manifold ContDiff Topology Bundle |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M14 |
| 25 | |
| 26 | /-- A relative-interior point has a relative neighborhood contained |
| 27 | in the same relative interior, as used for the joint stable domain |
| 28 | in Proposition 6.28, p. 117. -/ |
| 29 | theorem relativeInterior_mem_nhdsWithin {Y : Type*} [TopologicalSpace Y] |
| 30 | {A S : Set Y} {z : Y} (hz : z ∈ M14RelativeInterior A S) : |
| 31 | M14RelativeInterior A S ∈ 𝓝[A] z := by |
| 32 | obtain ⟨_, U, hU, hzU, hsub⟩ := hz |
| 33 | apply mem_nhdsWithin.mpr |
| 34 | refine ⟨U, hU, hzU, ?_⟩ |
| 35 | intro w hw |
| 36 | exact ⟨hsub hw, U, hU, hw.1, hsub⟩ |
| 37 | |
| 38 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 39 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 40 | {T : ℝ} {x : G.Point} |
| 41 | |
| 42 | /-- Every joint-domain point has strictly positive square time, |
| 43 | Definition 6.25 and Proposition 6.28, pp. 116-117. -/ |
| 44 | theorem jointDomain_time_pos (E : M14ExponentialFamily G T x) |
| 45 | {z : G.Horizontal x × ℝ} (hz : z ∈ M14JointDomain G E) : 0 < z.2 := by |
| 46 | obtain ⟨τ, _, hτ, _, ht⟩ := hz.1 |
| 47 | rw [ht] |
| 48 | exact Real.sqrt_pos.mpr hτ |
| 49 | |
| 50 | /-- Every point of the joint domain has a convex spatial, closed-time |
| 51 | tube inside that domain and inside one actual smooth gauge inverse. |
| 52 | The tube is a neighborhood relative to physical admissibility, even |
| 53 | at a physical endpoint, Proposition 6.28, p. 117. -/ |
| 54 | theorem exists_jointDomain_gauge_tube (E : M14ExponentialFamily G T x) |
| 55 | {Z : G.Horizontal x} {s : ℝ} (hz : (Z, s) ∈ M14JointDomain G E) : |
| 56 | ∃ (b : G.gaugeCover.index) (N : Set G.Point) |
| 57 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 58 | G.gaugeCover.spatial b), |
| 59 | IsOpen N ∧ E.gamma Z s ∈ N ∧ |
| 60 | ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift N ∧ |
| 61 | (∀ q ∈ N, (G.gaugeCover.cylinder b).toSpacetime (lift q) = q) ∧ |
| 62 | (∀ q ∈ N, (lift q).1.val = G.spacetime.timeFunction q) ∧ |
| 63 | ∃ V : Set (G.Horizontal x), IsOpen V ∧ Convex ℝ V ∧ Z ∈ V ∧ |
| 64 | ∃ a c : ℝ, 0 < a ∧ a < s ∧ s ≤ c ∧ |
| 65 | V ×ˢ Icc a c ⊆ M14JointDomain G E ∧ |
| 66 | (∀ z ∈ V ×ˢ Icc a c, E.gamma z.1 z.2 ∈ N) ∧ |
| 67 | V ×ˢ Icc a c ∈ 𝓝[M14AdmissibleParameter G T x] (Z, s) := by |
| 68 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 69 | let : NormedAddCommGroup (G.Horizontal x) := |
| 70 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 71 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 72 | let : InnerProductSpace ℝ (G.Horizontal x) := |
| 73 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 74 | have hs : 0 < s := jointDomain_time_pos E hz |
| 75 | have hsurv := jointDomain_subset_domain E hz |
| 76 | have hAdm := E.domain_admissible hsurv |
| 77 | have hT : T ∈ I.domain := by |
| 78 | rw [← G.spacetime.time_range] |
| 79 | exact ⟨x, E.base_time⟩ |
| 80 | obtain ⟨d, hsd, hclock, hnear⟩ := exists_squareClock_prefix_neighborhood hT hs hAdm.2 |
| 81 | let A := M14AdmissibleParameter G T x |
| 82 | let B := (univ : Set (G.Horizontal x)) ×ˢ Icc 0 d |
| 83 | have hBA : B ⊆ A := fun z hz => ⟨hz.2.1, hclock z.2 hz.2⟩ |
| 84 | have hJn : M14JointDomain G E ∈ 𝓝[A] (Z, s) := relativeInterior_mem_nhdsWithin hz |
| 85 | have hDn : E.domain ∈ 𝓝[A] (Z, s) := mem_of_superset hJn (jointDomain_subset_domain E) |
| 86 | obtain ⟨b, N, lift, hN, hpN, hlift, hrec, htime⟩ := exists_smooth_gauge_lift G (E.gamma Z s) |
| 87 | have hpre : {z : G.Horizontal x × ℝ | E.gamma z.1 z.2 ∈ N} ∈ 𝓝[A] (Z, s) := |
| 88 | nhdsWithin_le_of_mem hDn |
| 89 | ((E.joint_continuous (Z, s) hsurv).preimage_mem_nhdsWithin (hN.mem_nhds hpN)) |
| 90 | have hsmall : M14JointDomain G E ∩ {z | E.gamma z.1 z.2 ∈ N} ∈ 𝓝[B] (Z, s) := |
| 91 | nhdsWithin_mono (Z, s) hBA (inter_mem hJn hpre) |
| 92 | obtain ⟨U, hU, hZU, _, a, c, ha, has, hsc, _, hsub, hCn⟩ := |
| 93 | exists_open_closed_family_neighborhood isOpen_univ (mem_univ Z) hs hsd hsmall |
| 94 | obtain ⟨ε, hε, hεU⟩ := Metric.mem_nhds_iff.mp (hU.mem_nhds hZU) |
| 95 | let V := ball Z ε |
| 96 | have hVU : V ⊆ U := hεU |
| 97 | have hVZ : Z ∈ V := mem_ball_self hε |
| 98 | refine ⟨b, N, lift, hN, hpN, hlift, hrec, htime, V, isOpen_ball, convex_ball Z ε, |
| 99 | hVZ, a, c, ha, has, hsc, ?_, ?_, ?_⟩ |
| 100 | · exact fun z hz => (hsub ⟨hVU hz.1, hz.2⟩).1 |
| 101 | · exact fun z hz => (hsub ⟨hVU hz.1, hz.2⟩).2 |
| 102 | · have hprod : A = (univ : Set (G.Horizontal x)) ×ˢ |
| 103 | {r | 0 ≤ r ∧ T - r ^ 2 ∈ I.domain} := by |
| 104 | ext z |
| 105 | simp only [A, M14AdmissibleParameter, mem_ofPred_eq, mem_prod, mem_univ, true_and] |
| 106 | change V ×ˢ Icc a c ∈ 𝓝[A] (Z, s) |
| 107 | rw [hprod, nhdsWithin_prod_eq, nhdsWithin_univ] |
| 108 | exact prod_mem_prod (isOpen_ball.mem_nhds hVZ) (nhdsWithin_le_of_mem hnear hCn) |
| 109 | |
| 110 | end PoincareMT.M14 |