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.TwoDimensional.Compact.Rigidity.Degenerate |
| 2 | import PoincareLib.Geometry.Riemannian.Comparison.Hessian.Geodesic |
| 3 | |
| 4 | /-! |
| 5 | # The soliton potential along an affine geodesic |
| 6 | |
| 7 | The Hessian identity gives an autonomous scalar equation for the potential |
| 8 | along a constant-speed geodesic. Its derivative solves the scalar Jacobi |
| 9 | equation with the surface Gaussian curvature coefficient. This is the local |
| 10 | ODE input to the rotational proof of compact shrinking-surface rigidity; |
| 11 | compare Chow--Knopf, Proposition 5.21, p. 118. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | namespace PoincareMT.LeviCivitaData |
| 21 | |
| 22 | variable {M : Type*} [TopologicalSpace M] [PreconnectedSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin 2)) M] [IsManifold (𝓡 2) ∞ M] |
| 24 | {g : RiemannianMetric 2 M} |
| 25 | |
| 26 | omit [PreconnectedSpace M] in |
| 27 | theorem hasDerivAt_deriv_potential_geodesic (D : LeviCivitaData g) |
| 28 | {f : M → ℝ} {lambda : ℝ} (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) 2 f) |
| 29 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 2) x, |
| 30 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) |
| 31 | {γ : ℝ → M} {I : Set ℝ} (hgeo : g.IsGeodesicOn γ I) |
| 32 | {C t : ℝ} (ht : t ∈ I) |
| 33 | (hspeed : g.tangentNorm (γ t) (mfderiv 𝓘(ℝ, ℝ) (𝓡 2) γ t 1) = C) : |
| 34 | HasDerivAt (deriv (f ∘ γ)) |
| 35 | ((lambda - D.scalarCurvature (γ t) / 2) * C ^ 2) t := by |
| 36 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 2) : M → Type _) := |
| 37 | ⟨g.toRiemannianMetric⟩ |
| 38 | have hs := D.hasDerivAt_deriv_comp_geodesic_of_contMDiffOn isOpen_univ |
| 39 | (D.contMDiff_of_C2_surface_soliton hf hsol).contMDiffOn hgeo ht (mem_univ _) |
| 40 | rw [D.hessian_eq_of_surface_soliton hsol] at hs |
| 41 | have hnorm : g.inner (γ t) (mfderiv 𝓘(ℝ, ℝ) (𝓡 2) γ t 1) |
| 42 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 2) γ t 1) = C ^ 2 := by |
| 43 | have hnonneg : 0 ≤ g.inner (γ t) (mfderiv 𝓘(ℝ, ℝ) (𝓡 2) γ t 1) |
| 44 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 2) γ t 1) := by |
| 45 | change 0 ≤ inner ℝ (mfderiv 𝓘(ℝ, ℝ) (𝓡 2) γ t 1) |
| 46 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 2) γ t 1) |
| 47 | exact real_inner_self_nonneg |
| 48 | have hh := congrArg (fun r : ℝ => r ^ 2) hspeed |
| 49 | rwa [RiemannianMetric.tangentNorm, Real.sq_sqrt hnonneg] at hh |
| 50 | rw [hnorm] at hs |
| 51 | convert hs using 1 |
| 52 | ring |
| 53 | |
| 54 | /-- The derivative of the potential solves the scalar surface Jacobi equation |
| 55 | along every constant-speed affine geodesic. -/ |
| 56 | theorem hasDerivAt_second_deriv_potential_geodesic (D : LeviCivitaData g) |
| 57 | {f : M → ℝ} {lambda : ℝ} (hf : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) 2 f) |
| 58 | (hsol : ∀ x, ∀ v w : TangentSpace (𝓡 2) x, |
| 59 | D.ricci x v w + D.hessian f x v w = lambda * g.inner x v w) |
| 60 | {γ : ℝ → M} {I : Set ℝ} (hI : IsOpen I) (hgeo : g.IsGeodesicOn γ I) |
| 61 | {C : ℝ} (hspeed : ∀ s ∈ I, |
| 62 | g.tangentNorm (γ s) (mfderiv 𝓘(ℝ, ℝ) (𝓡 2) γ s 1) = C) |
| 63 | {t : ℝ} (ht : t ∈ I) : |
| 64 | HasDerivAt (deriv (deriv (f ∘ γ))) |
| 65 | (-(D.scalarCurvature (γ t) * C ^ 2 / 2) * deriv (f ∘ γ) t) t := by |
| 66 | have hf1 : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) 1 f := hf.of_le (by norm_num) |
| 67 | have hF : HasDerivAt (f ∘ γ) (deriv (f ∘ γ) t) t := by |
| 68 | apply DifferentiableAt.hasDerivAt |
| 69 | exact (contMDiffAt_iff_contDiffAt.mp ((hf1 (γ t)).comp t |
| 70 | (hgeo.contMDiffAt ht))).differentiableAt (by simp) |
| 71 | have heq : deriv (deriv (f ∘ γ)) =ᶠ[𝓝 t] fun s => |
| 72 | (lambda - D.scalarCurvature (γ t) / 2 * Real.exp (f (γ s) - f (γ t))) * C ^ 2 := by |
| 73 | filter_upwards [hI.mem_nhds ht] with s hs |
| 74 | rw [(D.hasDerivAt_deriv_potential_geodesic hf hsol hgeo hs (hspeed s hs)).deriv, |
| 75 | D.scalar_eq_exp_potential_difference_of_surface_soliton hf hsol (γ t) (γ s)] |
| 76 | ring |
| 77 | have hexp := ((hF.sub_const (f (γ t))).exp).const_mul (D.scalarCurvature (γ t) / 2) |
| 78 | have hd := (hexp.const_sub lambda).mul_const (C ^ 2) |
| 79 | apply (hd.congr_of_eventuallyEq heq).congr_deriv |
| 80 | simp only [Function.comp_apply, sub_self, Real.exp_zero] |
| 81 | ring |
| 82 | |
| 83 | end PoincareMT.LeviCivitaData |