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.ClosedAffineField |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.AdaptedFields.WeightedFieldCoordinates |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.IndexForm.FixedEndpointBoundary |
| 4 | import Mathlib.Geometry.Manifold.PartitionOfUnity |
| 5 | |
| 6 | /-! |
| 7 | # Actual variations realizing arbitrary smooth horizontal fields |
| 8 | |
| 9 | A finite partition of unity and successive actual spatial perturbations |
| 10 | realize the entire prescribed field on the closed square interval. |
| 11 | Every zero of the field remains a fixed square point. Morgan-Tian |
| 12 | Proposition 6.37 and Lemma 6.40, pp. 123-127. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | -- The actual horizontal bundle uses the retained spacetime tangent model. |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Bundle Topology BigOperators |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M14 |
| 25 | |
| 26 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 27 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 28 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 29 | |
| 30 | /-- The constant square family is an actual variation with zero |
| 31 | horizontal field, Proposition 6.37, pp. 123-127. -/ |
| 32 | theorem exists_constant_squareVariation (R : M14SquareRootPath G p) |
| 33 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) : |
| 34 | ∃ V : M14LVariationData G p R, |
| 35 | (∀ s ∈ M14SqrtParameterInterval a b, ∀ v, V.squareFamily s v = R.curve s) ∧ |
| 36 | ∀ s ∈ M14SqrtParameterInterval a b, M14VariationField V s = 0 := by |
| 37 | have hH : ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓘(ℝ, ℝ))) (spacetimeModel n) ∞ |
| 38 | (fun z : ℝ × ℝ => R.curve z.1) (M14SqrtParameterInterval a b ×ˢ Ioo (-1) 1) := |
| 39 | (R.smooth.mono R.interval_subset).comp contMDiffOn_fst (fun _ hz => hz.1) |
| 40 | obtain ⟨V, _, hV⟩ := exists_variationOfSquare_eqOn hM12 R (fun z => R.curve z.1) |
| 41 | zero_lt_one hH (fun s hs _ _ => R.curve_time s hs) (fun _ _ => rfl) |
| 42 | refine ⟨V, hV, fun s hs => variationField_eq_zero_of_constant V ?_⟩ |
| 43 | intro v _ |
| 44 | exact (hV s hs v).trans (hV s hs 0).symm |
| 45 | |
| 46 | set_option maxHeartbeats 800000 in |
| 47 | -- Finite composition retains actual family, field and fixed-point witnesses together. |
| 48 | /-- Every smooth actual horizontal field on the closed square |
| 49 | interval is realized by an admissible variation, with every zero |
| 50 | retained as a fixed square point, Proposition 6.37 and Lemma 6.40, |
| 51 | pp. 123-127. -/ |
| 52 | theorem exists_variation_of_smooth_horizontalField (R : M14SquareRootPath G p) |
| 53 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (Y : ∀ s, G.Horizontal (R.curve s)) |
| 54 | (hY : ContMDiffOn (𝓘(ℝ, ℝ)) |
| 55 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 56 | (fun s => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (R.curve s) (Y s)) |
| 57 | (M14SqrtParameterInterval a b)) : |
| 58 | ∃ V : M14LVariationData G p R, |
| 59 | (∀ s ∈ M14SqrtParameterInterval a b, M14VariationField V s = Y s) ∧ |
| 60 | ∀ s ∈ M14SqrtParameterInterval a b, Y s = 0 → |
| 61 | ∀ v, V.squareFamily s v = R.curve s := by |
| 62 | classical |
| 63 | let C := M14SqrtParameterInterval a b |
| 64 | obtain ⟨m, D, hcover⟩ := exists_finite_squareFieldGaugeCover R |
| 65 | obtain ⟨ρ, hρ⟩ := SmoothPartitionOfUnity.exists_isSubordinate (𝓘(ℝ, ℝ)) |
| 66 | (show IsClosed C from isClosed_Icc) (fun i => (D i).parameterSet) |
| 67 | (fun i => (D i).parameter_open) hcover |
| 68 | choose η hη hηsupp hvalue hzero using fun i : Fin m => |
| 69 | exists_weightedFieldGauge_coordinates (D i) Y hY (ρ i) (ρ i).contMDiff.contDiff (hρ i) |
| 70 | have hsrc (i : Fin m) (s : ℝ) (hs : s ∈ C ∩ tsupport (η i)) : |
| 71 | R.curve s ∈ (D i).domain := (D i).curve_mem s ⟨hs.1, hηsupp i hs.2⟩ |
| 72 | have hfinite (L : Finset (Fin m)) : |
| 73 | ∃ V : M14LVariationData G p R, |
| 74 | (∀ s ∈ C, M14VariationField V s = ∑ i ∈ L, ρ i s • Y s) ∧ |
| 75 | ∀ s ∈ C, Y s = 0 → ∀ v, V.squareFamily s v = R.curve s := by |
| 76 | induction L using Finset.induction_on with |
| 77 | | empty => |
| 78 | obtain ⟨V, hV, hfield⟩ := exists_constant_squareVariation R hM12 |
| 79 | exact ⟨V, fun s hs => by simpa only [Finset.sum_empty] using hfield s hs, |
| 80 | fun s hs _ => hV s hs⟩ |
| 81 | | @insert i L hi ih => |
| 82 | obtain ⟨V, hfield, hfixed⟩ := ih |
| 83 | obtain ⟨W, _, hW⟩ := exists_supportedAffineGauge_variation_closed V (D i).gauge |
| 84 | (D i).lift (η i) 1 hM12 (D i).domain_open (D i).lift_smooth |
| 85 | (D i).right_inverse (hη i) (hsrc i) |
| 86 | refine ⟨W, ?_, ?_⟩ |
| 87 | · intro s hs |
| 88 | have hadd : M14VariationField W s = M14VariationField V s + ρ i s • Y s := by |
| 89 | apply Subtype.ext |
| 90 | rw [Submodule.coe_add, Submodule.coe_smul, |
| 91 | variationField_supportedAffineGauge_val_closed V W (D i).gauge (D i).lift |
| 92 | (η i) 1 hW (D i).domain_open (D i).lift_smooth (D i).right_inverse |
| 93 | (hη i) (hsrc i) hs] |
| 94 | dsimp only |
| 95 | rw [one_smul, hvalue i s hs] |
| 96 | rw [hadd, hfield s hs, Finset.sum_insert hi] |
| 97 | exact add_comm _ _ |
| 98 | · intro s hs hz v |
| 99 | rw [hW s hs v] |
| 100 | exact supportedAffineGaugeFamily_fixed_of_zero V (D i).gauge (D i).lift (η i) 1 |
| 101 | (hzero i s hs hz) (hfixed s hs hz) |
| 102 | (fun ht => (D i).right_inverse _ (hsrc i s ⟨hs, ht⟩)) v |
| 103 | obtain ⟨V, hfield, hfixed⟩ := hfinite Finset.univ |
| 104 | refine ⟨V, ?_, hfixed⟩ |
| 105 | intro s hs |
| 106 | have hsum : ∑ i : Fin m, ρ i s = 1 := by |
| 107 | simpa only [finsum_eq_sum_of_fintype] using ρ.sum_eq_one hs |
| 108 | rw [hfield s hs, ← Finset.sum_smul, hsum, one_smul] |
| 109 | |
| 110 | /-- A fixed square-time point gives a fixed original-time point, |
| 111 | with the genuine square reparametrization, Lemma 6.40, pp. 123-124. -/ |
| 112 | theorem variation_family_fixed_of_square {R : M14SquareRootPath G p} |
| 113 | (V : M14LVariationData G p R) {t : ℝ} (ht : t ∈ Icc a b) |
| 114 | (hfix : ∀ v, V.squareFamily (Real.sqrt t) v = R.curve (Real.sqrt t)) : |
| 115 | ∀ v ∈ V.parameterDomain, V.family t v = p.curve t := by |
| 116 | have hs : Real.sqrt t ∈ M14SqrtParameterInterval a b := |
| 117 | ⟨Real.sqrt_le_sqrt ht.1, Real.sqrt_le_sqrt ht.2⟩ |
| 118 | intro v hv |
| 119 | have heq := V.square_agrees _ hs v hv |
| 120 | rw [Real.sq_sqrt (p.tau_nonneg.trans ht.1)] at heq |
| 121 | rw [← heq, hfix v, R.agrees _ hs, Real.sq_sqrt (p.tau_nonneg.trans ht.1)] |
| 122 | |
| 123 | /-- Every smooth field vanishing initially is realized by an |
| 124 | initial-fixed admissible variation. A zero terminal field also fixes |
| 125 | the terminal endpoint, Proposition 6.37, pp. 123-127. -/ |
| 126 | theorem exists_initialFixed_variation_of_smooth_horizontalField |
| 127 | (R : M14SquareRootPath G p) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 128 | (Y : ∀ s, G.Horizontal (R.curve s)) |
| 129 | (hY : ContMDiffOn (𝓘(ℝ, ℝ)) |
| 130 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 131 | (fun s => Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (R.curve s) (Y s)) |
| 132 | (M14SqrtParameterInterval a b)) (hleft : Y (Real.sqrt a) = 0) : |
| 133 | ∃ V : M14LVariationData G p R, V.left_endpoint_fixed ∧ |
| 134 | (∀ s ∈ M14SqrtParameterInterval a b, M14VariationField V s = Y s) ∧ |
| 135 | (Y (Real.sqrt b) = 0 → V.right_endpoint_fixed) := by |
| 136 | obtain ⟨V, hfield, hfixed⟩ := exists_variation_of_smooth_horizontalField R hM12 Y hY |
| 137 | have hab := Real.sqrt_le_sqrt p.tau_lt.le |
| 138 | exact ⟨V, V.left_endpoint_fixed_spec.mpr |
| 139 | (variation_family_fixed_of_square V ⟨le_rfl, p.tau_lt.le⟩ |
| 140 | (hfixed _ ⟨le_rfl, hab⟩ hleft)), hfield, fun hz => V.right_endpoint_fixed_spec.mpr |
| 141 | (variation_family_fixed_of_square V ⟨p.tau_lt.le, le_rfl⟩ |
| 142 | (hfixed _ ⟨hab, le_rfl⟩ hz))⟩ |
| 143 | |
| 144 | end PoincareMT.M14 |