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.SupportedGaugeFamily |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.SquareVariationConstruction |
| 4 | |
| 5 | /-! |
| 6 | # Actual local test variations |
| 7 | |
| 8 | Morgan-Tian Lemma 6.4 and Definition 6.7, pp. 107-108. A smooth spatial |
| 9 | test field supported in an interior gauge neighborhood gives an actual |
| 10 | generalized variation with fixed endpoints. M08's compact tube lemma |
| 11 | provides a common positive radius for all supported spatial shifts. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | -- The compatible cylinder's product model is the selected spacetime model. |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M14 |
| 24 | |
| 25 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 26 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 27 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 28 | (R : M14SquareRootPath G p) (b : G.gaugeCover.index) |
| 29 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 30 | G.gaugeCover.spatial b) (η : ℝ → EuclideanSpace ℝ (Fin n)) |
| 31 | |
| 32 | /-- Compact support gives one positive parameter radius on which every |
| 33 | spatial shift remains in its actual gauge domain, Lemma 6.4, pp. 107-108. -/ |
| 34 | theorem exists_supportedGauge_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 ∧ ∀ s ∈ tsupport η, ∀ v ∈ Ioo (-r) r, |
| 40 | (lift (R.curve s)).2.val + v • η s ∈ G.gaugeCover.spatial b := by |
| 41 | let J := Ioo (Real.sqrt τ₁) (Real.sqrt τ₂) ∩ R.curve ⁻¹' U |
| 42 | have hR : ContinuousOn R.curve (Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) := |
| 43 | R.smooth.continuousOn.mono (Ioo_subset_Icc_self.trans R.interval_subset) |
| 44 | have hJ : IsOpen J := hR.isOpen_inter_preimage isOpen_Ioo hU |
| 45 | have hL : ContinuousOn (fun s => lift (R.curve s)) J := |
| 46 | hlift.continuousOn.comp (hR.mono inter_subset_left) (fun _ hs => hs.2) |
| 47 | have hshift : ContinuousOn |
| 48 | (fun z : ℝ × ℝ => (lift (R.curve z.1)).2.val + z.2 • η z.1) (J ×ˢ univ) := |
| 49 | ((continuous_subtype_val.comp_continuousOn hL.snd).comp continuousOn_fst |
| 50 | (fun _ hz => hz.1)).add |
| 51 | (continuousOn_snd.smul (hη.continuous.comp continuous_fst).continuousOn) |
| 52 | let Ω := (J ×ˢ univ) ∩ |
| 53 | (fun z : ℝ × ℝ => (lift (R.curve z.1)).2.val + z.2 • η z.1) ⁻¹' |
| 54 | (G.gaugeCover.spatial b : Set (EuclideanSpace ℝ (Fin n))) |
| 55 | have hΩ : IsOpen Ω := |
| 56 | hshift.isOpen_inter_preimage (hJ.prod isOpen_univ) (G.gaugeCover.spatial b).isOpen |
| 57 | have hK : IsCompact (tsupport η) := isCompact_Icc.of_isClosed_subset |
| 58 | (isClosed_tsupport η) (hsupport.trans Ioo_subset_Icc_self) |
| 59 | have hzero : tsupport η ×ˢ {(0 : ℝ)} ⊆ Ω := by |
| 60 | rintro ⟨s, v⟩ ⟨hs, hv⟩ |
| 61 | have hv0 : v = 0 := mem_singleton_iff.mp hv |
| 62 | refine ⟨⟨⟨hsupport hs, hsrc s hs⟩, mem_univ v⟩, ?_⟩ |
| 63 | change (lift (R.curve s)).2.val + v • η s ∈ G.gaugeCover.spatial b |
| 64 | simpa only [hv0, zero_smul, add_zero] using (lift (R.curve s)).2.property |
| 65 | obtain ⟨r, hr, _, hKr⟩ := M08.exists_squareTube_radius hK hΩ hzero zero_lt_one |
| 66 | exact ⟨r, hr, fun s hs v hv => (hKr (show (s, v) ∈ tsupport η ×ˢ Ioo (-r) r |
| 67 | from ⟨hs, hv⟩)).2⟩ |
| 68 | |
| 69 | /-- Every supported smooth spatial test field is realized by the exact |
| 70 | frozen variation record with both endpoints fixed, Lemma 6.4, pp. 107-108. -/ |
| 71 | theorem exists_supportedGauge_variation (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 72 | {U : Set G.Point} (hU : IsOpen U) |
| 73 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 74 | (hright : ∀ q ∈ U, (G.gaugeCover.cylinder b).toSpacetime (lift q) = q) |
| 75 | (hη : ContDiff ℝ ∞ η) |
| 76 | (hsupport : tsupport η ⊆ Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) |
| 77 | (hsrc : ∀ s ∈ tsupport η, R.curve s ∈ U) : |
| 78 | ∃ V : M14LVariationData G p R, M14BothEndpointsFixed V ∧ |
| 79 | ∀ s v, V.squareFamily s v = supportedGaugeFamily R b lift η (s, v) := by |
| 80 | obtain ⟨r, hr, hshift⟩ := exists_supportedGauge_radius R b lift η hU hlift hη |
| 81 | hsupport hsrc |
| 82 | have hH := supportedGaugeFamily_contMDiffOn R b lift η hU hlift hright hη |
| 83 | hsupport hsrc hshift |
| 84 | have hclock : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, ∀ v ∈ Ioo (-r) r, |
| 85 | G.spacetime.timeFunction (supportedGaugeFamily R b lift η (s, v)) = T - s ^ 2 := by |
| 86 | intro s hs v _ |
| 87 | apply supportedGaugeFamily_time R b lift η (fun t ht => ?_) hs |
| 88 | exact ((G.gaugeCover.cylinder b).time_eq (lift (R.curve t))).symm.trans |
| 89 | (congrArg G.spacetime.timeFunction (hright _ (hsrc t ht))) |
| 90 | have hzero := supportedGaugeFamily_at_zero R b lift η (fun s hs => hright _ (hsrc s hs)) |
| 91 | refine ⟨variationOfSquare hM12 R (supportedGaugeFamily R b lift η) r hr hH hclock hzero, |
| 92 | ?_, fun _ _ => rfl⟩ |
| 93 | apply variationOfSquare_bothEndpointsFixed |
| 94 | · intro v _ |
| 95 | have hs : Real.sqrt τ₁ ∉ tsupport η := fun hs => (lt_irrefl _ (hsupport hs).1) |
| 96 | rw [supportedGaugeFamily_eq_of_not_tsupport R b lift η hs, |
| 97 | R.agrees _ ⟨le_rfl, Real.sqrt_le_sqrt p.tau_lt.le⟩, Real.sq_sqrt p.tau_nonneg] |
| 98 | · intro v _ |
| 99 | have hs : Real.sqrt τ₂ ∉ tsupport η := fun hs => (lt_irrefl _ (hsupport hs).2) |
| 100 | rw [supportedGaugeFamily_eq_of_not_tsupport R b lift η hs, |
| 101 | R.agrees _ ⟨Real.sqrt_le_sqrt p.tau_lt.le, le_rfl⟩, |
| 102 | Real.sq_sqrt (p.tau_nonneg.trans p.tau_lt.le)] |
| 103 | |
| 104 | end PoincareMT.M14 |