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.Variation.Jacobi.JacobiPair |
| 2 | |
| 3 | /-! |
| 4 | # Packaging an actual horizontal Jacobi pair |
| 5 | |
| 6 | Morgan-Tian Lemmas 6.10 and 6.12, pp. 109-110. The extension of |
| 7 | the second phase variable becomes the derivative extension without |
| 8 | changing its section. This gives the exact frozen second derivative. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace PoincareMT.M14 |
| 18 | |
| 19 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 20 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 21 | {γ : ℝ → G.Point} {J : Set ℝ} {Y P : ∀ s, G.Horizontal (γ s)} |
| 22 | |
| 23 | /-- An actual first-order pair gives the frozen two-derivative data |
| 24 | while preserving both extension sections, Lemmas 6.10 and 6.12, |
| 25 | pp. 109-110. -/ |
| 26 | def jacobiFieldOfPair (EY : M14PullbackExtension G γ J Y) |
| 27 | (EP : M14PullbackExtension G γ J P) |
| 28 | (hP : ∀ s ∈ J, M14HorizontalCovariantDerivative G γ J Y EY s = P s) : |
| 29 | M14JacobiFieldData G γ J where |
| 30 | field := Y |
| 31 | extension := EY |
| 32 | derivative_extension := { EP with |
| 33 | agrees := fun s hs => (EP.agrees s hs).trans (hP s hs).symm } |
| 34 | |
| 35 | /-- The packaged first derivative is the actual second phase field |
| 36 | on its stated interval, Lemmas 6.10 and 6.12, pp. 109-110. -/ |
| 37 | theorem jacobiFieldOfPair_firstDerivative (EY : M14PullbackExtension G γ J Y) |
| 38 | (EP : M14PullbackExtension G γ J P) |
| 39 | (hP : ∀ s ∈ J, M14HorizontalCovariantDerivative G γ J Y EY s = P s) |
| 40 | {s : ℝ} (hs : s ∈ J) : M14JacobiFirstDerivative (jacobiFieldOfPair EY EP hP) s = P s := |
| 41 | hP s hs |
| 42 | |
| 43 | /-- The packaged second derivative retains the actual derivative |
| 44 | of the second phase field, Lemmas 6.10 and 6.12, pp. 109-110. -/ |
| 45 | theorem jacobiFieldOfPair_secondDerivative (EY : M14PullbackExtension G γ J Y) |
| 46 | (EP : M14PullbackExtension G γ J P) |
| 47 | (hP : ∀ s ∈ J, M14HorizontalCovariantDerivative G γ J Y EY s = P s) (s : ℝ) : |
| 48 | M14JacobiSecondDerivative (jacobiFieldOfPair EY EP hP) s = |
| 49 | M14HorizontalCovariantDerivative G γ J P EP s := rfl |
| 50 | |
| 51 | variable {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 52 | {R : M14SquareRootPath G p} |
| 53 | |
| 54 | /-- Every frozen Jacobi witness yields its actual first-order phase |
| 55 | pair, including smoothness at both closed endpoints from its supplied |
| 56 | extensions, Lemmas 6.10 and 6.12, pp. 109-110. -/ |
| 57 | theorem jacobiField_isHorizontalJacobiPair |
| 58 | (Q : M14JacobiFieldData G R.curve (M14SqrtParameterInterval τ₁ τ₂)) |
| 59 | (hQ : ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, |
| 60 | ∀ W : G.Horizontal (R.curve s), M14JacobiResidual G R Q s W = 0) : |
| 61 | IsHorizontalJacobiPairOn R (Real.sqrt τ₁) (Real.sqrt τ₂) |
| 62 | (fun s => (Q.field s, M14JacobiFirstDerivative Q s)) := by |
| 63 | have hR := R.smooth.mono R.interval_subset |
| 64 | refine ⟨Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt, Subset.rfl, |
| 65 | pullbackExtension_field_contMDiffOn Q.extension hR, |
| 66 | pullbackExtension_field_contMDiffOn Q.derivative_extension hR, |
| 67 | Q.extension, Q.derivative_extension, fun _ _ => rfl, ?_⟩ |
| 68 | exact hQ |
| 69 | |
| 70 | /-- A phase solution on the full closed square interval packages |
| 71 | into the exact frozen Jacobi equation, Lemmas 6.10 and 6.12, |
| 72 | pp. 109-110. -/ |
| 73 | theorem IsHorizontalJacobiPairOn.exists_jacobiField |
| 74 | {z : ∀ s, G.Horizontal (R.curve s) × G.Horizontal (R.curve s)} |
| 75 | (h : IsHorizontalJacobiPairOn R (Real.sqrt τ₁) (Real.sqrt τ₂) z) : |
| 76 | ∃ Q : M14JacobiFieldData G R.curve (M14SqrtParameterInterval τ₁ τ₂), |
| 77 | Q.field = (fun s => (z s).1) ∧ |
| 78 | (∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, M14JacobiFirstDerivative Q s = (z s).2) ∧ |
| 79 | ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, |
| 80 | ∀ W : G.Horizontal (R.curve s), M14JacobiResidual G R Q s W = 0 := by |
| 81 | obtain ⟨EY, EP, hY, hP⟩ := h.equations |
| 82 | refine ⟨jacobiFieldOfPair EY EP hY, rfl, |
| 83 | fun _ hs => jacobiFieldOfPair_firstDerivative EY EP hY hs, ?_⟩ |
| 84 | intro s hs W |
| 85 | change horizontalJacobiPairResidual R s (z s).1 |
| 86 | (M14HorizontalCovariantDerivative G R.curve (Icc (Real.sqrt τ₁) (Real.sqrt τ₂)) |
| 87 | (fun r => (z r).1) EY s) |
| 88 | (M14HorizontalCovariantDerivative G R.curve (Icc (Real.sqrt τ₁) (Real.sqrt τ₂)) |
| 89 | (fun r => (z r).2) EP s) W = 0 |
| 90 | rw [hY s hs] |
| 91 | exact hP s hs W |
| 92 | |
| 93 | end PoincareMT.M14 |