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.Analysis.Immersed.CurveComposition |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.Analysis.Smooth.RetractionDifferentials |
| 3 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Uniqueness.EmbeddedCurve |
| 4 | |
| 5 | /-! |
| 6 | # Smooth fixed labels from an actual smooth anchor slice |
| 7 | |
| 8 | The actual retraction differential detects immersion of the embedded |
| 9 | reference curve. Scalar composition cancellation upgrades the same |
| 10 | fixed labels, hence the original normal solution. MT2007 Claim 19.1, |
| 11 | p. 437; `2026-09-22-smooth-upgrade-fixed-labels.md`, statement 2. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff |
| 18 | |
| 19 | universe u v |
| 20 | |
| 21 | namespace PoincareMT.M63 |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | {ι : Type v} [Fintype ι] {a b : ℝ} |
| 26 | |
| 27 | local notation "W" => EuclideanSpace ℝ ι |
| 28 | |
| 29 | /-- Both actual anchor slices are retained when the anchor is an |
| 30 | included endpoint. The same continuous labels become smooth and |
| 31 | transport the reference's joint interior smoothness. MT2007 Claim |
| 32 | 19.1, p. 437; fixed-label smooth upgrade derivation, statement 2. -/ |
| 33 | theorem smoothShrinkingCurve_of_fixed_relabeling_and_smooth_slice |
| 34 | (F : RicciFlow n M (Icc a b)) |
| 35 | {e : M → W} (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) |
| 36 | {U : Set W} (hU : IsOpen U) (heU : range e ⊆ U) {ρ : W → M} |
| 37 | (hρ : ContMDiffOn 𝓘(ℝ, W) (𝓡 n) ∞ ρ U) (hρe : ∀ p, ρ (e p) = p) |
| 38 | {J : Set ℝ} {s : ℝ} (hs : s ∈ J) {c d : ℝ → ℝ → M} |
| 39 | (hc : M63C2ShrinkingCurveOn F c J) (hd : M63SmoothShrinkingCurveOn F d J) |
| 40 | (hcs : ContMDiff 𝓘(ℝ, ℝ) (𝓡 n) ∞ (fun x => c x s)) |
| 41 | (hds : ContMDiff 𝓘(ℝ, ℝ) (𝓡 n) ∞ (fun x => d x s)) |
| 42 | {phi : ℝ → ℝ} (hphi : Continuous phi) |
| 43 | (hrel : ∀ t ∈ J, ∀ x, c x t = d (phi x) t) : |
| 44 | ContDiff ℝ ∞ phi ∧ M63SmoothShrinkingCurveOn F c J := by |
| 45 | let f : ℝ → W := fun y => e (d y s) |
| 46 | have hf : ContDiff ℝ ∞ f := (he.comp hds).contDiff |
| 47 | have hdata := (c2ShrinkingCurve_embedded_closed_data hd.1 he).2.1 |
| 48 | have hleft := (smooth_retraction_differentials he hU heU hρ hρe).2.2 |
| 49 | have hne (y : ℝ) : deriv f y ≠ 0 := by |
| 50 | have hder : HasDerivAt f |
| 51 | (mfderiv (𝓡 n) 𝓘(ℝ, W) e (d y s) |
| 52 | (curveVelocity (n := n) (fun z => d z s) y)) y := hdata s hs y |
| 53 | rw [hder.deriv] |
| 54 | intro hz |
| 55 | have h := hleft (d y s) (curveVelocity (n := n) (fun z => d z s) y) |
| 56 | erw [hz, map_zero] at h |
| 57 | exact hd.1.immersed s hs y h.symm |
| 58 | have hfc : ContDiff ℝ ∞ (f ∘ phi) := by |
| 59 | have heq : f ∘ phi = fun x => e (c x s) := |
| 60 | funext fun x => congrArg e (hrel s hs x).symm |
| 61 | rw [heq] |
| 62 | exact (he.comp hcs).contDiff |
| 63 | have hphis : ContDiff ℝ ∞ phi := contDiff_iff_contDiffAt.mpr fun x => |
| 64 | contDiffAt_of_comp_immersed_curve (by simp) (hphi.continuousAt) |
| 65 | hf.contDiffAt (hne (phi x)) hfc.contDiffAt |
| 66 | have hmap : ContMDiff 𝓘(ℝ, ℝ × ℝ) 𝓘(ℝ, ℝ × ℝ) ∞ |
| 67 | (fun z : ℝ × ℝ => (phi z.1, z.2)) := |
| 68 | ((hphis.comp contDiff_fst).prodMk contDiff_snd).contMDiff |
| 69 | refine ⟨hphis, hc, ?_⟩ |
| 70 | apply (hd.2.comp hmap.contMDiffOn (fun z hz => ⟨mem_univ _, hz.2⟩)).congr |
| 71 | intro z hz |
| 72 | exact hrel z.2 (interior_subset hz.2) z.1 |
| 73 | |
| 74 | end PoincareMT.M63 |