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.Induction.EpochExtension.Spacetime.GeneralizedWorldlines |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.EpochExtension.Spacetime.GeneralizedCylinderSpatial |
| 3 | import PoincareLib.Geometry.Spacetime.Realization.Worldline.Restriction |
| 4 | |
| 5 | /-! |
| 6 | # Local product factorization of the actual raw cylinder |
| 7 | |
| 8 | Worldline uniqueness identifies the cylinder with one original box after |
| 9 | a fixed-time spatial coordinate change. The coordinate change is smooth |
| 10 | and has injective differential at the marked point. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Function Filter |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.EpochExtension.Spacetime |
| 22 | |
| 23 | open Poincare.Spacetime.Realization |
| 24 | |
| 25 | variable {F : GeneralizedRicciFlowData.{u}} |
| 26 | (R : GeneralizedFlowCarrierConclusionWithInterval (flowBoxAtlas F)) |
| 27 | {C : GeneralizedSliceCarrier.{u}} {a q : ℝ} {J : SpacetimeInterval} |
| 28 | {U : TopologicalSpace.Opens C.carrier} |
| 29 | (e : GeneralizedFlowCylinder F C a q J.domain U) |
| 30 | |
| 31 | /-- Local data for one point of the actual cylinder, not a new geometric premise. -/ |
| 32 | structure RawCylinderLocalFactor |
| 33 | (p : (R.timeIntervals.interval (cylinderPhysicalInterval a q e.scale_pos J)).Point × U) where |
| 34 | interval : SpacetimeInterval |
| 35 | subset : interval.domain ⊆ (cylinderPhysicalInterval a q e.scale_pos J).domain |
| 36 | center_mem : p.1.val ∈ interval.domain |
| 37 | relatively_open : |
| 38 | IsOpen {v : (cylinderPhysicalInterval a q e.scale_pos J).domain | v.val ∈ interval.domain} |
| 39 | box : F.box_index |
| 40 | box_subset : interval.domain ⊆ (boxInterval F box).domain |
| 41 | spatial : U → (F.box box).carrier.carrier |
| 42 | spatial_smooth : ContMDiffAt (𝓡 3) (𝓡 3) ∞ spatial p.2 |
| 43 | spatial_injective : Injective (mfderiv (𝓡 3) (𝓡 3) spatial p.2) |
| 44 | local_eq : |
| 45 | (fun z : (R.timeIntervals.interval interval).Point × U => |
| 46 | rawCylinderMap R e |
| 47 | (spacetimeIntervalInclusion (R.timeIntervals.interval interval) |
| 48 | (R.timeIntervals.interval (cylinderPhysicalInterval a q e.scale_pos J)) subset z.1, |
| 49 | z.2)) =ᶠ[𝓝 (⟨p.1.val, center_mem⟩, p.2)] |
| 50 | (fun z => originalBoxMap F R box |
| 51 | (spacetimeIntervalInclusion (R.timeIntervals.interval interval) |
| 52 | (R.timeIntervals.interval (boxInterval F box)) box_subset z.1, spatial z.2)) |
| 53 | |
| 54 | theorem rawCylinderLocalFactor_exists |
| 55 | (hI : (cylinderPhysicalInterval a q e.scale_pos J).domain ⊆ F.interval) |
| 56 | (p : (R.timeIntervals.interval (cylinderPhysicalInterval a q e.scale_pos J)).Point × U) : |
| 57 | Nonempty (RawCylinderLocalFactor R e p) := by |
| 58 | let K := cylinderPhysicalInterval a q e.scale_pos J |
| 59 | let s := cylinderClockHomeomorph a q e.scale_pos J p.1 |
| 60 | let T := a + s.val / q |
| 61 | have hT : T = p.1.val := parabolicTimeInv_parabolicTime q e.scale_pos a p.1.val |
| 62 | obtain ⟨b, y, δ, hδ, hv⟩ := e.vertical_compatibility s.val s.property p.2.val p.2.property |
| 63 | obtain ⟨hb0, hbase⟩ := hv s.val s.property (by simpa using hδ) |
| 64 | have htbox : p.1.val ∈ (F.box b).interval := hT ▸ hb0 |
| 65 | obtain ⟨O, hO, hOb⟩ := (F.box b).relatively_open |
| 66 | have hopen : IsOpen {t : K.domain | t.val ∈ (F.box b).interval} := by |
| 67 | have he : {t : K.domain | t.val ∈ (F.box b).interval} = |
| 68 | (Subtype.val : K.domain → ℝ) ⁻¹' O := by |
| 69 | ext t |
| 70 | simp only [hOb, mem_ofPred_eq, mem_inter_iff, mem_preimage, hI t.property, true_and] |
| 71 | rw [he] |
| 72 | exact hO.preimage continuous_subtype_val |
| 73 | obtain ⟨L, hK, htL, ho, hLb⟩ := interval_exists_open_small_neighborhood K p.1 |
| 74 | (hopen.mem_nhds htbox) |
| 75 | have hb : L.domain ⊆ (boxInterval F b).domain := fun t ht => hLb ⟨t, ht⟩ |
| 76 | let f := rawSpatialMap e s |
| 77 | let k : U → (F.box b).carrier.carrier := (F.box b).inverse T hb0 ∘ f |
| 78 | have hfx : f p.2 ∈ range ((F.box b).forward T hb0) := ⟨y, hbase.symm⟩ |
| 79 | have hrange := ((F.box b).forward_openEmbedding T hb0).isOpen_range |
| 80 | have hnear : ∀ᶠ z in 𝓝 p.2, f z ∈ range ((F.box b).forward T hb0) := |
| 81 | (rawSpatialMap_smooth e s p.2).continuousAt (hrange.mem_nhds hfx) |
| 82 | have hk : ContMDiffAt (𝓡 3) (𝓡 3) ∞ k p.2 := |
| 83 | ((F.box b).inverse_smooth T hb0 |>.contMDiffAt (hrange.mem_nhds hfx)).comp p.2 |
| 84 | (rawSpatialMap_smooth e s p.2) |
| 85 | have hkleft : (F.box b).forward T hb0 ∘ k =ᶠ[𝓝 p.2] f := by |
| 86 | filter_upwards [hnear] with z hz |
| 87 | exact (F.box b).right_inverse T hb0 hz |
| 88 | have hkdiff := hkleft.mfderiv_eq (I := 𝓡 3) (I' := 𝓡 3) |
| 89 | rw [mfderiv_comp p.2 ((F.box b).forward_smooth T hb0 (k p.2) |>.mdifferentiableAt |
| 90 | (by simp)) (hk.mdifferentiableAt (by simp))] at hkdiff |
| 91 | have hinj : Injective (mfderiv (𝓡 3) (𝓡 3) k p.2) := by |
| 92 | intro v w hvw |
| 93 | apply rawSpatialMap_differential_injective e s p.2 |
| 94 | have hv' := congrArg (fun d : TangentSpace (𝓡 3) p.2 →L[ℝ] |
| 95 | TangentSpace (𝓡 3) (f p.2) => d v) hkdiff |
| 96 | have hw' := congrArg (fun d : TangentSpace (𝓡 3) p.2 →L[ℝ] |
| 97 | TangentSpace (𝓡 3) (f p.2) => d w) hkdiff |
| 98 | exact hv'.symm.trans ((congrArg (mfderiv (𝓡 3) (𝓡 3) |
| 99 | ((F.box b).forward T hb0) (k p.2)) hvw).trans hw') |
| 100 | refine ⟨⟨L, hK, htL, ho, b, hb, k, hk, hinj, ?_⟩⟩ |
| 101 | filter_upwards [continuous_snd.continuousAt hnear] with z hz |
| 102 | let γ := rawCylinderWorldline R e hI z.2 |
| 103 | let η := embeddingWorldline (originalBoxCylinder F R b).toCompatibleSpacetimeEmbedding (k z.2) |
| 104 | have hTK : T ∈ K.domain := ⟨s.val, s.property, rfl⟩ |
| 105 | have hstart : γ.curve ⟨T, hTK⟩ = η.curve ⟨T, hb0⟩ := |
| 106 | (rawCylinderMap_at_parameter R e s z.2).trans |
| 107 | (congrArg (fun w => (⟨T, w⟩ : F.point)) ((F.box b).right_inverse T hb0 hz).symm) |
| 108 | exact R.compatible.worldline_unique K (boxInterval F b) γ η T hTK hb0 hstart |
| 109 | z.1.val (hK z.1.property) (hb z.1.property) |
| 110 | |
| 111 | end PoincareMT.EpochExtension.Spacetime |