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.Attainment.Minimum.SliceMinimum |
| 2 | |
| 3 | /-! |
| 4 | # The capped free-endpoint action value |
| 5 | |
| 6 | Morgan--Tian Proposition 16.4, pp. 389-391. Adjoining the confinement |
| 7 | barrier to the set of actual slice actions gives a finite value even |
| 8 | before reachability of every slice has been proved. Whenever that value |
| 9 | is strictly below the barrier, the actual free-endpoint minimum attains it. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.Proofs.M46 |
| 20 | |
| 21 | variable {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 22 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport 3 X time I} |
| 23 | {T start : ℝ} {x : G.Point} |
| 24 | |
| 25 | /-- The actual free-endpoint action infimum with one added barrier value. |
| 26 | The added value does not represent an admissible path. -/ |
| 27 | noncomputable def cappedSliceAction |
| 28 | (G : GeneralizedLGeometryTransport 3 X time I) (T : ℝ) (x : G.Point) |
| 29 | (barrier b : ℝ) : ℝ := |
| 30 | sInf (insert barrier {a | ∃ y : G.Point, |
| 31 | ∃ p : M14BackwardPath G T 0 (b ^ 2) x y, M14BackwardLAction G p = a}) |
| 32 | |
| 33 | /-- An actual free minimum at or below the added barrier identifies |
| 34 | the capped value exactly. Source: Proposition 16.4, pp. 389-391. -/ |
| 35 | theorem cappedSliceAction_eq_of_minimum {barrier b : ℝ} {y : G.Point} |
| 36 | (p : M14BackwardPath G T 0 (b ^ 2) x y) |
| 37 | (hpB : M14BackwardLAction G p ≤ barrier) |
| 38 | (hmin : ∀ z : G.Point, ∀ q : M14BackwardPath G T 0 (b ^ 2) x z, |
| 39 | M14BackwardLAction G p ≤ M14BackwardLAction G q) : |
| 40 | cappedSliceAction G T x barrier b = M14BackwardLAction G p := by |
| 41 | apply IsLeast.csInf_eq |
| 42 | refine ⟨Or.inr ⟨y, p, rfl⟩, ?_⟩ |
| 43 | intro a ha |
| 44 | rcases ha with rfl | ⟨z, q, rfl⟩ |
| 45 | · exact hpB |
| 46 | · exact hmin z q |
| 47 | |
| 48 | /-- If no actual path lies below the barrier, the capped value equals |
| 49 | the added barrier. No attainment is asserted in this case. -/ |
| 50 | theorem cappedSliceAction_eq_barrier {barrier b : ℝ} |
| 51 | (hmin : ∀ z : G.Point, ∀ q : M14BackwardPath G T 0 (b ^ 2) x z, |
| 52 | barrier ≤ M14BackwardLAction G q) : |
| 53 | cappedSliceAction G T x barrier b = barrier := by |
| 54 | apply IsLeast.csInf_eq |
| 55 | refine ⟨Or.inl rfl, ?_⟩ |
| 56 | intro a ha |
| 57 | rcases ha with rfl | ⟨z, q, rfl⟩ |
| 58 | · exact le_rfl |
| 59 | · exact hmin z q |
| 60 | |
| 61 | /-- Every positive included slice has a finite capped value bounded by |
| 62 | every actual path action. Below the barrier, that value is attained by |
| 63 | an actual free-endpoint minimum. Source: Proposition 16.4, pp. 389-391. -/ |
| 64 | theorem cappedSliceAction_alternative |
| 65 | (hM04 : RicciFlowCurvatureTheory.{0}) |
| 66 | (hM12 : GeneralizedRicciGaugeTheory.{u} 3) |
| 67 | (LG : GeneralizedLGeometryConclusion G) |
| 68 | (E : M14ExponentialFamily G T x) (C : ActionConfinement G T start x) |
| 69 | {b : ℝ} (hb : 0 < b) (hbStart : b ^ 2 ≤ T - start) : |
| 70 | cappedSliceAction G T x C.barrier b ≤ C.barrier ∧ |
| 71 | (∀ z : G.Point, ∀ q : M14BackwardPath G T 0 (b ^ 2) x z, |
| 72 | cappedSliceAction G T x C.barrier b ≤ M14BackwardLAction G q) ∧ |
| 73 | (cappedSliceAction G T x C.barrier b = C.barrier ∨ |
| 74 | ∃ y : G.Point, ∃ p : M14BackwardPath G T 0 (b ^ 2) x y, |
| 75 | M14IsMinimizing p ∧ |
| 76 | M14BackwardLAction G p = cappedSliceAction G T x C.barrier b ∧ |
| 77 | M14BackwardLAction G p < C.barrier ∧ |
| 78 | ∀ z : G.Point, ∀ q : M14BackwardPath G T 0 (b ^ 2) x z, |
| 79 | M14BackwardLAction G p ≤ M14BackwardLAction G q) := by |
| 80 | classical |
| 81 | by_cases hreach : ∃ y : G.Point, ∃ p : M14BackwardPath G T 0 (b ^ 2) x y, |
| 82 | M14BackwardLAction G p < C.barrier |
| 83 | · obtain ⟨y0, p0, hp0⟩ := hreach |
| 84 | obtain ⟨y, p, hp, hpp0, hmin⟩ := |
| 85 | exists_confined_slice_minimum hM04 hM12 LG E C hb hbStart p0 hp0 |
| 86 | have hpB := hpp0.trans_lt hp0 |
| 87 | have heq := cappedSliceAction_eq_of_minimum p hpB.le hmin |
| 88 | exact ⟨heq.le.trans hpB.le, fun z q => heq.le.trans (hmin z q), |
| 89 | Or.inr ⟨y, p, hp, heq.symm, hpB, hmin⟩⟩ |
| 90 | · have hmin (z : G.Point) (q : M14BackwardPath G T 0 (b ^ 2) x z) : |
| 91 | C.barrier ≤ M14BackwardLAction G q := |
| 92 | le_of_not_gt (fun hq => hreach ⟨z, q, hq⟩) |
| 93 | have heq := cappedSliceAction_eq_barrier hmin |
| 94 | exact ⟨heq.le, fun z q => heq.le.trans (hmin z q), Or.inl heq⟩ |
| 95 | |
| 96 | /-- Strictly sub-barrier capped values are represented by actual branches |
| 97 | of the same selected exponential. Source: Proposition 16.4, pp. 389-391. -/ |
| 98 | theorem cappedSliceAction_exponential |
| 99 | (hM04 : RicciFlowCurvatureTheory.{0}) |
| 100 | (hM12 : GeneralizedRicciGaugeTheory.{u} 3) |
| 101 | (LG : GeneralizedLGeometryConclusion G) |
| 102 | (E : M14ExponentialFamily G T x) (C : ActionConfinement G T start x) |
| 103 | {b : ℝ} (hb : 0 < b) (hbStart : b ^ 2 ≤ T - start) |
| 104 | (hvalue : cappedSliceAction G T x C.barrier b < C.barrier) : |
| 105 | ∃ Z : G.Horizontal x, ∃ hZ : (Z, b) ∈ E.domain, |
| 106 | M14IsMinimizing (E.path Z b hZ hb) ∧ |
| 107 | E.action Z b = cappedSliceAction G T x C.barrier b := by |
| 108 | obtain h | ⟨y, p, hp, haction, _, _⟩ := |
| 109 | (cappedSliceAction_alternative hM04 hM12 LG E C hb hbStart).2.2 |
| 110 | · exact False.elim ((ne_of_lt hvalue) h) |
| 111 | obtain ⟨Z, hZsqrt, htrace, _⟩ := minimizing_exponential_branch LG E p hp |
| 112 | have hZ : (Z, b) ∈ E.domain := by simpa only [Real.sqrt_sq hb.le] using hZsqrt |
| 113 | obtain ⟨hact, hminimal⟩ := represented_minimizer_action E hb p hZ htrace |
| 114 | exact ⟨Z, hZ, hminimal.mp hp, hact.trans haction⟩ |
| 115 | |
| 116 | end PoincareMT.Proofs.M46 |