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.Exponential.Endpoint.EndpointCost |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareCornerComparison |
| 3 | |
| 4 | /-! |
| 5 | # The actual broken cost has a local minimum |
| 6 | |
| 7 | Morgan-Tian Proposition 6.30, pp. 118-119. The central cost is the |
| 8 | original action. Nearby valid parameters give exactly matching |
| 9 | meeting endpoints and fixed outer endpoints, so the genuine corner |
| 10 | comparison supplies the local minimum used by the Hessian argument. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set Filter |
| 16 | open scoped Manifold ContDiff Topology intervalIntegral |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 23 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 24 | {f : ℝ × ℝ → G.Point} {U : Set ℝ} {T b c : ℝ} |
| 25 | {j : G.gaugeCover.index} |
| 26 | {lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval j)).Point × |
| 27 | G.gaugeCover.spatial j} {x y : G.Point} |
| 28 | |
| 29 | namespace GaugeEndpointFamily |
| 30 | |
| 31 | variable (D : GaugeEndpointFamily f U T 0 b c 0 j lift) |
| 32 | |
| 33 | /-- The central broken cost is the actual action of its original |
| 34 | admissible path, Proposition 6.30, pp. 118-119. -/ |
| 35 | theorem cost_zero_eq_action (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 36 | (hc : c ∈ Ioo 0 b) (m : M14BackwardPath G T 0 (b ^ 2) x y) |
| 37 | (heq : EqOn (fun t => f (Real.sqrt t, 0)) m.curve (Icc 0 (b ^ 2))) : |
| 38 | D.cost (0, 0) = M14BackwardLAction G m := by |
| 39 | have hb : 0 < b := hc.1.trans hc.2 |
| 40 | have hC : M14SqrtParameterInterval 0 (b ^ 2) = Icc 0 b := by |
| 41 | rw [M14SqrtParameterInterval, Real.sqrt_zero, Real.sqrt_sq hb.le] |
| 42 | let α := fun s => D.family (s, (0, (lift (f (c, 0))).2.val)) |
| 43 | have hα : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ α (Icc 0 b) := |
| 44 | D.smooth.comp (contMDiff_id.prodMk contMDiff_const).contMDiffOn |
| 45 | (fun _ hs => ⟨hs, D.center_mem⟩) |
| 46 | have hclock (s : ℝ) (hs : s ∈ M14SqrtParameterInterval 0 (b ^ 2)) : |
| 47 | G.spacetime.timeFunction (α s) = T - s ^ 2 := D.clock s (hC ▸ hs) _ D.center_mem |
| 48 | have hcurve : EqOn (fun t => α (Real.sqrt t)) m.curve (Icc 0 (b ^ 2)) := by |
| 49 | intro t ht |
| 50 | have hs : Real.sqrt t ∈ Icc 0 b := |
| 51 | ⟨Real.sqrt_nonneg t, (Real.sqrt_le_sqrt ht.2).trans_eq (Real.sqrt_sq hb.le)⟩ |
| 52 | exact (D.recovery _ D.center_mem _ hs).trans (heq ht) |
| 53 | have htotal : (∫ s in 0..b, squareCurveDensity G α (Icc 0 b) s) = M14BackwardLAction G m := by |
| 54 | simpa only [hC, Real.sqrt_zero, Real.sqrt_sq hb.le] using |
| 55 | integral_squareCurveDensity_eq_action_of_curve hM12 m α (hC.symm ▸ hα) hclock hcurve |
| 56 | have hd := (squareCurveDensity_contDiffOn hM12 (uniqueDiffOn_Icc hb) hα).continuousOn |
| 57 | have hpre : IntervalIntegrable (squareCurveDensity G α (Icc 0 b)) MeasureTheory.volume 0 c := |
| 58 | (hd.mono (fun _ hs => ⟨hs.1, hs.2.trans hc.2.le⟩)).intervalIntegrable_of_Icc hc.1.le |
| 59 | have htail : IntervalIntegrable (squareCurveDensity G α (Icc 0 b)) MeasureTheory.volume c b := |
| 60 | (hd.mono (fun _ hs => ⟨hc.1.le.trans hs.1, hs.2⟩)).intervalIntegrable_of_Icc hc.2.le |
| 61 | simpa only [cost, prefixAction, tailAction, squareFamilyAction, add_zero, α] using |
| 62 | (intervalIntegral.integral_add_adjacent_intervals hpre htail).trans htotal |
| 63 | |
| 64 | /-- The genuine broken cost is locally minimal when its central |
| 65 | full path minimizes and its original initial endpoint is fixed, |
| 66 | Proposition 6.30, pp. 118-119. -/ |
| 67 | theorem cost_isLocalMin (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 68 | (hc : c ∈ Ioo 0 b) (m : M14BackwardPath G T 0 (b ^ 2) x y) |
| 69 | (hmin : M14IsMinimizing m) |
| 70 | (heq : EqOn (fun t => f (Real.sqrt t, 0)) m.curve (Icc 0 (b ^ 2))) |
| 71 | (hleft : ∀ r ∈ U, f (0, r) = x) (hright : f (b, 0) = y) : |
| 72 | IsLocalMin D.cost (0, 0) := by |
| 73 | have hb : 0 < b := hc.1.trans hc.2 |
| 74 | have hC : M14SqrtParameterInterval 0 (b ^ 2) = Icc 0 b := by |
| 75 | rw [M14SqrtParameterInterval, Real.sqrt_zero, Real.sqrt_sq hb.le] |
| 76 | let A := fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 77 | (z.1, (lift (f (c, z.1))).2.val + z.2) |
| 78 | let B := fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 79 | ((0 : ℝ), (lift (f (c, z.1))).2.val + z.2) |
| 80 | have ha : ContinuousAt |
| 81 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => (lift (f (c, z.1))).2.val + z.2) (0, 0) := |
| 82 | (D.coordinate_smooth.comp (0, 0) contDiffAt_fst).continuousAt.add continuousAt_snd |
| 83 | have hAN : D.parameters ∈ 𝓝 (A (0, 0)) := by |
| 84 | simpa only [A, add_zero] using D.parameters_open.mem_nhds D.center_mem |
| 85 | have hBN : D.parameters ∈ 𝓝 (B (0, 0)) := by |
| 86 | simpa only [B, add_zero] using D.parameters_open.mem_nhds D.center_mem |
| 87 | have hA := (continuousAt_fst.prodMk ha).preimage_mem_nhds hAN |
| 88 | have hB := (continuousAt_const.prodMk ha).preimage_mem_nhds hBN |
| 89 | change ∀ᶠ z in 𝓝 (0, 0), D.cost (0, 0) ≤ D.cost z |
| 90 | rw [D.cost_zero_eq_action hM12 hc m heq] |
| 91 | filter_upwards [hA, hB] with z hzA hzB |
| 92 | let α := fun s => D.family (s, A z) |
| 93 | let β := fun s => D.family (s, B z) |
| 94 | have hα : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ α (Icc 0 b) := |
| 95 | D.smooth.comp (contMDiff_id.prodMk contMDiff_const).contMDiffOn (fun _ hs => ⟨hs, hzA⟩) |
| 96 | have hβ : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ β (Icc 0 b) := |
| 97 | D.smooth.comp (contMDiff_id.prodMk contMDiff_const).contMDiffOn (fun _ hs => ⟨hs, hzB⟩) |
| 98 | have hαclock (s : ℝ) (hs : s ∈ M14SqrtParameterInterval 0 (b ^ 2)) : |
| 99 | G.spacetime.timeFunction (α s) = T - s ^ 2 := D.clock s (hC ▸ hs) _ hzA |
| 100 | have hβclock (s : ℝ) (hs : s ∈ M14SqrtParameterInterval 0 (b ^ 2)) : |
| 101 | G.spacetime.timeFunction (β s) = T - s ^ 2 := D.clock s (hC ▸ hs) _ hzB |
| 102 | have hαx : α (Real.sqrt 0) = x := by |
| 103 | rw [Real.sqrt_zero] |
| 104 | exact (D.initial _ hzA).trans (hleft _ (D.parameter_subset _ hzA)) |
| 105 | have hβx : β (Real.sqrt 0) = x := by |
| 106 | rw [Real.sqrt_zero] |
| 107 | exact (D.initial _ hzB).trans (hleft _ (D.parameter_subset _ hzB)) |
| 108 | have hβy : β (Real.sqrt (b ^ 2)) = y := by |
| 109 | rw [Real.sqrt_sq hb.le] |
| 110 | exact (D.final _ hzB).trans hright |
| 111 | have hjoin : α (Real.sqrt (c ^ 2)) = β (Real.sqrt (c ^ 2)) := by |
| 112 | rw [Real.sqrt_sq hc.1.le] |
| 113 | obtain ⟨hyA, hmA⟩ := D.marked _ hzA |
| 114 | obtain ⟨hyB, hmB⟩ := D.marked _ hzB |
| 115 | exact hmA.trans hmB.symm |
| 116 | have hcc : c ^ 2 ∈ Ioo 0 (b ^ 2) := ⟨sq_pos_of_pos hc.1, sq_lt_sq' (by linarith [hc.1]) hc.2⟩ |
| 117 | have hcomp := minimizing_action_le_square_prefix_add_tail hM12 m hmin hcc α β |
| 118 | (hC.symm ▸ hα) (hC.symm ▸ hβ) hαclock hβclock hαx hβx hβy hjoin |
| 119 | simpa only [cost, prefixAction, tailAction, squareFamilyAction, M14SqrtParameterInterval, |
| 120 | Real.sqrt_zero, Real.sqrt_sq hb.le, Real.sqrt_sq hc.1.le, α, β, A, B] using hcomp |
| 121 | |
| 122 | end GaugeEndpointFamily |
| 123 | |
| 124 | end PoincareMT.M14 |