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.ReducedGeometry.ReducedLength.Variation.Differential.CenteredJacobiResidual |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Fields.VariationChartField |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Differential.FamilyLinearization |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.SecondPullbackCoordinate |
| 5 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Initial.InitialJacobiDerivative |
| 6 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Initial.InitialVariationDifferential |
| 7 | |
| 8 | /-! |
| 9 | # The actual Jacobi differential of an L-exponential family |
| 10 | |
| 11 | The variation field has constructed square-regular extensions. Its two |
| 12 | covariant derivatives identify the linearized phase equation with the |
| 13 | frozen Jacobi residual, including both interval endpoints. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option maxSynthPendingDepth 3 |
| 18 | set_option maxHeartbeats 800000 |
| 19 | |
| 20 | open scoped Manifold ContDiff Bundle Topology |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.ReducedLength |
| 25 | |
| 26 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 28 | [IsManifold (𝓡 n) ∞ M] |
| 29 | {J : Set ℝ} {F : RicciFlow n M J} {T τmax : ℝ} {p : M} |
| 30 | |
| 31 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 32 | |
| 33 | set_option backward.isDefEq.respectTransparency false in |
| 34 | theorem initialVectorVariation_isLJacobiField |
| 35 | (hM04 : RicciFlowCurvatureTheory.{u}) (hτmax : 0 < τmax) |
| 36 | (hwindow : Set.Icc (T - τmax) T ⊆ J) (A : LExponentialFamily F T τmax p) |
| 37 | (Z W : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) : |
| 38 | IsLJacobiField F T 0 b (A.path Z b hb hmax) |
| 39 | (variationField (initialVectorVariation A Z W b hb hmax).toLVariation) := by |
| 40 | let V := (initialVectorVariation A Z W b hb hmax).toLVariation |
| 41 | let R := lExponentialFamily_squareRegularization hM04 hτmax hwindow A Z b hb hmax |
| 42 | let K := sqrtParameterInterval 0 b |
| 43 | obtain ⟨Q⟩ := nonempty_sqrtRegularField_variation τmax hτmax hmax hwindow R.path V |
| 44 | refine ⟨R, Q, initialVectorVariation_field_zero A Z W b hb hmax, ?_⟩ |
| 45 | intro s hs Wtest |
| 46 | let x0 := R.path.curve s |
| 47 | let H : ℝ × ℝ → M := fun z ↦ V.squareFamily z.1 z.2 |
| 48 | let Ω := V.squareDomain ∩ H ⁻¹' (chartAt E x0).source |
| 49 | let U0 := (fun r : ℝ ↦ (r, (0 : ℝ))) ⁻¹' Ω |
| 50 | let U := (U0 ∩ R.path.domain) ∩ Set.Ioo (-Real.sqrt τmax) (Real.sqrt τmax) |
| 51 | let x : ℝ → E := fun r ↦ (chartAt E x0) (R.path.curve r) |
| 52 | let v : ℝ → E := fun r ↦ deriv (fun u ↦ (chartAt E x0) (V.squareFamily r u)) 0 |
| 53 | let C := coordinateConnectionBilinear (squareChartMetric F T x0) |
| 54 | let d : ℝ → E := fun r ↦ deriv v r + C (r, x r) (deriv x r) (v r) |
| 55 | obtain ⟨hU0, hbase, hq0, hv0, hfield⟩ := squareVariationField_chart_smooth V x0 |
| 56 | have hbaseEq : V.baseSquareCurve = R.path.curve := |
| 57 | initialVectorVariation_baseSquareCurve A Z W b hb hmax |
| 58 | have hx_eq : x = fun r ↦ (chartAt E x0) (A.squareFamily Z r) := rfl |
| 59 | have hv_eq : v = fun r ↦ |
| 60 | deriv (fun u : ℝ ↦ (chartAt E x0) (A.squareFamily (Z + u • W) r)) 0 := by |
| 61 | funext r |
| 62 | simp only [v, V, initialVectorVariation_squareFamily] |
| 63 | have htime : s ∈ Set.Ioo (-Real.sqrt τmax) (Real.sqrt τmax) := by |
| 64 | have hs0 : 0 ≤ s := by simpa only [sqrtParameterInterval, Real.sqrt_zero] using hs.1 |
| 65 | exact ⟨(neg_lt_zero.mpr (Real.sqrt_pos.mpr hτmax)).trans_le hs0, |
| 66 | hs.2.trans_lt (Real.sqrt_lt_sqrt hb.le hmax)⟩ |
| 67 | have hsU0 : s ∈ U0 := by |
| 68 | refine ⟨V.square_contains ⟨hs, neg_lt_zero.mpr V.radius_pos, V.radius_pos⟩, ?_⟩ |
| 69 | change V.baseSquareCurve s ∈ (chartAt E x0).source |
| 70 | rw [hbaseEq] |
| 71 | exact mem_chart_source E x0 |
| 72 | have hU : IsOpen U := (hU0.inter R.path.open_domain).inter isOpen_Ioo |
| 73 | have hsU : s ∈ U := ⟨⟨hsU0, R.path.interval_subset hs⟩, htime⟩ |
| 74 | have hUR : U ⊆ R.path.domain := fun _ hr ↦ hr.1.2 |
| 75 | have hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ R.path.curve U := R.path.smooth.mono hUR |
| 76 | have hq : ∀ r ∈ U, R.path.curve r ∈ (chartAt E x0).source := by |
| 77 | intro r hr |
| 78 | rw [← hbaseEq] |
| 79 | exact hq0 r hr.1.1 |
| 80 | have hv : ContDiffOn ℝ ∞ v U := hv0.mono (fun _ hr ↦ hr.1.1) |
| 81 | have hx : ContDiffOn ℝ ∞ x U := (contMDiffOn_chart.comp hγ hq).contDiffOn |
| 82 | have hcast (q q' : M) (h : q = q') (w : TangentSpace (𝓡 n) q) : |
| 83 | (h ▸ w : TangentSpace (𝓡 n) q') = (show TangentSpace (𝓡 n) q' from w) := by |
| 84 | cases h |
| 85 | rfl |
| 86 | have heq : ∀ r ∈ K ∩ U, chartVectorField x0 (v r) (R.path.curve r) = Q.field r := by |
| 87 | intro r hr |
| 88 | have hf := hfield r hr.2.1.1 |
| 89 | change (chartVectorField x0 (v r) (V.baseSquareCurve r) : E) = squareVariationField V r at hf |
| 90 | rw [hbaseEq] at hf |
| 91 | have hQ := Q.agrees r hr.1 |
| 92 | simp only [hcast] at hQ |
| 93 | exact hf.trans ((squareVariationField_eq_variationField V r hr.1).trans hQ.symm) |
| 94 | have hKd : UniqueDiffOn ℝ K := uniqueDiffOn_Icc (Real.sqrt_lt_sqrt (by norm_num) hb) |
| 95 | have hxAt := hx.contDiffAt (hU.mem_nhds hsU) |
| 96 | have hvAt := hv.contDiffAt (hU.mem_nhds hsU) |
| 97 | have hxd := hxAt.differentiableAt (by simp) |
| 98 | have hvd := hvAt.differentiableAt (by simp) |
| 99 | have hx2 := (hxAt.derivWithin (m := ∞) (by simp)).differentiableAt (by simp) |
| 100 | have hv2 := (hvAt.derivWithin (m := ∞) (by simp)).differentiableAt (by simp) |
| 101 | have hgd := (hγ.contMDiffAt (hU.mem_nhds hsU)).mdifferentiableAt (by simp) |
| 102 | have hvel := (curveVelocityWithin_eq_curveVelocity R.path.curve K s (hKd s hs) hgd).trans |
| 103 | (chartVectorField_coordinate_velocity x0 R.path.curve s (deriv x s) (hq s hsU) hgd |
| 104 | hxd.hasDerivAt).symm |
| 105 | have hvel' : (curveVelocityWithin (n := n) R.path.curve K s : E) = deriv x s := by |
| 106 | have h := congrArg (fun z : TangentSpace (𝓡 n) (R.path.curve s) ↦ (z : E)) hvel |
| 107 | simpa only [x0, chartVectorField_self] using h |
| 108 | have hfield' : (Q.field s : E) = v s := by |
| 109 | have h := congrArg (fun z : TangentSpace (𝓡 n) (R.path.curve s) ↦ (z : E)) |
| 110 | (heq s ⟨hs, hsU⟩).symm |
| 111 | simpa only [x0, chartVectorField_self] using h |
| 112 | have hfirst := pullbackCovariantDerivative_eq_chart F T τmax hτmax hwindow x0 |
| 113 | R.path.curve Q.field K U Q.extension hU hγ hq v hv heq s hs hsU (hKd s hs) htime |
| 114 | have hfirst' : (Q.firstDerivative s : E) = d s := by |
| 115 | have h := congrArg (fun z : TangentSpace (𝓡 n) (R.path.curve s) ↦ (z : E)) hfirst |
| 116 | simpa only [SqrtRegularField.firstDerivative, d, C, x, x0, |
| 117 | coordinateConnectionBilinear_apply, chartVectorField_self] using h |
| 118 | have hsecond := sqrtRegularField_secondDerivative_eq_chart τmax hτmax hwindow R.path |
| 119 | (variationField V) Q x0 U hU hUR hq (fun _ hr ↦ hr.2) v hv heq s hs hsU |
| 120 | have hsecond' : (Q.secondDerivative s : E) = |
| 121 | deriv d s + C (s, x s) (deriv x s) (d s) := by |
| 122 | have h := congrArg (fun z : TangentSpace (𝓡 n) (R.path.curve s) ↦ (z : E)) hsecond |
| 123 | simpa only [d, C, x, x0, coordinateConnectionBilinear_apply, |
| 124 | chartVectorField_self] using h |
| 125 | have hphase0 := lExponentialFamily_chartPhase_hasDerivAt hM04 hτmax hwindow A Z b hb hmax |
| 126 | x0 s hs (mem_chart_source E x0) |
| 127 | have hphase : deriv (deriv x) s = |
| 128 | (regularizedCoordinatePhase (squareChartMetric F T x0) (squareChartScalar F T x0) |
| 129 | (s, (x s, deriv x s))).2 := by |
| 130 | have hd := (hphase0.hasFDerivAt.snd).hasDerivAt |
| 131 | have hd' : HasDerivAt (deriv x) |
| 132 | (regularizedCoordinatePhase (squareChartMetric F T x0) (squareChartScalar F T x0) |
| 133 | (s, (x s, deriv x s))).2 s := by |
| 134 | simpa [hx_eq, ContinuousLinearMap.comp_apply, |
| 135 | ContinuousLinearMap.toSpanSingleton_apply] using hd |
| 136 | exact hd'.deriv |
| 137 | have hlin0 := lExponentialFamily_variation_phase_hasDerivAt hM04 hτmax hwindow A |
| 138 | Z W b hb hmax x0 s hs (mem_chart_source E x0) |
| 139 | dsimp only at hlin0 |
| 140 | simp only [timeDerivativePhase, zero_smul, add_zero] at hlin0 |
| 141 | have hlinear : deriv (deriv v) s = |
| 142 | (fderiv ℝ (regularizedCoordinatePhase (squareChartMetric F T x0) |
| 143 | (squareChartScalar F T x0)) (s, (x s, deriv x s)) (0, (v s, deriv v s))).2 := by |
| 144 | have hd := (hlin0.hasFDerivAt.snd).hasDerivAt |
| 145 | have hd' : HasDerivAt (deriv v) |
| 146 | (fderiv ℝ (regularizedCoordinatePhase (squareChartMetric F T x0) |
| 147 | (squareChartScalar F T x0)) (s, (x s, deriv x s)) (0, (v s, deriv v s))).2 s := by |
| 148 | simpa [hx_eq, hv_eq, ContinuousLinearMap.comp_apply, |
| 149 | ContinuousLinearMap.toSpanSingleton_apply] using hd |
| 150 | exact hd'.deriv |
| 151 | have hres := centered_coordinate_jacobi_residual F hM04 T τmax hτmax hwindow x0 x v s |
| 152 | htime rfl hxd hx2 hvd hv2 hphase hlinear Wtest |
| 153 | unfold regularizedJacobiResidual |
| 154 | dsimp only |
| 155 | rw [hvel', hfield', hfirst', hsecond'] |
| 156 | exact hres |
| 157 | |
| 158 | theorem lExponentialFamily_jacobi_differential |
| 159 | (hM04 : RicciFlowCurvatureTheory.{u}) (hτmax : 0 < τmax) |
| 160 | (hwindow : Set.Icc (T - τmax) T ⊆ J) (A : LExponentialFamily F T τmax p) |
| 161 | (Z W : TangentSpace (𝓡 n) p) (b : ℝ) (hb : 0 < b) (hmax : b < τmax) : |
| 162 | ∃ Y : ∀ τ, TangentSpace (𝓡 n) ((A.path Z b hb hmax).curve τ), |
| 163 | IsLJacobiField F T 0 b (A.path Z b hb hmax) Y ∧ |
| 164 | HasLJacobiInitialDerivative (A.regularization Z b hb hmax) Y |
| 165 | (((congrFun (A.path_eq Z b hb hmax) 0).trans (A.gamma_at_zero Z)).symm ▸ ((2 : ℝ) • W)) ∧ |
| 166 | ∀ τ ∈ Set.Icc 0 b, |
| 167 | ((congrFun (A.path_eq Z b hb hmax) τ) ▸ Y τ : TangentSpace (𝓡 n) (A.gamma Z τ)) = |
| 168 | A.sliceDifferential Z τ W := by |
| 169 | exact ⟨variationField (initialVectorVariation A Z W b hb hmax).toLVariation, |
| 170 | initialVectorVariation_isLJacobiField hM04 hτmax hwindow A Z W b hb hmax, |
| 171 | initialVectorVariation_hasLJacobiInitialDerivative hτmax hwindow A Z W b hb hmax, |
| 172 | initialVectorVariation_differential_on_interval A Z W b hb hmax⟩ |
| 173 | |
| 174 | end PoincareMT.ReducedLength |