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.Coordinates.Coefficients |
| 2 | import PoincareLib.Geometry.Riemannian.Curvature.NormBounds |
| 3 | import PoincareLib.Geometry.Riemannian.Coordinates.Harmonic.Perturbation |
| 4 | |
| 5 | /-! |
| 6 | # Time derivatives in fixed spatial charts |
| 7 | |
| 8 | The flow equation and a curvature bound control the time derivative of the |
| 9 | actual pullback bilinear form. The spatial map stays fixed throughout time. |
| 10 | This is the first time-derivative estimate used in Morgan--Tian, |
| 11 | Proposition 5.14, pp. 90--91. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | set_option maxSynthPendingDepth 8 |
| 17 | set_option synthInstance.maxHeartbeats 100000 |
| 18 | set_option maxHeartbeats 800000 |
| 19 | |
| 20 | open Set |
| 21 | open scoped Manifold ContDiff Topology Bundle |
| 22 | |
| 23 | namespace PoincareMT.RicciFlow |
| 24 | |
| 25 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | {J : Set ℝ} |
| 28 | |
| 29 | /-- Smoothness of the metric coefficients on each fixed spatial time line. -/ |
| 30 | theorem differentiableAt_pullbackCoefficients_time (F : RicciFlow n M J) |
| 31 | (hJ : IsOpen J) {U : Set (EuclideanSpace ℝ (Fin n))} (hU : IsOpen U) |
| 32 | {e : EuclideanSpace ℝ (Fin n) → M} |
| 33 | (he : ContMDiffOn (𝓡 n) (𝓡 n) ∞ e U) |
| 34 | {t : ℝ} (ht : t ∈ J) {x : EuclideanSpace ℝ (Fin n)} (hx : x ∈ U) : |
| 35 | DifferentiableAt ℝ (fun s => (F.metric s).pullbackCoefficients e x) t := by |
| 36 | have hs := (F.contDiffOn_pullbackCoefficients hJ hU he).contDiffAt (x := (t, x)) |
| 37 | ((hJ.prod hU).mem_nhds ⟨ht, hx⟩) |
| 38 | exact (hs.comp t (contDiffAt_id.prodMk contDiffAt_const)).differentiableAt (by simp) |
| 39 | |
| 40 | /-- Evaluation of the time derivative of the actual fixed-chart metric. -/ |
| 41 | theorem deriv_pullbackCoefficients_apply (F : RicciFlow n M J) |
| 42 | (hJ : IsOpen J) {U : Set (EuclideanSpace ℝ (Fin n))} (hU : IsOpen U) |
| 43 | {e : EuclideanSpace ℝ (Fin n) → M} |
| 44 | (he : ContMDiffOn (𝓡 n) (𝓡 n) ∞ e U) |
| 45 | {t : ℝ} (ht : t ∈ J) {x : EuclideanSpace ℝ (Fin n)} (hx : x ∈ U) |
| 46 | (u v : EuclideanSpace ℝ (Fin n)) : |
| 47 | deriv (fun s => (F.metric s).pullbackCoefficients e x) t u v = |
| 48 | -2 * (F.connection t).ricci (e x) |
| 49 | (mfderiv (𝓡 n) (𝓡 n) e x u) (mfderiv (𝓡 n) (𝓡 n) e x v) := by |
| 50 | have hd := F.differentiableAt_pullbackCoefficients_time hJ hU he ht hx |
| 51 | have hv := (hd.hasDerivAt.clm_apply (hasDerivAt_const t u)).clm_apply |
| 52 | (hasDerivAt_const t v) |
| 53 | have hv' : HasDerivAt (fun s => (F.metric s).pullbackCoefficients e x u v) |
| 54 | (deriv (fun s => (F.metric s).pullbackCoefficients e x) t u v) t := by |
| 55 | simpa using hv |
| 56 | exact hv'.unique ((F.equation t ht (e x) _ _).hasDerivAt (hJ.mem_nhds ht)) |
| 57 | |
| 58 | /-- Upper ellipticity and curvature control bound the operator norm of the |
| 59 | time derivative, uniformly over all tangent directions. -/ |
| 60 | theorem norm_deriv_pullbackCoefficients_le [T2Space M] (F : RicciFlow n M J) |
| 61 | (hJ : IsOpen J) {U : Set (EuclideanSpace ℝ (Fin n))} (hU : IsOpen U) |
| 62 | {e : EuclideanSpace ℝ (Fin n) → M} |
| 63 | (he : ContMDiffOn (𝓡 n) (𝓡 n) ∞ e U) |
| 64 | {t : ℝ} (ht : t ∈ J) {x : EuclideanSpace ℝ (Fin n)} (hx : x ∈ U) |
| 65 | {b K : ℝ} (hb : 0 ≤ b) (hK : 0 ≤ K) |
| 66 | (hupper : ∀ v, (F.metric t).pullbackCoefficients e x v v ≤ b * ‖v‖ ^ 2) |
| 67 | (hcurv : (F.connection t).curvatureTensorNorm (e x) ≤ K) : |
| 68 | ‖deriv (fun s => (F.metric s).pullbackCoefficients e x) t‖ ≤ |
| 69 | 2 * (n : ℝ) ^ 3 * K * b := by |
| 70 | have hd := F.differentiableAt_pullbackCoefficients_time hJ hU he ht hx |
| 71 | have happ (u v : EuclideanSpace ℝ (Fin n)) : |
| 72 | HasDerivAt (fun s => (F.metric s).pullbackCoefficients e x u v) |
| 73 | (deriv (fun s => (F.metric s).pullbackCoefficients e x) t u v) t := by |
| 74 | simpa using (hd.hasDerivAt.clm_apply (hasDerivAt_const t u)).clm_apply |
| 75 | (hasDerivAt_const t v) |
| 76 | apply HarmonicCoordinates.norm_bilinear_le_of_quadratic _ (by positivity) |
| 77 | · intro u v |
| 78 | have heq : (fun s => (F.metric s).pullbackCoefficients e x u v) = |
| 79 | (fun s => (F.metric s).pullbackCoefficients e x v u) := |
| 80 | funext fun s => (F.metric s).symm _ _ _ |
| 81 | have huv := happ u v |
| 82 | rw [heq] at huv |
| 83 | exact huv.unique (happ v u) |
| 84 | · intro v |
| 85 | rw [F.deriv_pullbackCoefficients_apply hJ hU he ht hx, abs_mul] |
| 86 | have hdim : Module.finrank ℝ (TangentSpace (𝓡 n) (e x)) = n := by |
| 87 | rw [VectorBundle.finrank_eq ℝ (EuclideanSpace ℝ (Fin n)), finrank_euclideanSpace] |
| 88 | simp |
| 89 | have hric := (F.connection t).abs_ricci_quadratic_le_curvatureTensorNorm |
| 90 | (e x) (mfderiv (𝓡 n) (𝓡 n) e x v) |
| 91 | simp only [Fintype.card_fin, hdim] at hric |
| 92 | have hnonneg : 0 ≤ (F.metric t).pullbackCoefficients e x v v := by |
| 93 | let w := mfderiv (𝓡 n) (𝓡 n) e x v |
| 94 | change 0 ≤ (F.metric t).inner (e x) w w |
| 95 | by_cases hw : w = 0 |
| 96 | · simp [hw] |
| 97 | · exact ((F.metric t).pos (e x) w hw).le |
| 98 | have hbound := hric.trans (mul_le_mul |
| 99 | (mul_le_mul_of_nonneg_left hcurv (by positivity)) (hupper v) |
| 100 | hnonneg (by positivity)) |
| 101 | calc |
| 102 | _ ≤ 2 * ((n : ℝ) ^ 3 * K * (b * ‖v‖ ^ 2)) := by |
| 103 | norm_num only [abs_neg, abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 2)] |
| 104 | exact mul_le_mul_of_nonneg_left hbound (by norm_num) |
| 105 | _ = _ := by ring |
| 106 | |
| 107 | end PoincareMT.RicciFlow |