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 Mathlib.Analysis.Calculus.ContDiff.Basic |
| 2 | import Mathlib.Analysis.InnerProductSpace.PiL2 |
| 3 | import Mathlib.Order.Interval.Set.OrdConnected |
| 4 | import Mathlib.Topology.OpenPartialHomeomorph.Basic |
| 5 | |
| 6 | /-! Ported from Mapher06/Poincare-MorganTian, `PoincareMT/Definitions/M11AdaptedAtlas.lean`, |
| 7 | revision `b2c3c64781fee22edfd683a224d4f8d280e2e9ce`. Declaration bodies are unchanged; |
| 8 | only imports and module placement differ. See |
| 9 | `references/ricci-flow/mapher/spacetime-port.json`. -/ |
| 10 | |
| 11 | /-! |
| 12 | # Raw adapted metric atlases |
| 13 | |
| 14 | These are the local inputs for the spacetime realization argument underlying |
| 15 | Morgan-Tian Definitions 3.34-3.35, printed pp. 59-60. The time intervals may |
| 16 | include endpoints. All metric regularity and overlap identities concern the |
| 17 | specified domains. No smooth structure, time vector, horizontal bundle, or |
| 18 | Ricci equation on the spacetime carrier is assumed here. |
| 19 | -/ |
| 20 | |
| 21 | set_option autoImplicit false |
| 22 | |
| 23 | open scoped ContDiff Topology |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT |
| 28 | |
| 29 | /-- A nondegenerate real time interval, with any choice of included endpoints. -/ |
| 30 | structure SpacetimeInterval where |
| 31 | domain : Set ℝ |
| 32 | ordConnected : domain.OrdConnected |
| 33 | nontrivial : domain.Nontrivial |
| 34 | |
| 35 | /-- A topological product box with jointly smooth positive metric coefficients. -/ |
| 36 | structure AdaptedMetricBox (n : ℕ) (X : Type u) [TopologicalSpace X] |
| 37 | (time : X → ℝ) (I : SpacetimeInterval) where |
| 38 | interval : SpacetimeInterval |
| 39 | spatial : TopologicalSpace.Opens (EuclideanSpace ℝ (Fin n)) |
| 40 | spatial_nonempty : (spatial : Set (EuclideanSpace ℝ (Fin n))).Nonempty |
| 41 | interval_relatively_open : |
| 42 | ∃ U : Set ℝ, IsOpen U ∧ interval.domain = I.domain ∩ U |
| 43 | toSpacetime : interval.domain × spatial → X |
| 44 | openEmbedding : Topology.IsOpenEmbedding toSpacetime |
| 45 | time_toSpacetime : ∀ p, time (toSpacetime p) = p.1.1 |
| 46 | metric : ℝ × EuclideanSpace ℝ (Fin n) → |
| 47 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ |
| 48 | metric_smooth : ContDiffOn ℝ ∞ metric |
| 49 | (interval.domain ×ˢ (spatial : Set (EuclideanSpace ℝ (Fin n)))) |
| 50 | metric_symm : ∀ t ∈ interval.domain, ∀ x ∈ spatial, ∀ v w, |
| 51 | metric (t, x) v w = metric (t, x) w v |
| 52 | metric_pos : ∀ t ∈ interval.domain, ∀ x ∈ spatial, ∀ v, v ≠ 0 → |
| 53 | 0 < metric (t, x) v v |
| 54 | |
| 55 | /-- A box time belongs to the specified global time interval. -/ |
| 56 | theorem AdaptedMetricBox.interval_subset {n : ℕ} {X : Type u} |
| 57 | [TopologicalSpace X] {time : X → ℝ} {I : SpacetimeInterval} |
| 58 | (b : AdaptedMetricBox n X time I) : b.interval.domain ⊆ I.domain := by |
| 59 | rcases b.interval_relatively_open with ⟨U, _, hU⟩ |
| 60 | rw [hU] |
| 61 | exact Set.inter_subset_left |
| 62 | |
| 63 | /-- An actual adapted coordinate change on a product neighborhood of a marked |
| 64 | overlap point. Its spatial coordinate change is independent of time. -/ |
| 65 | structure AdaptedMetricTransition {n : ℕ} {X : Type u} [TopologicalSpace X] |
| 66 | {time : X → ℝ} {I : SpacetimeInterval} |
| 67 | (b c : AdaptedMetricBox n X time I) |
| 68 | (t : ℝ) (x y : EuclideanSpace ℝ (Fin n)) where |
| 69 | interval : SpacetimeInterval |
| 70 | interval_relatively_open : |
| 71 | ∃ U : Set ℝ, IsOpen U ∧ interval.domain = I.domain ∩ U |
| 72 | interval_subset_left : interval.domain ⊆ b.interval.domain |
| 73 | interval_subset_right : interval.domain ⊆ c.interval.domain |
| 74 | time_mem : t ∈ interval.domain |
| 75 | coordinateChange : OpenPartialHomeomorph |
| 76 | (EuclideanSpace ℝ (Fin n)) (EuclideanSpace ℝ (Fin n)) |
| 77 | source_subset : coordinateChange.source ⊆ b.spatial |
| 78 | target_subset : coordinateChange.target ⊆ c.spatial |
| 79 | source_mem : x ∈ coordinateChange.source |
| 80 | map_marked : coordinateChange x = y |
| 81 | smooth : ContDiffOn ℝ ∞ coordinateChange coordinateChange.source |
| 82 | symm_smooth : ContDiffOn ℝ ∞ coordinateChange.symm coordinateChange.target |
| 83 | box_eq : ∀ s (hs : s ∈ interval.domain), |
| 84 | ∀ z (hz : z ∈ coordinateChange.source), |
| 85 | b.toSpacetime |
| 86 | (⟨s, interval_subset_left hs⟩, ⟨z, source_subset hz⟩) = |
| 87 | c.toSpacetime |
| 88 | (⟨s, interval_subset_right hs⟩, |
| 89 | ⟨coordinateChange z, target_subset (coordinateChange.map_source hz)⟩) |
| 90 | metric_eq : ∀ s ∈ interval.domain, ∀ z ∈ coordinateChange.source, ∀ v w, |
| 91 | b.metric (s, z) v w = |
| 92 | c.metric (s, coordinateChange z) |
| 93 | (fderiv ℝ coordinateChange z v) (fderiv ℝ coordinateChange z w) |
| 94 | |
| 95 | /-- A covering by compatible adapted metric boxes on a fixed topological |
| 96 | carrier. Separation and countability are hypotheses of the realization theorem. -/ |
| 97 | structure AdaptedMetricAtlas (n : ℕ) (X : Type u) [TopologicalSpace X] where |
| 98 | time : X → ℝ |
| 99 | interval : SpacetimeInterval |
| 100 | time_continuous : Continuous time |
| 101 | time_range : Set.range time = interval.domain |
| 102 | box_index : Type u |
| 103 | box : box_index → AdaptedMetricBox n X time interval |
| 104 | box_covers : ∀ p : X, ∃ b, ∃ q, (box b).toSpacetime q = p |
| 105 | transitions : ∀ b c, ∀ t, |
| 106 | ∀ (hb : t ∈ (box b).interval.domain) (hc : t ∈ (box c).interval.domain), |
| 107 | ∀ (x : (box b).spatial) (y : (box c).spatial), |
| 108 | (box b).toSpacetime (⟨t, hb⟩, x) = |
| 109 | (box c).toSpacetime (⟨t, hc⟩, y) → |
| 110 | Nonempty (AdaptedMetricTransition (box b) (box c) t x y) |
| 111 | |
| 112 | end PoincareMT |