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.Ramp.Data |
| 2 | import Mathlib.Geometry.Manifold.ContMDiffMFDeriv |
| 3 | import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace |
| 4 | |
| 5 | /-! |
| 6 | # Actual embedded data of arbitrary C2 solutions |
| 7 | |
| 8 | The actual tangent map transfers the closed bundle continuity fields to |
| 9 | the fixed Euclidean target. The pure-normal equation gives a witnessed |
| 10 | time derivative only in the interior. MT2007 Claim 19.1, p. 437; |
| 11 | `2026-09-22-uniqueness-embedded-curve-data.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle |
| 19 | |
| 20 | universe u v |
| 21 | |
| 22 | namespace PoincareMT.M63 |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 26 | {ι : Type v} [Fintype ι] {a b : ℝ} |
| 27 | |
| 28 | local notation "W" => EuclideanSpace ℝ ι |
| 29 | |
| 30 | /-- Smooth ambient composition preserves actual spatial C2 data and |
| 31 | the closed value, first derivative and pushed-curvature continuity. |
| 32 | MT2007 Claim 19.1, p. 437; embedded-curve-data derivation, statement 1. |
| 33 | No assertion about continuity of the raw second derivative is made. -/ |
| 34 | theorem c2ShrinkingCurve_embedded_closed_data |
| 35 | {F : RicciFlow n M (Icc a b)} {c : ℝ → ℝ → M} {J : Set ℝ} |
| 36 | (hc : M63C2ShrinkingCurveOn F c J) {e : M → W} |
| 37 | (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) : |
| 38 | (∀ t ∈ J, ContDiff ℝ 2 (fun x => e (c x t))) ∧ |
| 39 | (∀ t ∈ J, ∀ x, HasDerivAt (fun y => e (c y t)) |
| 40 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t) |
| 41 | (curveVelocity (n := n) (fun y => c y t) x) : W) x) ∧ |
| 42 | ContinuousOn (fun z : ℝ × ℝ => e (c z.1 z.2)) (univ ×ˢ J) ∧ |
| 43 | ContinuousOn (fun z : ℝ × ℝ => deriv (fun y => e (c y z.2)) z.1) |
| 44 | (univ ×ˢ J) ∧ |
| 45 | ContinuousOn (fun z : ℝ × ℝ => |
| 46 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c z.1 z.2) |
| 47 | (m62CurvatureVector F c z.2 z.1) : W)) (univ ×ˢ J) := by |
| 48 | have hspace (t : ℝ) (ht : t ∈ J) : ContDiff ℝ 2 (fun x => e (c x t)) := |
| 49 | ((he.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 2)).comp |
| 50 | (hc.spatial_regular t ht)).contDiff |
| 51 | have hderiv (t : ℝ) (ht : t ∈ J) (x : ℝ) : HasDerivAt (fun y => e (c y t)) |
| 52 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t) |
| 53 | (curveVelocity (n := n) (fun y => c y t) x) : W) x := by |
| 54 | have hchain : fderiv ℝ (fun y => e (c y t)) x = |
| 55 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t)).comp |
| 56 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 n) (fun y => c y t) x) := by |
| 57 | rw [← mfderiv_eq_fderiv] |
| 58 | exact mfderiv_comp x (he.mdifferentiable (by simp)).mdifferentiableAt |
| 59 | ((hc.spatial_regular t ht x).mdifferentiableAt (by norm_num)) |
| 60 | have hd := ((hspace t ht).differentiable (by norm_num) x).hasDerivAt |
| 61 | have heq := congrArg (fun L : ℝ →L[ℝ] W => L 1) hchain |
| 62 | exact hd.congr_deriv heq |
| 63 | have hpush : Continuous (fun p : TangentBundle (𝓡 n) M => |
| 64 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e p.1 p.2 : W)) := |
| 65 | (contMDiff_snd_tangentBundle_modelSpace (n := ∞) W 𝓘(ℝ, W)).continuous.comp |
| 66 | (he.continuous_tangentMap (by simp)) |
| 67 | refine ⟨hspace, hderiv, he.continuous.comp_continuousOn hc.continuous, ?_, ?_⟩ |
| 68 | · exact (hpush.comp_continuousOn hc.velocity_continuous).congr |
| 69 | (fun z hz => (hderiv z.2 hz.2 z.1).deriv) |
| 70 | · exact hpush.comp_continuousOn hc.curvature_continuous |
| 71 | |
| 72 | /-- The actual frozen pure-normal equation becomes a witnessed ambient |
| 73 | time derivative in the interior, with joint C1 regularity there. |
| 74 | MT2007 Claim 19.1, p. 437; embedded-curve-data derivation, statement 2. -/ |
| 75 | theorem c2ShrinkingCurve_embedded_interior_equation |
| 76 | {F : RicciFlow n M (Icc a b)} {c : ℝ → ℝ → M} {J : Set ℝ} |
| 77 | (hc : M63C2ShrinkingCurveOn F c J) {e : M → W} |
| 78 | (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) : |
| 79 | ContDiffOn ℝ 1 (fun z : ℝ × ℝ => e (c z.1 z.2)) (univ ×ˢ interior J) ∧ |
| 80 | ∀ t ∈ interior J, ∀ x, HasDerivAt (fun s => e (c x s)) |
| 81 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t) (m62CurvatureVector F c t x) : W) t := by |
| 82 | have hC1 : ContDiffOn ℝ 1 (fun z : ℝ × ℝ => e (c z.1 z.2)) |
| 83 | (univ ×ˢ interior J) := |
| 84 | ((he.of_le (ENat.natCast_le_of_coe_top_le_withTop le_rfl 1)).comp_contMDiffOn |
| 85 | hc.joint_c1).contDiffOn |
| 86 | refine ⟨hC1, ?_⟩ |
| 87 | intro t ht x |
| 88 | have hmem : (x, t) ∈ univ ×ˢ interior J := ⟨mem_univ _, ht⟩ |
| 89 | have htime : MDifferentiableAt 𝓘(ℝ, ℝ) 𝓘(ℝ, ℝ × ℝ) |
| 90 | (fun s : ℝ => (x, s)) t := |
| 91 | ((differentiableAt_const x).prodMk differentiableAt_id).mdifferentiableAt |
| 92 | have hct := (((hc.joint_c1 (x, t) hmem).contMDiffAt |
| 93 | ((isOpen_univ.prod isOpen_interior).mem_nhds hmem)).mdifferentiableAt |
| 94 | (by norm_num)).comp t htime |
| 95 | have hqd : DifferentiableAt ℝ (fun s => e (c x s)) t := |
| 96 | ((hC1.contDiffAt ((isOpen_univ.prod isOpen_interior).mem_nhds hmem)).differentiableAt |
| 97 | (by norm_num)).comp t ((differentiableAt_const x).prodMk differentiableAt_id) |
| 98 | have hchain : fderiv ℝ (fun s => e (c x s)) t = |
| 99 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t)).comp |
| 100 | (mfderiv 𝓘(ℝ, ℝ) (𝓡 n) (fun s => c x s) t) := by |
| 101 | rw [← mfderiv_eq_fderiv] |
| 102 | exact mfderiv_comp t (he.mdifferentiable (by simp)).mdifferentiableAt hct |
| 103 | have heq := congrArg (fun L : ℝ →L[ℝ] W => L 1) hchain |
| 104 | change deriv (fun s => e (c x s)) t = |
| 105 | mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t) (curveVelocity (fun s => c x s) t) at heq |
| 106 | rw [hc.equation t ht x] at heq |
| 107 | exact hqd.hasDerivAt.congr_deriv heq |
| 108 | |
| 109 | end PoincareMT.M63 |