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.Surgery.Induction.Noncollapse.MinimizingRegion.DisplacementFamily |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Families.SquareFamilyAction |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.SquareRoot.Action.SquareCurveEndpoints |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.Action.PathCongruence |
| 5 | |
| 6 | /-! |
| 7 | # The actual action of the displacement family |
| 8 | |
| 9 | Proposition 16.4, p. 369, and Proposition 6.30, pp. 118-119. The genuine |
| 10 | square action is jointly continuous in displacement and the variable |
| 11 | closed upper integration limit, and constructs actual backward paths. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle Topology intervalIntegral |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.Proofs.M46 |
| 23 | |
| 24 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 25 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 26 | {T b c : ℝ} {gamma : ℝ → G.Point} {j : G.gaugeCover.index} |
| 27 | {lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval j)).Point × |
| 28 | G.gaugeCover.spatial j} {U : Set G.Point} |
| 29 | |
| 30 | /-- The literal square action, retaining the closed time set used for |
| 31 | the actual within velocity. Source: equation (6.2), p. 106. -/ |
| 32 | noncomputable def EndpointDisplacementFamily.cost |
| 33 | (D : EndpointDisplacementFamily gamma T b c j lift U) |
| 34 | (z : EuclideanSpace ℝ (Fin n) × ℝ) : ℝ := |
| 35 | ∫ s in 0..z.2, M14.squareCurveDensity G (fun r => D.family (r, z.1)) (Icc 0 b) s |
| 36 | |
| 37 | /-- Joint action continuity includes the final physical endpoint. |
| 38 | Source: Lemma 6.22, pp. 115-116, applied in Proposition 16.4, p. 369. -/ |
| 39 | theorem EndpointDisplacementFamily.cost_contDiffOn |
| 40 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 41 | (D : EndpointDisplacementFamily gamma T b c j lift U) (hb : 0 < b) : |
| 42 | ContDiffOn ℝ ∞ D.cost (D.parameters ×ˢ Icc 0 b) := by |
| 43 | exact M14.closedFamilyPrimitive_contDiffOn hb D.parameters_open _ |
| 44 | (M14.squareFamilyDensity_contDiffOn hM12 (uniqueDiffOn_Icc hb) |
| 45 | D.parameters_open D.smooth) |
| 46 | |
| 47 | /-- Every admissible positive prefix is an actual backward path with |
| 48 | the literal family action. Source: Definition 6.7, p. 108. -/ |
| 49 | theorem EndpointDisplacementFamily.exists_path |
| 50 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 51 | (D : EndpointDisplacementFamily gamma T b c j lift U) |
| 52 | {tau : ℝ} (htau : 0 < tau) (hs : Real.sqrt tau ≤ b) |
| 53 | {v : EuclideanSpace ℝ (Fin n)} (hv : v ∈ D.parameters) |
| 54 | {x y : G.Point} (hx : gamma 0 = x) (hy : D.family (Real.sqrt tau, v) = y) : |
| 55 | ∃ p : M14BackwardPath G T 0 tau x y, |
| 56 | (∀ t ∈ Icc 0 tau, p.curve t = D.family (Real.sqrt t, v)) ∧ |
| 57 | M14BackwardLAction G p = D.cost (v, Real.sqrt tau) := by |
| 58 | let alpha := fun s => D.family (s, v) |
| 59 | have halpha : ContMDiffOn (𝓘(ℝ, ℝ)) (spacetimeModel n) ∞ alpha (Icc 0 b) := |
| 60 | D.smooth.comp (contMDiff_id.prodMk contMDiff_const).contMDiffOn |
| 61 | (fun _ hr => ⟨hr, hv⟩) |
| 62 | have hsub : M14SqrtParameterInterval 0 tau ⊆ Icc 0 b := by |
| 63 | intro r hr |
| 64 | exact ⟨by simpa only [Real.sqrt_zero] using hr.1, hr.2.trans hs⟩ |
| 65 | have hclock (r : ℝ) (hr : r ∈ M14SqrtParameterInterval 0 tau) : |
| 66 | G.spacetime.timeFunction (alpha r) = T - r ^ 2 := D.clock r (hsub hr) v hv |
| 67 | have hstart : alpha (Real.sqrt 0) = x := by |
| 68 | rw [Real.sqrt_zero] |
| 69 | exact (D.initial v hv).trans hx |
| 70 | let p := M14.backwardPathOfSquareCurveBetween hM12 (by norm_num : (0 : ℝ) ≤ 0) |
| 71 | htau alpha (halpha.mono hsub) hclock hstart hy |
| 72 | refine ⟨p, fun _ _ => rfl, ?_⟩ |
| 73 | have h := M14.integral_squareCurveDensity_eq_action_between hM12 |
| 74 | (by norm_num : (0 : ℝ) ≤ 0) htau alpha halpha hsub hclock hstart hy |
| 75 | simpa only [p, EndpointDisplacementFamily.cost, alpha, Real.sqrt_zero] using h.symm |
| 76 | |
| 77 | /-- Zero displacement has exactly the original path action, without |
| 78 | assuming that the original exponential action was defined at zero. |
| 79 | Source: equation (6.2), p. 106, and Proposition 16.4, p. 369. -/ |
| 80 | theorem EndpointDisplacementFamily.cost_zero |
| 81 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 82 | (D : EndpointDisplacementFamily gamma T b c j lift U) |
| 83 | {tau : ℝ} {x y : G.Point} (p : M14BackwardPath G T 0 tau x y) |
| 84 | (hs : Real.sqrt tau ≤ b) (hx : gamma 0 = x) |
| 85 | (htrace : EqOn p.curve (fun t => gamma (Real.sqrt t)) (Icc 0 tau)) : |
| 86 | D.cost (0, Real.sqrt tau) = M14BackwardLAction G p := by |
| 87 | have hy : D.family (Real.sqrt tau, 0) = y := |
| 88 | (D.recovery _ ⟨Real.sqrt_nonneg _, hs⟩).trans |
| 89 | ((htrace ⟨p.tau_lt.le, le_rfl⟩).symm.trans p.curve_end) |
| 90 | obtain ⟨r, hr, haction⟩ := D.exists_path hM12 p.tau_lt hs D.zero_mem hx hy |
| 91 | apply haction.symm.trans |
| 92 | apply M14.action_eq_of_curve_eqOn r p |
| 93 | intro t ht |
| 94 | rw [hr t (Ioo_subset_Icc_self ht)] |
| 95 | exact (D.recovery _ ⟨Real.sqrt_nonneg _, (Real.sqrt_le_sqrt ht.2.le).trans hs⟩).trans |
| 96 | (htrace (Ioo_subset_Icc_self ht)).symm |
| 97 | |
| 98 | end PoincareMT.Proofs.M46 |