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.Box.Metric |
| 2 | import PoincareLib.Geometry.Spacetime.Realization.Horizontal.Inclusion |
| 3 | |
| 4 | /-! |
| 5 | # Smoothness of the descended horizontal metric |
| 6 | -/ |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open Set Bundle ContinuousLinearMap |
| 12 | open scoped Manifold ContDiff Bundle Topology |
| 13 | |
| 14 | open PoincareMT |
| 15 | |
| 16 | namespace Poincare.Spacetime.Realization |
| 17 | |
| 18 | variable {n : ℕ} {X : Type*} [TopologicalSpace X] |
| 19 | |
| 20 | theorem horizontal_trivializationAt (A : AdaptedMetricAtlas n X) (p : X) : |
| 21 | letI := adaptedHorizontalTopology A |
| 22 | letI := adaptedHorizontalFiberBundle A |
| 23 | trivializationAt (EuclideanSpace ℝ (Fin n)) (fun p ↦ adaptedHorizontal A p) p = |
| 24 | horizontalTrivialization A (box_targets_cover A p).choose := rfl |
| 25 | |
| 26 | theorem horizontalTrivialization_symmL (A : AdaptedMetricAtlas n X) (b : A.box_index) |
| 27 | (p : X) (hp : p ∈ boxTarget A b) (v : EuclideanSpace ℝ (Fin n)) : |
| 28 | letI := adaptedHorizontalTopology A |
| 29 | letI := adaptedHorizontalFiberBundle A |
| 30 | letI := adaptedHorizontalVectorBundle A |
| 31 | letI := horizontalTrivialization_mem A b |
| 32 | (horizontalTrivialization A b).symmL ℝ p v = boxHorizontalEquiv A b p hp v := by |
| 33 | let := adaptedHorizontalTopology A |
| 34 | let := adaptedHorizontalFiberBundle A |
| 35 | let := adaptedHorizontalVectorBundle A |
| 36 | let := horizontalTrivialization_mem A b |
| 37 | rw [Trivialization.symmL_apply _ hp] |
| 38 | exact linearPretrivialization_symm (boxTarget A b) |
| 39 | (fun p hp ↦ (boxHorizontalEquiv A b p hp).symm) p hp v |
| 40 | |
| 41 | theorem adaptedHorizontalMetric_smooth (A : AdaptedMetricAtlas n X) : |
| 42 | letI := adaptedChartedSpace A |
| 43 | letI := adaptedHorizontalTopology A |
| 44 | letI := adaptedHorizontalFiberBundle A |
| 45 | letI := adaptedHorizontalVectorBundle A |
| 46 | letI := adaptedHorizontalSmoothBundle A |
| 47 | ContMDiff (spacetimeModel n) |
| 48 | ((spacetimeModel n).prod |
| 49 | 𝓘(ℝ, EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ)) ∞ |
| 50 | (fun p ↦ TotalSpace.mk' (EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 51 | EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 52 | (E := fun p ↦ adaptedHorizontal A p →L[ℝ] adaptedHorizontal A p →L[ℝ] ℝ) |
| 53 | p (adaptedHorizontalMetric A p)) := by |
| 54 | let := adaptedChartedSpace A |
| 55 | let := adaptedHorizontalTopology A |
| 56 | let := adaptedHorizontalFiberBundle A |
| 57 | let := adaptedHorizontalVectorBundle A |
| 58 | let := adaptedHorizontalSmoothBundle A |
| 59 | intro p₀ |
| 60 | let b := (box_targets_cover A p₀).choose |
| 61 | have hb : p₀ ∈ boxTarget A b := (box_targets_cover A p₀).choose_spec |
| 62 | let := intervalChartedSpace (A.box b).interval |
| 63 | let := horizontalTrivialization_mem A b |
| 64 | have hlocal := (box_metric_smooth (A.box b)).contMDiffAt.comp p₀ |
| 65 | ((box_inverse_smooth A b).contMDiffAt ((boxTarget A b).isOpen.mem_nhds hb)) |
| 66 | rw [contMDiffAt_section] |
| 67 | apply hlocal.congr_of_eventuallyEq |
| 68 | filter_upwards [(boxTarget A b).isOpen.mem_nhds hb] with p hp |
| 69 | apply ContinuousLinearMap.ext |
| 70 | intro v |
| 71 | apply ContinuousLinearMap.ext |
| 72 | intro w |
| 73 | rw [hom_trivializationAt_apply] |
| 74 | simp only [inCoordinates, comp_apply] |
| 75 | rw [Trivialization.continuousLinearMapAt_apply_of_mem ℝ _ |
| 76 | (show p ∈ (trivializationAt |
| 77 | (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 78 | (fun p ↦ adaptedHorizontal A p →L[ℝ] ℝ) p₀).baseSet from |
| 79 | ⟨by rw [horizontal_trivializationAt]; exact hp, mem_univ p⟩)] |
| 80 | rw [hom_trivializationAt_apply] |
| 81 | simp only [inCoordinates, comp_apply] |
| 82 | simp only [horizontal_trivializationAt] |
| 83 | change (trivializationAt ℝ (fun _ : X ↦ ℝ) p₀).continuousLinearMapAt ℝ p |
| 84 | (adaptedHorizontalMetric A p |
| 85 | ((horizontalTrivialization A b).symmL ℝ p v) |
| 86 | ((horizontalTrivialization A b).symmL ℝ p w)) = _ |
| 87 | rw [horizontalTrivialization_symmL A b p hp, horizontalTrivialization_symmL A b p hp, |
| 88 | adaptedHorizontalMetric_box A b p hp, horizontalBoxMetric_apply] |
| 89 | simp |
| 90 | |
| 91 | end Poincare.Spacetime.Realization |