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.CurveShortening.Evolution.Speed |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Minimum.Variation.Geometry.Tangent |
| 3 | import Mathlib.Analysis.SpecialFunctions.Sqrt |
| 4 | |
| 5 | /-! |
| 6 | # Interior regularity of the actual curve fields |
| 7 | |
| 8 | The primitive smooth curve map and shrinking equation give smooth velocity |
| 9 | and curvature fields on the open cylinder. The actual metric gives smooth |
| 10 | squared curvature and speed. This justifies the differentiations in MT2007 |
| 11 | Lemma 19.6, pp. 441-442, and correction Lemmas 0.1-0.2, pp. 3-6. |
| 12 | See `references/ricci-flow/mapher/curve-evolution/derivations/2026-09-19-interior-regularity.md`. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option maxSynthPendingDepth 3 |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.M62 |
| 24 | |
| 25 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 27 | {a b : ℝ} (F : RicciFlow n M (Set.Icc a b)) (c : ℝ → ℝ → M) |
| 28 | |
| 29 | /-- The actual spatial velocity is jointly smooth in the interior. |
| 30 | MT2007 Lemma 19.6, pp. 441-442; correction Lemma 0.1, p. 3. -/ |
| 31 | theorem spatial_velocity_joint_contMDiff (hc : M62ShrinkingCurve F c) : |
| 32 | ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 33 | (fun z : ℝ × ℝ ↦ (⟨c z.1 z.2, curveVelocity (fun y ↦ c y z.2) z.1⟩ : |
| 34 | TangentBundle (𝓡 n) M)) (Set.univ ×ˢ Set.Ioo a b) := by |
| 35 | have hcurve := hc.joint_smooth |
| 36 | rw [modelWithCornersSelf_prod, ← chartedSpaceSelf_prod] at hcurve |
| 37 | have h := ReducedLengthMinimum.Variation.Geometry.contMDiffOn_curveVelocity_fst (isOpen_univ.prod isOpen_Ioo) _ hcurve |
| 38 | rw [modelWithCornersSelf_prod, ← chartedSpaceSelf_prod] |
| 39 | exact h |
| 40 | |
| 41 | /-- The actual time velocity is jointly smooth in the interior. |
| 42 | MT2007 Lemma 19.6, pp. 441-442; correction Lemma 0.1, p. 3. -/ |
| 43 | theorem time_velocity_joint_contMDiff (hc : M62ShrinkingCurve F c) : |
| 44 | ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 45 | (fun z : ℝ × ℝ ↦ (⟨c z.1 z.2, curveVelocity (fun s ↦ c z.1 s) z.2⟩ : |
| 46 | TangentBundle (𝓡 n) M)) (Set.univ ×ˢ Set.Ioo a b) := by |
| 47 | have hcurve := hc.joint_smooth |
| 48 | rw [modelWithCornersSelf_prod, ← chartedSpaceSelf_prod] at hcurve |
| 49 | have h := ReducedLengthMinimum.Variation.Geometry.contMDiffOn_curveVelocity_snd (isOpen_univ.prod isOpen_Ioo) _ hcurve |
| 50 | rw [modelWithCornersSelf_prod, ← chartedSpaceSelf_prod] |
| 51 | exact h |
| 52 | |
| 53 | /-- The primitive shrinking equation makes the actual curvature field |
| 54 | jointly smooth in the interior; correction Lemma 0.2, pp. 4-6. -/ |
| 55 | theorem curvature_joint_contMDiff (hc : M62ShrinkingCurve F c) : |
| 56 | ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 57 | (fun z : ℝ × ℝ ↦ (⟨c z.1 z.2, m62CurvatureVector F c z.2 z.1⟩ : |
| 58 | TangentBundle (𝓡 n) M)) (Set.univ ×ˢ Set.Ioo a b) := by |
| 59 | apply (time_velocity_joint_contMDiff F c hc).congr |
| 60 | intro z hz |
| 61 | exact congrArg (Bundle.TotalSpace.mk (c z.1 z.2)) (hc.equation z.2 hz.2 z.1).symm |
| 62 | |
| 63 | /-- The actual evolving metric pairs smooth along-map fields smoothly |
| 64 | on the open cylinder; correction Lemmas 0.1-0.2, pp. 3-6. -/ |
| 65 | theorem metric_pairing_contDiffOn |
| 66 | (hc : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓡 n) ∞ |
| 67 | (fun z : ℝ × ℝ ↦ c z.1 z.2) (Set.univ ×ˢ Set.Ioo a b)) |
| 68 | (Y Z : (z : ℝ × ℝ) → TangentSpace (𝓡 n) (c z.1 z.2)) |
| 69 | (hY : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 70 | (fun z : ℝ × ℝ ↦ (⟨c z.1 z.2, Y z⟩ : TangentBundle (𝓡 n) M)) |
| 71 | (Set.univ ×ˢ Set.Ioo a b)) |
| 72 | (hZ : ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 73 | (fun z : ℝ × ℝ ↦ (⟨c z.1 z.2, Z z⟩ : TangentBundle (𝓡 n) M)) |
| 74 | (Set.univ ×ˢ Set.Ioo a b)) : |
| 75 | ContDiffOn ℝ ∞ (fun z : ℝ × ℝ ↦ (F.metric z.2).inner (c z.1 z.2) (Y z) (Z z)) |
| 76 | (Set.univ ×ˢ Set.Ioo a b) := by |
| 77 | have ht : ContMDiff (𝓘(ℝ, ℝ × ℝ)) (𝓘(ℝ, ℝ)) ∞ (Prod.snd : ℝ × ℝ → ℝ) := |
| 78 | contDiff_snd.contMDiff |
| 79 | have hg := F.smooth.comp (ht.contMDiffOn.prodMk hc) |
| 80 | (fun z hz ↦ ⟨Set.Ioo_subset_Icc_self hz.2, Set.mem_univ _⟩) |
| 81 | suffices ContMDiffOn (𝓘(ℝ, ℝ × ℝ)) (𝓘(ℝ, ℝ)) ∞ |
| 82 | (fun z : ℝ × ℝ ↦ (F.metric z.2).inner (c z.1 z.2) (Y z) (Z z)) |
| 83 | (Set.univ ×ˢ Set.Ioo a b) from this.contDiffOn |
| 84 | intro z hz |
| 85 | have hp : ContMDiffWithinAt (𝓘(ℝ, ℝ × ℝ)) ((𝓡 n).prod (𝓘(ℝ, ℝ))) ∞ |
| 86 | (fun w : ℝ × ℝ ↦ Bundle.TotalSpace.mk' ℝ (E := Bundle.Trivial M ℝ) |
| 87 | (c w.1 w.2) ((F.metric w.2).inner (c w.1 w.2) (Y w) (Z w))) |
| 88 | (Set.univ ×ˢ Set.Ioo a b) z := |
| 89 | (hg z hz).clm_bundle_apply₂ (hY z hz) (hZ z hz) |
| 90 | exact (Bundle.contMDiffWithinAt_totalSpace.mp hp).2 |
| 91 | |
| 92 | /-- Positive speed is jointly smooth on the open cylinder. |
| 93 | MT2007 Lemma 19.6, pp. 441-442; correction Lemma 0.1, p. 3. -/ |
| 94 | theorem speed_joint_contDiffOn (hc : M62ShrinkingCurve F c) : |
| 95 | ContDiffOn ℝ ∞ (fun z : ℝ × ℝ ↦ curveSpeed F c z.2 z.1) |
| 96 | (Set.univ ×ˢ Set.Ioo a b) := by |
| 97 | have hX := spatial_velocity_joint_contMDiff F c hc |
| 98 | exact (metric_pairing_contDiffOn F c hc.joint_smooth _ _ hX hX).sqrt |
| 99 | (fun z hz ↦ ((F.metric z.2).pos _ _ |
| 100 | (hc.immersed z.2 (Set.Ioo_subset_Icc_self hz.2) z.1)).ne') |
| 101 | |
| 102 | /-- Squared curvature is smooth even at curvature zeros in the interior. |
| 103 | Correction Lemma 0.2 and Corollary 0.3, pp. 4-7. -/ |
| 104 | theorem curvatureSquared_contDiffOn (hc : M62ShrinkingCurve F c) : |
| 105 | ContDiffOn ℝ ∞ (fun z : ℝ × ℝ ↦ m62CurvatureSquared F c z.2 z.1) |
| 106 | (Set.univ ×ˢ Set.Ioo a b) := by |
| 107 | have hH := curvature_joint_contMDiff F c hc |
| 108 | exact metric_pairing_contDiffOn F c hc.joint_smooth _ _ hH hH |
| 109 | |
| 110 | end PoincareMT.M62 |