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.Basic |
| 2 | |
| 3 | /-! |
| 4 | # Transporting actual pullback extensions |
| 5 | |
| 6 | Morgan-Tian Lemma 6.4, pp. 107-108. Equal base curves and fields equal |
| 7 | on their parameter set identify pullback extensions without changing |
| 8 | their parameter-dependent sections or their actual derivatives. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | -- Equal base points identify the frozen dependent horizontal tangent fibers. |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open scoped Manifold |
| 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 | {γ γ' : ℝ → G.Point} {J : Set ℝ} |
| 24 | {Y : ∀ s, G.Horizontal (γ s)} {Y' : ∀ s, G.Horizontal (γ' s)} |
| 25 | |
| 26 | /-- Transport an actual extension along an equality of base curves |
| 27 | and on-set equality of fields; Lemma 6.4, pp. 107-108. -/ |
| 28 | def pullbackExtensionCongr (E : M14PullbackExtension G γ J Y) |
| 29 | (hγ : γ = γ') (hY : ∀ s ∈ J, HEq (Y s) (Y' s)) : |
| 30 | M14PullbackExtension G γ' J Y' := by |
| 31 | subst γ' |
| 32 | exact { E with agrees := fun s hs => (E.agrees s hs).trans (eq_of_heq (hY s hs)) } |
| 33 | |
| 34 | /-- Transporting the curve and its field preserves the exact frozen |
| 35 | pullback derivative; Lemma 6.4, pp. 107-108. -/ |
| 36 | theorem horizontalCovariantDerivative_congr |
| 37 | (E : M14PullbackExtension G γ J Y) (hγ : γ = γ') |
| 38 | (hY : ∀ s ∈ J, HEq (Y s) (Y' s)) (s : ℝ) : |
| 39 | HEq (M14HorizontalCovariantDerivative G γ J Y E s) |
| 40 | (M14HorizontalCovariantDerivative G γ' J Y' (pullbackExtensionCongr E hγ hY) s) := by |
| 41 | subst γ' |
| 42 | rfl |
| 43 | |
| 44 | private theorem section_apply_heq (S : HorizontalSection G.spacetime) |
| 45 | {q r : G.Point} (h : q = r) : HEq (S q) (S r) := by |
| 46 | cases h |
| 47 | rfl |
| 48 | |
| 49 | /-- On-set equality of base curves and fields transports an actual |
| 50 | pullback extension, including closed endpoints, Lemma 6.8, pp. 108-109. -/ |
| 51 | def pullbackExtensionCongrOn (E : M14PullbackExtension G γ J Y) |
| 52 | (hγ : Set.EqOn γ γ' J) (hY : ∀ s ∈ J, HEq (Y s) (Y' s)) : |
| 53 | M14PullbackExtension G γ' J Y' where |
| 54 | extension := E.extension |
| 55 | domain := E.domain |
| 56 | domain_open := E.domain_open |
| 57 | graph_mem := fun s hs => hγ hs ▸ E.graph_mem s hs |
| 58 | spatial_smooth := E.spatial_smooth |
| 59 | joint_smooth := by |
| 60 | obtain ⟨U, hU, hgraph, hsmooth⟩ := E.joint_smooth |
| 61 | exact ⟨U, hU, fun s hs => hγ hs ▸ hgraph s hs, hsmooth⟩ |
| 62 | agrees := by |
| 63 | intro s hs |
| 64 | exact eq_of_heq ((section_apply_heq (E.extension s) (hγ hs).symm).trans |
| 65 | ((heq_of_eq (E.agrees s hs)).trans (hY s hs))) |
| 66 | parameter_derivative := by |
| 67 | intro s hs |
| 68 | rw [← hγ hs] |
| 69 | exact E.parameter_derivative s hs |
| 70 | |
| 71 | private theorem pullbackDerivative_heq (S : ℝ → HorizontalSection G.spacetime) |
| 72 | {q r : G.Point} (h : q = r) {v : TangentSpace (spacetimeModel n) q} |
| 73 | {w : TangentSpace (spacetimeModel n) r} (hv : HEq v w) (s : ℝ) : |
| 74 | HEq (deriv (fun t => S t q) s + rawHorizontalCovariantDerivative G.leafwise (S s) q v) |
| 75 | (deriv (fun t => S t r) s + rawHorizontalCovariantDerivative G.leafwise (S s) r w) := by |
| 76 | cases h |
| 77 | cases hv |
| 78 | rfl |
| 79 | |
| 80 | /-- The actual within pullback derivative respects equality on the |
| 81 | parameter set, including its endpoints, Lemma 6.8, pp. 108-109. -/ |
| 82 | theorem horizontalCovariantDerivative_congrOn |
| 83 | (E : M14PullbackExtension G γ J Y) (hγ : Set.EqOn γ γ' J) |
| 84 | (hY : ∀ s ∈ J, HEq (Y s) (Y' s)) {s : ℝ} (hs : s ∈ J) : |
| 85 | HEq (M14HorizontalCovariantDerivative G γ J Y E s) |
| 86 | (M14HorizontalCovariantDerivative G γ' J Y' (pullbackExtensionCongrOn E hγ hY) s) := by |
| 87 | have hd := mfderivWithin_congr_of_mem (I := 𝓘(ℝ, ℝ)) |
| 88 | (I' := spacetimeModel n) hγ hs |
| 89 | dsimp only [M14HorizontalCovariantDerivative, pullbackExtensionCongrOn] |
| 90 | apply pullbackDerivative_heq (G := G) E.extension (hγ hs) (s := s) |
| 91 | exact heq_of_eq (congrArg (fun A => A (1 : ℝ)) hd) |
| 92 | |
| 93 | end PoincareMT.M14 |