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.ReducedLength |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Fields.VariationHessianChain |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.Fields.VariationContact |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Variation.IndexForm.RealizedIndex |
| 5 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Barrier.SecondDerivativeComparison |
| 6 | |
| 7 | /-! |
| 8 | # Actual lower-contact Hessians bounded by geometric index forms |
| 9 | |
| 10 | The terminal acceleration in the scalar chain rule cancels its exact |
| 11 | second-variation boundary contribution. Smooth field realization then |
| 12 | allows every actual initial-zero horizontal test field. |
| 13 | Morgan-Tian Lemma 6.40 and Proposition 6.43, pp. 126-128. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Topology intervalIntegral |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M14 |
| 24 | |
| 25 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 26 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 27 | {T a b : ℝ} {x y : G.Point} {p : M14BackwardPath G T a b x y} |
| 28 | {R : M14SquareRootPath G p} |
| 29 | |
| 30 | /-- An actual fixed initial endpoint gives a constant square endpoint |
| 31 | curve on the open parameter interval, Lemma 6.40, pp. 126-127. -/ |
| 32 | theorem initialFixed_squareEndpoint_constant (V : M14LVariationData G p R) |
| 33 | (hfix : V.left_endpoint_fixed) : |
| 34 | EqOn (V.squareFamily (Real.sqrt a)) (fun _ => V.squareFamily (Real.sqrt a) 0) |
| 35 | V.parameterDomain := by |
| 36 | have hzero : (0 : ℝ) ∈ V.parameterDomain := by |
| 37 | rw [V.parameterDomain_eq] |
| 38 | exact ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩ |
| 39 | have hpoint (v : ℝ) (hv : v ∈ V.parameterDomain) : |
| 40 | V.squareFamily (Real.sqrt a) v = p.curve a := by |
| 41 | rw [V.square_agrees _ ⟨le_rfl, Real.sqrt_le_sqrt p.tau_lt.le⟩ v hv, |
| 42 | Real.sq_sqrt p.tau_nonneg] |
| 43 | exact (V.left_endpoint_fixed_spec.mp hfix) v hv |
| 44 | exact fun v hv => (hpoint v hv).trans (hpoint 0 hzero).symm |
| 45 | |
| 46 | /-- A fixed initial endpoint leaves precisely the terminal acceleration |
| 47 | pair in second variation, Proposition 6.33, pp. 120-121. -/ |
| 48 | theorem secondVariationBoundaryTerm_initialFixed (V : M14LVariationData G p R) |
| 49 | (D : M14VariationDerivativeData V) (hfix : V.left_endpoint_fixed) : |
| 50 | M14SecondVariationBoundaryTerm V D = |
| 51 | G.spacetime.horizontalMetric.inner (R.curve (Real.sqrt b)) |
| 52 | (R.horizontal_velocity (Real.sqrt b)) |
| 53 | (M14VariationEndpointAcceleration V D (Real.sqrt b) |
| 54 | ⟨Real.sqrt_le_sqrt p.tau_lt.le, le_rfl⟩) := by |
| 55 | have hleft := variationEndpointAcceleration_eq_zero_of_constant V D |
| 56 | ⟨le_rfl, Real.sqrt_le_sqrt p.tau_lt.le⟩ (initialFixed_squareEndpoint_constant V hfix) |
| 57 | simp only [M14SecondVariationBoundaryTerm, hleft, map_zero, sub_zero, M14SquareRootVelocity] |
| 58 | |
| 59 | private theorem hessian_pair_time_congr {T τ σ : ℝ} (h : τ = σ) (q : G.Point) |
| 60 | (hq : G.spacetime.timeFunction q = T - τ) (hq' : G.spacetime.timeFunction q = T - σ) |
| 61 | (f : G.Point → ℝ) (Y : G.Horizontal q) : |
| 62 | M14ReducedLengthHessianPairing G ⟨q, hq⟩ f Y Y = |
| 63 | M14ReducedLengthHessianPairing G ⟨q, hq'⟩ f Y Y := by |
| 64 | subst σ |
| 65 | rfl |
| 66 | |
| 67 | /-- The actual initial-fixed variation bounds the scalar endpoint |
| 68 | Hessian whenever its normalized action is a local upper contact, |
| 69 | Lemma 6.40, pp. 126-127. -/ |
| 70 | theorem variation_hessian_le_index |
| 71 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 72 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 73 | (V : M14LVariationData G p R) (D : M14VariationDerivativeData V) |
| 74 | (hmin : M14IsMinimizing p) (hfix : V.left_endpoint_fixed) |
| 75 | (f : G.Point → ℝ) (O : Set G.Point) (hO : IsOpen O) |
| 76 | (hp : R.curve (Real.sqrt b) ∈ O) |
| 77 | (hf : ContMDiffOn (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ f O) |
| 78 | (hgap : IsLocalMin (fun v => M14VariationAction V v - |
| 79 | (2 * Real.sqrt b) * f (V.squareFamily (Real.sqrt b) v)) 0) |
| 80 | (hdf : ∀ W : G.Horizontal (R.curve (Real.sqrt b)), |
| 81 | mvfderiv (spacetimeModel n) f (R.curve (Real.sqrt b)) W.val = |
| 82 | G.spacetime.horizontalMetric.inner (R.curve (Real.sqrt b)) |
| 83 | (R.horizontal_velocity (Real.sqrt b)) W / (2 * Real.sqrt b)) |
| 84 | (hq : G.spacetime.timeFunction (R.curve (Real.sqrt b)) = T - b) : |
| 85 | M14ReducedLengthHessianPairing G ⟨R.curve (Real.sqrt b), hq⟩ f |
| 86 | (M14VariationField V (Real.sqrt b)) (M14VariationField V (Real.sqrt b)) ≤ |
| 87 | M14SecondVariationIndexForm V D / (2 * Real.sqrt b) := by |
| 88 | have hb : 0 < b := p.tau_nonneg.trans_lt p.tau_lt |
| 89 | have hc : 0 < 2 * Real.sqrt b := mul_pos zero_lt_two (Real.sqrt_pos.mpr hb) |
| 90 | have hs : Real.sqrt b ∈ M14SqrtParameterInterval a b := |
| 91 | ⟨Real.sqrt_le_sqrt p.tau_lt.le, le_rfl⟩ |
| 92 | have hP : IsOpen V.parameterDomain := V.parameterDomain_eq ▸ isOpen_Ioo |
| 93 | have hzero : (0 : ℝ) ∈ V.parameterDomain := by |
| 94 | rw [V.parameterDomain_eq] |
| 95 | exact ⟨neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩ |
| 96 | have hS := (variationAction_contDiffOn hM12 V).contDiffAt (hP.mem_nhds hzero) |
| 97 | have hg : ContDiffAt ℝ ∞ (fun v => f (V.squareFamily (Real.sqrt b) v)) 0 := by |
| 98 | apply ContMDiffAt.contDiffAt |
| 99 | apply (hf.contMDiffAt (hO.mem_nhds (V.square_base (Real.sqrt b) ▸ hp))).comp |
| 100 | exact (variationEndpoint_contMDiffOn V hs).contMDiffAt (hP.mem_nhds hzero) |
| 101 | have hsecond := Proofs.M09.localMin_secondDeriv_scaled_comparison |
| 102 | (M14VariationAction V) (fun v => f (V.squareFamily (Real.sqrt b) v)) |
| 103 | (2 * Real.sqrt b) 0 hS hg hgap |
| 104 | have hchain := variationEndpoint_secondDeriv_comp |
| 105 | (hM12.coordinate_gauges X time I G.spacetime G.slices G.timeIntervals G.gaugeCover G.leafwise) |
| 106 | V D hs f O hO hp hf |
| 107 | rw [hessian_pair_time_congr (Real.sq_sqrt hb.le) _ _ hq f _, hdf] at hchain |
| 108 | obtain ⟨_, d, hd, heq⟩ := secondVariationIdentity_of_squareEuler hCoordinates hM04 hM12 V D |
| 109 | (fun _ hs W => squareRootEulerResidual_eq_zero_of_minimizing hCoordinates hM12 hmin |
| 110 | D.base_extension hs W) |
| 111 | rw [hchain, hd.deriv, heq, secondVariationBoundaryTerm_initialFixed V D hfix] at hsecond |
| 112 | apply (le_div_iff₀ hc).mpr |
| 113 | have hcancel := mul_div_cancel₀ |
| 114 | (G.spacetime.horizontalMetric.inner (R.curve (Real.sqrt b)) |
| 115 | (R.horizontal_velocity (Real.sqrt b)) |
| 116 | (M14VariationEndpointAcceleration V D (Real.sqrt b) hs)) hc.ne' |
| 117 | nlinarith |
| 118 | |
| 119 | /-- Every smooth initial-zero actual horizontal field is a valid |
| 120 | Hessian test field for a finite lower contact, Lemma 6.40, pp. 126-127. -/ |
| 121 | theorem hessian_le_pullback_index |
| 122 | (hCoordinates : M12MetricPredecessors.{0} n) |
| 123 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) |
| 124 | (hmin : M14IsMinimizing p) (f : G.Point → ℝ) (O : Set G.Point) (hO : IsOpen O) |
| 125 | (hp : R.curve (Real.sqrt b) ∈ O) |
| 126 | (hf : ContMDiffOn (spacetimeModel n) (𝓘(ℝ, ℝ)) ∞ f O) |
| 127 | (hvalue : f (R.curve (Real.sqrt b)) = M14BackwardLAction G p / (2 * Real.sqrt b)) |
| 128 | (hcontact : ∀ᶠ q in 𝓝 (R.curve (Real.sqrt b)), f q ≤ M14ReducedLengthAt G T a x q) |
| 129 | (hfinite : ∀ᶠ q in 𝓝 (R.curve (Real.sqrt b)), |
| 130 | M14FiniteValueDomain G T a (T - G.spacetime.timeFunction q) x q) |
| 131 | (hdf : ∀ W : G.Horizontal (R.curve (Real.sqrt b)), |
| 132 | mvfderiv (spacetimeModel n) f (R.curve (Real.sqrt b)) W.val = |
| 133 | G.spacetime.horizontalMetric.inner (R.curve (Real.sqrt b)) |
| 134 | (R.horizontal_velocity (Real.sqrt b)) W / (2 * Real.sqrt b)) |
| 135 | (hq : G.spacetime.timeFunction (R.curve (Real.sqrt b)) = T - b) |
| 136 | {Y : ∀ s, G.Horizontal (R.curve s)} |
| 137 | (EY : M14PullbackExtension G R.curve (M14SqrtParameterInterval a b) Y) |
| 138 | (hleft : Y (Real.sqrt a) = 0) : |
| 139 | M14ReducedLengthHessianPairing G ⟨R.curve (Real.sqrt b), hq⟩ f |
| 140 | (Y (Real.sqrt b)) (Y (Real.sqrt b)) ≤ |
| 141 | (∫ s in Real.sqrt a..Real.sqrt b, pullbackIndexPairDensity R EY EY s) / |
| 142 | (2 * Real.sqrt b) := by |
| 143 | have hY := pullbackExtension_field_contMDiffOn EY (R.smooth.mono R.interval_subset) |
| 144 | obtain ⟨V, hfix, hfield, _⟩ := |
| 145 | exists_initialFixed_variation_of_smooth_horizontalField R hM12 Y hY hleft |
| 146 | obtain ⟨D⟩ := exists_variationDerivativeData V |
| 147 | have hgap := isLocalMin_variationAction_gap hM12 V hfix f hvalue hcontact hfinite |
| 148 | have h := variation_hessian_le_index hCoordinates hM04 hM12 V D hmin hfix f O hO hp hf hgap hdf hq |
| 149 | rwa [secondVariationIndexForm_eq_of_field V D EY hfield, |
| 150 | hfield _ ⟨Real.sqrt_le_sqrt p.tau_lt.le, le_rfl⟩] at h |
| 151 | |
| 152 | end PoincareMT.M14 |