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.SquareVariationConstruction |
| 2 | |
| 3 | /-! |
| 4 | # Variations specified only on their actual closed square interval |
| 5 | |
| 6 | Morgan-Tian Lemma 6.4 and equation (6.2), pp. 106-108. |
| 7 | Patching to the central curve outside the closed interval meets the |
| 8 | frozen constructor's global central equality. The actual smooth |
| 9 | rectangle and all parameter germs at its time points are retained. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | open scoped Manifold ContDiff |
| 16 | |
| 17 | universe u |
| 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 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 24 | |
| 25 | /-- A smooth square family equal to the central curve on the actual |
| 26 | closed interval supplies a frozen variation with exactly that family |
| 27 | there. No outside-time regularity is required, Lemma 6.4, pp. 107-108. -/ |
| 28 | theorem exists_variationOfSquare_eqOn (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 29 | (R : M14SquareRootPath G p) (H : ℝ × ℝ → G.Point) {r : ℝ} (hr : 0 < r) |
| 30 | (hH : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ H |
| 31 | (M14SqrtParameterInterval a b ×ˢ Ioo (-r) r)) |
| 32 | (hclock : ∀ s ∈ M14SqrtParameterInterval a b, ∀ v ∈ Ioo (-r) r, |
| 33 | G.spacetime.timeFunction (H (s, v)) = T - s ^ 2) |
| 34 | (hzero : ∀ s ∈ M14SqrtParameterInterval a b, H (s, 0) = R.curve s) : |
| 35 | ∃ V : M14LVariationData G p R, V.parameterDomain = Ioo (-r) r ∧ |
| 36 | ∀ s ∈ M14SqrtParameterInterval a b, ∀ v, V.squareFamily s v = H (s, v) := by |
| 37 | classical |
| 38 | let K : ℝ × ℝ → G.Point := fun z => |
| 39 | if z.1 ∈ M14SqrtParameterInterval a b then H z else R.curve z.1 |
| 40 | have heq (s : ℝ) (hs : s ∈ M14SqrtParameterInterval a b) (v : ℝ) : K (s, v) = H (s, v) := |
| 41 | if_pos hs |
| 42 | have hK : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ K |
| 43 | (M14SqrtParameterInterval a b ×ˢ Ioo (-r) r) := |
| 44 | hH.congr (fun z hz => heq z.1 hz.1 z.2) |
| 45 | have htime (s : ℝ) (hs : s ∈ M14SqrtParameterInterval a b) (v : ℝ) |
| 46 | (hv : v ∈ Ioo (-r) r) : G.spacetime.timeFunction (K (s, v)) = T - s ^ 2 := by |
| 47 | rw [heq s hs v, hclock s hs v hv] |
| 48 | have hcenter (s : ℝ) : K (s, 0) = R.curve s := by |
| 49 | by_cases hs : s ∈ M14SqrtParameterInterval a b |
| 50 | · exact (heq s hs 0).trans (hzero s hs) |
| 51 | · exact if_neg hs |
| 52 | exact ⟨variationOfSquare hM12 R K r hr hK htime hcenter, rfl, heq⟩ |
| 53 | |
| 54 | end PoincareMT.M14 |