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.Surgery.StandardCap.Geometry |
| 2 | |
| 3 | /-! |
| 4 | # Standard necks as intrinsic neck certificates |
| 5 | |
| 6 | Morgan--Tian Definition 2.18, p. 31, Definition 9.72 and Remark 9.73, |
| 7 | pp. 230-231, and Theorem 12.32, pp. 326-327. These conversions preserve |
| 8 | the actual maps, carrier, scalar normalization and connection. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle Topology |
| 14 | |
| 15 | namespace PoincareMT |
| 16 | |
| 17 | /-- Restrict the two standard patch maps to their actual open domains. |
| 18 | Definition 2.18, p. 31. -/ |
| 19 | def StandardCylinderPatch.neckHomeomorph {epsilon : ℝ} {x : StandardCapSpace} |
| 20 | (P : StandardCylinderPatch epsilon⁻¹ x) : NeckDomain epsilon ≃ₜ P.carrier where |
| 21 | toFun z := ⟨P.coordinate (z.1, z.2.1), by |
| 22 | rw [← P.coordinate_image] |
| 23 | exact ⟨(z.1, z.2.1), ⟨Set.mem_univ _, z.2.2⟩, rfl⟩⟩ |
| 24 | invFun y := ((P.inverse y.1).1, ⟨(P.inverse y.1).2, P.inverse_domain y.1 y.2⟩) |
| 25 | left_inv z := by |
| 26 | have h := P.coordinate_left_inverse |
| 27 | (show (z.1, z.2.1) ∈ Set.univ ×ˢ Set.Ioo (-epsilon⁻¹) epsilon⁻¹ from |
| 28 | ⟨Set.mem_univ z.1, z.2.2⟩) |
| 29 | apply Prod.ext |
| 30 | · change (P.inverse (P.coordinate (z.1, z.2.1))).1 = z.1 |
| 31 | exact congrArg (fun q : RoundCylinderSpace => q.1) h |
| 32 | · apply Subtype.ext |
| 33 | change (P.inverse (P.coordinate (z.1, z.2.1))).2 = z.2.1 |
| 34 | exact congrArg (fun q : RoundCylinderSpace => q.2) h |
| 35 | right_inv y := Subtype.ext (P.coordinate_right_inverse y.2) |
| 36 | continuous_toFun := by |
| 37 | apply Continuous.subtype_mk |
| 38 | exact P.coordinate_smooth.continuousOn.comp_continuous |
| 39 | (continuous_fst.prodMk (continuous_subtype_val.comp continuous_snd)) |
| 40 | (fun z => ⟨Set.mem_univ z.1, z.2.2⟩) |
| 41 | continuous_invFun := by |
| 42 | have h := P.inverse_smooth.continuousOn.comp_continuous continuous_subtype_val |
| 43 | (fun y : P.carrier => y.2) |
| 44 | exact h.fst.prodMk (h.snd.subtype_mk _) |
| 45 | |
| 46 | /-- A standard static neck is the common intrinsic neck, with the exact |
| 47 | old coordinate and connection. Definition 2.18, p. 31. -/ |
| 48 | noncomputable def StandardStaticNeck.toEpsilonNeck |
| 49 | {atlas : StandardCylinderAtlas} {g : RiemannianMetric 3 StandardCapSpace} |
| 50 | {D : LeviCivitaData g} {epsilon : ℝ} (N : StandardStaticNeck atlas g D epsilon) : |
| 51 | EpsilonNeck g where |
| 52 | epsilon := epsilon |
| 53 | epsilon_pos := N.epsilon_pos |
| 54 | epsilon_lt_half := N.epsilon_lt_half |
| 55 | scale := D.scalarCurvature N.center ^ (-1 / 2 : ℝ) |
| 56 | scale_pos := Real.rpow_pos_of_pos N.scalar_pos _ |
| 57 | center := N.center |
| 58 | connection := D |
| 59 | scalar_center_pos := N.scalar_pos |
| 60 | scale_eq_scalar := rfl |
| 61 | carrier := N.patch.carrier |
| 62 | carrier_open := N.patch.carrier_open |
| 63 | coordinate := N.patch.neckHomeomorph |
| 64 | coordinate_map := N.patch.coordinate |
| 65 | coordinate_map_eq := fun _ => rfl |
| 66 | coordinate_map_smooth := N.patch.coordinate_smooth |
| 67 | coordinate_inverse := N.patch.inverse |
| 68 | coordinate_inverse_mem := fun y hy => ⟨Set.mem_univ _, N.patch.inverse_domain y hy⟩ |
| 69 | coordinate_inverse_left := fun z => |
| 70 | N.patch.coordinate_left_inverse ⟨Set.mem_univ z.1, z.2.2⟩ |
| 71 | coordinate_inverse_right := fun y hy => Subtype.ext (N.patch.coordinate_right_inverse hy) |
| 72 | coordinate_inverse_smooth := N.patch.inverse_smooth |
| 73 | central_sphere := N.patch.centralSphere |
| 74 | central_sphere_eq := rfl |
| 75 | center_on_central_sphere := by |
| 76 | obtain ⟨z, hz⟩ := N.patch.center_sphere |
| 77 | exact ⟨(z, 0), ⟨Set.mem_univ _, rfl⟩, hz⟩ |
| 78 | central_sphere_subset := by |
| 79 | rintro y ⟨⟨z, s⟩, ⟨_, hs⟩, rfl⟩ |
| 80 | have hs0 : s = 0 := hs |
| 81 | rw [hs0, ← N.patch.coordinate_image] |
| 82 | exact ⟨(z, 0), ⟨Set.mem_univ _, by |
| 83 | constructor <;> linarith [N.patch.length_pos]⟩, rfl⟩ |
| 84 | metric_comparison := ⟨by |
| 85 | have hscale : (D.scalarCurvature N.center ^ (-1 / 2 : ℝ))⁻¹ ^ 2 = |
| 86 | D.scalarCurvature N.center := by |
| 87 | rw [inv_pow, ← Real.rpow_mul_natCast N.scalar_pos.le (-1 / 2) 2] |
| 88 | norm_num [Real.rpow_neg_one] |
| 89 | simpa only [StandardSpatialCylinderClose, hscale] using N.close⟩ |
| 90 | |
| 91 | /-- The zero-time spatial slice of an evolving neck uses its original |
| 92 | normalization, even on a singleton time interval. Remark 2.17, p. 30. -/ |
| 93 | def StandardEvolvingNeck.staticAtZero |
| 94 | {atlas : StandardCylinderAtlas} {g₀ : StandardInitialMetric} |
| 95 | {F : MaximalStandardCapFlow g₀} {t epsilon : ℝ} {x : StandardCapSpace} |
| 96 | {I : Set ℝ} (N : StandardEvolvingNeck atlas F t epsilon x I) (hzero : 0 ∈ I) : |
| 97 | StandardStaticNeck atlas (F.metric t) (F.connection t) epsilon where |
| 98 | epsilon_pos := N.epsilon_pos |
| 99 | epsilon_lt_half := N.epsilon_lt_half |
| 100 | center := x |
| 101 | scalar_pos := N.scalar_pos |
| 102 | patch := N.patch |
| 103 | close := by |
| 104 | obtain ⟨hsmooth, bound, hbound, hclose⟩ := N.close |
| 105 | refine ⟨?_, bound, hbound, ?_⟩ |
| 106 | · simpa only [zero_div, add_zero] using hsmooth 0 hzero |
| 107 | · simpa only [zero_div, add_zero] using hclose 0 hzero |
| 108 | |
| 109 | end PoincareMT |