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.Action.VariationAction |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Fields.VariationPaths |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Fields.VariationClock |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareCurveEndpoints |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.Action.LLength |
| 6 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.ODE.Families.ClosedFamilyPrimitive |
| 7 | |
| 8 | /-! |
| 9 | # Actual variation actions and finite lower contacts |
| 10 | |
| 11 | The smooth closed action integral supplies the parameter germ. Its |
| 12 | admissible moving-endpoint path bounds the actual action infimum only |
| 13 | on the finite-value domain. Morgan-Tian Lemma 6.22 and Lemma 6.40, |
| 14 | pp. 115-116, 126-127. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Manifold ContDiff Topology intervalIntegral |
| 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 | {R : M14SquareRootPath G p} |
| 30 | |
| 31 | /-- The actual variation action is smooth on its entire open parameter |
| 32 | domain, Lemma 6.22, pp. 115-116. -/ |
| 33 | theorem variationAction_contDiffOn (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 34 | (V : M14LVariationData G p R) : ContDiffOn ℝ ∞ (M14VariationAction V) V.parameterDomain := by |
| 35 | have hP : IsOpen V.parameterDomain := V.parameterDomain_eq ▸ isOpen_Ioo |
| 36 | have hab := Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt |
| 37 | have hi := closedFamilyPrimitive_contDiffOn hab hP (variationActionDensity V) |
| 38 | (variationActionDensity_contDiffOn hM12 V) |
| 39 | have hslice : ContDiffOn ℝ ∞ |
| 40 | (fun v => ∫ s in Real.sqrt a..Real.sqrt b, variationActionDensity V (s, v)) |
| 41 | V.parameterDomain := |
| 42 | hi.comp (contDiffOn_id.prodMk contDiffOn_const) (fun _ hv => ⟨hv, hab.le, le_rfl⟩) |
| 43 | exact hslice.congr (fun _ hv => variationAction_eq_squareIntegral V hv) |
| 44 | |
| 45 | /-- Every actual closed-time endpoint curve is smooth in the open |
| 46 | variation parameter, Proposition 6.33, pp. 120-121. -/ |
| 47 | theorem variationEndpoint_contMDiffOn (V : M14LVariationData G p R) |
| 48 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval a b) : |
| 49 | ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ (V.squareFamily s) V.parameterDomain := |
| 50 | V.square_smooth.comp ((contMDiff_const (c := s)).prodMk contMDiff_id).contMDiffOn |
| 51 | (fun _ hv => V.square_contains ⟨hs, hv⟩) |
| 52 | |
| 53 | /-- An initial-fixed variation gives a genuine competitor with its |
| 54 | actual moving endpoint and exactly the variation action, Lemma 6.40, |
| 55 | pp. 126-127. -/ |
| 56 | theorem exists_initialFixed_variationEndpointPath |
| 57 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (V : M14LVariationData G p R) |
| 58 | (hfix : V.left_endpoint_fixed) {v : ℝ} (hv : v ∈ V.parameterDomain) : |
| 59 | ∃ q : M14BackwardPath G T a b x (V.squareFamily (Real.sqrt b) v), |
| 60 | M14BackwardLAction G q = M14VariationAction V v := by |
| 61 | let α := fun s => V.squareFamily s v |
| 62 | have hα : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ α (M14SqrtParameterInterval a b) := |
| 63 | V.square_smooth.comp (contMDiff_id.prodMk (contMDiff_const (c := v))).contMDiffOn |
| 64 | (fun _ hs => V.square_contains ⟨hs, hv⟩) |
| 65 | have hclock (s : ℝ) (hs : s ∈ M14SqrtParameterInterval a b) : |
| 66 | G.spacetime.timeFunction (α s) = T - s ^ 2 := variation_squareFamily_time V hs hv |
| 67 | have hleft : α (Real.sqrt a) = x := by |
| 68 | rw [show α (Real.sqrt a) = V.family a v from by |
| 69 | simpa only [Real.sq_sqrt p.tau_nonneg] using V.square_agrees (Real.sqrt a) |
| 70 | ⟨le_rfl, Real.sqrt_le_sqrt p.tau_lt.le⟩ v hv] |
| 71 | exact ((V.left_endpoint_fixed_spec.mp hfix) v hv).trans p.curve_start |
| 72 | refine ⟨backwardPathOfSquareCurveBetween hM12 p.tau_nonneg p.tau_lt α hα hclock hleft rfl, ?_⟩ |
| 73 | rw [← integral_squareCurveDensity_eq_action_between hM12 p.tau_nonneg p.tau_lt |
| 74 | α hα Subset.rfl hclock hleft rfl, variationAction_eq_squareIntegral V hv] |
| 75 | rfl |
| 76 | |
| 77 | /-- On the actual finite-value domain, normalized variation action |
| 78 | is an upper bound for raw endpoint reduced length, Definition 6.45 |
| 79 | and Lemma 6.40, pp. 129, 126-127. -/ |
| 80 | theorem reducedLengthAt_le_variationAction |
| 81 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (V : M14LVariationData G p R) |
| 82 | (hfix : V.left_endpoint_fixed) {v : ℝ} (hv : v ∈ V.parameterDomain) |
| 83 | (hfinite : M14FiniteValueDomain G T a b x (V.squareFamily (Real.sqrt b) v)) : |
| 84 | M14ReducedLengthAt G T a x (V.squareFamily (Real.sqrt b) v) ≤ |
| 85 | M14VariationAction V v / (2 * Real.sqrt b) := by |
| 86 | obtain ⟨q, hq⟩ := exists_initialFixed_variationEndpointPath hM12 V hfix hv |
| 87 | have hb : 0 < b := p.tau_nonneg.trans_lt p.tau_lt |
| 88 | unfold M14ReducedLengthAt |
| 89 | rw [variation_squareFamily_time V ⟨Real.sqrt_le_sqrt p.tau_lt.le, le_rfl⟩ hv, |
| 90 | Real.sq_sqrt hb.le, sub_sub_cancel] |
| 91 | exact (div_le_div_of_nonneg_right (actionValue_le_action hfinite q) |
| 92 | (mul_pos zero_lt_two (Real.sqrt_pos.mpr hb)).le).trans_eq (congrArg (· / (2 * Real.sqrt b)) hq) |
| 93 | |
| 94 | /-- A smooth finite lower contact produces the actual scalar action |
| 95 | gap minimum used in the Hessian comparison, Lemma 6.40, pp. 126-127. -/ |
| 96 | theorem isLocalMin_variationAction_gap |
| 97 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (V : M14LVariationData G p R) |
| 98 | (hfix : V.left_endpoint_fixed) (f : G.Point → ℝ) |
| 99 | (hvalue : f (R.curve (Real.sqrt b)) = M14BackwardLAction G p / (2 * Real.sqrt b)) |
| 100 | (hcontact : ∀ᶠ q in 𝓝 (R.curve (Real.sqrt b)), f q ≤ M14ReducedLengthAt G T a x q) |
| 101 | (hfinite : ∀ᶠ q in 𝓝 (R.curve (Real.sqrt b)), |
| 102 | M14FiniteValueDomain G T a (T - G.spacetime.timeFunction q) x q) : |
| 103 | IsLocalMin (fun v => M14VariationAction V v - |
| 104 | (2 * Real.sqrt b) * f (V.squareFamily (Real.sqrt b) v)) 0 := by |
| 105 | have hb : 0 < b := p.tau_nonneg.trans_lt p.tau_lt |
| 106 | have hc : 0 < 2 * Real.sqrt b := mul_pos zero_lt_two (Real.sqrt_pos.mpr hb) |
| 107 | have hP : IsOpen V.parameterDomain := V.parameterDomain_eq ▸ isOpen_Ioo |
| 108 | have hzero : (0 : ℝ) ∈ V.parameterDomain := by |
| 109 | rw [V.parameterDomain_eq] |
| 110 | exact ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩ |
| 111 | have hs : Real.sqrt b ∈ M14SqrtParameterInterval a b := |
| 112 | ⟨Real.sqrt_le_sqrt p.tau_lt.le, le_rfl⟩ |
| 113 | have hη := ((variationEndpoint_contMDiffOn V hs).contMDiffAt (hP.mem_nhds hzero)).continuousAt |
| 114 | have hnear : ∀ᶠ v in 𝓝 (0 : ℝ), |
| 115 | f (V.squareFamily (Real.sqrt b) v) ≤ |
| 116 | M14ReducedLengthAt G T a x (V.squareFamily (Real.sqrt b) v) ∧ |
| 117 | M14FiniteValueDomain G T a |
| 118 | (T - G.spacetime.timeFunction (V.squareFamily (Real.sqrt b) v)) x |
| 119 | (V.squareFamily (Real.sqrt b) v) := |
| 120 | hη.tendsto.eventually (V.square_base (Real.sqrt b) ▸ hcontact.and hfinite) |
| 121 | have hgap : M14VariationAction V 0 - |
| 122 | (2 * Real.sqrt b) * f (V.squareFamily (Real.sqrt b) 0) = 0 := by |
| 123 | rw [variationAction_zero, V.square_base, hvalue, mul_div_cancel₀ _ hc.ne', sub_self] |
| 124 | filter_upwards [hP.mem_nhds hzero, hnear] with v hv hcontact' |
| 125 | change M14VariationAction V 0 - (2 * Real.sqrt b) * f (V.squareFamily (Real.sqrt b) 0) ≤ _ |
| 126 | rw [hgap] |
| 127 | have hfin := hcontact'.2 |
| 128 | rw [variation_squareFamily_time V hs hv, Real.sq_sqrt hb.le, sub_sub_cancel] at hfin |
| 129 | exact sub_nonneg.mpr (by simpa only [mul_comm] using ((le_div_iff₀ hc).mp |
| 130 | (hcontact'.1.trans (reducedLengthAt_le_variationAction hM12 V hfix hv hfin)))) |
| 131 | |
| 132 | end PoincareMT.M14 |