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.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Extension.SupportedAffineFamily |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Extension.LocalTestVariation |
| 4 | |
| 5 | /-! |
| 6 | # Actual admissible supported affine variations |
| 7 | |
| 8 | Morgan-Tian Proposition 6.13 and Corollary 6.16, pp. 110-112. |
| 9 | M08's compact tube lemma gives a common parameter radius on which |
| 10 | the supplied family remains in the gauge inverse domain and its |
| 11 | affine spatial shift stays admissible. The actual square-family |
| 12 | constructor preserves the clock, action integrability and endpoints. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff 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 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 27 | {R : M14SquareRootPath G p} (V : M14LVariationData G p R) (b : G.gaugeCover.index) |
| 28 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 29 | G.gaugeCover.spatial b) (η : ℝ → EuclideanSpace ℝ (Fin n)) (c : ℝ) |
| 30 | |
| 31 | /-- Compact time support gives one positive radius for the old |
| 32 | family's gauge membership and all affine shifts, Proposition 6.13 |
| 33 | and Corollary 6.16, pp. 110-112. The radius may depend on c. -/ |
| 34 | theorem exists_supportedAffineGauge_radius {U : Set G.Point} (hU : IsOpen U) |
| 35 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 36 | (hη : ContDiff ℝ ∞ η) |
| 37 | (hsupport : tsupport η ⊆ Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) |
| 38 | (hsrc : ∀ s ∈ tsupport η, R.curve s ∈ U) : |
| 39 | ∃ r : ℝ, 0 < r ∧ r ≤ V.radius ∧ ∀ s ∈ tsupport η, ∀ v ∈ Ioo (-r) r, |
| 40 | V.squareFamily s v ∈ U ∧ |
| 41 | (lift (V.squareFamily s v)).2.val + (c * v) • η s ∈ G.gaugeCover.spatial b := by |
| 42 | let α : ℝ × ℝ → G.Point := fun z => V.squareFamily z.1 z.2 |
| 43 | let A := Ioo (Real.sqrt τ₁) (Real.sqrt τ₂) ×ˢ V.parameterDomain |
| 44 | have hP : IsOpen V.parameterDomain := V.parameterDomain_eq ▸ isOpen_Ioo |
| 45 | have hA : IsOpen A := isOpen_Ioo.prod hP |
| 46 | have hα : ContinuousOn α A := V.square_smooth.continuousOn.mono |
| 47 | (fun _ hz => V.square_contains ⟨Ioo_subset_Icc_self hz.1, hz.2⟩) |
| 48 | let J := A ∩ α ⁻¹' U |
| 49 | have hJ : IsOpen J := hα.isOpen_inter_preimage hA hU |
| 50 | have hL : ContinuousOn (lift ∘ α) J := |
| 51 | hlift.continuousOn.comp (hα.mono inter_subset_left) (fun _ hz => hz.2) |
| 52 | let shift := fun z : ℝ × ℝ => (lift (α z)).2.val + (c * z.2) • η z.1 |
| 53 | have hshift : ContinuousOn shift J := |
| 54 | (continuous_subtype_val.comp_continuousOn hL.snd).add |
| 55 | ((continuousOn_const.mul continuousOn_snd).smul |
| 56 | (hη.continuous.comp continuous_fst).continuousOn) |
| 57 | let Ω := J ∩ shift ⁻¹' (G.gaugeCover.spatial b : Set (EuclideanSpace ℝ (Fin n))) |
| 58 | have hΩ : IsOpen Ω := hshift.isOpen_inter_preimage hJ (G.gaugeCover.spatial b).isOpen |
| 59 | have hK : IsCompact (tsupport η) := isCompact_Icc.of_isClosed_subset |
| 60 | (isClosed_tsupport η) (hsupport.trans Ioo_subset_Icc_self) |
| 61 | have hzero : (0 : ℝ) ∈ V.parameterDomain := by |
| 62 | rw [V.parameterDomain_eq] |
| 63 | exact ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩ |
| 64 | have hKzero : tsupport η ×ˢ {(0 : ℝ)} ⊆ Ω := by |
| 65 | rintro ⟨s, v⟩ ⟨hs, hv⟩ |
| 66 | have hv0 : v = 0 := mem_singleton_iff.mp hv |
| 67 | subst v |
| 68 | refine ⟨⟨⟨hsupport hs, hzero⟩, ?_⟩, ?_⟩ |
| 69 | · change V.squareFamily s 0 ∈ U |
| 70 | rw [V.square_base] |
| 71 | exact hsrc s hs |
| 72 | · change (lift (V.squareFamily s 0)).2.val + (c * 0) • η s ∈ G.gaugeCover.spatial b |
| 73 | simpa only [mul_zero, zero_smul, add_zero] using (lift (V.squareFamily s 0)).2.property |
| 74 | obtain ⟨r, hr, hrv, hKr⟩ := M08.exists_squareTube_radius hK hΩ hKzero V.radius_pos |
| 75 | refine ⟨r, hr, hrv, ?_⟩ |
| 76 | intro s hs v hv |
| 77 | have h := hKr (show (s, v) ∈ tsupport η ×ˢ Ioo (-r) r from ⟨hs, hv⟩) |
| 78 | exact ⟨h.1.2, h.2⟩ |
| 79 | |
| 80 | /-- The supported affine family is an actual admissible variation |
| 81 | with the same fixed endpoints, Proposition 6.13 and Corollary 6.16, |
| 82 | pp. 110-112. -/ |
| 83 | theorem exists_supportedAffineGauge_variation (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 84 | (hfix : M14BothEndpointsFixed V) {U : Set G.Point} (hU : IsOpen U) |
| 85 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 86 | (hright : ∀ q ∈ U, (G.gaugeCover.cylinder b).toSpacetime (lift q) = q) |
| 87 | (hη : ContDiff ℝ ∞ η) |
| 88 | (hsupport : tsupport η ⊆ Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) |
| 89 | (hsrc : ∀ s ∈ tsupport η, R.curve s ∈ U) : |
| 90 | ∃ W : M14LVariationData G p R, M14BothEndpointsFixed W ∧ |
| 91 | ∀ s v, W.squareFamily s v = supportedAffineGaugeFamily V b lift η c (s, v) := by |
| 92 | obtain ⟨r, hr, hrv, hshift⟩ := exists_supportedAffineGauge_radius V b lift η c hU hlift hη |
| 93 | hsupport hsrc |
| 94 | have hparam : Ioo (-r) r ⊆ V.parameterDomain := by |
| 95 | rw [V.parameterDomain_eq] |
| 96 | exact Ioo_subset_Ioo (neg_le_neg hrv) hrv |
| 97 | have hH := supportedAffineGaugeFamily_contMDiffOn V b lift η c hU hlift hright hη |
| 98 | hsupport hparam (fun s hs v hv => (hshift s hs v hv).1) |
| 99 | (fun s hs v hv => (hshift s hs v hv).2) |
| 100 | have hclock : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, ∀ v ∈ Ioo (-r) r, |
| 101 | G.spacetime.timeFunction (supportedAffineGaugeFamily V b lift η c (s, v)) = T - s ^ 2 := |
| 102 | fun s hs v hv => supportedAffineGaugeFamily_time V b lift η c hparam |
| 103 | (fun t ht u hu => hright _ (hshift t ht u hu).1) hs hv |
| 104 | have hzero := supportedAffineGaugeFamily_at_zero V b lift η c |
| 105 | (fun s hs => hright _ (hsrc s hs)) |
| 106 | refine ⟨variationOfSquare hM12 R (supportedAffineGaugeFamily V b lift η c) r hr hH hclock hzero, |
| 107 | ?_, fun _ _ => rfl⟩ |
| 108 | apply variationOfSquare_bothEndpointsFixed |
| 109 | · intro v hv |
| 110 | have hs : Real.sqrt τ₁ ∉ tsupport η := fun hs => lt_irrefl _ (hsupport hs).1 |
| 111 | rw [supportedAffineGaugeFamily_eq_of_not_tsupport V b lift η c hs, |
| 112 | V.square_agrees _ ⟨le_rfl, Real.sqrt_le_sqrt p.tau_lt.le⟩ v (hparam hv), |
| 113 | Real.sq_sqrt p.tau_nonneg] |
| 114 | exact V.left_endpoint_fixed_spec.mp hfix.1 v (hparam hv) |
| 115 | · intro v hv |
| 116 | have hs : Real.sqrt τ₂ ∉ tsupport η := fun hs => lt_irrefl _ (hsupport hs).2 |
| 117 | rw [supportedAffineGaugeFamily_eq_of_not_tsupport V b lift η c hs, |
| 118 | V.square_agrees _ ⟨Real.sqrt_le_sqrt p.tau_lt.le, le_rfl⟩ v (hparam hv), |
| 119 | Real.sq_sqrt (p.tau_nonneg.trans p.tau_lt.le)] |
| 120 | exact V.right_endpoint_fixed_spec.mp hfix.2 v (hparam hv) |
| 121 | |
| 122 | end PoincareMT.M14 |