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.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Manifold.OpenSubsetHessian |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Coordinates.GaugeScalarHessian |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Surface.VariationGaugeAcceleration |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Surface.VariationGaugeDerivative |
| 6 | |
| 7 | /-! |
| 8 | # The Hessian chain rule for an actual generalized variation |
| 9 | |
| 10 | The supplied endpoint extension gives the same acceleration appearing |
| 11 | in the ordinary coordinate chain rule. No extension of physical time |
| 12 | is required. Morgan-Tian Proposition 6.33 and Lemma 6.40, |
| 13 | pp. 120-121, 126-127. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | -- Gauge reconstruction identifies the actual horizontal tangent fibers. |
| 18 | set_option backward.isDefEq.respectTransparency false |
| 19 | |
| 20 | open Set Filter |
| 21 | open scoped Manifold ContDiff Topology |
| 22 | |
| 23 | universe u |
| 24 | |
| 25 | namespace PoincareMT.M14 |
| 26 | |
| 27 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 28 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 29 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 30 | {R : M14SquareRootPath G p} |
| 31 | |
| 32 | private theorem hessian_pair_eq_of_heq {T τ : ℝ} {q r : G.Point} |
| 33 | (h : q = r) (hq : G.spacetime.timeFunction q = T - τ) |
| 34 | (hr : G.spacetime.timeFunction r = T - τ) (f : G.Point → ℝ) |
| 35 | {Y : G.Horizontal q} {Z : G.Horizontal r} (hY : HEq Y Z) : |
| 36 | M14ReducedLengthHessianPairing G ⟨q, hq⟩ f Y Y = |
| 37 | M14ReducedLengthHessianPairing G ⟨r, hr⟩ f Z Z := by |
| 38 | cases h |
| 39 | cases hY |
| 40 | rfl |
| 41 | |
| 42 | private theorem scalar_differential_eq_of_heq {q r : G.Point} |
| 43 | (h : q = r) (f : G.Point → ℝ) |
| 44 | {Y : G.Horizontal q} {Z : G.Horizontal r} (hY : HEq Y Z) : |
| 45 | mvfderiv (spacetimeModel n) f q Y.val = mvfderiv (spacetimeModel n) f r Z.val := by |
| 46 | cases h |
| 47 | cases hY |
| 48 | rfl |
| 49 | |
| 50 | /-- Along each actual endpoint parameter curve, the second scalar |
| 51 | derivative is the frozen slice Hessian plus the actual acceleration |
| 52 | differential, Proposition 6.33 and Lemma 6.40, pp. 120-121, 126-127. -/ |
| 53 | theorem variationEndpoint_secondDeriv_comp |
| 54 | (hCoordinates : SpacetimeGaugeTheory.{u, 0} G.leafwise G.timeIntervals) |
| 55 | (V : M14LVariationData G p R) (D : M14VariationDerivativeData V) |
| 56 | {s : ℝ} (hs : s ∈ M14SqrtParameterInterval a b) |
| 57 | (f : G.Point → ℝ) (O : Set G.Point) (hO : IsOpen O) (hp : R.curve s ∈ O) |
| 58 | (hf : ContMDiffOn (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ f O) : |
| 59 | deriv (deriv (fun v => f (V.squareFamily s v))) 0 = |
| 60 | M14ReducedLengthHessianPairing G ⟨R.curve s, R.curve_time s hs⟩ f |
| 61 | (M14VariationField V s) (M14VariationField V s) + |
| 62 | mvfderiv (spacetimeModel n) f (R.curve s) |
| 63 | (M14VariationEndpointAcceleration V D s hs).val := by |
| 64 | obtain ⟨j, N, P, β, hN, hsN, hP, hzero, hPsub, hβ, hrec, hclock⟩ := |
| 65 | exists_variation_gauge_rectangle V hs |
| 66 | obtain ⟨W⟩ := ordinaryGaugeWitness_nonempty j hCoordinates |
| 67 | let S := M14SqrtParameterInterval a b ∩ N |
| 68 | have hsS : s ∈ S := ⟨hs, hsN⟩ |
| 69 | let t := (β (s, 0)).1 |
| 70 | let z : ℝ → G.gaugeCover.spatial j := fun v => (β (s, v)).2 |
| 71 | let q : ℝ → EuclideanSpace ℝ (Fin n) := fun v => (z v).val |
| 72 | let e := (G.gaugeCover.cylinder j).toMovingSpacetimeGauge |
| 73 | let F : G.gaugeCover.spatial j → G.Point := fun w => e.toSpacetime (t, w) |
| 74 | let φ : G.gaugeCover.spatial j → ℝ := f ∘ F |
| 75 | have hF : ContMDiff (𝓡 n) (spacetimeModel n) ∞ F := |
| 76 | e.smooth.comp (contMDiff_const.prodMk contMDiff_id) |
| 77 | have hbase : F (z 0) = R.curve s := (hrec s hsS 0 hzero).trans (V.square_base s) |
| 78 | have hz : ContMDiffAt (𝓘(ℝ, ℝ)) (𝓡 n) ∞ z 0 := |
| 79 | ((hβ.comp ((contMDiff_const (c := s)).prodMk contMDiff_id).contMDiffOn |
| 80 | (fun _ hv => ⟨hsS, hv⟩)) 0 hzero).snd.contMDiffAt (hP.mem_nhds hzero) |
| 81 | have hφ : ContMDiffOn (𝓡 n) (𝓘(ℝ, ℝ)) ∞ φ (F ⁻¹' O) := |
| 82 | hf.comp hF.contMDiffOn (fun _ hw => hw) |
| 83 | have htarget : z 0 ∈ F ⁻¹' O := by |
| 84 | change F (z 0) ∈ O |
| 85 | rwa [hbase] |
| 86 | have hchain := openSubset_secondDeriv_comp (G.gaugeCover.spatial j) (W.flow.connection t.val) |
| 87 | φ (F ⁻¹' O) (hO.preimage hF.continuous) hφ z hz htarget |
| 88 | have htime (r : ℝ) (hr : r ∈ S) : T - r ^ 2 ∈ (G.gaugeCover.interval j).domain := by |
| 89 | rw [← hclock r hr 0 hzero] |
| 90 | exact (β (r, 0)).1.property |
| 91 | let Γ := M08.closedChartConnection W.flow T (z 0) S (s, q 0) |
| 92 | have hc : (show EuclideanSpace ℝ (Fin n) from |
| 93 | (W.flow.connection t.val).connection (fun _ => deriv q 0) (z 0) (deriv q 0)) = |
| 94 | Γ (deriv q 0) (deriv q 0) := by |
| 95 | rw [show t.val = T - s ^ 2 from hclock s hsS 0 hzero] |
| 96 | exact openSubset_chartConnection (G.gaugeCover.spatial j) W.flow T htime (z 0) (z 0) |
| 97 | hsS (deriv q 0) (deriv q 0) |
| 98 | have hf0 : ContMDiffAt (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ f (F (z 0)) := |
| 99 | hf.contMDiffAt (hO.mem_nhds htarget) |
| 100 | have hH := movingGauge_spacetimeHessian (ordinaryGauge_movingCalculus j hCoordinates W) |
| 101 | t (z 0) (hclock s hsS 0 hzero) f hf0 (deriv q 0) (deriv q 0) |
| 102 | have hdf := movingGauge_spacetimeDifferential |
| 103 | (g := ordinaryGaugeGeometry j W) t (z 0) f hf0 |
| 104 | (deriv (deriv q) 0 + Γ (deriv q 0) (deriv q 0)) |
| 105 | have hY := variationField_gauge V j hP hzero hβ hrec hsS |
| 106 | have hA := variationEndpointAcceleration_gauge V D j hCoordinates W (z 0) |
| 107 | inter_subset_left hP hzero hPsub hβ hrec hclock hsS |
| 108 | have hnear : (fun v => f (V.squareFamily s v)) =ᶠ[𝓝 0] (fun v => φ (z v)) := by |
| 109 | filter_upwards [hP.mem_nhds hzero] with v hv |
| 110 | have ht : (β (s, v)).1 = t := Subtype.ext |
| 111 | ((hclock s hsS v hv).trans (hclock s hsS 0 hzero).symm) |
| 112 | rw [← hrec s hsS v hv] |
| 113 | change f (e.toSpacetime ((β (s, v)).1, (β (s, v)).2)) = _ |
| 114 | rw [ht] |
| 115 | rfl |
| 116 | rw [hnear.deriv.deriv_eq] |
| 117 | change deriv (deriv (fun v => φ (z v))) 0 = _ |
| 118 | change deriv (deriv (fun v => φ (z v))) 0 = |
| 119 | (W.flow.connection t.val).hessian φ (z 0) (deriv q 0) (deriv q 0) + |
| 120 | mvfderiv (𝓡 n) φ (z 0) (deriv (deriv q) 0 + |
| 121 | (show EuclideanSpace ℝ (Fin n) from |
| 122 | (W.flow.connection t.val).connection (fun _ => deriv q 0) (z 0) (deriv q 0))) at hchain |
| 123 | rw [hc] at hchain |
| 124 | exact hchain.trans ((congrArg₂ (· + ·) hH hdf).trans (congrArg₂ (· + ·) |
| 125 | (hessian_pair_eq_of_heq hbase _ _ f hY.symm) |
| 126 | (scalar_differential_eq_of_heq hbase f hA.symm))) |
| 127 | |
| 128 | end PoincareMT.M14 |