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.PullbackFrame |
| 2 | |
| 3 | /-! |
| 4 | # Independence of the parametric extension in the pullback connection |
| 5 | |
| 6 | Frame coefficients agree on the actual curve domain. Ambient derivatives |
| 7 | and uniqueness of within-derivatives identify their derivatives at endpoints. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | |
| 12 | open scoped Manifold ContDiff Bundle BigOperators |
| 13 | |
| 14 | namespace PoincareMT.ReducedLength |
| 15 | |
| 16 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 17 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 18 | [IsManifold (𝓡 n) ∞ M] |
| 19 | |
| 20 | local notation "V" => EuclideanSpace ℝ (Fin n) |
| 21 | |
| 22 | set_option backward.isDefEq.respectTransparency false in |
| 23 | theorem pullbackCovariantDerivative_extension_independent {J : Set ℝ} |
| 24 | (F : RicciFlow n M J) (time : ℝ → ℝ) (γ : ℝ → M) |
| 25 | (Y : (t : ℝ) → TangentSpace (𝓡 n) (γ t)) (I : Set ℝ) |
| 26 | (E E' : ParametricAlongCurveExtensionOn I γ Y) (s : ℝ) (hs : s ∈ I) |
| 27 | (hI : UniqueDiffWithinAt ℝ I s) |
| 28 | (hγ : MDifferentiableAt (𝓘(ℝ, ℝ)) (𝓡 n) γ s) : |
| 29 | pullbackCovariantDerivative F time γ Y I E s = |
| 30 | pullbackCovariantDerivative F time γ Y I E' s := by |
| 31 | let b := (stdOrthonormalBasis ℝ V).toBasis |
| 32 | let e := trivializationAt V (TangentSpace (𝓡 n) : M → Type _) (γ s) |
| 33 | have hq : γ s ∈ e.baseSet := FiberBundle.mem_baseSet_trivializationAt' (γ s) |
| 34 | have hE (A : ParametricAlongCurveExtensionOn I γ Y) : |
| 35 | MDifferentiableAt ((𝓘(ℝ, ℝ)).prod (𝓡 n)) ((𝓡 n).prod (𝓡 n)) |
| 36 | (fun z : ℝ × M ↦ Bundle.TotalSpace.mk' V z.2 (A.extension z.1 z.2)) (s, γ s) := |
| 37 | (A.smooth.contMDiffAt (A.open_domain.mem_nhds (A.graph_mem s hs))).mdifferentiableAt |
| 38 | (by simp) |
| 39 | have hv : curveVelocityWithin γ I s = curveVelocity γ s := |
| 40 | congrArg (fun L : ℝ →L[ℝ] TangentSpace (𝓡 n) (γ s) ↦ L 1) |
| 41 | (mfderivWithin_eq_mfderiv hI.uniqueMDiffWithinAt hγ) |
| 42 | unfold pullbackCovariantDerivative |
| 43 | rw [hv, parametric_pullback_frame (F.connection (time s)) b (γ s) γ s |
| 44 | E.extension hq (hE E) hγ, |
| 45 | parametric_pullback_frame (F.connection (time s)) b (γ s) γ s |
| 46 | E'.extension hq (hE E') hγ] |
| 47 | apply Finset.sum_congr rfl |
| 48 | intro i _ |
| 49 | have heq : ∀ t ∈ I, |
| 50 | e.localFrameCoeff (𝓡 n) b i (γ t) (E.extension t (γ t)) = |
| 51 | e.localFrameCoeff (𝓡 n) b i (γ t) (E'.extension t (γ t)) := by |
| 52 | intro t ht |
| 53 | rw [E.agrees t ht, E'.agrees t ht] |
| 54 | have hd (A : ParametricAlongCurveExtensionOn I γ Y) : DifferentiableAt ℝ |
| 55 | (fun t ↦ e.localFrameCoeff (𝓡 n) b i (γ t) (A.extension t (γ t))) s := |
| 56 | (hasDerivAt_parametric_curve |
| 57 | (fun z : ℝ × M ↦ e.localFrameCoeff (𝓡 n) b i z.2 (A.extension z.1 z.2)) γ s |
| 58 | (mdifferentiableAt_parametric_frameCoeff b (γ s) (γ s) s |
| 59 | A.extension hq (hE A) i) hγ).differentiableAt |
| 60 | have hder : deriv |
| 61 | (fun t ↦ e.localFrameCoeff (𝓡 n) b i (γ t) (E.extension t (γ t))) s = |
| 62 | deriv (fun t ↦ e.localFrameCoeff (𝓡 n) b i (γ t) (E'.extension t (γ t))) s := |
| 63 | hI.eq_deriv I |
| 64 | ((hd E).hasDerivAt.hasDerivWithinAt.congr_of_mem (fun t ht ↦ (heq t ht).symm) hs) |
| 65 | (hd E').hasDerivAt.hasDerivWithinAt |
| 66 | exact congrArg₂ (· + ·) (congrArg (· • |
| 67 | (F.connection (time s)).connection (e.localFrame b i) (γ s) (curveVelocity γ s)) |
| 68 | (heq s hs)) (congrArg (· • e.localFrame b i (γ s)) hder) |
| 69 | |
| 70 | end PoincareMT.ReducedLength |