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.Soliton.ThreeDimensional.Noncompact.Rigidity.Levels.PotentialLimit.Coefficients |
| 2 | import PoincareLib.Geometry.Riemannian.Comparison.Hessian.Coordinates |
| 3 | import PoincareLib.Geometry.RicciFlow.Compactness.Coordinates.SpacetimeBounds.TimeDerivative |
| 4 | |
| 5 | /-! |
| 6 | # Coordinate equation for normalized pointed potentials |
| 7 | |
| 8 | The covariant Hessian formula and the soliton equation express the second |
| 9 | coordinate derivative in terms of the first derivative, the pulled metric, |
| 10 | and its actual Ricci-flow time derivative. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | set_option maxSynthPendingDepth 12 |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.LeviCivitaData |
| 24 | |
| 25 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | {g : RiemannianMetric n M} |
| 28 | |
| 29 | /-- The coordinate Hessian identity only needs a smooth map with invertible |
| 30 | differential on the coordinate neighborhood. -/ |
| 31 | theorem hessian_in_smooth_parametrization (D : LeviCivitaData g) |
| 32 | {U : Set (EuclideanSpace ℝ (Fin n))} (hU : IsOpen U) |
| 33 | {e : EuclideanSpace ℝ (Fin n) → M} |
| 34 | (he : ContMDiffOn (𝓡 n) (𝓡 n) ∞ e U) |
| 35 | (hi : ∀ y ∈ U, (mfderiv (𝓡 n) (𝓡 n) e y).IsInvertible) |
| 36 | {x : EuclideanSpace ℝ (Fin n)} (hx : x ∈ U) |
| 37 | {f : M → ℝ} (hf : ContMDiffAt (𝓡 n) 𝓘(ℝ, ℝ) ∞ f (e x)) |
| 38 | (v w : EuclideanSpace ℝ (Fin n)) : |
| 39 | D.hessian f (e x) (mfderiv (𝓡 n) (𝓡 n) e x v) (mfderiv (𝓡 n) (𝓡 n) e x w) = |
| 40 | fderiv ℝ (fderiv ℝ (f ∘ e)) x v w - fderiv ℝ (f ∘ e) x |
| 41 | (CoordinateExponential.christoffelBilinear (g.pullbackCoefficients e) x v w) := by |
| 42 | have hcoeff : ContDiffOn ℝ ∞ (g.pullbackCoefficients e) U := by |
| 43 | intro y hy |
| 44 | exact (g.contDiffAt_pullbackCoefficients |
| 45 | (he.contMDiffAt (hU.mem_nhds hy))).contDiffWithinAt |
| 46 | obtain ⟨gE, DE, V, hVo, hxV, _, hE⟩ := |
| 47 | RiemannianMetric.exists_local_realization hU hx |
| 48 | (g.pullbackCoefficients e) hcoeff (fun y _ a b => g.symm _ _ _) |
| 49 | (fun y hy a ha => by |
| 50 | apply g.pos (e y) |
| 51 | intro hzero |
| 52 | apply ha |
| 53 | apply (hi y hy).injective |
| 54 | rw [map_zero] |
| 55 | exact hzero) |
| 56 | have heq : gE.euclideanCoefficients =ᶠ[𝓝 x] g.pullbackCoefficients e := by |
| 57 | filter_upwards [hVo.mem_nhds hxV] with y hy |
| 58 | exact hE y hy |
| 59 | have hinv : ∀ᶠ y in 𝓝 x, (mfderiv (𝓡 n) (𝓡 n) e y).IsInvertible := |
| 60 | Filter.mem_of_superset (hU.mem_nhds hx) hi |
| 61 | have hmetric : ∀ᶠ y in 𝓝 x, ∀ a b : EuclideanSpace ℝ (Fin n), |
| 62 | gE.inner y a b = g.inner (e y) |
| 63 | (mfderiv (𝓡 n) (𝓡 n) e y a) (mfderiv (𝓡 n) (𝓡 n) e y b) := by |
| 64 | filter_upwards [heq] with y hy a b |
| 65 | exact congrArg (fun C => C a b) hy |
| 66 | have hΓ : CoordinateExponential.christoffelBilinear gE.euclideanCoefficients x = |
| 67 | CoordinateExponential.christoffelBilinear (g.pullbackCoefficients e) x := by |
| 68 | simp only [CoordinateExponential.christoffelBilinear, heq.self_of_nhds, heq.fderiv_eq] |
| 69 | rw [← DE.hessian_comp_of_metric_pullback D |
| 70 | (he.contMDiffAt (hU.mem_nhds hx)) hinv hmetric hf, |
| 71 | DE.hessian_eq_fderiv_sub_christoffel |
| 72 | (contMDiffAt_iff_contDiffAt.mp (hf.comp x (he.contMDiffAt (hU.mem_nhds hx)))), hΓ] |
| 73 | |
| 74 | end PoincareMT.LeviCivitaData |
| 75 | |
| 76 | namespace PoincareMT.ShrinkingSolitonFlow |
| 77 | |
| 78 | variable {M : Type u} [TopologicalSpace M] |
| 79 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 80 | [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 81 | [SecondCountableTopology M] [ConnectedSpace M] |
| 82 | {S : GradientShrinkingSolitonData 3 M} (G : ShrinkingSolitonFlow S) |
| 83 | |
| 84 | omit [MeasurableSpace M] [BorelSpace M] [T2Space M] [T3Space M] |
| 85 | [SecondCountableTopology M] [ConnectedSpace M] in |
| 86 | private theorem ricci_eq_of_metric_eq {g h : RiemannianMetric 3 M} |
| 87 | (D : LeviCivitaData g) (D' : LeviCivitaData h) (heq : g = h) |
| 88 | (x : M) (v w : TangentSpace (𝓡 3) x) : D.ricci x v w = D'.ricci x v w := by |
| 89 | subst h |
| 90 | simp only [LeviCivitaData.ricci, D.curvatureTensor_eq D'] |
| 91 | |
| 92 | /-- The normalized potential's actual coordinate equation under any smooth |
| 93 | local parametrization of the original source. -/ |
| 94 | theorem normalizedPotential_fderiv2_in_parametrization (q : M) |
| 95 | {U : Set (EuclideanSpace ℝ (Fin 3))} (hU : IsOpen U) |
| 96 | {e : EuclideanSpace ℝ (Fin 3) → M} |
| 97 | (he : ContMDiffOn (𝓡 3) (𝓡 3) ∞ e U) |
| 98 | (hi : ∀ y ∈ U, (mfderiv (𝓡 3) (𝓡 3) e y).IsInvertible) |
| 99 | {x : EuclideanSpace ℝ (Fin 3)} (hx : x ∈ U) |
| 100 | (v w : EuclideanSpace ℝ (Fin 3)) : |
| 101 | fderiv ℝ (fderiv ℝ (S.normalizedPotential q ∘ e)) x v w = |
| 102 | fderiv ℝ (S.normalizedPotential q ∘ e) x |
| 103 | (CoordinateExponential.christoffelBilinear |
| 104 | (fun y => (G.unscaledSourceFlow.metric 0).pullbackCoefficients e y) x v w) + |
| 105 | ((G.unscaledSourceFlow.metric 0).pullbackCoefficients e x v w + |
| 106 | deriv (fun t => (G.unscaledSourceFlow.metric t).pullbackCoefficients e x) 0 v w) / |
| 107 | (2 * S.potentialGradientScale q) := by |
| 108 | have hHess := S.connection.hessian_in_smooth_parametrization hU he hi hx |
| 109 | (S.normalizedPotential_contMDiff q _) v w |
| 110 | rw [S.hessian_normalizedPotential] at hHess |
| 111 | have hflow := G.unscaledSourceFlow.deriv_pullbackCoefficients_apply |
| 112 | isOpen_Iio hU he (by norm_num : (0 : ℝ) ∈ Iio 1) hx v w |
| 113 | rw [ricci_eq_of_metric_eq (G.unscaledSourceFlow.connection 0) S.connection |
| 114 | G.unscaledSourceFlow_metric_zero] at hflow |
| 115 | have hsol := S.soliton_equation (e x) |
| 116 | (mfderiv (𝓡 3) (𝓡 3) e x v) (mfderiv (𝓡 3) (𝓡 3) e x w) |
| 117 | rw [G.unscaledSourceFlow_metric_zero] |
| 118 | rw [hflow] |
| 119 | have hess : S.connection.hessian S.potential (e x) |
| 120 | (mfderiv (𝓡 3) (𝓡 3) e x v) (mfderiv (𝓡 3) (𝓡 3) e x w) = |
| 121 | (1 / 2 : ℝ) * S.metric.pullbackCoefficients e x v w - |
| 122 | S.connection.ricci (e x) (mfderiv (𝓡 3) (𝓡 3) e x v) |
| 123 | (mfderiv (𝓡 3) (𝓡 3) e x w) := by |
| 124 | change _ = (1 / 2 : ℝ) * S.metric.inner _ _ _ - _ |
| 125 | exact eq_sub_of_add_eq' hsol |
| 126 | rw [hess] at hHess |
| 127 | simp only [div_eq_mul_inv, mul_inv_rev] at * |
| 128 | norm_num only [invOf_eq_inv, inv_inv, one_div, inv_pos] at * |
| 129 | linear_combination -hHess |
| 130 | |
| 131 | attribute [local instance] FlowCarrier.topologicalSpace FlowCarrier.chartedSpace |
| 132 | FlowCarrier.isManifold |
| 133 | attribute [local instance] RicciFlow.smallCarrier RicciFlow.smallChartedSpace |
| 134 | RicciFlow.smallIsManifold |
| 135 | |
| 136 | variable {q : ℕ → M} |
| 137 | (L : AncientPointedGeometricConvergence |
| 138 | (fun _ => AncientRescalingSequence.smallRescalingCarrier (M := M)) |
| 139 | (fun _ => G.unscaledSourceFlow.shrink.metric) |
| 140 | (fun k => equivShrink M (q k)) 1) |
| 141 | |
| 142 | /-- The second-derivative equation uses precisely the source spacetime |
| 143 | coefficients retained by the pointed convergence, with its same subsequence |
| 144 | and spatial embeddings. -/ |
| 145 | theorem normalizedPotentialPullback_fderiv2 |
| 146 | (z : L.limitCarrier.carrier) (k : ℕ) (x : EuclideanSpace ℝ (Fin 3)) |
| 147 | (hx : x ∈ (extChartAt (𝓡 3) z).target) |
| 148 | (hxk : (extChartAt (𝓡 3) z).symm x ∈ L.exhaustion k) |
| 149 | (v w : EuclideanSpace ℝ (Fin 3)) : |
| 150 | let f := G.normalizedPotentialPullback L k ∘ (extChartAt (𝓡 3) z).symm |
| 151 | let H := G.normalizedPotentialSpacetimeCoefficients L z k |
| 152 | fderiv ℝ (fderiv ℝ f) x v w = |
| 153 | fderiv ℝ f x (CoordinateExponential.christoffelBilinear (fun y => H (0, y)) x v w) + |
| 154 | (H (0, x) v w + deriv (fun t => H (t, x)) 0 v w) / |
| 155 | (2 * S.potentialGradientScale (q (L.subsequence k))) := by |
| 156 | let c := extChartAt (𝓡 3) z |
| 157 | let U := c.target ∩ c.symm ⁻¹' L.exhaustion k |
| 158 | let e := G.unscaledOriginalEmbedding L k ∘ c.symm |
| 159 | let eS := L.embedding k ∘ c.symm |
| 160 | let d := (Poincare.Manifold.shrinkDiffeomorph (𝓡 3) M).symm |
| 161 | let H := fun p : ℝ × EuclideanSpace ℝ (Fin 3) => |
| 162 | (G.unscaledSourceFlow.shrink.metric p.1).pullbackCoefficients eS p.2 |
| 163 | have hU : IsOpen U := |
| 164 | (contMDiffOn_extChartAt_symm (n := ∞) z).continuousOn.isOpen_inter_preimage |
| 165 | (isOpen_extChartAt_target z) (L.exhaustion_open k) |
| 166 | have hxU : x ∈ U := ⟨hx, hxk⟩ |
| 167 | have hc (y : EuclideanSpace ℝ (Fin 3)) (hy : y ∈ c.target) : |
| 168 | ContMDiffAt (𝓡 3) (𝓡 3) ∞ c.symm y := |
| 169 | (contMDiffWithinAt_extChartAt_symm_target (n := ∞) z hy).contMDiffAt |
| 170 | (extChartAt_target_mem_nhds' hy) |
| 171 | have hsmall (y : EuclideanSpace ℝ (Fin 3)) (hy : y ∈ U) : |
| 172 | ContMDiffAt (𝓡 3) (𝓡 3) ∞ eS y := |
| 173 | ((L.embedding_smooth k ⟨c.symm y, hy.2⟩).contMDiffAt).comp y (hc y hy.1) |
| 174 | have he : ContMDiffOn (𝓡 3) (𝓡 3) ∞ e U := |
| 175 | (G.unscaledOriginalEmbedding_contMDiffOn L k).comp |
| 176 | ((contMDiffOn_extChartAt_symm (n := ∞) z).mono inter_subset_left) inter_subset_right |
| 177 | have hi (y : EuclideanSpace ℝ (Fin 3)) (hy : y ∈ U) : |
| 178 | (mfderiv (𝓡 3) (𝓡 3) e y).IsInvertible := by |
| 179 | have hiE : IsLocalDiffeomorphAt (𝓡 3) (𝓡 3) ∞ |
| 180 | (G.unscaledOriginalEmbedding L k) (c.symm y) := |
| 181 | (L.embedding_smooth k ⟨c.symm y, hy.2⟩).comp (𝓡 3) M (d.isLocalDiffeomorph _) |
| 182 | have hiC : (mfderiv (𝓡 3) (𝓡 3) c.symm y).IsInvertible := by |
| 183 | simpa only [modelWithCornersSelf_coe, range_id, mfderivWithin_univ] using |
| 184 | (isInvertible_mfderivWithin_extChartAt_symm (I := 𝓡 3) hy.1) |
| 185 | dsimp only [e] |
| 186 | rw [mfderiv_comp y (hiE.contMDiffAt.mdifferentiableAt (by simp)) |
| 187 | ((hc y hy.1).mdifferentiableAt (by simp))] |
| 188 | exact (show (mfderiv (𝓡 3) (𝓡 3) (G.unscaledOriginalEmbedding L k) (c.symm y)).IsInvertible |
| 189 | from ⟨hiE.mfderivToContinuousLinearEquiv (by simp), rfl⟩).comp hiC |
| 190 | have hmetric (t : ℝ) (y : EuclideanSpace ℝ (Fin 3)) (hy : y ∈ U) : |
| 191 | (G.unscaledSourceFlow.metric t).pullbackCoefficients e y = H (t, y) := by |
| 192 | ext a b |
| 193 | change (G.unscaledSourceFlow.metric t).inner (d (eS y)) |
| 194 | (mfderiv (𝓡 3) (𝓡 3) (d ∘ eS) y a) |
| 195 | (mfderiv (𝓡 3) (𝓡 3) (d ∘ eS) y b) = _ |
| 196 | rw [mfderiv_comp y (d.contMDiff.mdifferentiable (by simp) _) |
| 197 | ((hsmall y hy).mdifferentiableAt (by simp))] |
| 198 | rfl |
| 199 | have hmetric0 : (G.unscaledSourceFlow.metric 0).pullbackCoefficients e =ᶠ[𝓝 x] |
| 200 | (fun y => H (0, y)) := by |
| 201 | filter_upwards [hU.mem_nhds hxU] with y hy |
| 202 | exact hmetric 0 y hy |
| 203 | have hΓ : CoordinateExponential.christoffelBilinear |
| 204 | ((G.unscaledSourceFlow.metric 0).pullbackCoefficients e) x = |
| 205 | CoordinateExponential.christoffelBilinear (fun y => H (0, y)) x := by |
| 206 | simp only [CoordinateExponential.christoffelBilinear, |
| 207 | hmetric0.self_of_nhds, hmetric0.fderiv_eq] |
| 208 | have ht : (fun t => (G.unscaledSourceFlow.metric t).pullbackCoefficients e x) = |
| 209 | (fun t => H (t, x)) := funext (fun t => hmetric t x hxU) |
| 210 | have h := G.normalizedPotential_fderiv2_in_parametrization |
| 211 | (q (L.subsequence k)) hU he hi hxU v w |
| 212 | rw [hΓ, hmetric0.self_of_nhds, ht] at h |
| 213 | exact h |
| 214 | |
| 215 | end PoincareMT.ShrinkingSolitonFlow |