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 |
| 2 | import Mathlib.Algebra.Module.Torsion.Free |
| 3 | import Mathlib.Tactic.NormNum |
| 4 | |
| 5 | /-! |
| 6 | # Recovering the initial vector of a selected exponential branch |
| 7 | |
| 8 | Morgan-Tian Lemma 6.8, p. 108, and Definition 6.17, p. 113. The frozen |
| 9 | family records the initial within derivative as twice the initial vector. |
| 10 | Consequently agreement of positive-length branches determines that vector. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.M14 |
| 20 | |
| 21 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 22 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 23 | {T : ℝ} {x : G.Point} |
| 24 | |
| 25 | private theorem tangent_transport {q r : G.Point} (h : q = r) |
| 26 | (v : TangentSpace (spacetimeModel n) q) : |
| 27 | (show SpacetimeModelVector n from |
| 28 | (h ▸ v : TangentSpace (spacetimeModel n) r)) = v := by |
| 29 | cases h |
| 30 | rfl |
| 31 | |
| 32 | /-- The selected square-root path is the same branch throughout its closed |
| 33 | interval, Morgan-Tian Definition 6.17, p. 113. -/ |
| 34 | theorem exponential_square_curve_eq (E : M14ExponentialFamily G T x) |
| 35 | (Z : G.Horizontal x) {s : ℝ} (hs : (Z, s) ∈ E.domain) (hpos : 0 < s) |
| 36 | {r : ℝ} (hr : r ∈ M14SqrtParameterInterval 0 (s ^ 2)) : |
| 37 | (E.square_path Z s hs hpos).curve r = E.gamma Z r := by |
| 38 | have hr0 : 0 ≤ r := by simpa [M14SqrtParameterInterval] using hr.1 |
| 39 | have hrs : r ≤ s := by |
| 40 | simpa [M14SqrtParameterInterval, Real.sqrt_sq hpos.le] using hr.2 |
| 41 | have hsq : r ^ 2 ∈ Set.Icc 0 (s ^ 2) := |
| 42 | ⟨sq_nonneg r, (sq_le_sq₀ hr0 hpos.le).mpr hrs⟩ |
| 43 | calc |
| 44 | (E.square_path Z s hs hpos).curve r = |
| 45 | (E.path Z s hs hpos).curve (r ^ 2) := |
| 46 | (E.square_path Z s hs hpos).agrees r hr |
| 47 | _ = E.gamma Z (Real.sqrt (r ^ 2)) := E.path_coherent Z s hs hpos _ hsq |
| 48 | _ = E.gamma Z r := by rw [Real.sqrt_sq hr0] |
| 49 | |
| 50 | /-- The initial derivative, read in the fixed tangent model, is twice the |
| 51 | initial horizontal vector; Morgan-Tian Lemma 6.8, p. 108. -/ |
| 52 | theorem exponential_initial_derivative (E : M14ExponentialFamily G T x) |
| 53 | (Z : G.Horizontal x) {s : ℝ} (hs : (Z, s) ∈ E.domain) (hpos : 0 < s) : |
| 54 | (show SpacetimeModelVector n from |
| 55 | mfderivWithin (𝓘(ℝ, ℝ)) (spacetimeModel n) |
| 56 | (E.square_path Z s hs hpos).curve (M14SqrtParameterInterval 0 (s ^ 2)) |
| 57 | 0 (1 : ℝ)) = (2 : ℝ) • Z.val := by |
| 58 | obtain ⟨hbase, hderiv⟩ := E.initial_derivative Z s hs hpos |
| 59 | have hmodel := congrArg |
| 60 | (fun v : TangentSpace (spacetimeModel n) x => |
| 61 | (show SpacetimeModelVector n from v)) hderiv |
| 62 | simpa only [tangent_transport] using hmodel |
| 63 | |
| 64 | /-- Equal square-root branches on a positive interval have equal initial |
| 65 | vectors, Morgan-Tian Lemma 6.8 and Definition 6.17, pp. 108, 113. -/ |
| 66 | theorem initialVector_eq_of_square_branches_eqOn (E : M14ExponentialFamily G T x) |
| 67 | {Z W : G.Horizontal x} {s : ℝ} |
| 68 | (hZ : (Z, s) ∈ E.domain) (hW : (W, s) ∈ E.domain) (hpos : 0 < s) |
| 69 | (h : Set.EqOn (E.gamma Z) (E.gamma W) (M14SqrtParameterInterval 0 (s ^ 2))) : |
| 70 | Z = W := by |
| 71 | have hcurves : Set.EqOn (E.square_path Z s hZ hpos).curve |
| 72 | (E.square_path W s hW hpos).curve (M14SqrtParameterInterval 0 (s ^ 2)) := by |
| 73 | intro r hr |
| 74 | exact (exponential_square_curve_eq E Z hZ hpos hr).trans |
| 75 | ((h hr).trans (exponential_square_curve_eq E W hW hpos hr).symm) |
| 76 | have hzero : (0 : ℝ) ∈ M14SqrtParameterInterval 0 (s ^ 2) := by |
| 77 | exact ⟨by simp, Real.sqrt_nonneg _⟩ |
| 78 | have hd := mfderivWithin_congr_of_mem |
| 79 | (I := 𝓘(ℝ, ℝ)) (I' := spacetimeModel n) hcurves hzero |
| 80 | have hv := congrArg (fun L : ℝ →L[ℝ] SpacetimeModelVector n => L 1) hd |
| 81 | have hvectors : (2 : ℝ) • Z.val = (2 : ℝ) • W.val := |
| 82 | (exponential_initial_derivative E Z hZ hpos).symm.trans |
| 83 | (hv.trans (exponential_initial_derivative E W hW hpos)) |
| 84 | apply Subtype.ext |
| 85 | exact smul_right_injective (SpacetimeModelVector n) |
| 86 | (by norm_num : (2 : ℝ) ≠ 0) hvectors |
| 87 | |
| 88 | /-- Equal backward-time branches recover the same initial vector, using the |
| 89 | square-root reparameterization of Morgan-Tian equations (6.1)-(6.2), p. 106. -/ |
| 90 | theorem initialVector_eq_of_backward_branches_eqOn |
| 91 | (E : M14ExponentialFamily G T x) {Z W : G.Horizontal x} {s : ℝ} |
| 92 | (hZ : (Z, s) ∈ E.domain) (hW : (W, s) ∈ E.domain) (hpos : 0 < s) |
| 93 | (h : Set.EqOn (fun t => E.gamma Z (Real.sqrt t)) |
| 94 | (fun t => E.gamma W (Real.sqrt t)) (Set.Icc 0 (s ^ 2))) : Z = W := by |
| 95 | apply initialVector_eq_of_square_branches_eqOn E hZ hW hpos |
| 96 | intro r hr |
| 97 | have hr0 : 0 ≤ r := by simpa [M14SqrtParameterInterval] using hr.1 |
| 98 | have hrs : r ≤ s := by |
| 99 | simpa [M14SqrtParameterInterval, Real.sqrt_sq hpos.le] using hr.2 |
| 100 | have heq := h (show r ^ 2 ∈ Set.Icc 0 (s ^ 2) from |
| 101 | ⟨sq_nonneg r, (sq_le_sq₀ hr0 hpos.le).mpr hrs⟩) |
| 102 | simpa only [Real.sqrt_sq hr0] using heq |
| 103 | |
| 104 | end PoincareMT.M14 |