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.CanonicalInduction.Generalized.GeneralizedBridgeGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Induction.EpochExtension.History.Transport.GuardedCylinders |
| 3 | |
| 4 | /-! |
| 5 | # Actual backward cylinders in the selected regular history |
| 6 | |
| 7 | An open left endpoint supplies an earlier worldline point at every |
| 8 | included parameter. The physical clock stays between zero and the |
| 9 | included terminal time, so the full cylinder lies in the selected M33 |
| 10 | history. Rebasing uses the actual terminal history map. |
| 11 | Source: Morgan--Tian Proposition 14.12, p. 350, and Definition 9.78. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M47 |
| 22 | |
| 23 | variable {F : SurgeryFlowData.{u}} {W : M33RegularHistoryWindow F} |
| 24 | (H : M33RegularHistoryData W) |
| 25 | |
| 26 | /-- The actual physical clock of a backward cylinder fits every selected |
| 27 | history containing zero and its terminal time. -/ |
| 28 | theorem regular_history_backward_cylinder_time |
| 29 | {C : GeneralizedSliceCarrier.{u}} {t scale a : ℝ} {U : Set C.carrier} |
| 30 | (ht : t ∈ H.generalized.interval) |
| 31 | (e : SurgeryFlowCylinder F C t scale (Ioc a 0) U) |
| 32 | (s : ℝ) (hs : s ∈ Ioc a 0) : t + s / scale ∈ H.generalized.interval := by |
| 33 | rw [H.interval_eq] |
| 34 | apply W.interval_connected.out W.zero_mem (H.interval_eq ▸ ht) |
| 35 | refine ⟨F.time_domain_nonnegative (e.time_subset (mem_image_of_mem _ hs)), ?_⟩ |
| 36 | exact add_le_of_nonpos_right (div_nonpos_of_nonpos_of_nonneg hs.2 e.scale_pos.le) |
| 37 | |
| 38 | /-- The full strict-left cylinder lifts through M33 with its actual maps |
| 39 | and rescaled metric, without a separate survival premise. -/ |
| 40 | theorem exists_regular_history_backward_cylinder |
| 41 | {C : GeneralizedSliceCarrier.{u}} {t scale a : ℝ} {U : Set C.carrier} |
| 42 | (ht : t ∈ H.generalized.interval) (hU : IsOpen U) |
| 43 | (e : SurgeryFlowCylinder F C t scale (Ioc a 0) U) : |
| 44 | ∃ d : GeneralizedFlowCylinder H.generalized C t scale (Ioc a 0) U, |
| 45 | (∀ s hs x, x ∈ U → H.history.forward (t + s / scale) |
| 46 | (regular_history_backward_cylinder_time H ht e s hs) (d.forward s hs x) = |
| 47 | e.forward s hs x) ∧ |
| 48 | (∀ s hs x, x ∈ U → ∀ v w : TangentSpace (𝓡 3) x, |
| 49 | d.pullbackInner s hs x v w = e.pullbackInner s hs x v w) := |
| 50 | H.cylinders_from_surgery C t scale (Ioc a 0) U hU |
| 51 | (regular_history_backward_cylinder_time H ht e) e |
| 52 | (fun _ hs => e.regular_image_Ioc hs) |
| 53 | |
| 54 | variable {t origin scale : ℝ} (ht : t ∈ H.generalized.interval) |
| 55 | {J : Set ℝ} (U : Set (F.slice t).carrier) |
| 56 | (d : GeneralizedFlowCylinder H.generalized (F.slice t) origin scale J U) |
| 57 | |
| 58 | /-- The original source is replaced by its exact preimage under the |
| 59 | terminal history embedding, retaining all actual vertical worldlines. -/ |
| 60 | noncomputable def regular_history_rebase_cylinder : |
| 61 | GeneralizedFlowCylinder H.generalized (H.generalized.slice t) origin scale J |
| 62 | (H.history.forward t ht ⁻¹' U) := by |
| 63 | have hmaps : MapsTo (H.history.forward t ht) (H.history.forward t ht ⁻¹' U) U := |
| 64 | fun _ hx => hx |
| 65 | have himage (s : ℝ) (hs : s ∈ J) : |
| 66 | (d.forward s hs ∘ H.history.forward t ht) '' (H.history.forward t ht ⁻¹' U) ⊆ |
| 67 | d.forward s hs '' U := by |
| 68 | rintro _ ⟨x, hx, rfl⟩ |
| 69 | exact ⟨H.history.forward t ht x, hx, rfl⟩ |
| 70 | refine { |
| 71 | scale_pos := d.scale_pos |
| 72 | forward := fun s hs => d.forward s hs ∘ H.history.forward t ht |
| 73 | inverse := fun s hs => H.history.inverse t ht ∘ d.inverse s hs |
| 74 | forward_smooth := fun s hs => (d.forward_smooth s hs).comp |
| 75 | (H.history.forward_smooth t ht).contMDiffOn hmaps |
| 76 | inverse_smooth := ?_ |
| 77 | left_inverse := ?_ |
| 78 | right_inverse := ?_ |
| 79 | embedding := ?_ |
| 80 | vertical_compatibility := fun s hs x hx => d.vertical_compatibility s hs _ hx |
| 81 | } |
| 82 | · intro s hs |
| 83 | apply (H.history.inverse_smooth t ht).comp |
| 84 | ((d.inverse_smooth s hs).mono (himage s hs)) |
| 85 | rintro _ ⟨x, hx, rfl⟩ |
| 86 | change d.inverse s hs (d.forward s hs (H.history.forward t ht x)) ∈ |
| 87 | range (H.history.forward t ht) |
| 88 | rw [d.left_inverse s hs hx] |
| 89 | exact mem_range_self x |
| 90 | · intro s hs x hx |
| 91 | dsimp only [Function.comp_apply] |
| 92 | rw [d.left_inverse s hs hx, H.history.left_inverse t ht x] |
| 93 | · rintro s hs _ ⟨x, hx, rfl⟩ |
| 94 | dsimp only [Function.comp_apply] |
| 95 | rw [d.left_inverse s hs hx, H.history.left_inverse t ht x] |
| 96 | · exact d.embedding.comp (Topology.IsEmbedding.id.prodMap |
| 97 | ((H.history.forward_openEmbedding t ht).isEmbedding.restrict hmaps)) |
| 98 | |
| 99 | /-- The rebased pullback metric is the lifted pullback evaluated on the |
| 100 | actual terminal differential, on precisely the preimage source domain. -/ |
| 101 | theorem regular_history_rebase_pullback (hU : IsOpen U) |
| 102 | (s : ℝ) (hs : s ∈ J) (x : (H.generalized.slice t).carrier) |
| 103 | (hx : H.history.forward t ht x ∈ U) (v w : TangentSpace (𝓡 3) x) : |
| 104 | (regular_history_rebase_cylinder H ht U d).pullbackInner s hs x v w = |
| 105 | d.pullbackInner s hs (H.history.forward t ht x) |
| 106 | (mfderiv (𝓡 3) (𝓡 3) (H.history.forward t ht) x v) |
| 107 | (mfderiv (𝓡 3) (𝓡 3) (H.history.forward t ht) x w) := by |
| 108 | have hd := ((d.forward_smooth s hs).mdifferentiableOn (by simp) _ hx).mdifferentiableAt |
| 109 | (hU.mem_nhds hx) |
| 110 | have hf := (H.history.forward_smooth t ht).mdifferentiable (by simp) x |
| 111 | change scale * (H.generalized.metric (origin + s / scale)).inner _ |
| 112 | (mfderiv (𝓡 3) (𝓡 3) (d.forward s hs ∘ H.history.forward t ht) x v) |
| 113 | (mfderiv (𝓡 3) (𝓡 3) (d.forward s hs ∘ H.history.forward t ht) x w) = _ |
| 114 | rw [mfderiv_comp x hd hf] |
| 115 | rfl |
| 116 | |
| 117 | end PoincareMT.M47 |