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.Frame.Transport.Coordinates |
| 2 | import PoincareLib.Geometry.RicciFlow.Frame.Transport.Regularity |
| 3 | import PoincareLib.Geometry.RicciFlow.Frame.RicciEndomorphism.Regularity |
| 4 | |
| 5 | /-! |
| 6 | # Spatial regularity of canonical orthonormal transport |
| 7 | |
| 8 | In a fixed tangent trivialization the canonical transport satisfies a linear |
| 9 | ODE with jointly smooth coefficients. Parameter dependence therefore gives |
| 10 | smoothness of each transport section on the manifold. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | set_option maxHeartbeats 800000 |
| 16 | |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | open Bundle Filter Set |
| 19 | |
| 20 | universe u |
| 21 | noncomputable section |
| 22 | |
| 23 | namespace PoincareMT.RicciFlow.Frame |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | {a b : ℝ} |
| 28 | |
| 29 | /-- The actual Ricci endomorphism in a fixed tangent trivialization. -/ |
| 30 | def ricciCoordinate (F : RicciFlow n M (Ico a b)) (x : M) (p : ℝ × M) : |
| 31 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) := |
| 32 | ContinuousLinearMap.inCoordinates (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) |
| 33 | (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x p.2 x p.2 |
| 34 | (ricciEndomorphism F p.2 p.1) |
| 35 | |
| 36 | theorem contMDiffWithinAt_ricciCoordinate (F : RicciFlow n M (Ico a b)) (x y : M) |
| 37 | {t : ℝ} (ht : t ∈ Ico a b) |
| 38 | (hy : y ∈ (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x).baseSet) : |
| 39 | ContMDiffWithinAt (𝓘(ℝ, ℝ).prod (𝓡 n)) |
| 40 | 𝓘(ℝ, EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n)) ∞ |
| 41 | (ricciCoordinate F x) (Ico a b ×ˢ univ) (t, y) := by |
| 42 | let e := trivializationAt (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n)) |
| 43 | (fun z => TangentSpace (𝓡 n) z →L[ℝ] TangentSpace (𝓡 n) z) x |
| 44 | have he : TotalSpace.mk' (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n)) |
| 45 | (E := fun z => TangentSpace (𝓡 n) z →L[ℝ] TangentSpace (𝓡 n) z) |
| 46 | y (ricciEndomorphism F y t) ∈ e.source := by |
| 47 | simpa [e] using hy |
| 48 | have h := (e.contMDiffWithinAt_iff |
| 49 | (f := fun p : ℝ × M => TotalSpace.mk' |
| 50 | (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n)) |
| 51 | (E := fun z => TangentSpace (𝓡 n) z →L[ℝ] TangentSpace (𝓡 n) z) |
| 52 | p.2 (ricciEndomorphism F p.2 p.1)) (x₀ := (t, y)) he).mp |
| 53 | (contMDiffOn_ricciEndomorphism F (t, y) ⟨ht, mem_univ y⟩) |>.2 |
| 54 | simp only [e, hom_trivializationAt_apply] at h |
| 55 | convert h using 1 <;> rfl |
| 56 | |
| 57 | /-- Ricci coefficients in Euclidean chart parameters, with spatial parameter first. -/ |
| 58 | def chartRicciCoefficient (F : RicciFlow n M (Ico a b)) (x : M) |
| 59 | (z : EuclideanSpace ℝ (Fin n)) (t : ℝ) : |
| 60 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) := |
| 61 | ricciCoordinate F x (t, (extChartAt (𝓡 n) x).symm z) |
| 62 | |
| 63 | theorem chartRicciCoefficient_contDiffOn (F : RicciFlow n M (Ico a b)) (x : M) : |
| 64 | ContDiffOn ℝ ∞ (Function.uncurry (chartRicciCoefficient F x)) |
| 65 | ((extChartAt (𝓡 n) x).target ×ˢ Ico a b) := by |
| 66 | rintro ⟨z, t⟩ ⟨hz, ht⟩ |
| 67 | have hz' : (extChartAt (𝓡 n) x).symm z ∈ |
| 68 | (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x).baseSet := by |
| 69 | rw [TangentBundle.trivializationAt_baseSet] |
| 70 | simpa only [extChartAt_source] using (extChartAt (𝓡 n) x).map_target hz |
| 71 | have harg : ContMDiffWithinAt |
| 72 | (𝓘(ℝ, EuclideanSpace ℝ (Fin n)).prod 𝓘(ℝ, ℝ)) |
| 73 | (𝓘(ℝ, ℝ).prod (𝓡 n)) ∞ |
| 74 | (fun p : EuclideanSpace ℝ (Fin n) × ℝ => (p.2, (extChartAt (𝓡 n) x).symm p.1)) |
| 75 | ((extChartAt (𝓡 n) x).target ×ˢ Ico a b) (z, t) := |
| 76 | contMDiffWithinAt_snd.prodMk |
| 77 | (((contMDiffOn_extChartAt_symm x) z hz).comp (z, t) contMDiffWithinAt_fst mapsTo_fst_prod) |
| 78 | have h := (contMDiffWithinAt_ricciCoordinate F x _ ht hz').comp (z, t) harg |
| 79 | (show MapsTo (fun p : EuclideanSpace ℝ (Fin n) × ℝ => |
| 80 | (p.2, (extChartAt (𝓡 n) x).symm p.1)) |
| 81 | ((extChartAt (𝓡 n) x).target ×ˢ Ico a b) (Ico a b ×ˢ univ) from |
| 82 | fun p hp => ⟨hp.2, mem_univ _⟩) |
| 83 | simp +instances only [← modelWithCornersSelf_prod, chartedSpaceSelf_prod] at h |
| 84 | exact h.contDiffWithinAt |
| 85 | |
| 86 | private theorem canonicalTransport_chart_contDiffOn |
| 87 | (F : RicciFlow n M (Ico a b)) (x : M) {t : ℝ} (ht : t ∈ Ico a b) : |
| 88 | ContDiffOn ℝ ∞ (fun z : EuclideanSpace ℝ (Fin n) => |
| 89 | ContinuousLinearMap.inCoordinates (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) |
| 90 | (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) |
| 91 | x ((extChartAt (𝓡 n) x).symm z) x ((extChartAt (𝓡 n) x).symm z) |
| 92 | (canonicalTransport F t ((extChartAt (𝓡 n) x).symm z))) |
| 93 | (extChartAt (𝓡 n) x).target := by |
| 94 | let E := EuclideanSpace ℝ (Fin n) |
| 95 | let : NormedAddCommGroup (E →L[ℝ] E) := ContinuousLinearMap.toNormedAddCommGroup |
| 96 | let : NormedSpace ℝ (E →L[ℝ] E) := ContinuousLinearMap.toNormedSpace |
| 97 | let : NormedAddCommGroup ((E →L[ℝ] E) →L[ℝ] E →L[ℝ] E) := |
| 98 | ContinuousLinearMap.toNormedAddCommGroup |
| 99 | let : NormedSpace ℝ ((E →L[ℝ] E) →L[ℝ] E →L[ℝ] E) := |
| 100 | ContinuousLinearMap.toNormedSpace |
| 101 | let e := extChartAt (𝓡 n) x |
| 102 | let A : E → ℝ → (E →L[ℝ] E) →L[ℝ] E →L[ℝ] E := fun z s => |
| 103 | ContinuousLinearMap.compL ℝ E E E (chartRicciCoefficient F x z s) |
| 104 | let Φ : E → ℝ → E →L[ℝ] E := fun z s => |
| 105 | ContinuousLinearMap.inCoordinates E (TangentSpace (𝓡 n)) E (TangentSpace (𝓡 n)) |
| 106 | x (e.symm z) x (e.symm z) (canonicalTransport F s (e.symm z)) |
| 107 | have hsub : Icc a t ⊆ Ico a b := fun s hs => ⟨hs.1, hs.2.trans_lt ht.2⟩ |
| 108 | have hzbase (z : E) (hz : z ∈ e.target) : e.symm z ∈ |
| 109 | (trivializationAt E (TangentSpace (𝓡 n)) x).baseSet := by |
| 110 | rw [TangentBundle.trivializationAt_baseSet] |
| 111 | simpa only [e, extChartAt_source] using e.map_target hz |
| 112 | have hA : ContDiffOn ℝ ∞ (Function.uncurry A) (e.target ×ˢ Icc a t) := |
| 113 | (ContinuousLinearMap.compL ℝ E E E).contDiff.comp_contDiffOn |
| 114 | ((chartRicciCoefficient_contDiffOn F x).mono (prod_mono Subset.rfl hsub)) |
| 115 | have hinit : ContDiffOn ℝ ∞ (fun z => Φ z a) e.target := by |
| 116 | apply (contDiffOn_const : ContDiffOn ℝ ∞ (fun _ : E => ContinuousLinearMap.id ℝ E) |
| 117 | e.target).congr |
| 118 | intro z hz |
| 119 | exact canonicalTransport_coordinates_initial F (ht.1.trans_lt ht.2) x _ (hzbase z hz) |
| 120 | have hsol : ∀ z ∈ e.target, ∀ s ∈ Icc a t, |
| 121 | HasDerivWithinAt (Φ z) (A z s (Φ z s)) (Icc a t) s := by |
| 122 | intro z hz s hs |
| 123 | exact (canonicalTransport_coordinates_hasDerivWithinAt F x _ (hzbase z hz) |
| 124 | (hsub hs)).mono hsub |
| 125 | exact linearODE_contDiffOn_spatial A ht.1 (isOpen_extChartAt_target x) hA Φ hinit hsol |
| 126 | (right_mem_Icc.mpr ht.1) |
| 127 | |
| 128 | /-- At every included time the canonical transport is a smooth section of the |
| 129 | tangent endomorphism bundle. -/ |
| 130 | theorem canonicalTransport_contMDiff_spatial (F : RicciFlow n M (Ico a b)) |
| 131 | {t : ℝ} (ht : t ∈ Ico a b) : |
| 132 | ContMDiff (𝓡 n) |
| 133 | ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n))) ∞ |
| 134 | (fun x => TotalSpace.mk' (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n)) |
| 135 | (E := fun y => TangentSpace (𝓡 n) y →L[ℝ] TangentSpace (𝓡 n) y) |
| 136 | x (canonicalTransport F t x)) := by |
| 137 | intro x |
| 138 | rw [contMDiffAt_hom_bundle] |
| 139 | refine ⟨contMDiffAt_id, ?_⟩ |
| 140 | have h := (canonicalTransport_chart_contDiffOn F x ht).contDiffAt |
| 141 | ((isOpen_extChartAt_target x).mem_nhds (mem_extChartAt_target x)) |
| 142 | have hc := h.contMDiffAt.comp x (contMDiffAt_extChartAt (I := 𝓡 n) (x := x)) |
| 143 | apply hc.congr_of_eventuallyEq |
| 144 | filter_upwards [(isOpen_extChartAt_source (I := 𝓡 n) x).mem_nhds |
| 145 | (mem_extChartAt_source x)] with y hy |
| 146 | exact congrArg (fun z : M => |
| 147 | ContinuousLinearMap.inCoordinates (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) |
| 148 | (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x z x z |
| 149 | (canonicalTransport F t z)) ((extChartAt (𝓡 n) x).left_inv hy).symm |
| 150 | |
| 151 | end PoincareMT.RicciFlow.Frame |