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.Paths.SquareRoot.Families.SquareVariationRestriction |
| 2 | |
| 3 | /-! |
| 4 | # Actual directional variations of a closed-time family |
| 5 | |
| 6 | Morgan-Tian Lemma 6.22, pp. 115-116. An affine line through an open |
| 7 | parameter domain gives a genuine frozen variation of its central |
| 8 | square path. The retained time interval may be a closed subinterval |
| 9 | of the family's original time set. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter Metric |
| 15 | open scoped Manifold ContDiff Topology |
| 16 | |
| 17 | universe u v |
| 18 | |
| 19 | namespace PoincareMT.M14 |
| 20 | |
| 21 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 22 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 23 | {P : Type v} [NormedAddCommGroup P] [NormedSpace ℝ P] |
| 24 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 25 | |
| 26 | /-- Every affine direction through a valid open parameter gives an |
| 27 | actual frozen variation on the retained closed square interval, |
| 28 | Lemma 6.22, pp. 115-116. -/ |
| 29 | theorem exists_parameterLineVariation (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 30 | (R : M14SquareRootPath G p) (γ : ℝ × P → G.Point) {C : Set ℝ} {U : Set P} |
| 31 | (hU : IsOpen U) |
| 32 | (hγ : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, P))) (spacetimeModel n) ∞ γ (C ×ˢ U)) |
| 33 | (hsub : M14SqrtParameterInterval a b ⊆ C) |
| 34 | (hclock : ∀ s ∈ C, ∀ z ∈ U, G.spacetime.timeFunction (γ (s, z)) = T - s ^ 2) |
| 35 | (z d : P) (hz : z ∈ U) |
| 36 | (hzero : ∀ s ∈ M14SqrtParameterInterval a b, γ (s, z) = R.curve s) : |
| 37 | ∃ V : M14LVariationData G p R, |
| 38 | (∀ u ∈ V.parameterDomain, z + u • d ∈ U) ∧ |
| 39 | ∀ s ∈ M14SqrtParameterInterval a b, ∀ u, V.squareFamily s u = γ (s, z + u • d) := by |
| 40 | have hline : ContDiff ℝ ∞ (fun u : ℝ => z + u • d) := |
| 41 | contDiff_const.add (contDiff_id.smul contDiff_const) |
| 42 | have hnear : {u : ℝ | z + u • d ∈ U} ∈ 𝓝 0 := |
| 43 | (hU.preimage hline.continuous).mem_nhds (by |
| 44 | change z + (0 : ℝ) • d ∈ U |
| 45 | simpa only [zero_smul, add_zero] using hz) |
| 46 | obtain ⟨ρ, hρ, hρsub⟩ := Metric.mem_nhds_iff.mp hnear |
| 47 | have hparam (u : ℝ) (hu : u ∈ Ioo (-ρ) ρ) : z + u • d ∈ U := by |
| 48 | apply hρsub |
| 49 | simpa only [Metric.mem_ball, Real.dist_eq, sub_zero, abs_lt, mem_Ioo] using hu |
| 50 | let H := fun w : ℝ × ℝ => γ (w.1, z + w.2 • d) |
| 51 | have hk : ContMDiff ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) |
| 52 | ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, P))) ∞ (fun w : ℝ × ℝ => (w.1, z + w.2 • d)) := by |
| 53 | rw [← modelWithCornersSelf_prod, ← modelWithCornersSelf_prod, |
| 54 | chartedSpaceSelf_prod, chartedSpaceSelf_prod] |
| 55 | exact (contDiff_fst.prodMk (contDiff_const.add (contDiff_snd.smul contDiff_const))).contMDiff |
| 56 | have hH : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ H |
| 57 | (M14SqrtParameterInterval a b ×ˢ Ioo (-ρ) ρ) := |
| 58 | hγ.comp hk.contMDiffOn (fun w hw => ⟨hsub hw.1, hparam w.2 hw.2⟩) |
| 59 | have htime (s : ℝ) (hs : s ∈ M14SqrtParameterInterval a b) |
| 60 | (u : ℝ) (hu : u ∈ Ioo (-ρ) ρ) : G.spacetime.timeFunction (H (s, u)) = T - s ^ 2 := |
| 61 | hclock s (hsub hs) _ (hparam u hu) |
| 62 | have hbase (s : ℝ) (hs : s ∈ M14SqrtParameterInterval a b) : H (s, 0) = R.curve s := by |
| 63 | simpa only [H, zero_smul, add_zero] using hzero s hs |
| 64 | obtain ⟨V, hVparam, hV⟩ := exists_variationOfSquare_eqOn hM12 R H hρ hH htime hbase |
| 65 | exact ⟨V, fun u hu => hparam u (hVparam ▸ hu), hV⟩ |
| 66 | |
| 67 | end PoincareMT.M14 |