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.Blowup.Construction.SourceNames |
| 2 | import PoincareLib.Geometry.RicciFlow.Blowup.Controlled.Geometry |
| 3 | import PoincareLib.Geometry.RicciFlow.Rescaling.Construction |
| 4 | |
| 5 | /-! |
| 6 | # The actual terminal metric of a normalized cylinder |
| 7 | |
| 8 | Morgan--Tian Definition 3.40, p. 61, and Corollary 11.3, p. 269. |
| 9 | The terminal identity holds on an open set, so it identifies the spatial |
| 10 | differential as well as the point. Consequently the normalized pullback |
| 11 | is the scaled terminal metric. Its ambient balls are exactly the frozen |
| 12 | normalized base balls, for every real radius. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M30 |
| 23 | |
| 24 | private theorem inner_mfderiv_of_slice_identity (F : GeneralizedRicciFlowData.{u}) |
| 25 | {s t : ℝ} (ht : t = s) |
| 26 | (f : (F.slice s).carrier → (F.slice t).carrier) (x : (F.slice s).carrier) |
| 27 | (hf : ∀ᶠ y in 𝓝 x, (⟨t, f y⟩ : F.point) = (⟨s, y⟩ : F.point)) |
| 28 | (v w : TangentSpace (𝓡 3) x) : |
| 29 | (F.metric t).inner (f x) (mfderiv (𝓡 3) (𝓡 3) f x v) |
| 30 | (mfderiv (𝓡 3) (𝓡 3) f x w) = (F.metric s).inner x v w := by |
| 31 | subst t |
| 32 | have heq : f =ᶠ[𝓝 x] id := by |
| 33 | filter_upwards [hf] with y hy |
| 34 | exact eq_of_heq (Sigma.mk.inj_iff.mp hy).2 |
| 35 | rw [heq.mfderiv_eq, mfderiv_id] |
| 36 | change (F.metric s).inner (f x) v w = (F.metric s).inner x v w |
| 37 | exact congrArg (fun y => (F.metric s).inner y v w) heq.eq_of_nhds |
| 38 | |
| 39 | /-- A cylinder equal to the actual terminal slice on an open set has exactly |
| 40 | its scaled terminal inner product (Definition 3.40 and Corollary 11.3, |
| 41 | pp. 61 and 269). The point identity is used on a neighborhood of each point. -/ |
| 42 | theorem Cylinder.pullbackInner_zero_of_identity |
| 43 | {F : GeneralizedRicciFlowData.{u}} {origin scale : ℝ} {I : Set ℝ} |
| 44 | {U : Set (F.slice origin).carrier} (hU : IsOpen U) |
| 45 | (e : GeneralizedFlowCylinder F (F.slice origin) origin scale I U) |
| 46 | (h₀ : (0 : ℝ) ∈ I) |
| 47 | (hzero : ∀ x ∈ U, e.pointMap 0 h₀ x = (⟨origin, x⟩ : F.point)) |
| 48 | (x : (F.slice origin).carrier) (hx : x ∈ U) |
| 49 | (v w : TangentSpace (𝓡 3) x) : |
| 50 | e.pullbackInner 0 h₀ x v w = scale * (F.metric origin).inner x v w := by |
| 51 | unfold GeneralizedFlowCylinder.pullbackInner |
| 52 | congr 1 |
| 53 | apply inner_mfderiv_of_slice_identity F (by simp) (e.forward 0 h₀) x ?_ v w |
| 54 | filter_upwards [hU.mem_nhds hx] with y hy |
| 55 | exact hzero y hy |
| 56 | |
| 57 | /-- Positive parabolic metric scaling gives the exact normalized base balls |
| 58 | of Definition 3.40 and Corollary 11.3, pp. 61 and 269, including empty balls |
| 59 | at nonpositive radii. -/ |
| 60 | theorem scaled_terminal_ball_eq_baseBall (S : GeneralizedBlowupSequence.{u}) |
| 61 | (k : ℕ) (R : ℝ) : |
| 62 | RiemannianMetric.ball |
| 63 | (M13.scaleSmoothMetric ((S.flow k).metric (S.base k).1) |
| 64 | (S.scale k) (S.base_scalar_pos k)) |
| 65 | (S.base k).2 R = S.baseBall k R := by |
| 66 | have h := M13.homothety_ball_image ((S.flow k).metric (S.base k).1) |
| 67 | (M13.scaleSmoothMetric ((S.flow k).metric (S.base k).1) |
| 68 | (S.scale k) (S.base_scalar_pos k)) |
| 69 | (Diffeomorph.refl (𝓡 3) ((S.flow k).slice (S.base k).1).carrier ∞) |
| 70 | (S.scale k) (S.base_scalar_pos k) |
| 71 | (M13.identity_metricHomothety ((S.flow k).metric (S.base k).1) |
| 72 | (S.scale k) (S.base_scalar_pos k)) |
| 73 | (S.base k).2 (R / Real.sqrt (S.scale k)) |
| 74 | have hsqrt : Real.sqrt (S.scale k) ≠ 0 := |
| 75 | (Real.sqrt_pos.mpr (S.base_scalar_pos k)).ne' |
| 76 | simpa only [GeneralizedBlowupSequence.baseBall, Diffeomorph.coe_refl, id_eq, |
| 77 | image_id, mul_div_cancel₀ _ hsqrt] |
| 78 | using h.symm |
| 79 | |
| 80 | end PoincareMT.M30 |