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.Generalized.ReducedGeometry.Exponential.Stability.StableInjectivity |
| 2 | import Mathlib.Tactic.Linarith |
| 3 | |
| 4 | /-! |
| 5 | # The joint stable graph and its endpoint map |
| 6 | |
| 7 | Morgan-Tian Proposition 6.28, p. 117. The clock separates different times; |
| 8 | fixed-time stable injectivity separates initial vectors. Continuity and the |
| 9 | clock equation then restrict to the frozen relative-interior joint domain. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | universe u |
| 15 | |
| 16 | namespace PoincareMT.M14 |
| 17 | |
| 18 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 19 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 20 | {T : ℝ} {x : G.Point} |
| 21 | |
| 22 | /-- Stable graph points lie in the selected exponential's survival domain, |
| 23 | Morgan-Tian Definitions 6.17 and 6.25, pp. 113, 116. -/ |
| 24 | theorem stableGraph_subset_domain (E : M14ExponentialFamily G T x) : |
| 25 | M14StableGraph G E ⊆ E.domain := by |
| 26 | rintro z ⟨τ, H, _, hZ, hs⟩ |
| 27 | change (z.1, z.2) ∈ E.domain |
| 28 | rw [hs] |
| 29 | exact H.survivor z.1 hZ |
| 30 | |
| 31 | /-- The joint relative-interior domain retains survival of the same branch, |
| 32 | Morgan-Tian Proposition 6.28, p. 117. -/ |
| 33 | theorem jointDomain_subset_domain (E : M14ExponentialFamily G T x) : |
| 34 | M14JointDomain G E ⊆ E.domain := |
| 35 | fun _ hz => stableGraph_subset_domain E hz.1 |
| 36 | |
| 37 | /-- The actual endpoint map is injective on the entire stable graph, |
| 38 | Morgan-Tian Proposition 6.28, p. 117. -/ |
| 39 | theorem stableGraph_endpoint_injective (E : M14ExponentialFamily G T x) : |
| 40 | Set.InjOn (fun z : G.Horizontal x × ℝ => E.gamma z.1 z.2) |
| 41 | (M14StableGraph G E) := by |
| 42 | intro z hz w hw heq |
| 43 | have hclock := congrArg G.spacetime.timeFunction heq |
| 44 | rw [E.clock z.1 z.2 (stableGraph_subset_domain E hz), |
| 45 | E.clock w.1 w.2 (stableGraph_subset_domain E hw)] at hclock |
| 46 | obtain ⟨τ, H, hτ, hZ, hs⟩ := hz |
| 47 | obtain ⟨σ, K, hσ, hW, ht⟩ := hw |
| 48 | rw [hs, ht, Real.sq_sqrt hτ.le, Real.sq_sqrt hσ.le] at hclock |
| 49 | have htime : τ = σ := by linarith only [hclock] |
| 50 | subst σ |
| 51 | have hWH : w.1 ∈ H.carrier := |
| 52 | (H.carrier_exact w.1).mpr ((K.carrier_exact w.1).mp hW) |
| 53 | have hv : z.1 = w.1 := stable_endpoint_injective H hZ hWH (by |
| 54 | calc |
| 55 | H.endpoint_map z.1 = E.gamma z.1 (Real.sqrt τ) := H.endpoint_map_eq z.1 hZ |
| 56 | _ = E.gamma z.1 z.2 := congrArg (E.gamma z.1) hs.symm |
| 57 | _ = E.gamma w.1 w.2 := heq |
| 58 | _ = E.gamma w.1 (Real.sqrt τ) := congrArg (E.gamma w.1) ht |
| 59 | _ = H.endpoint_map w.1 := (H.endpoint_map_eq w.1 hWH).symm) |
| 60 | exact Prod.ext hv (hs.trans ht.symm) |
| 61 | |
| 62 | /-- The endpoint map on the joint domain is injective, |
| 63 | Morgan-Tian Proposition 6.28, p. 117. -/ |
| 64 | theorem jointMap_injective (E : M14ExponentialFamily G T x) : |
| 65 | Function.Injective (fun z : M14JointDomain G E => E.gamma z.1.1 z.1.2) := by |
| 66 | intro z w heq |
| 67 | exact Subtype.ext (stableGraph_endpoint_injective E z.2.1 w.2.1 heq) |
| 68 | |
| 69 | /-- Restrict the selected family's joint continuity to its stable joint domain, |
| 70 | Morgan-Tian Proposition 6.28, p. 117. -/ |
| 71 | theorem jointMap_continuous (E : M14ExponentialFamily G T x) : |
| 72 | Continuous (fun z : M14JointDomain G E => E.gamma z.1.1 z.1.2) := |
| 73 | (E.joint_continuous.mono (jointDomain_subset_domain E)).domRestrict |
| 74 | |
| 75 | /-- The joint map has the actual backward clock of its selected branches, |
| 76 | Morgan-Tian Definition 6.17 and Proposition 6.28, pp. 113, 117. -/ |
| 77 | theorem jointMap_clock (E : M14ExponentialFamily G T x) (z : M14JointDomain G E) : |
| 78 | G.spacetime.timeFunction (E.gamma z.1.1 z.1.2) = T - z.1.2 ^ 2 := |
| 79 | E.clock z.1.1 z.1.2 (jointDomain_subset_domain E z.2) |
| 80 | |
| 81 | end PoincareMT.M14 |