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 | |
| 3 | /-! |
| 4 | # Coordinate velocities of an arbitrary manifold curve |
| 5 | |
| 6 | Chart differentiation and the inverse differential identify the actual |
| 7 | velocity. A smooth coordinate velocity gives a parametric extension along |
| 8 | the original curve, with no global chart-inverse representation required. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle |
| 14 | |
| 15 | namespace PoincareMT.ReducedLength |
| 16 | |
| 17 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 18 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 19 | [IsManifold (𝓡 n) ∞ M] |
| 20 | |
| 21 | local notation "V" => EuclideanSpace ℝ (Fin n) |
| 22 | |
| 23 | set_option backward.isDefEq.respectTransparency false in |
| 24 | theorem hasDerivAt_chart_curve (p : M) (γ : ℝ → M) (s : ℝ) |
| 25 | (hq : γ s ∈ (chartAt V p).source) |
| 26 | (hγ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ s) : |
| 27 | HasDerivAt (fun t ↦ (chartAt V p) (γ t)) |
| 28 | (mfderiv (𝓡 n) (𝓡 n) (chartAt V p) (γ s) (curveVelocity γ s)) s := by |
| 29 | have he := (mdifferentiable_chart (I := 𝓡 n) p).mdifferentiableAt hq |
| 30 | convert! (he.hasMFDerivAt.comp s hγ.hasMFDerivAt).hasFDerivAt.hasDerivAt using 1 |
| 31 | |
| 32 | set_option backward.isDefEq.respectTransparency false in |
| 33 | theorem chartVectorField_coordinate_velocity (p : M) (γ : ℝ → M) (s : ℝ) (v : V) |
| 34 | (hq : γ s ∈ (chartAt V p).source) |
| 35 | (hγ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ s) |
| 36 | (ha : HasDerivAt (fun t ↦ (chartAt V p) (γ t)) v s) : |
| 37 | chartVectorField p v (γ s) = curveVelocity γ s := by |
| 38 | have hv := ha.unique (hasDerivAt_chart_curve p γ s hq hγ) |
| 39 | have hi : (mfderiv (𝓡 n) (𝓡 n) (chartAt V p) (γ s)).IsInvertible := |
| 40 | ⟨(mdifferentiable_chart (I := 𝓡 n) p).mfderiv hq, rfl⟩ |
| 41 | change (mfderiv (𝓡 n) (𝓡 n) (chartAt V p) (γ s)).inverse v = _ |
| 42 | rw [hv] |
| 43 | exact hi.inverse_apply_self _ |
| 44 | |
| 45 | noncomputable def chartVelocityExtensionAlong (p : M) (γ : ℝ → M) (v : ℝ → V) |
| 46 | (U I : Set ℝ) (hU : IsOpen U) (hIU : I ⊆ U) (hI : UniqueDiffOn ℝ I) |
| 47 | (hv : ContDiffOn ℝ ∞ v U) |
| 48 | (hγ : ∀ s ∈ I, MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ s) |
| 49 | (ha : ∀ s ∈ I, HasDerivAt (fun t ↦ (chartAt V p) (γ t)) (v s) s) |
| 50 | (hq : ∀ s ∈ I, γ s ∈ (chartAt V p).source) : |
| 51 | ParametricAlongCurveExtensionOn I γ (curveVelocityWithin (n := n) γ I) where |
| 52 | extension := fun s ↦ chartVectorField p (v s) |
| 53 | domain := U ×ˢ (chartAt V p).source |
| 54 | open_domain := hU.prod (chartAt V p).open_source |
| 55 | graph_mem := fun s hs ↦ ⟨hIU hs, hq s hs⟩ |
| 56 | smooth := chartVectorField_param_smooth p v U hv |
| 57 | agrees := by |
| 58 | intro s hs |
| 59 | rw [chartVectorField_coordinate_velocity p γ s (v s) (hq s hs) (hγ s hs) (ha s hs)] |
| 60 | exact (congrArg (fun L : ℝ →L[ℝ] TangentSpace (𝓡 n) (γ s) ↦ L 1) |
| 61 | (mfderivWithin_eq_mfderiv (hI s hs).uniqueMDiffWithinAt (hγ s hs))).symm |
| 62 | |
| 63 | set_option backward.isDefEq.respectTransparency false in |
| 64 | theorem chartVelocityExtensionAlong_pullback {J : Set ℝ} (F : RicciFlow n M J) |
| 65 | (time : ℝ → ℝ) (p : M) (γ : ℝ → M) (v : ℝ → V) |
| 66 | (U I : Set ℝ) (hU : IsOpen U) (hIU : I ⊆ U) (hI : UniqueDiffOn ℝ I) |
| 67 | (hv : ContDiffOn ℝ ∞ v U) |
| 68 | (hγ : ∀ s ∈ I, MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ s) |
| 69 | (ha : ∀ s ∈ I, HasDerivAt (fun t ↦ (chartAt V p) (γ t)) (v s) s) |
| 70 | (hq : ∀ s ∈ I, γ s ∈ (chartAt V p).source) |
| 71 | (s : ℝ) (hs : s ∈ I) (w : V) (hdv : HasDerivAt v w s) : |
| 72 | pullbackCovariantDerivative F time γ (curveVelocityWithin (n := n) γ I) I |
| 73 | (chartVelocityExtensionAlong p γ v U I hU hIU hI hv hγ ha hq) s = |
| 74 | chartVectorField p w (γ s) + |
| 75 | (F.connection (time s)).connection (chartVectorField p (v s)) (γ s) |
| 76 | (curveVelocityWithin (n := n) γ I s) := by |
| 77 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 78 | ⟨(F.metric (time s)).toRiemannianMetric⟩ |
| 79 | let L : V →L[ℝ] TangentSpace (𝓡 n) (γ s) := |
| 80 | (mfderiv (𝓡 n) (𝓡 n) (chartAt V p) (γ s)).inverse |
| 81 | have hd : HasDerivAt (fun r ↦ L (v r)) (L w) s := by |
| 82 | simpa only [zero_apply, zero_add] using (hasDerivAt_const s L).clm_apply hdv |
| 83 | exact congrArg (· + (F.connection (time s)).connection |
| 84 | (chartVectorField p (v s)) (γ s) (curveVelocityWithin (n := n) γ I s)) hd.deriv |
| 85 | |
| 86 | end PoincareMT.ReducedLength |