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.Domain.JointLocalInverse |
| 2 | |
| 3 | /-! |
| 4 | # The inverse on the full joint image |
| 5 | |
| 6 | Joint injectivity identifies every local inverse with one selected |
| 7 | inverse. The image is open, and the selected inverse is smooth and |
| 8 | continuous there. Empty joint domains require no selected point. |
| 9 | Morgan-Tian Proposition 6.28, p. 117. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Manifold ContDiff Topology Bundle |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.M14 |
| 20 | |
| 21 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 22 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 23 | {T : ℝ} {x : G.Point} |
| 24 | |
| 25 | /-- The selected inverse on the actual joint image, totalized by zero |
| 26 | elsewhere. No point is chosen from an empty joint domain, |
| 27 | Proposition 6.28, p. 117. -/ |
| 28 | noncomputable def jointEndpointInverse (E : M14ExponentialFamily G T x) |
| 29 | (q : G.Point) : G.Horizontal x × ℝ := by |
| 30 | classical |
| 31 | exact if h : ∃ z : G.Horizontal x × ℝ, z ∈ M14JointDomain G E ∧ E.gamma z.1 z.2 = q then |
| 32 | h.choose else 0 |
| 33 | |
| 34 | /-- On the joint image the selected inverse belongs to the exact |
| 35 | joint domain and recovers the endpoint, Proposition 6.28, p. 117. -/ |
| 36 | theorem jointEndpointInverse_spec (E : M14ExponentialFamily G T x) {q : G.Point} |
| 37 | (hq : q ∈ range (fun z : M14JointDomain G E => E.gamma z.1.1 z.1.2)) : |
| 38 | jointEndpointInverse E q ∈ M14JointDomain G E ∧ |
| 39 | E.gamma (jointEndpointInverse E q).1 (jointEndpointInverse E q).2 = q := by |
| 40 | classical |
| 41 | have h : ∃ z : G.Horizontal x × ℝ, z ∈ M14JointDomain G E ∧ E.gamma z.1 z.2 = q := by |
| 42 | obtain ⟨z, rfl⟩ := hq |
| 43 | exact ⟨z.val, z.property, rfl⟩ |
| 44 | simpa only [jointEndpointInverse, dif_pos h] using h.choose_spec |
| 45 | |
| 46 | /-- The selected inverse recovers every joint-domain parameter, |
| 47 | Proposition 6.28, p. 117. -/ |
| 48 | theorem jointEndpointInverse_left (E : M14ExponentialFamily G T x) |
| 49 | (z : M14JointDomain G E) : jointEndpointInverse E (E.gamma z.1.1 z.1.2) = z.val := by |
| 50 | have h := jointEndpointInverse_spec E (mem_range_self z) |
| 51 | exact stableGraph_endpoint_injective E h.1.1 z.property.1 h.2 |
| 52 | |
| 53 | /-- The exact image of the joint-domain endpoint map is open in the |
| 54 | actual spacetime, including its physical boundary, Proposition 6.28, |
| 55 | p. 117. -/ |
| 56 | theorem jointMap_range_isOpen (E : M14ExponentialFamily G T x) : |
| 57 | IsOpen (range (fun z : M14JointDomain G E => E.gamma z.1.1 z.1.2)) := by |
| 58 | rw [isOpen_iff_mem_nhds] |
| 59 | rintro q ⟨z, rfl⟩ |
| 60 | obtain ⟨O, hO, hpO, inv, _, hmem, hright⟩ := exists_jointMap_local_inverse E z.property |
| 61 | exact mem_of_superset (hO.mem_nhds hpO) (fun q hq => ⟨⟨inv q, hmem q hq⟩, hright q hq⟩) |
| 62 | |
| 63 | /-- The inverse on the entire joint image is smooth because actual |
| 64 | local inverses agree by joint injectivity, Proposition 6.28, p. 117. -/ |
| 65 | theorem jointEndpointInverse_smooth (E : M14ExponentialFamily G T x) : |
| 66 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 67 | letI : NormedAddCommGroup (G.Horizontal x) := |
| 68 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 69 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 70 | letI : InnerProductSpace ℝ (G.Horizontal x) := |
| 71 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 72 | ContMDiffOn (spacetimeModel n) (𝓘(ℝ, G.Horizontal x × ℝ)) ∞ (jointEndpointInverse E) |
| 73 | (range (fun z : M14JointDomain G E => E.gamma z.1.1 z.1.2)) := by |
| 74 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 75 | let : NormedAddCommGroup (G.Horizontal x) := |
| 76 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 77 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 78 | let : InnerProductSpace ℝ (G.Horizontal x) := |
| 79 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 80 | change ContMDiffOn (spacetimeModel n) (𝓘(ℝ, G.Horizontal x × ℝ)) ∞ (jointEndpointInverse E) _ |
| 81 | rintro q ⟨z, rfl⟩ |
| 82 | obtain ⟨O, hO, hpO, inv, hsm, hmem, hright⟩ := exists_jointMap_local_inverse E z.property |
| 83 | have hagree : jointEndpointInverse E =ᶠ[𝓝 (E.gamma z.1.1 z.1.2)] inv := by |
| 84 | filter_upwards [hO.mem_nhds hpO] with q hq |
| 85 | have hi := jointEndpointInverse_spec E |
| 86 | (show q ∈ range (fun w : M14JointDomain G E => E.gamma w.1.1 w.1.2) from |
| 87 | ⟨⟨inv q, hmem q hq⟩, hright q hq⟩) |
| 88 | exact stableGraph_endpoint_injective E hi.1.1 (hmem q hq).1 (hi.2.trans (hright q hq).symm) |
| 89 | exact ((hsm.contMDiffAt (hO.mem_nhds hpO)).congr_of_eventuallyEq hagree).contMDiffWithinAt |
| 90 | |
| 91 | /-- The selected joint inverse is continuous on its actual image, |
| 92 | Proposition 6.28, p. 117. -/ |
| 93 | theorem jointEndpointInverse_continuous (E : M14ExponentialFamily G T x) : |
| 94 | ContinuousOn (jointEndpointInverse E) |
| 95 | (range (fun z : M14JointDomain G E => E.gamma z.1.1 z.1.2)) := by |
| 96 | let metric := G.spacetime.horizontalMetric.toRiemannianMetric |
| 97 | let : NormedAddCommGroup (G.Horizontal x) := |
| 98 | (metric.toCore x).toNormedAddCommGroupOfTopology |
| 99 | (metric.continuousAt x) (metric.isVonNBounded x) |
| 100 | let : InnerProductSpace ℝ (G.Horizontal x) := |
| 101 | .ofCoreOfTopology (metric.toCore x) (metric.continuousAt x) (metric.isVonNBounded x) |
| 102 | exact (jointEndpointInverse_smooth E).continuousOn |
| 103 | |
| 104 | /-- Every open subset of the joint domain has open endpoint image, |
| 105 | Proposition 6.28, p. 117. -/ |
| 106 | theorem jointMap_isOpenMap (E : M14ExponentialFamily G T x) : |
| 107 | IsOpenMap (fun z : M14JointDomain G E => E.gamma z.1.1 z.1.2) := by |
| 108 | intro S hS |
| 109 | obtain ⟨U, hU, rfl⟩ := isOpen_induced_iff.mp hS |
| 110 | have heq : (fun z : M14JointDomain G E => E.gamma z.1.1 z.1.2) '' |
| 111 | (Subtype.val ⁻¹' U) = |
| 112 | range (fun z : M14JointDomain G E => E.gamma z.1.1 z.1.2) ∩ jointEndpointInverse E ⁻¹' U := by |
| 113 | ext q |
| 114 | constructor |
| 115 | · rintro ⟨z, hz, rfl⟩ |
| 116 | exact ⟨mem_range_self z, by simpa only [mem_preimage, jointEndpointInverse_left E z] using hz⟩ |
| 117 | · rintro ⟨⟨z, rfl⟩, hz⟩ |
| 118 | exact ⟨z, by simpa only [mem_preimage, jointEndpointInverse_left E z] using hz, rfl⟩ |
| 119 | rw [heq] |
| 120 | exact (jointEndpointInverse_continuous E).isOpen_inter_preimage (jointMap_range_isOpen E) hU |
| 121 | |
| 122 | end PoincareMT.M14 |