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.ReducedGeometry.ReducedLength.Coordinates.ChartCurveExtension |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.PullbackExtension |
| 3 | |
| 4 | /-! |
| 5 | # Local coordinate derivatives of actual fields along a curve |
| 6 | |
| 7 | Restricting to an open chart neighborhood preserves within derivatives. |
| 8 | The constant-coordinate extension computes the actual pullback derivative, |
| 9 | including at a closed interval endpoint. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedLength |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 23 | [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | local notation "V" => EuclideanSpace ℝ (Fin n) |
| 26 | |
| 27 | noncomputable def chartFieldExtensionAlong (p : M) (γ : ℝ → M) |
| 28 | (Y : ∀ s, TangentSpace (𝓡 n) (γ s)) (v : ℝ → V) |
| 29 | (U K : Set ℝ) (hU : IsOpen U) (hKU : K ⊆ U) |
| 30 | (hv : ContDiffOn ℝ ∞ v U) |
| 31 | (hq : ∀ s ∈ K, γ s ∈ (chartAt V p).source) |
| 32 | (heq : ∀ s ∈ K, chartVectorField p (v s) (γ s) = Y s) : |
| 33 | ParametricAlongCurveExtensionOn K γ Y where |
| 34 | extension := fun s ↦ chartVectorField p (v s) |
| 35 | domain := U ×ˢ (chartAt V p).source |
| 36 | open_domain := hU.prod (chartAt V p).open_source |
| 37 | graph_mem := fun s hs ↦ ⟨hKU hs, hq s hs⟩ |
| 38 | smooth := chartVectorField_param_smooth p v U hv |
| 39 | agrees := heq |
| 40 | |
| 41 | set_option backward.isDefEq.respectTransparency false in |
| 42 | theorem chartFieldExtensionAlong_pullback {J : Set ℝ} (F : RicciFlow n M J) |
| 43 | (time : ℝ → ℝ) (p : M) (γ : ℝ → M) |
| 44 | (Y : ∀ s, TangentSpace (𝓡 n) (γ s)) (v : ℝ → V) |
| 45 | (U K : Set ℝ) (hU : IsOpen U) (hKU : K ⊆ U) |
| 46 | (hv : ContDiffOn ℝ ∞ v U) |
| 47 | (hq : ∀ s ∈ K, γ s ∈ (chartAt V p).source) |
| 48 | (heq : ∀ s ∈ K, chartVectorField p (v s) (γ s) = Y s) |
| 49 | (s : ℝ) (w : V) (hdv : HasDerivAt v w s) : |
| 50 | pullbackCovariantDerivative F time γ Y K |
| 51 | (chartFieldExtensionAlong p γ Y v U K hU hKU hv hq heq) s = |
| 52 | chartVectorField p w (γ s) + |
| 53 | (F.connection (time s)).connection (chartVectorField p (v s)) (γ s) |
| 54 | (curveVelocityWithin (n := n) γ K s) := by |
| 55 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 56 | ⟨(F.metric (time s)).toRiemannianMetric⟩ |
| 57 | let L : V →L[ℝ] TangentSpace (𝓡 n) (γ s) := |
| 58 | (mfderiv (𝓡 n) (𝓡 n) (chartAt V p) (γ s)).inverse |
| 59 | have hd : HasDerivAt (fun r ↦ L (v r)) (L w) s := by |
| 60 | simpa only [zero_apply, zero_add] using (hasDerivAt_const s L).clm_apply hdv |
| 61 | exact congrArg (· + (F.connection (time s)).connection |
| 62 | (chartVectorField p (v s)) (γ s) (curveVelocityWithin (n := n) γ K s)) hd.deriv |
| 63 | |
| 64 | theorem pullbackCovariantDerivative_chart_field_local {J : Set ℝ} (F : RicciFlow n M J) |
| 65 | (time : ℝ → ℝ) (p : M) (γ : ℝ → M) |
| 66 | (Y : ∀ s, TangentSpace (𝓡 n) (γ s)) (I U : Set ℝ) |
| 67 | (E : ParametricAlongCurveExtensionOn I γ Y) |
| 68 | (s : ℝ) (hs : s ∈ I) (hU : IsOpen U) (hsU : s ∈ U) |
| 69 | (hI : UniqueDiffWithinAt ℝ I s) |
| 70 | (hγ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ s) |
| 71 | (v : ℝ → V) (hv : ContDiffOn ℝ ∞ v U) |
| 72 | (hq : ∀ r ∈ I ∩ U, γ r ∈ (chartAt V p).source) |
| 73 | (heq : ∀ r ∈ I ∩ U, chartVectorField p (v r) (γ r) = Y r) |
| 74 | (w : V) (hdv : HasDerivAt v w s) : |
| 75 | pullbackCovariantDerivative F time γ Y I E s = |
| 76 | chartVectorField p w (γ s) + |
| 77 | (F.connection (time s)).connection (chartVectorField p (v s)) (γ s) |
| 78 | (curveVelocityWithin (n := n) γ I s) := by |
| 79 | let K := I ∩ U |
| 80 | let E' : ParametricAlongCurveExtensionOn K γ Y := { |
| 81 | extension := E.extension |
| 82 | domain := E.domain |
| 83 | open_domain := E.open_domain |
| 84 | graph_mem := fun r hr ↦ E.graph_mem r hr.1 |
| 85 | smooth := E.smooth |
| 86 | agrees := fun r hr ↦ E.agrees r hr.1 |
| 87 | } |
| 88 | have hK : UniqueDiffWithinAt ℝ K s := hI.inter (hU.mem_nhds hsU) |
| 89 | have hvel : curveVelocityWithin (n := n) γ I s = curveVelocityWithin (n := n) γ K s := by |
| 90 | unfold curveVelocityWithin |
| 91 | rw [mfderivWithin_eq_mfderiv hI.uniqueMDiffWithinAt hγ, |
| 92 | mfderivWithin_eq_mfderiv hK.uniqueMDiffWithinAt hγ] |
| 93 | have hrestrict : pullbackCovariantDerivative F time γ Y I E s = |
| 94 | pullbackCovariantDerivative F time γ Y K E' s := by |
| 95 | unfold pullbackCovariantDerivative |
| 96 | rw [hvel] |
| 97 | rw [hrestrict, pullbackCovariantDerivative_extension_independent F time γ Y K E' |
| 98 | (chartFieldExtensionAlong p γ Y v U K hU Set.inter_subset_right hv hq heq) |
| 99 | s ⟨hs, hsU⟩ hK hγ, |
| 100 | chartFieldExtensionAlong_pullback F time p γ Y v U K hU Set.inter_subset_right |
| 101 | hv hq heq s w hdv, ← hvel] |
| 102 | |
| 103 | theorem pullbackCovariantDerivative_chart_field_zero {J : Set ℝ} (F : RicciFlow n M J) |
| 104 | (time : ℝ → ℝ) (p : M) (γ : ℝ → M) |
| 105 | (Y : ∀ s, TangentSpace (𝓡 n) (γ s)) (I U : Set ℝ) |
| 106 | (E : ParametricAlongCurveExtensionOn I γ Y) |
| 107 | (s : ℝ) (hs : s ∈ I) (hU : IsOpen U) (hsU : s ∈ U) |
| 108 | (hI : UniqueDiffWithinAt ℝ I s) |
| 109 | (hγ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ s) |
| 110 | (v : ℝ → V) (hv : ContDiffOn ℝ ∞ v U) |
| 111 | (hq : ∀ r ∈ I ∩ U, γ r ∈ (chartAt V p).source) |
| 112 | (heq : ∀ r ∈ I ∩ U, chartVectorField p (v r) (γ r) = Y r) |
| 113 | (w : V) (hdv : HasDerivAt v w s) (hzero : v s = 0) : |
| 114 | pullbackCovariantDerivative F time γ Y I E s = chartVectorField p w (γ s) := by |
| 115 | rw [pullbackCovariantDerivative_chart_field_local F time p γ Y I U E s hs hU hsU |
| 116 | hI hγ v hv hq heq w hdv, hzero] |
| 117 | have hfield : chartVectorField (n := n) p 0 = 0 := by |
| 118 | funext x |
| 119 | exact (mfderiv (𝓡 n) (𝓡 n) (chartAt V p) x).inverse.map_zero |
| 120 | rw [hfield, (F.connection (time s)).connection.zero] |
| 121 | exact add_zero _ |
| 122 | |
| 123 | end PoincareMT.ReducedLength |