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.GeneralizedAtlas |
| 2 | import PoincareLib.Geometry.Spacetime.Realization.OrdinaryProduct.Chart.Homeomorph |
| 3 | |
| 4 | /-! |
| 5 | # Original flow boxes as compatible spacetime cylinders |
| 6 | |
| 7 | The point maps and clocks are the original generalized-flow box maps. Local |
| 8 | spatial charts transfer smoothness and full rank from the selected M11 boxes; |
| 9 | their worldlines transfer the actual time-vector identity. This is the concrete |
| 10 | compatibility required by Morgan--Tian Definition 3.38, p. 61. |
| 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 | |
| 28 | def originalBoxMap (b : F.box_index) |
| 29 | (p : (R.timeIntervals.interval (boxInterval F b)).Point × (F.box b).carrier.carrier) : |
| 30 | R.spacetime.Point := ⟨p.1.val, (F.box b).forward p.1.val p.1.property p.2⟩ |
| 31 | |
| 32 | theorem originalBoxMap_chart (b : F.box_index) (x : (F.box b).carrier.carrier) |
| 33 | (q : (R.timeIntervals.interval (boxInterval F b)).Point × spatialChartDomain x) : |
| 34 | originalBoxMap F R b (q.1, spatialChartInverse x q.2) = |
| 35 | (R.boxCylinder ⟨b, x⟩).toSpacetime q := |
| 36 | (R.boxCylinder_eq ⟨b, x⟩ q).symm |
| 37 | |
| 38 | theorem originalBoxMap_smooth (b : F.box_index) : |
| 39 | ContMDiff (spacetimeModel 3) (spacetimeModel 3) ∞ (originalBoxMap F R b) := by |
| 40 | intro p |
| 41 | let e := spatialChartHomeomorph (n := 3) p.2 |
| 42 | have hp : p.2 ∈ e.target := by |
| 43 | rw [spatialChartHomeomorph_target] |
| 44 | exact mem_chart_source _ p.2 |
| 45 | have hi := (spatialChartHomeomorph_inverse_smooth p.2).contMDiffAt |
| 46 | (e.open_target.mem_nhds hp) |
| 47 | have hlocal := (R.boxCylinder ⟨b, p.2⟩).smooth.contMDiffAt.comp p |
| 48 | (contMDiffAt_fst.prodMk (hi.comp p contMDiffAt_snd)) |
| 49 | apply hlocal.congr_of_eventuallyEq |
| 50 | filter_upwards [(e.open_target.preimage continuous_snd).mem_nhds hp] with q hq |
| 51 | change originalBoxMap F R b q = (R.boxCylinder ⟨b, p.2⟩).toSpacetime (q.1, e.symm q.2) |
| 52 | rw [← originalBoxMap_chart F R b p.2 (q.1, e.symm q.2)] |
| 53 | change originalBoxMap F R b q = originalBoxMap F R b (q.1, e (e.symm q.2)) |
| 54 | rw [e.right_inv hq] |
| 55 | |
| 56 | theorem originalBoxMap_derivative_chart (b : F.box_index) |
| 57 | (x : (F.box b).carrier.carrier) |
| 58 | (q : (R.timeIntervals.interval (boxInterval F b)).Point × spatialChartDomain x) : |
| 59 | mfderiv (spacetimeModel 3) (spacetimeModel 3) (originalBoxMap F R b) |
| 60 | (q.1, spatialChartInverse x q.2) ∘L |
| 61 | mfderiv (spacetimeModel 3) (spacetimeModel 3) |
| 62 | (Prod.map id (spatialChartInverse x)) q = |
| 63 | mfderiv (spacetimeModel 3) (spacetimeModel 3) |
| 64 | (R.boxCylinder ⟨b, x⟩).toSpacetime q := by |
| 65 | have hj : ContMDiff (spacetimeModel 3) (spacetimeModel 3) ∞ |
| 66 | (Prod.map id (spatialChartInverse x) : |
| 67 | (R.timeIntervals.interval (boxInterval F b)).Point × spatialChartDomain x → |
| 68 | (R.timeIntervals.interval (boxInterval F b)).Point × (F.box b).carrier.carrier) := |
| 69 | contMDiff_fst.prodMk ((spatialChartInverse_smooth x).comp contMDiff_snd) |
| 70 | have h := mfderiv_comp q |
| 71 | ((originalBoxMap_smooth F R b _).mdifferentiableAt (by simp)) |
| 72 | ((hj q).mdifferentiableAt (by simp)) |
| 73 | have heq : originalBoxMap F R b ∘ Prod.map id (spatialChartInverse x) = |
| 74 | (R.boxCylinder ⟨b, x⟩).toSpacetime := funext (originalBoxMap_chart F R b x) |
| 75 | rw [heq] at h |
| 76 | exact h.symm |
| 77 | |
| 78 | theorem originalBoxMap_differential_injective (b : F.box_index) |
| 79 | (p : (R.timeIntervals.interval (boxInterval F b)).Point × (F.box b).carrier.carrier) : |
| 80 | Injective (mfderiv (spacetimeModel 3) (spacetimeModel 3) (originalBoxMap F R b) p) := by |
| 81 | let x : spatialChartDomain (n := 3) p.2 := |
| 82 | ⟨chartAt (EuclideanSpace ℝ (Fin 3)) p.2 p.2, mem_chart_target _ p.2⟩ |
| 83 | have hx : spatialChartInverse p.2 x = p.2 := |
| 84 | (chartAt (EuclideanSpace ℝ (Fin 3)) p.2).left_inv (mem_chart_source _ p.2) |
| 85 | have hj : Surjective (mfderiv (spacetimeModel 3) (spacetimeModel 3) |
| 86 | (Prod.map id (spatialChartInverse p.2) : |
| 87 | (R.timeIntervals.interval (boxInterval F b)).Point × spatialChartDomain p.2 → |
| 88 | (R.timeIntervals.interval (boxInterval F b)).Point × (F.box b).carrier.carrier) |
| 89 | (p.1, x)) := by |
| 90 | rw [mfderiv_prodMap mdifferentiableAt_id |
| 91 | ((spatialChartInverse_smooth p.2 x).mdifferentiableAt (by simp)), mfderiv_id] |
| 92 | exact Surjective.prodMap (fun v => ⟨v, rfl⟩) |
| 93 | ((spatialChartInverse_localDiffeomorph p.2 x).mfderivToContinuousLinearEquiv |
| 94 | (by simp)).surjective |
| 95 | have hc := (R.boxCylinder ⟨b, p.2⟩).differential_injective (p.1, x) |
| 96 | rw [← originalBoxMap_derivative_chart F R b p.2 (p.1, x)] at hc |
| 97 | change Injective ((mfderiv (spacetimeModel 3) (spacetimeModel 3) |
| 98 | (originalBoxMap F R b) (p.1, spatialChartInverse p.2 x)) ∘ |
| 99 | (mfderiv (spacetimeModel 3) (spacetimeModel 3) |
| 100 | (Prod.map id (spatialChartInverse p.2)) (p.1, x))) at hc |
| 101 | have h := hc.of_comp_right hj |
| 102 | have hp : (p.1, spatialChartInverse p.2 x) = p := Prod.ext rfl hx |
| 103 | exact hp ▸ h |
| 104 | |
| 105 | noncomputable def originalBoxCylinder (b : F.box_index) : |
| 106 | CompatibleSpacetimeCylinder R.spacetime (R.timeIntervals.interval (boxInterval F b)) |
| 107 | (F.box b).carrier.carrier where |
| 108 | interval_subset := by |
| 109 | obtain ⟨U, _, hU⟩ := (F.box b).relatively_open |
| 110 | change (F.box b).interval ⊆ F.interval |
| 111 | rw [hU] |
| 112 | exact inter_subset_left |
| 113 | toSpacetime := originalBoxMap F R b |
| 114 | embedding := (F.box_openEmbedding b).isEmbedding |
| 115 | time_eq := fun _ => rfl |
| 116 | worldline_smooth := by |
| 117 | intro x |
| 118 | exact (originalBoxMap_smooth F R b).comp (contMDiff_id.prodMk contMDiff_const) |
| 119 | worldline_derivative := by |
| 120 | intro t x |
| 121 | let y : spatialChartDomain (n := 3) x := |
| 122 | ⟨chartAt (EuclideanSpace ℝ (Fin 3)) x x, mem_chart_target _ x⟩ |
| 123 | have hy : spatialChartInverse x y = x := |
| 124 | (chartAt (EuclideanSpace ℝ (Fin 3)) x).left_inv (mem_chart_source _ x) |
| 125 | have heq : (fun s => originalBoxMap F R b (s, x)) = |
| 126 | (fun s => (R.boxCylinder ⟨b, x⟩).toSpacetime (s, y)) := by |
| 127 | funext s |
| 128 | rw [← originalBoxMap_chart, hy] |
| 129 | change mfderiv (𝓡∂ 1) (spacetimeModel 3) (fun s => originalBoxMap F R b (s, x)) t |
| 130 | ((R.timeIntervals.interval (boxInterval F b)).positiveTangent t) = _ |
| 131 | rw [heq, congrFun heq t] |
| 132 | exact (R.boxCylinder ⟨b, x⟩).worldline_derivative t y |
| 133 | smooth := originalBoxMap_smooth F R b |
| 134 | differential_injective := originalBoxMap_differential_injective F R b |
| 135 | |
| 136 | end PoincareMT.EpochExtension.Spacetime |