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.Limit.TimeDerivative |
| 2 | import PoincareLib.Geometry.Riemannian.Coordinates.Coefficients |
| 3 | |
| 4 | /-! |
| 5 | # Time derivatives from scalar coordinate coefficients |
| 6 | |
| 7 | A fixed chart differential is independent of time. Expanding two tangent |
| 8 | vectors in its coordinate basis therefore transfers convergence of scalar |
| 9 | coordinate time derivatives to arbitrary tangent vectors. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle BigOperators Topology |
| 16 | open Filter |
| 17 | |
| 18 | namespace PoincareMT.RiemannianMetric |
| 19 | |
| 20 | attribute [local instance] normedAddCommGroupTangentSpaceVectorSpace |
| 21 | normedSpaceTangentSpaceVectorSpace |
| 22 | |
| 23 | private theorem deriv_bilinear_eq_sum |
| 24 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 25 | {ι : Type*} [Fintype ι] (b : Module.Basis ι ℝ E) |
| 26 | (B : ℝ → E →L[ℝ] E →L[ℝ] ℝ) (t : ℝ) |
| 27 | (hB : ∀ i j, DifferentiableAt ℝ (fun s => B s (b i) (b j)) t) |
| 28 | (u v : E) : |
| 29 | deriv (fun s => B s u v) t = |
| 30 | ∑ i, ∑ j, (b.repr u i * b.repr v j) * deriv (fun s => B s (b i) (b j)) t := by |
| 31 | classical |
| 32 | have hexpand (s : ℝ) : B s u v = |
| 33 | ∑ i, ∑ j, (b.repr u i * b.repr v j) * B s (b i) (b j) := by |
| 34 | conv_lhs => rw [← b.sum_repr u, ← b.sum_repr v] |
| 35 | simp only [map_sum, sum_apply, map_smul, smul_apply, smul_eq_mul, Finset.mul_sum, |
| 36 | mul_assoc] |
| 37 | rw [Finset.sum_comm] |
| 38 | congr 1 |
| 39 | ext i |
| 40 | congr 1 |
| 41 | ext j |
| 42 | ring |
| 43 | have hd := HasDerivAt.fun_sum (u := Finset.univ) (fun i _ => |
| 44 | HasDerivAt.fun_sum (u := Finset.univ) (fun j _ => |
| 45 | (hB i j).hasDerivAt.const_mul (b.repr u i * b.repr v j))) |
| 46 | simpa only [← hexpand] using hd.deriv |
| 47 | |
| 48 | /-- Scalar time derivatives in the fixed inverse chart control derivatives |
| 49 | on all fixed tangent vectors. -/ |
| 50 | theorem tendsto_inner_time_deriv_of_coordinate_deriv |
| 51 | {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 52 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 53 | {α : Type*} {l : Filter α} {J : Set ℝ} |
| 54 | (gseq : α → ℝ → RiemannianMetric n M) (g : ℝ → RiemannianMetric n M) |
| 55 | (hseq : ∀ k, IsSmoothFamilyOn (gseq k) J) (hg : IsSmoothFamilyOn g J) |
| 56 | (hJ : IsOpen J) {t : ℝ} (ht : t ∈ J) (x : M) |
| 57 | (h : ∀ a b : Fin n, |
| 58 | Tendsto (fun k => deriv (fun s => (gseq k s).pullbackCoefficients |
| 59 | (extChartAt (𝓡 n) x).symm (extChartAt (𝓡 n) x x) |
| 60 | (EuclideanSpace.basisFun (Fin n) ℝ a) |
| 61 | (EuclideanSpace.basisFun (Fin n) ℝ b)) t) l |
| 62 | (𝓝 (deriv (fun s => (g s).pullbackCoefficients |
| 63 | (extChartAt (𝓡 n) x).symm (extChartAt (𝓡 n) x x) |
| 64 | (EuclideanSpace.basisFun (Fin n) ℝ a) |
| 65 | (EuclideanSpace.basisFun (Fin n) ℝ b)) t))) |
| 66 | (u v : TangentSpace (𝓡 n) x) : |
| 67 | Tendsto (fun k => deriv (fun s => (gseq k s).inner x u v) t) l |
| 68 | (𝓝 (deriv (fun s => (g s).inner x u v) t)) := by |
| 69 | classical |
| 70 | let c := extChartAt (𝓡 n) x |
| 71 | let p := c x |
| 72 | have hp : c.symm p = x := c.left_inv (mem_extChartAt_source x) |
| 73 | have hi : (mfderiv (𝓡 n) (𝓡 n) c.symm p).IsInvertible := by |
| 74 | simpa only [ModelWithCorners.range_eq_univ, mfderivWithin_univ] using |
| 75 | isInvertible_mfderivWithin_extChartAt_symm (I := 𝓡 n) (mem_extChartAt_target x) |
| 76 | obtain ⟨e, he⟩ := hi |
| 77 | let b := (EuclideanSpace.basisFun (Fin n) ℝ).toBasis |
| 78 | have heval (G : ℝ → RiemannianMetric n M) (s : ℝ) : |
| 79 | (G s).pullbackCoefficients c.symm p (e.symm u) (e.symm v) = |
| 80 | (G s).inner x u v := by |
| 81 | change (G s).inner (c.symm p) |
| 82 | (mfderiv (𝓡 n) (𝓡 n) c.symm p (e.symm u)) |
| 83 | (mfderiv (𝓡 n) (𝓡 n) c.symm p (e.symm v)) = _ |
| 84 | rw [← he] |
| 85 | simp only [ContinuousLinearEquiv.coe_coe, ContinuousLinearEquiv.apply_symm_apply] |
| 86 | exact congrArg (fun y : M => (G s).inner y u v) hp |
| 87 | have hdiff (G : ℝ → RiemannianMetric n M) (hG : IsSmoothFamilyOn G J) |
| 88 | (a d : Fin n) : |
| 89 | DifferentiableAt ℝ (fun s => (G s).pullbackCoefficients c.symm p (b a) (b d)) t := by |
| 90 | change DifferentiableAt ℝ (fun s => (G s).inner (c.symm p) |
| 91 | (mfderiv (𝓡 n) (𝓡 n) c.symm p (b a)) |
| 92 | (mfderiv (𝓡 n) (𝓡 n) c.symm p (b d))) t |
| 93 | exact (hG.hasDerivAt_inner hJ ht _ _ _).differentiableAt |
| 94 | have heq (G : ℝ → RiemannianMetric n M) (hG : IsSmoothFamilyOn G J) := |
| 95 | deriv_bilinear_eq_sum b (fun s => (G s).pullbackCoefficients c.symm p) t |
| 96 | (hdiff G hG) (e.symm u) (e.symm v) |
| 97 | simp only [heval] at heq |
| 98 | simp_rw [heq _ hg, heq _ (hseq _)] |
| 99 | apply tendsto_finsetSum |
| 100 | intro a _ |
| 101 | apply tendsto_finsetSum |
| 102 | intro d _ |
| 103 | exact (h a d).const_mul _ |
| 104 | |
| 105 | end PoincareMT.RiemannianMetric |