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.CurveShortening.Comparison.PolygonApproximation.Interpolator.EndpointBound |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.PolygonApproximation.Sampled.PolygonSpeed |
| 3 | import PoincareLib.Geometry.CurveShortening.Ramp.CurveEstimates.Relabeling.Geometry |
| 4 | |
| 5 | /-! |
| 6 | # Horizontal derivative of the interpolator rectangle |
| 7 | |
| 8 | The horizontal basis vector leaves interpolation time fixed and differentiates |
| 9 | both endpoint curves. The resulting endpoint tangent vectors are exactly the |
| 10 | inputs controlled by the compact short-tube derivative bound. |
| 11 | |
| 12 | Morgan--Tian context: Section 19.4, Definition 19.18 and Claims 19.19-19.22, printed pp. |
| 13 | 450-453. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter Bundle |
| 20 | open scoped Manifold ContDiff Topology Bundle ENNReal |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 28 | [IsManifold (𝓡 n) ∞ M] |
| 29 | |
| 30 | omit [IsManifold (𝓡 n) ∞ M] in |
| 31 | /-- Differentiate both endpoint curves while keeping interpolation time fixed. Source: |
| 32 | Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. 450-453; project |
| 33 | construction in `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 34 | theorem m64_interpolator_horizontal_column_eq |
| 35 | {gamma beta : ℝ → M} {H : ℝ × (M × M) → M} (x : LoopPlane) |
| 36 | (hgamma : MDifferentiableAt 𝓘(ℝ, ℝ) (𝓡 n) gamma (x 0)) |
| 37 | (hbeta : MDifferentiableAt 𝓘(ℝ, ℝ) (𝓡 n) beta (x 0)) |
| 38 | (hH : MDifferentiableAt |
| 39 | (𝓘(ℝ, ℝ).prod ((𝓡 n).prod (𝓡 n))) (𝓡 n) H |
| 40 | (x 1, gamma (x 0), beta (x 0))) : |
| 41 | mfderiv (𝓡 2) (𝓡 n) |
| 42 | (fun p : LoopPlane => H (p 1, gamma (p 0), beta (p 0))) x |
| 43 | (EuclideanSpace.basisFun (Fin 2) ℝ 0) = |
| 44 | mfderiv (𝓘(ℝ, ℝ).prod ((𝓡 n).prod (𝓡 n))) (𝓡 n) H |
| 45 | (x 1, gamma (x 0), beta (x 0)) |
| 46 | (0, curveVelocity gamma (x 0), curveVelocity beta (x 0)) := by |
| 47 | have hp0 : MDifferentiableAt (𝓡 2) 𝓘(ℝ, ℝ) |
| 48 | (fun p : LoopPlane => p 0) x := |
| 49 | (PiLp.proj (𝕜 := ℝ) 2 (fun _ : Fin 2 => ℝ) 0).contDiff |
| 50 | (n := ∞) |>.contMDiff.contMDiffAt |>.mdifferentiableAt (by simp) |
| 51 | have hp1 : MDifferentiableAt (𝓡 2) 𝓘(ℝ, ℝ) |
| 52 | (fun p : LoopPlane => p 1) x := |
| 53 | (PiLp.proj (𝕜 := ℝ) 2 (fun _ : Fin 2 => ℝ) 1).contDiff |
| 54 | (n := ∞) |>.contMDiff.contMDiffAt |>.mdifferentiableAt (by simp) |
| 55 | let b := EuclideanSpace.basisFun (Fin 2) ℝ 0 |
| 56 | have hb0 : mfderiv (𝓡 2) 𝓘(ℝ, ℝ) (fun p : LoopPlane => p 0) x b = 1 := by |
| 57 | rw [mfderiv_eq_fderiv] |
| 58 | have hd : fderiv ℝ (fun p : LoopPlane => p 0) x = |
| 59 | (EuclideanSpace.proj 0 : LoopPlane →L[ℝ] ℝ) := |
| 60 | (show LoopPlane →L[ℝ] ℝ from EuclideanSpace.proj 0).fderiv |
| 61 | rw [hd] |
| 62 | change (EuclideanSpace.basisFun (Fin 2) ℝ 0) 0 = 1 |
| 63 | simp [EuclideanSpace.basisFun_apply] |
| 64 | have hb1 : mfderiv (𝓡 2) 𝓘(ℝ, ℝ) (fun p : LoopPlane => p 1) x b = 0 := by |
| 65 | rw [mfderiv_eq_fderiv] |
| 66 | have hd : fderiv ℝ (fun p : LoopPlane => p 1) x = |
| 67 | (EuclideanSpace.proj 1 : LoopPlane →L[ℝ] ℝ) := |
| 68 | (show LoopPlane →L[ℝ] ℝ from EuclideanSpace.proj 1).fderiv |
| 69 | rw [hd] |
| 70 | change (EuclideanSpace.basisFun (Fin 2) ℝ 0) 1 = 0 |
| 71 | simp [EuclideanSpace.basisFun_apply] |
| 72 | have hgamma_b : mfderiv (𝓡 2) (𝓡 n) |
| 73 | (fun p : LoopPlane => gamma (p 0)) x b = curveVelocity gamma (x 0) := by |
| 74 | have hc := mfderiv_comp_apply x hgamma hp0 b |
| 75 | rw [hb0] at hc |
| 76 | simpa only [Function.comp_def, curveVelocity] using hc |
| 77 | have hbeta_b : mfderiv (𝓡 2) (𝓡 n) |
| 78 | (fun p : LoopPlane => beta (p 0)) x b = curveVelocity beta (x 0) := by |
| 79 | have hc := mfderiv_comp_apply x hbeta hp0 b |
| 80 | rw [hb0] at hc |
| 81 | simpa only [Function.comp_def, curveVelocity] using hc |
| 82 | let input : LoopPlane → ℝ × (M × M) := fun p => |
| 83 | (p 1, gamma (p 0), beta (p 0)) |
| 84 | have hinput : MDifferentiableAt (𝓡 2) |
| 85 | (𝓘(ℝ, ℝ).prod ((𝓡 n).prod (𝓡 n))) input x := |
| 86 | hp1.prodMk ((hgamma.comp x hp0).prodMk (hbeta.comp x hp0)) |
| 87 | have hbinput : mfderiv (𝓡 2) |
| 88 | (𝓘(ℝ, ℝ).prod ((𝓡 n).prod (𝓡 n))) input x b = |
| 89 | (0, curveVelocity gamma (x 0), curveVelocity beta (x 0)) := by |
| 90 | have hprod := mfderiv_prodMk hp1 |
| 91 | ((hgamma.comp x hp0).prodMk (hbeta.comp x hp0)) |
| 92 | have hev := congrArg (fun L => L b) hprod |
| 93 | erw [mfderiv_prodMk (hgamma.comp x hp0) (hbeta.comp x hp0)] at hev |
| 94 | change _ = ((mfderiv (𝓡 2) 𝓘(ℝ, ℝ) (fun p : LoopPlane => p 1) x) b, |
| 95 | ((mfderiv (𝓡 2) (𝓡 n) (fun p : LoopPlane => gamma (p 0)) x) b, |
| 96 | (mfderiv (𝓡 2) (𝓡 n) (fun p : LoopPlane => beta (p 0)) x) b)) at hev |
| 97 | simpa only [input, Function.comp_def, hb1, hgamma_b, hbeta_b] using hev |
| 98 | have hc := mfderiv_comp_apply x hH hinput b |
| 99 | rw [hbinput] at hc |
| 100 | simpa only [Function.comp_def, input, b] using hc |
| 101 | |
| 102 | /-- Translating a minimizing side's parameter preserves its constant speed. Source: |
| 103 | Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. 450-453; project |
| 104 | construction in `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 105 | theorem m64_translated_side_speed |
| 106 | {g : RiemannianMetric n M} {D : LeviCivitaData g} |
| 107 | {ell left x : ℝ} {p q : M} |
| 108 | (side : M63MinimizingGeodesicSide g D ell p q) |
| 109 | (hx : x - left ∈ Icc (0 : ℝ) ell) : |
| 110 | g.tangentNorm (side.map (x - left)) |
| 111 | (curveVelocity (fun y => side.map (y - left)) x) = side.speed := by |
| 112 | have hside : MDifferentiableAt 𝓘(ℝ, ℝ) (𝓡 n) side.map (x - left) := |
| 113 | (side.smooth.contMDiffAt |
| 114 | (side.domain_open.mem_nhds (side.interval_subset hx))).mdifferentiableAt |
| 115 | (by simp) |
| 116 | rw [M63.curveVelocity_comp (phi := fun y : ℝ => y - left) |
| 117 | (x := x) (v := 1) hside ((hasDerivAt_id x).sub_const left), one_smul] |
| 118 | exact side.constant_speed (x - left) hx |
| 119 | |
| 120 | end PoincareMT |