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.Variation.Fields.ParametricFrame |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.ParametricCurveDerivative |
| 3 | |
| 4 | /-! |
| 5 | # The pullback derivative in an actual local frame |
| 6 | |
| 7 | The parameter derivative combines with the spatial Leibniz term to give |
| 8 | the derivative of the frame coefficients along the parameterized graph. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle Topology BigOperators |
| 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 parametric_pullback_frame {g : RiemannianMetric n M} |
| 25 | (D : LeviCivitaData g) {ι : Type*} [Fintype ι] (b : Module.Basis ι ℝ V) |
| 26 | (p : M) (γ : ℝ → M) (s : ℝ) (H : ℝ → (x : M) → TangentSpace (𝓡 n) x) |
| 27 | (hq : γ s ∈ (trivializationAt V (TangentSpace (𝓡 n) : M → Type _) p).baseSet) |
| 28 | (hH : MDifferentiableAt ((𝓘(ℝ, ℝ)).prod (𝓡 n)) ((𝓡 n).prod (𝓡 n)) |
| 29 | (fun z : ℝ × M ↦ Bundle.TotalSpace.mk' V z.2 (H z.1 z.2)) (s, γ s)) |
| 30 | (hγ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ s) : |
| 31 | let e := trivializationAt V (TangentSpace (𝓡 n) : M → Type _) p |
| 32 | deriv (fun t ↦ H t (γ s)) s + D.connection (H s) (γ s) (curveVelocity γ s) = |
| 33 | ∑ i, (e.localFrameCoeff (𝓡 n) b i (γ s) (H s (γ s)) • |
| 34 | D.connection (e.localFrame b i) (γ s) (curveVelocity γ s) + |
| 35 | deriv (fun t ↦ e.localFrameCoeff (𝓡 n) b i (γ t) (H t (γ t))) s • |
| 36 | e.localFrame b i (γ s)) := by |
| 37 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 38 | ⟨g.toRiemannianMetric⟩ |
| 39 | let e := trivializationAt V (TangentSpace (𝓡 n) : M → Type _) p |
| 40 | have hspatial : MDifferentiableAt (𝓡 n) ((𝓡 n).prod (𝓡 n)) (T% (H s)) (γ s) := |
| 41 | hH.comp (γ s) (mdifferentiableAt_const.prodMk mdifferentiableAt_id) |
| 42 | have htime := parametric_frame_time_derivative g b p (γ s) s H hq hH |
| 43 | have hconn := connection_localFrame D b p (γ s) hq (H s) hspatial (curveVelocity γ s) |
| 44 | dsimp only at htime hconn ⊢ |
| 45 | rw [htime.deriv, hconn, ← Finset.sum_add_distrib] |
| 46 | apply Finset.sum_congr rfl |
| 47 | intro i _ |
| 48 | have hchain := hasDerivAt_parametric_curve |
| 49 | (fun z : ℝ × M ↦ e.localFrameCoeff (𝓡 n) b i z.2 (H z.1 z.2)) γ s |
| 50 | (mdifferentiableAt_parametric_frameCoeff b p (γ s) s H hq hH i) hγ |
| 51 | change _ = e.localFrameCoeff (𝓡 n) b i (γ s) (H s (γ s)) • |
| 52 | D.connection (e.localFrame b i) (γ s) (curveVelocity γ s) + |
| 53 | deriv (fun t ↦ e.localFrameCoeff (𝓡 n) b i (γ t) (H t (γ t))) s • |
| 54 | e.localFrame b i (γ s) |
| 55 | rw [hchain.deriv, add_smul] |
| 56 | abel |
| 57 | |
| 58 | end PoincareMT.ReducedLength |