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.Paths.SquareRoot.Action.SquareRootAction |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Paths.Action.PathCongruence |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.Domain.MaximalCoherence |
| 4 | |
| 5 | /-! |
| 6 | # Coherent actual action of the selected initial-value family |
| 7 | |
| 8 | Morgan-Tian equation (6.2) and Definition 6.17, pp. 106, 113. |
| 9 | The action is the actual selected path action at positive survival |
| 10 | and zero elsewhere. Actual uniqueness removes the choice, and |
| 11 | restriction represents it by one square-density primitive on every |
| 12 | supplied closed prefix. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff intervalIntegral |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M14 |
| 23 | |
| 24 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 25 | {I : SpacetimeInterval} |
| 26 | |
| 27 | /-- The actual selected IVP action, with zero outside positive |
| 28 | survival, equation (6.2) and Definition 6.17, pp. 106, 113. -/ |
| 29 | noncomputable def initialValueAction (G : GeneralizedLGeometryTransport n X time I) |
| 30 | (T : ℝ) (x : G.Point) (Z : G.Horizontal x) (s : ℝ) : ℝ := by |
| 31 | classical |
| 32 | exact if h : initialValueSurvives G T x Z s then |
| 33 | M14BackwardLAction G (selectedInitialValuePath h).path else 0 |
| 34 | |
| 35 | variable {G : GeneralizedLGeometryTransport n X time I} {T τ : ℝ} |
| 36 | {x y y' : G.Point} {Z : G.Horizontal x} |
| 37 | |
| 38 | /-- The selected action vanishes at square time zero, the endpoint |
| 39 | convention of equation (6.2), p. 106. -/ |
| 40 | theorem initialValueAction_zero (Z : G.Horizontal x) : initialValueAction G T x Z 0 = 0 := by |
| 41 | unfold initialValueAction |
| 42 | rw [dif_neg (show ¬ initialValueSurvives G T x Z 0 from fun h => (lt_irrefl 0) h.1)] |
| 43 | |
| 44 | /-- Actual normalized paths with the same data have equal actions, |
| 45 | by actual endpoint and curve uniqueness, Definition 6.17 and |
| 46 | Lemma 6.18, pp. 113-114. -/ |
| 47 | theorem initialValuePath_action_eq |
| 48 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 49 | (P : M14SquareRootInitialValuePath G T τ x y Z) |
| 50 | (Q : M14SquareRootInitialValuePath G T τ x y' Z) : |
| 51 | M14BackwardLAction G P.path = M14BackwardLAction G Q.path := by |
| 52 | have hy := initialValuePath_endpoint_eq hM04 hM12 P Q |
| 53 | subst y' |
| 54 | apply action_eq_of_curve_eqOn P.path Q.path |
| 55 | intro r hr |
| 56 | apply initialValuePath_curve_eqOn hM04 hM12 P Q |
| 57 | simpa only [min_self] using Ioo_subset_Icc_self hr |
| 58 | |
| 59 | /-- Every supplied actual IVP realizes the selected action at its |
| 60 | positive final square time, Definition 6.17 and Lemma 6.18, |
| 61 | pp. 113-114. -/ |
| 62 | theorem initialValueAction_eq_of_path |
| 63 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 64 | {s : ℝ} (hs : 0 < s) (P : M14SquareRootInitialValuePath G T (s ^ 2) x y Z) : |
| 65 | initialValueAction G T x Z s = M14BackwardLAction G P.path := by |
| 66 | have hsurv : initialValueSurvives G T x Z s := ⟨hs, y, ⟨P⟩⟩ |
| 67 | unfold initialValueAction |
| 68 | rw [dif_pos hsurv] |
| 69 | exact initialValuePath_action_eq hM04 hM12 (selectedInitialValuePath hsurv) P |
| 70 | |
| 71 | /-- The action along every supplied closed prefix is the primitive |
| 72 | of that path's actual square density, including the zero endpoint, |
| 73 | equation (6.2) and Lemma 6.18, pp. 106, 113-114. -/ |
| 74 | theorem initialValueAction_eq_integral_prefix |
| 75 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 76 | (P : M14SquareRootInitialValuePath G T τ x y Z) {r : ℝ} |
| 77 | (hr : r ∈ Icc 0 (Real.sqrt τ)) : |
| 78 | initialValueAction G T x Z r = ∫ s in 0..r, squareRootLIntegrand P.square_path s := by |
| 79 | rcases eq_or_lt_of_le hr.1 with hr₀ | hr₀ |
| 80 | · subst r |
| 81 | rw [initialValueAction_zero, intervalIntegral.integral_same] |
| 82 | · have hsq : r ^ 2 ≤ τ := (sq_le_sq₀ hr₀.le (Real.sqrt_nonneg τ)).mpr hr.2 |>.trans_eq |
| 83 | (Real.sq_sqrt P.path.tau_lt.le) |
| 84 | let Q := initialValuePathRestrict P (sq_pos_of_pos hr₀) hsq |
| 85 | rw [initialValueAction_eq_of_path hM04 hM12 hr₀ Q, |
| 86 | ← integral_squareRootLIntegrand_eq_action Q.square_path, Real.sqrt_zero, |
| 87 | Real.sqrt_sq hr₀.le] |
| 88 | rfl |
| 89 | |
| 90 | end PoincareMT.M14 |