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.Spacetime.Realization.Worldline.Restriction |
| 2 | import PoincareLib.Geometry.Spacetime.Realization.Geometry |
| 3 | import PoincareLib.Geometry.Spacetime.Realization.Box.InverseDifferential |
| 4 | import PoincareLib.Geometry.Spacetime.Realization.Interval.Constant |
| 5 | |
| 6 | /-! |
| 7 | # Worldlines have constant spatial coordinates inside an adapted box |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | set_option backward.isDefEq.respectTransparency false |
| 12 | |
| 13 | open Set Function |
| 14 | open scoped Manifold ContDiff Topology |
| 15 | |
| 16 | open PoincareMT |
| 17 | |
| 18 | namespace Poincare.Spacetime.Realization |
| 19 | |
| 20 | variable {n : ℕ} {X : Type*} [TopologicalSpace X] [T2Space X] [SecondCountableTopology X] |
| 21 | |
| 22 | theorem worldline_box_inverse_smooth (A : AdaptedMetricAtlas n X) (K : SpacetimeInterval) |
| 23 | (γ : SpacetimeWorldline (adaptedSpacetime A) (smoothInterval K)) |
| 24 | (b : A.box_index) (hb : ∀ t, γ.curve t ∈ (boxHomeomorph (A.box b)).target) : |
| 25 | letI := intervalChartedSpace (A.box b).interval |
| 26 | ContMDiff (𝓡∂ 1) (spacetimeModel n) ∞ ((boxHomeomorph (A.box b)).symm ∘ γ.curve) := by |
| 27 | let := intervalChartedSpace K |
| 28 | let := intervalChartedSpace (A.box b).interval |
| 29 | let := adaptedChartedSpace A |
| 30 | intro t |
| 31 | exact ((box_inverse_smooth A b).contMDiffAt |
| 32 | ((boxHomeomorph (A.box b)).open_target.mem_nhds (hb t))).comp t (γ.smooth t) |
| 33 | |
| 34 | theorem worldline_box_inverse_derivative (A : AdaptedMetricAtlas n X) (K : SpacetimeInterval) |
| 35 | (γ : SpacetimeWorldline (adaptedSpacetime A) (smoothInterval K)) |
| 36 | (b : A.box_index) (t : (smoothInterval K).Point) |
| 37 | (ht : γ.curve t ∈ (boxHomeomorph (A.box b)).target) : |
| 38 | letI := intervalChartedSpace (A.box b).interval |
| 39 | mfderiv (𝓡∂ 1) (spacetimeModel n) ((boxHomeomorph (A.box b)).symm ∘ γ.curve) t |
| 40 | ((smoothInterval K).positiveTangent t) = |
| 41 | boxPositiveTangent (A.box b) ((boxHomeomorph (A.box b)).symm (γ.curve t)) := by |
| 42 | let := intervalChartedSpace K |
| 43 | let := intervalChartedSpace (A.box b).interval |
| 44 | let := adaptedChartedSpace A |
| 45 | let q := (boxHomeomorph (A.box b)).symm (γ.curve t) |
| 46 | have hi := (box_inverse_smooth A b).contMDiffAt |
| 47 | ((boxHomeomorph (A.box b)).open_target.mem_nhds ht) |
| 48 | rw [mfderiv_comp_apply t (hi.mdifferentiableAt (by simp)) |
| 49 | ((γ.smooth t).mdifferentiableAt (by simp)), γ.derivative_eq, |
| 50 | ← box_inverse_mfderiv A b (γ.curve t) ht] |
| 51 | have hv := adaptedTimeVector_box A b q |
| 52 | rw [boxHomeomorph_right_inv (A.box b) ht] at hv |
| 53 | change (boxTangentEquiv A b q).symm (adaptedTimeVector A (γ.curve t)) = _ |
| 54 | rw [hv] |
| 55 | exact (boxTangentEquiv A b q).symm_apply_apply (boxPositiveTangent (A.box b) q) |
| 56 | |
| 57 | theorem worldline_box_spatial_constant (A : AdaptedMetricAtlas n X) (K : SpacetimeInterval) |
| 58 | (γ : SpacetimeWorldline (adaptedSpacetime A) (smoothInterval K)) |
| 59 | (b : A.box_index) (hb : ∀ t, γ.curve t ∈ (boxHomeomorph (A.box b)).target) |
| 60 | (s t : (smoothInterval K).Point) : |
| 61 | ((boxHomeomorph (A.box b)).symm (γ.curve s)).2 = |
| 62 | ((boxHomeomorph (A.box b)).symm (γ.curve t)).2 := by |
| 63 | let := intervalChartedSpace K |
| 64 | let := intervalChartedSpace (A.box b).interval |
| 65 | let := adaptedChartedSpace A |
| 66 | let f := (boxHomeomorph (A.box b)).symm ∘ γ.curve |
| 67 | have hf := worldline_box_inverse_smooth A K γ b hb |
| 68 | apply Subtype.ext |
| 69 | apply interval_constant_of_derivative_zero K ((box_space_smooth (A.box b)).comp hf) |
| 70 | intro r |
| 71 | rw [mfderiv_comp_apply r (((box_space_smooth (A.box b)) (f r)).mdifferentiableAt (by simp)) |
| 72 | ((hf r).mdifferentiableAt (by simp)), worldline_box_inverse_derivative A K γ b r (hb r), |
| 73 | box_space_mfderiv] |
| 74 | rfl |
| 75 | |
| 76 | end Poincare.Spacetime.Realization |