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.Pullback.SurfaceTorsion |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Pullback.PullbackCongruence |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Fields.VariationClock |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Extension.OpenFieldExtension |
| 5 | |
| 6 | /-! |
| 7 | # Commutation for the frozen generalized variation |
| 8 | |
| 9 | Morgan-Tian Lemma 6.4, pp. 107-108. The actual square-root velocity |
| 10 | has parameter-direction extensions. Its derivative in the variation |
| 11 | direction equals the frozen derivative of the variation field along |
| 12 | the base curve, for every choice of those actual extensions. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | -- The square-base equality identifies dependent horizontal fibers and scalar tangent aliases. |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter |
| 20 | open scoped Manifold ContDiff Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.M14 |
| 25 | |
| 26 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 27 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 28 | {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 29 | {R : M14SquareRootPath G p} |
| 30 | |
| 31 | /-- The actual square-root velocity has an extension in the variation |
| 32 | parameter at every closed time, as used in Lemma 6.4, pp. 107-108. -/ |
| 33 | theorem exists_variation_velocity_parameter_extension (V : M14LVariationData G p R) |
| 34 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) : |
| 35 | Nonempty (M14PullbackExtension G (fun u => V.squareFamily s u) V.parameterDomain |
| 36 | (variationSquareVelocity V s)) := by |
| 37 | have hP : IsOpen V.parameterDomain := by rw [V.parameterDomain_eq]; exact isOpen_Ioo |
| 38 | apply exists_pullbackExtension_of_isOpen hP |
| 39 | exact (variationSquareVelocity_smooth V).comp |
| 40 | ((contMDiff_const (c := s)).prodMk contMDiff_id).contMDiffOn (fun _ hu => ⟨hs, hu⟩) |
| 41 | |
| 42 | /-- At an interior square-root time the actual within velocity is |
| 43 | the projected unrestricted surface tangent; Lemma 6.4, pp. 107-108. -/ |
| 44 | theorem variationSquareVelocity_eq_surfaceHorizontalFst (V : M14LVariationData G p R) |
| 45 | {s : ℝ} (hs : s ∈ Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) (u : ℝ) : |
| 46 | variationSquareVelocity V s u = |
| 47 | surfaceHorizontalFst (fun z => V.squareFamily z.1 z.2) s u := by |
| 48 | unfold variationSquareVelocity surfaceHorizontalFst |
| 49 | erw [mfderivWithin_of_mem_nhds (Icc_mem_nhds hs.1 hs.2)] |
| 50 | |
| 51 | private theorem horizontal_transport_heq {q r : G.Point} (h : q = r) |
| 52 | (v : G.Horizontal q) : HEq (h.symm ▸ v : G.Horizontal r) v := by |
| 53 | cases h |
| 54 | rfl |
| 55 | |
| 56 | set_option maxHeartbeats 1000000 in |
| 57 | -- The two frozen extension records are transported to the same surface before commutation. |
| 58 | /-- The frozen variation field derivative equals the parameter |
| 59 | derivative of the actual square-root velocity, for all extension |
| 60 | choices and interior square-root times; Lemma 6.4, pp. 107-108. -/ |
| 61 | theorem variation_covariantDerivative_commute |
| 62 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 63 | (V : M14LVariationData G p R) (D : M14VariationDerivativeData V) |
| 64 | {s : ℝ} (hs : s ∈ Ioo (Real.sqrt τ₁) (Real.sqrt τ₂)) |
| 65 | (E : M14PullbackExtension G (fun u => V.squareFamily s u) V.parameterDomain |
| 66 | (variationSquareVelocity V s)) : |
| 67 | HEq (M14HorizontalCovariantDerivative G R.curve (M14SqrtParameterInterval τ₁ τ₂) |
| 68 | (M14VariationField V) D.variation_extension s) |
| 69 | (M14HorizontalCovariantDerivative G (fun u => V.squareFamily s u) V.parameterDomain |
| 70 | (variationSquareVelocity V s) E 0) := by |
| 71 | let α : ℝ × ℝ → G.Point := fun z => V.squareFamily z.1 z.2 |
| 72 | have hP : IsOpen V.parameterDomain := by rw [V.parameterDomain_eq]; exact isOpen_Ioo |
| 73 | have hzero : (0 : ℝ) ∈ V.parameterDomain := by |
| 74 | rw [V.parameterDomain_eq] |
| 75 | exact ⟨neg_neg_of_pos V.radius_pos, V.radius_pos⟩ |
| 76 | have hbase : R.curve = fun r => α (r, 0) := (funext V.square_base).symm |
| 77 | have hfield : ∀ r ∈ M14SqrtParameterInterval τ₁ τ₂, |
| 78 | HEq (M14VariationField V r) (surfaceHorizontalSnd α r 0) := by |
| 79 | intro r _ |
| 80 | exact horizontal_transport_heq (V.square_base r) _ |
| 81 | have hvelocity : ∀ v ∈ V.parameterDomain, |
| 82 | HEq (variationSquareVelocity V s v) (surfaceHorizontalFst α s v) := by |
| 83 | intro v _ |
| 84 | exact heq_of_eq (variationSquareVelocity_eq_surfaceHorizontalFst V hs v) |
| 85 | let ES := pullbackExtensionCongr D.variation_extension hbase hfield |
| 86 | let EU := pullbackExtensionCongr E rfl hvelocity |
| 87 | have hα : ContMDiffOn ((𝓘(ℝ)).prod 𝓘(ℝ)) (spacetimeModel n) ∞ α |
| 88 | (Ioo (Real.sqrt τ₁) (Real.sqrt τ₂) ×ˢ V.parameterDomain) := |
| 89 | V.square_smooth.mono (fun z hz => V.square_contains ⟨Ioo_subset_Icc_self hz.1, hz.2⟩) |
| 90 | have hc := horizontalCovariantDerivative_surface_commute hCoordinates |
| 91 | (isOpen_Ioo.prod hP) hα ⟨hs, hzero⟩ (Icc_mem_nhds hs.1 hs.2) (hP.mem_nhds hzero) ES EU |
| 92 | exact (horizontalCovariantDerivative_congr D.variation_extension hbase hfield s).trans |
| 93 | ((heq_of_eq hc).trans (horizontalCovariantDerivative_congr E rfl hvelocity 0).symm) |
| 94 | |
| 95 | end PoincareMT.M14 |