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.Variation.Extension.SupportedAffineFamily |
| 2 | |
| 3 | /-! |
| 4 | # Supported affine families at closed time endpoints |
| 5 | |
| 6 | Spatial gauge perturbations preserve the old family off support and |
| 7 | are smooth within the actual closed time rectangle. The coordinate |
| 8 | field only needs within smoothness. Morgan-Tian Proposition 6.37 |
| 9 | and Lemma 6.40, pp. 123-127; see the field-realization derivation. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | -- The compatible cylinder uses the selected spacetime tangent model. |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff 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 | {R : M14SquareRootPath G p} (V : M14LVariationData G p R) (b : G.gaugeCover.index) |
| 27 | (lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval b)).Point × |
| 28 | G.gaugeCover.spatial b) (η : ℝ → EuclideanSpace ℝ (Fin n)) (c : ℝ) |
| 29 | |
| 30 | /-- The actual affine spatial shift is smooth within a closed time |
| 31 | rectangle at every admissible point, Proposition 6.37, pp. 123-127. -/ |
| 32 | theorem affineGaugeFamily_contMDiffWithinAt {U : Set G.Point} (hU : IsOpen U) |
| 33 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 34 | (hη : ContDiffOn ℝ ∞ η (M14SqrtParameterInterval τ₁ τ₂)) |
| 35 | {P : Set ℝ} (hP : P ⊆ V.parameterDomain) {z : ℝ × ℝ} |
| 36 | (hz : z ∈ M14SqrtParameterInterval τ₁ τ₂ ×ˢ P) |
| 37 | (hsrc : V.squareFamily z.1 z.2 ∈ U) |
| 38 | (hshift : (lift (V.squareFamily z.1 z.2)).2.val + (c * z.2) • η z.1 ∈ |
| 39 | G.gaugeCover.spatial b) : |
| 40 | ContMDiffWithinAt ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ |
| 41 | (affineGaugeFamily V b lift η c) (M14SqrtParameterInterval τ₁ τ₂ ×ˢ P) z := by |
| 42 | have hV := (V.square_smooth.mono |
| 43 | (fun _ hw => V.square_contains ⟨hw.1, hP hw.2⟩)) z hz |
| 44 | have hL := ((hlift _ hsrc).contMDiffAt (hU.mem_nhds hsrc)).comp_contMDiffWithinAt z hV |
| 45 | have hη' : ContMDiffWithinAt ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) |
| 46 | (𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (fun w : ℝ × ℝ => η w.1) |
| 47 | (M14SqrtParameterInterval τ₁ τ₂ ×ˢ P) z := |
| 48 | (hη z.1 hz.1).contMDiffWithinAt.comp z contMDiffWithinAt_fst |
| 49 | (fun w (hw : w ∈ M14SqrtParameterInterval τ₁ τ₂ ×ˢ P) => hw.1) |
| 50 | have hv : ContMDiffWithinAt ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) |
| 51 | (𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (fun w : ℝ × ℝ => (c * w.2) • η w.1) |
| 52 | (M14SqrtParameterInterval τ₁ τ₂ ×ˢ P) z := |
| 53 | (contMDiffWithinAt_const.mul contMDiffWithinAt_snd).smul hη' |
| 54 | have hS := (((G.gaugeCover.spatial b).affineShift_contMDiffOn _ hshift).contMDiffAt |
| 55 | ((G.gaugeCover.spatial b).affineShift_domain_isOpen.mem_nhds hshift)).comp_contMDiffWithinAt |
| 56 | z (hL.snd.prodMk hv) |
| 57 | exact (G.gaugeCover.cylinder b).smooth.contMDiffAt.comp_contMDiffWithinAt z |
| 58 | (hL.fst.prodMk hS) |
| 59 | |
| 60 | /-- Supported affine shifts paste smoothly on the full closed time |
| 61 | rectangle, with support allowed at its endpoints, Lemma 6.40, pp. 123-124. -/ |
| 62 | theorem supportedAffineGaugeFamily_contMDiffOn_closed {U : Set G.Point} (hU : IsOpen U) |
| 63 | (hlift : ContMDiffOn (spacetimeModel n) (spacetimeModel n) ∞ lift U) |
| 64 | (hright : ∀ q ∈ U, (G.gaugeCover.cylinder b).toSpacetime (lift q) = q) |
| 65 | (hη : ContDiffOn ℝ ∞ η (M14SqrtParameterInterval τ₁ τ₂)) |
| 66 | {P : Set ℝ} (hP : P ⊆ V.parameterDomain) |
| 67 | (hsrc : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂ ∩ tsupport η, ∀ v ∈ P, |
| 68 | V.squareFamily s v ∈ U) |
| 69 | (hshift : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂ ∩ tsupport η, ∀ v ∈ P, |
| 70 | (lift (V.squareFamily s v)).2.val + (c * v) • η s ∈ G.gaugeCover.spatial b) : |
| 71 | ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ |
| 72 | (supportedAffineGaugeFamily V b lift η c) (M14SqrtParameterInterval τ₁ τ₂ ×ˢ P) := by |
| 73 | have hbase := V.square_smooth.mono |
| 74 | (show M14SqrtParameterInterval τ₁ τ₂ ×ˢ P ⊆ V.squareDomain from |
| 75 | fun _ hz => V.square_contains ⟨hz.1, hP hz.2⟩) |
| 76 | intro z hz |
| 77 | by_cases hs : z.1 ∈ tsupport η |
| 78 | · have hmem := hsrc z.1 ⟨hz.1, hs⟩ z.2 hz.2 |
| 79 | have heq : supportedAffineGaugeFamily V b lift η c |
| 80 | =ᶠ[𝓝[M14SqrtParameterInterval τ₁ τ₂ ×ˢ P] z] affineGaugeFamily V b lift η c := by |
| 81 | filter_upwards [(hbase z hz).continuousWithinAt.preimage_mem_nhdsWithin |
| 82 | (hU.mem_nhds hmem)] with w hw |
| 83 | exact supportedAffineGaugeFamily_eq_gauge V b lift η c (hright _ hw) |
| 84 | exact (affineGaugeFamily_contMDiffWithinAt V b lift η c hU hlift hη hP hz hmem |
| 85 | (hshift _ ⟨hz.1, hs⟩ _ hz.2)).congr_of_eventuallyEq heq |
| 86 | (supportedAffineGaugeFamily_eq_gauge V b lift η c (hright _ hmem)) |
| 87 | · have heq : supportedAffineGaugeFamily V b lift η c =ᶠ[𝓝 z] |
| 88 | fun w => V.squareFamily w.1 w.2 := by |
| 89 | filter_upwards [((isClosed_tsupport η).isOpen_compl.preimage continuous_fst).mem_nhds |
| 90 | hs] with w hw |
| 91 | exact supportedAffineGaugeFamily_eq_of_not_tsupport V b lift η c hw |
| 92 | exact (hbase z hz).congr_of_eventuallyEq |
| 93 | (heq.filter_mono nhdsWithin_le_nhds) heq.eq_of_nhds |
| 94 | |
| 95 | /-- The supported affine shift retains the genuine clock at every |
| 96 | closed time point, Proposition 6.37, pp. 123-127. -/ |
| 97 | theorem supportedAffineGaugeFamily_time_closed {P : Set ℝ} (hP : P ⊆ V.parameterDomain) |
| 98 | (hrec : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂ ∩ tsupport η, ∀ v ∈ P, |
| 99 | (G.gaugeCover.cylinder b).toSpacetime (lift (V.squareFamily s v)) = V.squareFamily s v) |
| 100 | {s v : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) (hv : v ∈ P) : |
| 101 | G.spacetime.timeFunction (supportedAffineGaugeFamily V b lift η c (s, v)) = T - s ^ 2 := by |
| 102 | by_cases ht : s ∈ tsupport η |
| 103 | · rw [supportedAffineGaugeFamily_eq_gauge V b lift η c (hrec s ⟨hs, ht⟩ v hv)] |
| 104 | have hclock := ((G.gaugeCover.cylinder b).time_eq (lift (V.squareFamily s v))).symm.trans |
| 105 | (congrArg G.spacetime.timeFunction (hrec s ⟨hs, ht⟩ v hv)) |
| 106 | simp only [affineGaugeFamily, (G.gaugeCover.cylinder b).time_eq, hclock, |
| 107 | variation_squareFamily_time V hs (hP hv)] |
| 108 | · rw [supportedAffineGaugeFamily_eq_of_not_tsupport V b lift η c ht, |
| 109 | variation_squareFamily_time V hs (hP hv)] |
| 110 | |
| 111 | /-- Zero-parameter reconstruction needs only the actual closed time |
| 112 | interval, Lemma 6.40, pp. 123-124. -/ |
| 113 | theorem supportedAffineGaugeFamily_zero_closed |
| 114 | (hrec : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂ ∩ tsupport η, |
| 115 | (G.gaugeCover.cylinder b).toSpacetime (lift (R.curve s)) = R.curve s) |
| 116 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) : |
| 117 | supportedAffineGaugeFamily V b lift η c (s, 0) = R.curve s := by |
| 118 | by_cases ht : s ∈ tsupport η |
| 119 | · have h := hrec s ⟨hs, ht⟩ |
| 120 | have hVrec : (G.gaugeCover.cylinder b).toSpacetime (lift (V.squareFamily s 0)) = |
| 121 | V.squareFamily s 0 := by rwa [V.square_base] |
| 122 | rw [supportedAffineGaugeFamily_eq_gauge V b lift η c hVrec] |
| 123 | simp only [affineGaugeFamily, mul_zero, zero_smul, TopologicalSpace.Opens.affineShift_zero, |
| 124 | Prod.mk.eta, V.square_base, h] |
| 125 | · rw [supportedAffineGaugeFamily_eq_of_not_tsupport V b lift η c ht, V.square_base] |
| 126 | |
| 127 | end PoincareMT.M14 |