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.Stability.StablePrefix |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.InitialValue.InitialVector |
| 3 | |
| 4 | /-! |
| 5 | # Recovering a confined minimizer from a fixed stable prefix |
| 6 | |
| 7 | An actual square Euler path is a branch of the supplied exponential |
| 8 | family. If its minimizing prefix reaches a fixed stable endpoint, the |
| 9 | stable slice's uniqueness identifies its initial vector. This step |
| 10 | uses fixed-time stability only. Morgan-Tian Lemma 6.18 and Proposition |
| 11 | 6.30, pp. 114, 118-119, in the proof of Proposition 6.56, p. 133. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 25 | {T b τ : ℝ} {x y : G.Point} |
| 26 | |
| 27 | private theorem initialValuePath_cast_curve {c : ℝ} {Z : G.Horizontal x} |
| 28 | (h : b = c) (P : M14SquareRootInitialValuePath G T b x y Z) : |
| 29 | (h ▸ P : M14SquareRootInitialValuePath G T c x y Z).path.curve = P.path.curve := by |
| 30 | cases h |
| 31 | rfl |
| 32 | |
| 33 | /-- Every actual zero-start square Euler path belongs to the supplied |
| 34 | exponential family, with its actual transported initial velocity. |
| 35 | Lemma 6.18, p. 114. -/ |
| 36 | theorem exists_exponential_branch_of_square_euler (E : M14ExponentialFamily G T x) |
| 37 | {p : M14BackwardPath G T 0 b x y} (R : M14SquareRootPath G p) |
| 38 | (ER : M14PullbackExtension G R.curve (M14SqrtParameterInterval 0 b) |
| 39 | R.horizontal_velocity) |
| 40 | (hEuler : ∀ s ∈ M14SqrtParameterInterval 0 b, ∀ W, |
| 41 | M14SquareRootEulerResidual G R ER s W = 0) : |
| 42 | ∃ Z : G.Horizontal x, (Z, Real.sqrt b) ∈ E.domain ∧ |
| 43 | EqOn p.curve (fun t => E.gamma Z (Real.sqrt t)) (Icc 0 b) := by |
| 44 | have hb : 0 < b := p.tau_lt |
| 45 | have hzero : (0 : ℝ) ∈ M14SqrtParameterInterval 0 b := by |
| 46 | exact ⟨by simp, Real.sqrt_nonneg b⟩ |
| 47 | have h0 : R.curve 0 = x := by |
| 48 | simpa only [zero_pow (by norm_num : (2 : ℕ) ≠ 0)] using |
| 49 | (R.agrees 0 hzero).trans (by simpa using p.curve_start) |
| 50 | let Z : G.Horizontal x := (1 / 2 : ℝ) • (h0 ▸ R.horizontal_velocity 0) |
| 51 | let P : M14SquareRootInitialValuePath G T b x y Z := { |
| 52 | path := p |
| 53 | square_path := R |
| 54 | extension := ER |
| 55 | euler := hEuler |
| 56 | initial_velocity := ⟨h0, by |
| 57 | dsimp only [Z] |
| 58 | rw [smul_smul] |
| 59 | norm_num⟩ } |
| 60 | let P' : M14SquareRootInitialValuePath G T ((Real.sqrt b) ^ 2) x y Z := |
| 61 | (Real.sq_sqrt hb.le).symm ▸ P |
| 62 | have hPcurve : P'.path.curve = p.curve := |
| 63 | initialValuePath_cast_curve (Real.sq_sqrt hb.le).symm P |
| 64 | refine ⟨Z, (E.positive_survival_iff Z (Real.sqrt b) (Real.sqrt_pos.mpr hb)).mpr |
| 65 | ⟨y, ⟨P'⟩⟩, ?_⟩ |
| 66 | simpa only [hPcurve, Real.sq_sqrt hb.le] using |
| 67 | E.initial_value_agreement Z (Real.sqrt b) (Real.sqrt_pos.mpr hb) y P' |
| 68 | |
| 69 | private theorem minimizing_curves_eqOn_of_endpoint_eq {z w : G.Point} |
| 70 | (p : M14BackwardPath G T 0 τ x z) (q : M14BackwardPath G T 0 τ x w) |
| 71 | (h : z = w) |
| 72 | (hunique : ∀ r : M14BackwardPath G T 0 τ x z, |
| 73 | M14IsMinimizing r → EqOn r.curve p.curve (Icc 0 τ)) |
| 74 | (hq : M14IsMinimizing q) : EqOn q.curve p.curve (Icc 0 τ) := by |
| 75 | cases h |
| 76 | exact hunique q hq |
| 77 | |
| 78 | /-- A minimizing path whose strict prefix reaches a fixed stable |
| 79 | endpoint has the same initial vector as that stable branch. No |
| 80 | future joint stability is presumed, Proposition 6.30, pp. 118-119. -/ |
| 81 | theorem initialVector_eq_of_minimizing_stable_prefix |
| 82 | (hM12 : GeneralizedRicciGaugeTheory.{u} n) (E : M14ExponentialFamily G T x) |
| 83 | (H : M14StableSet G T τ x E) {Z W : G.Horizontal x} (hZ : Z ∈ H.carrier) |
| 84 | (p : M14BackwardPath G T 0 b x y) (hp : M14IsMinimizing p) |
| 85 | (hW : (W, Real.sqrt b) ∈ E.domain) (hτb : τ < b) |
| 86 | (hcurve : EqOn p.curve (fun t => E.gamma W (Real.sqrt t)) (Icc 0 b)) |
| 87 | (hpoint : p.curve τ = H.endpoint_map Z) : W = Z := by |
| 88 | obtain ⟨q, hqcurve, _, hqunique⟩ := H.minimizing_path Z hZ |
| 89 | have hprefix := isMinimizing_prefixPath hM12 p hp ⟨H.tau_pos, hτb⟩ |
| 90 | have heq := minimizing_curves_eqOn_of_endpoint_eq q |
| 91 | (prefixPath p τ H.tau_pos hτb.le) hpoint.symm hqunique hprefix |
| 92 | have hWτ : (W, Real.sqrt τ) ∈ E.domain := |
| 93 | (E.maximal_lifetime W).out (E.domain_zero W) hW |
| 94 | ⟨Real.sqrt_nonneg τ, Real.sqrt_le_sqrt hτb.le⟩ |
| 95 | apply initialVector_eq_of_backward_branches_eqOn E hWτ |
| 96 | (H.survivor Z hZ) (Real.sqrt_pos.mpr H.tau_pos) |
| 97 | rw [Real.sq_sqrt H.tau_pos.le] |
| 98 | intro t ht |
| 99 | exact (hcurve ⟨ht.1, ht.2.trans hτb.le⟩).symm.trans |
| 100 | ((heq ht).trans (hqcurve ht)) |
| 101 | |
| 102 | /-- A supplied stable branch minimizes at every positive earlier |
| 103 | time, including the stable terminal time itself, Proposition 6.30, |
| 104 | pp. 118-119. -/ |
| 105 | theorem exponentialPath_minimizing_of_stable_prefix |
| 106 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 107 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 108 | (E : M14ExponentialFamily G T x) (H : M14StableSet G T τ x E) |
| 109 | {Z : G.Horizontal x} (hZ : Z ∈ H.carrier) {s : ℝ} |
| 110 | (hs : 0 < s) (hst : s ^ 2 ≤ τ) (hD : (Z, s) ∈ E.domain) : |
| 111 | M14IsMinimizing (E.path Z s hD hs) := by |
| 112 | obtain ⟨_, _, U, _, hZU, hbranch⟩ := (H.carrier_exact Z).mp hZ |
| 113 | apply exponentialPath_minimizing_of_uniqueBranch E hs hD |
| 114 | rcases lt_or_eq_of_le hst with hlt | heq |
| 115 | · exact uniqueMinimizingBranch_prefix hM04 hCoordinates hM12 E |
| 116 | (sq_pos_of_pos hs) hlt (hbranch Z hZU) |
| 117 | · simpa only [heq] using hbranch Z hZU |
| 118 | |
| 119 | end PoincareMT.M14 |