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.Endpoint.EndpointCost |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.Endpoint.EndpointLineField |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.Families.ParameterLineVariation |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.Families.ParameterActionDifferential |
| 5 | |
| 6 | /-! |
| 7 | # The prefix differential is the actual spatial momentum |
| 8 | |
| 9 | Morgan-Tian Lemma 6.22 and Proposition 6.30, pp. 115-116, 118-119. |
| 10 | The independent endpoint removes the initial-vector component from |
| 11 | first variation. Actual gauge coordinates of the Euler velocity |
| 12 | identify the remaining covector through the prescribed metric. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | -- Equal actual basepoints transport both arguments of the metric pairing. |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff |
| 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 | |
| 29 | private theorem horizontal_heq_of_val_eq {q r : G.Point} (h : q = r) |
| 30 | {v : G.Horizontal q} {w : G.Horizontal r} (hv : v.val = w.val) : HEq v w := by |
| 31 | cases h |
| 32 | exact heq_of_eq (Subtype.ext hv) |
| 33 | |
| 34 | private theorem inner_pair_heq {q r : G.Point} (h : q = r) |
| 35 | {v w : G.Horizontal q} {v' w' : G.Horizontal r} (hv : HEq v v') (hw : HEq w w') : |
| 36 | G.spacetime.horizontalMetric.inner q v w = G.spacetime.horizontalMetric.inner r v' w' := by |
| 37 | cases h |
| 38 | cases hv |
| 39 | cases hw |
| 40 | rfl |
| 41 | |
| 42 | namespace GaugeEndpointFamily |
| 43 | |
| 44 | variable {f : ℝ × ℝ → G.Point} {U : Set ℝ} {T B c : ℝ} |
| 45 | {j : G.gaugeCover.index} |
| 46 | {lift : G.Point → (G.timeIntervals.interval (G.gaugeCover.interval j)).Point × |
| 47 | G.gaugeCover.spatial j} |
| 48 | (D : GaugeEndpointFamily f U T 0 B c 0 j lift) |
| 49 | |
| 50 | /-- At an actual Euler diagonal the prefix differential depends |
| 51 | only on the independent endpoint direction and equals the genuine |
| 52 | spatial metric momentum, Proposition 6.30, pp. 118-119. -/ |
| 53 | theorem prefixAction_fderiv_of_velocity |
| 54 | (hCoordinates : M12MetricPredecessors.{0} n) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 55 | (hc : c ∈ Ioo 0 B) {x y : G.Point} {p : M14BackwardPath G T 0 (c ^ 2) x y} |
| 56 | (R : M14SquareRootPath G p) |
| 57 | (E : M14PullbackExtension G R.curve (M14SqrtParameterInterval 0 (c ^ 2)) R.horizontal_velocity) |
| 58 | (hEuler : ∀ s ∈ M14SqrtParameterInterval 0 (c ^ 2), ∀ W, |
| 59 | M14SquareRootEulerResidual G R E s W = 0) |
| 60 | (r : ℝ) (hr : (r, (lift (f (c, r))).2.val) ∈ D.parameters) |
| 61 | (hbase : ∀ s ∈ Icc 0 c, f (s, r) = R.curve s) |
| 62 | (hleft : ∀ u ∈ U, f (0, u) = x) (ξ : EuclideanSpace ℝ (Fin n)) |
| 63 | (hvel : HEq (R.horizontal_velocity c) ((G.gaugeCover.metric j).spatialTangentEquiv |
| 64 | (lift (f (c, 0))).1 (lift (f (c, r))).2 ξ)) |
| 65 | (d : ℝ × EuclideanSpace ℝ (Fin n)) : |
| 66 | fderiv ℝ D.prefixAction (r, (lift (f (c, r))).2.val) d = |
| 67 | ((G.gaugeCover.metric j).metric (lift (f (c, 0))).1.val).inner (lift (f (c, r))).2 ξ d.2 := by |
| 68 | have hC : M14SqrtParameterInterval 0 (c ^ 2) = Icc 0 c := by |
| 69 | rw [M14SqrtParameterInterval, Real.sqrt_zero, Real.sqrt_sq hc.1.le] |
| 70 | have hsub : M14SqrtParameterInterval 0 (c ^ 2) ⊆ Icc 0 B := |
| 71 | fun _ hs => ⟨(hC ▸ hs).1, (hC ▸ hs).2.trans hc.2.le⟩ |
| 72 | let z : ℝ × EuclideanSpace ℝ (Fin n) := (r, (lift (f (c, r))).2.val) |
| 73 | have hzero (s : ℝ) (hs : s ∈ M14SqrtParameterInterval 0 (c ^ 2)) : |
| 74 | D.family (s, z) = R.curve s := |
| 75 | (D.recovery z hr s (hsub hs)).trans (hbase s (hC ▸ hs)) |
| 76 | obtain ⟨V, hparam, hV⟩ := exists_parameterLineVariation hM12 R D.family D.parameters_open |
| 77 | D.smooth hsub D.clock z d hr hzero |
| 78 | have hs0 : (0 : ℝ) ∈ M14SqrtParameterInterval 0 (c ^ 2) := by |
| 79 | rw [hC] |
| 80 | exact ⟨le_rfl, hc.1.le⟩ |
| 81 | have hsc : c ∈ M14SqrtParameterInterval 0 (c ^ 2) := by |
| 82 | rw [hC] |
| 83 | exact ⟨hc.1.le, le_rfl⟩ |
| 84 | have hfield0 : M14VariationField V (Real.sqrt 0) = 0 := by |
| 85 | rw [Real.sqrt_zero] |
| 86 | exact D.variationField_line_initial_zero V z d hparam (hV 0 hs0) hleft |
| 87 | have hdiff : DifferentiableAt ℝ |
| 88 | (squareFamilyAction G D.family (Icc 0 B) (Real.sqrt 0) (Real.sqrt (c ^ 2))) z := by |
| 89 | rw [Real.sqrt_zero, Real.sqrt_sq hc.1.le] |
| 90 | exact (D.prefixAction_contDiffAt hM12 hc hr).differentiableAt (by simp) |
| 91 | have hderiv := fderiv_squareFamilyAction_euler_line hCoordinates hM12 E hEuler V D.family |
| 92 | D.smooth hsub D.clock z d hparam hV hfield0 hdiff |
| 93 | have hfun : squareFamilyAction G D.family (Icc 0 B) (Real.sqrt 0) (Real.sqrt (c ^ 2)) = |
| 94 | D.prefixAction := by |
| 95 | rw [Real.sqrt_zero, Real.sqrt_sq hc.1.le] |
| 96 | rfl |
| 97 | rw [hfun] at hderiv |
| 98 | obtain ⟨hy, hfield⟩ := D.variationField_line_marked V hsc z d hr hparam (hV c hsc) |
| 99 | obtain ⟨hy', hmark⟩ := D.marked z hr |
| 100 | have hpoint : R.curve c = (G.gaugeCover.cylinder j).toSpacetime |
| 101 | ((lift (f (c, 0))).1, (lift (f (c, r))).2) := |
| 102 | (hzero c hsc).symm.trans hmark |
| 103 | have hfield' : HEq (M14VariationField V c) ((G.gaugeCover.metric j).spatialTangentEquiv |
| 104 | (lift (f (c, 0))).1 (lift (f (c, r))).2 d.2) := |
| 105 | horizontal_heq_of_val_eq hpoint hfield |
| 106 | have hpair := inner_pair_heq hpoint hvel hfield' |
| 107 | rw [← (G.gaugeCover.metric j).metric_eq] at hpair |
| 108 | have hboundary := congrArg (fun s => G.spacetime.horizontalMetric.inner (R.curve s) |
| 109 | (R.horizontal_velocity s) (M14VariationField V s)) (Real.sqrt_sq hc.1.le) |
| 110 | exact hderiv.trans (hboundary.trans hpair) |
| 111 | |
| 112 | end GaugeEndpointFamily |
| 113 | |
| 114 | end PoincareMT.M14 |