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.Manifold.OpenSubsetShift |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Extension.CompactPerturbation |
| 3 | |
| 4 | /-! |
| 5 | # Supported gauge perturbations of actual C1 paths |
| 6 | |
| 7 | Morgan-Tian Lemma 6.4, pp. 107-108. Compact spatial perturbations |
| 8 | preserve the actual clock and retain precisely the original path's |
| 9 | interior C1 and closed-interval continuity requirements. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | -- The cylinder's product charts use the supplied spacetime model. |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 25 | {T τ₁ τ₂ : ℝ} {x y : G.Point} (p : M14BackwardPath G T τ₁ τ₂ x y) |
| 26 | (b : G.gaugeCover.index) |
| 27 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 28 | G.gaugeCover.spatial b) (η : ℝ → EuclideanSpace ℝ (Fin n)) |
| 29 | |
| 30 | /-- The unpatched spatial perturbation in an actual compatible gauge, |
| 31 | Lemma 6.4, pp. 107-108. -/ |
| 32 | noncomputable def backwardGaugeFamily (v t : ℝ) : G.Point := |
| 33 | (G.gaugeCover.cylinder b).toSpacetime ((lift (p.curve t)).1, |
| 34 | (G.gaugeCover.spatial b).affineShift (lift (p.curve t)).2 (v • η t)) |
| 35 | |
| 36 | /-- The gauge perturbation confined to the closed test-field support, |
| 37 | Lemma 6.4, pp. 107-108. -/ |
| 38 | noncomputable def supportedBackwardGaugeFamily (v t : ℝ) : G.Point := by |
| 39 | classical |
| 40 | exact if t ∈ tsupport η then backwardGaugeFamily p b lift η v t else p.curve t |
| 41 | |
| 42 | /-- The perturbed curve agrees with the path off the test support, |
| 43 | the endpoint-preserving construction of Lemma 6.4, pp. 107-108. -/ |
| 44 | theorem supportedBackwardGaugeFamily_eq_of_not_tsupport {t : ℝ} (ht : t ∉ tsupport η) |
| 45 | (v : ℝ) : supportedBackwardGaugeFamily p b lift η v t = p.curve t := by |
| 46 | simp only [supportedBackwardGaugeFamily, if_neg ht] |
| 47 | |
| 48 | /-- An actual inverse lift identifies the patched and unpatched |
| 49 | expressions, including zero test vectors, Lemma 6.4, pp. 107-108. -/ |
| 50 | theorem supportedBackwardGaugeFamily_eq_gauge {t : ℝ} |
| 51 | (ht : (G.gaugeCover.cylinder b).toSpacetime (lift (p.curve t)) = p.curve t) (v : ℝ) : |
| 52 | supportedBackwardGaugeFamily p b lift η v t = backwardGaugeFamily p b lift η v t := by |
| 53 | by_cases hs : t ∈ tsupport η |
| 54 | · simp only [supportedBackwardGaugeFamily, if_pos hs] |
| 55 | · rw [supportedBackwardGaugeFamily_eq_of_not_tsupport p b lift η hs] |
| 56 | simp only [backwardGaugeFamily, image_eq_zero_of_notMem_tsupport hs, smul_zero, |
| 57 | TopologicalSpace.Opens.affineShift_zero, Prod.mk.eta] |
| 58 | exact ht.symm |
| 59 | |
| 60 | /-- The zero perturbation equals the original curve at every parameter, |
| 61 | Lemma 6.4, pp. 107-108. -/ |
| 62 | theorem supportedBackwardGaugeFamily_at_zero |
| 63 | (hsrc : ∀ t ∈ tsupport η, |
| 64 | (G.gaugeCover.cylinder b).toSpacetime (lift (p.curve t)) = p.curve t) (t : ℝ) : |
| 65 | supportedBackwardGaugeFamily p b lift η 0 t = p.curve t := by |
| 66 | by_cases hs : t ∈ tsupport η |
| 67 | · rw [supportedBackwardGaugeFamily_eq_gauge p b lift η (hsrc t hs)] |
| 68 | simp only [backwardGaugeFamily, zero_smul, TopologicalSpace.Opens.affineShift_zero, |
| 69 | Prod.mk.eta, hsrc t hs] |
| 70 | · exact supportedBackwardGaugeFamily_eq_of_not_tsupport p b lift η hs 0 |
| 71 | |
| 72 | /-- A supported spatial perturbation preserves the actual backward |
| 73 | clock throughout the closed interval, Lemma 6.4, pp. 107-108. -/ |
| 74 | theorem supportedBackwardGaugeFamily_time |
| 75 | (hclock : ∀ t ∈ tsupport η, (lift (p.curve t)).1.val = |
| 76 | G.spacetime.timeFunction (p.curve t)) {t : ℝ} (ht : t ∈ Icc τ₁ τ₂) (v : ℝ) : |
| 77 | G.spacetime.timeFunction (supportedBackwardGaugeFamily p b lift η v t) = T - t := by |
| 78 | by_cases hs : t ∈ tsupport η |
| 79 | · simp only [supportedBackwardGaugeFamily, if_pos hs, backwardGaugeFamily, |
| 80 | (G.gaugeCover.cylinder b).time_eq, hclock t hs, p.curve_time t ht] |
| 81 | · rw [supportedBackwardGaugeFamily_eq_of_not_tsupport p b lift η hs, |
| 82 | p.curve_time t ht] |
| 83 | |
| 84 | /-- The unpatched curve is C1 at every admissible interior gauge point, |
| 85 | the local chain rule in Lemma 6.4, pp. 107-108. -/ |
| 86 | theorem backwardGaugeFamily_contMDiffAt {U : Set G.Point} (hU : IsOpen U) |
| 87 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 88 | (hη : ContDiff ℝ ∞ η) {t v : ℝ} (ht : t ∈ Ioo τ₁ τ₂) (hsrc : p.curve t ∈ U) |
| 89 | (hshift : (lift (p.curve t)).2.val + v • η t ∈ G.gaugeCover.spatial b) : |
| 90 | ContMDiffAt (𝓘(ℝ, ℝ)) (spacetimeModel n) 1 (backwardGaugeFamily p b lift η v) t := by |
| 91 | have hp := (p.curve_regular t ht).contMDiffAt (isOpen_Ioo.mem_nhds ht) |
| 92 | have hL := (((hlift _ hsrc).contMDiffAt (hU.mem_nhds hsrc)).of_le (by simp)).comp t hp |
| 93 | have hηC1 : ContDiff ℝ 1 η := hη.of_le (by simp) |
| 94 | have hη1 : ContMDiffAt (𝓘(ℝ, ℝ)) (𝓡 n) 1 (fun s => v • η s) t := |
| 95 | ((contDiff_const (c := v)).smul hηC1).contMDiff.contMDiffAt |
| 96 | have hS := ((((G.gaugeCover.spatial b).affineShift_contMDiffOn _ hshift).contMDiffAt |
| 97 | ((G.gaugeCover.spatial b).affineShift_domain_isOpen.mem_nhds hshift)).of_le |
| 98 | (by simp)).comp t (hL.snd.prodMk hη1) |
| 99 | exact ((G.gaugeCover.cylinder b).smooth.of_le (by simp)).contMDiffAt.comp t |
| 100 | (hL.fst.prodMk hS) |
| 101 | |
| 102 | /-- The patched curve is C1 on the original open interval whenever all |
| 103 | supported shifts are admissible, Lemma 6.4, pp. 107-108. -/ |
| 104 | theorem supportedBackwardGaugeFamily_contMDiffOn {U : Set G.Point} (hU : IsOpen U) |
| 105 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 106 | (hright : ∀ q ∈ U, (G.gaugeCover.cylinder b).toSpacetime (lift q) = q) |
| 107 | (hη : ContDiff ℝ ∞ η) (hsrc : ∀ t ∈ tsupport η, p.curve t ∈ U) {v : ℝ} |
| 108 | (hshift : ∀ t ∈ tsupport η, |
| 109 | (lift (p.curve t)).2.val + v • η t ∈ G.gaugeCover.spatial b) : |
| 110 | ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) 1 |
| 111 | (supportedBackwardGaugeFamily p b lift η v) (Ioo τ₁ τ₂) := by |
| 112 | intro t ht |
| 113 | by_cases hs : t ∈ tsupport η |
| 114 | · have hp := (p.curve_regular t ht).contMDiffAt (isOpen_Ioo.mem_nhds ht) |
| 115 | have heq : supportedBackwardGaugeFamily p b lift η v =ᶠ[𝓝 t] |
| 116 | backwardGaugeFamily p b lift η v := by |
| 117 | filter_upwards [hp.continuousAt.preimage_mem_nhds (hU.mem_nhds (hsrc t hs))] |
| 118 | with s hsp |
| 119 | exact supportedBackwardGaugeFamily_eq_gauge p b lift η (hright _ hsp) v |
| 120 | exact ((backwardGaugeFamily_contMDiffAt p b lift η hU hlift hη ht (hsrc t hs) |
| 121 | (hshift t hs)).congr_of_eventuallyEq heq).contMDiffWithinAt |
| 122 | · have heq : supportedBackwardGaugeFamily p b lift η v =ᶠ[𝓝 t] p.curve := by |
| 123 | filter_upwards [(isClosed_tsupport η).isOpen_compl.mem_nhds hs] with s hsp |
| 124 | exact supportedBackwardGaugeFamily_eq_of_not_tsupport p b lift η hsp v |
| 125 | exact (p.curve_regular t ht).congr_of_eventuallyEq |
| 126 | (heq.filter_mono nhdsWithin_le_nhds) heq.eq_of_nhds |
| 127 | |
| 128 | /-- Compactly supported interior perturbations retain continuity on |
| 129 | the whole original closed interval, Lemma 6.4, pp. 107-108. -/ |
| 130 | theorem supportedBackwardGaugeFamily_continuousOn {U : Set G.Point} (hU : IsOpen U) |
| 131 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 132 | (hright : ∀ q ∈ U, (G.gaugeCover.cylinder b).toSpacetime (lift q) = q) |
| 133 | (hη : ContDiff ℝ ∞ η) (hsupport : tsupport η ⊆ Ioo τ₁ τ₂) |
| 134 | (hsrc : ∀ t ∈ tsupport η, p.curve t ∈ U) {v : ℝ} |
| 135 | (hshift : ∀ t ∈ tsupport η, |
| 136 | (lift (p.curve t)).2.val + v • η t ∈ G.gaugeCover.spatial b) : |
| 137 | ContinuousOn (supportedBackwardGaugeFamily p b lift η v) (Icc τ₁ τ₂) := by |
| 138 | intro t ht |
| 139 | by_cases hs : t ∈ tsupport η |
| 140 | · exact (((supportedBackwardGaugeFamily_contMDiffOn p b lift η hU hlift hright hη |
| 141 | hsrc hshift) t (hsupport hs)).contMDiffAt |
| 142 | (isOpen_Ioo.mem_nhds (hsupport hs))).continuousAt.continuousWithinAt |
| 143 | · have heq : supportedBackwardGaugeFamily p b lift η v =ᶠ[𝓝 t] p.curve := by |
| 144 | filter_upwards [(isClosed_tsupport η).isOpen_compl.mem_nhds hs] with s hsp |
| 145 | exact supportedBackwardGaugeFamily_eq_of_not_tsupport p b lift η hsp v |
| 146 | exact (p.curve_continuous t ht).congr_of_eventuallyEq |
| 147 | (heq.filter_mono nhdsWithin_le_nhds) heq.eq_of_nhds |
| 148 | |
| 149 | end PoincareMT.M14 |