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.StableSliceChart |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Exponential.Endpoint.EndpointDifferential |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Measure.Transport.BasisCoordinateVolume |
| 4 | |
| 5 | /-! |
| 6 | # The actual stable endpoint chart in Euclidean source coordinates |
| 7 | |
| 8 | Morgan-Tian Lemma 6.71, p. 141. The source coordinate equivalence preserves |
| 9 | the frozen source measure and converts the stable endpoint chart to the |
| 10 | Euclidean form needed for calibrated measure transport. Its derivative |
| 11 | is the actual endpoint tangent differential applied to the same coordinates. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M14 |
| 21 | |
| 22 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 23 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 24 | {T τ : ℝ} {x : G.Point} {E : M14ExponentialFamily G T x} |
| 25 | |
| 26 | private theorem horizontal_t2Space : T2Space (G.Horizontal x) := |
| 27 | FiberBundle.t2Space (EuclideanSpace ℝ (Fin n)) G.Horizontal x |
| 28 | |
| 29 | attribute [local instance] horizontal_t2Space |
| 30 | |
| 31 | /-- The stable slice endpoint chart in a fixed source basis, for the |
| 32 | change-of-variables formula of Morgan-Tian Lemma 6.71, p. 141. -/ |
| 33 | noncomputable def stableCoordinateChart (H : M14StableSet G T τ x E) |
| 34 | (b : Module.Basis (Fin n) ℝ (G.Horizontal x)) : |
| 35 | OpenPartialHomeomorph (EuclideanSpace ℝ (Fin n)) (G.slices (T - τ)).Point := |
| 36 | b.euclideanCoordinates.toHomeomorph.transOpenPartialHomeomorph (stableSliceChart H) |
| 37 | |
| 38 | /-- The coordinate chart source is exactly the preimage of the stable |
| 39 | carrier, Morgan-Tian Lemma 6.71, p. 141. -/ |
| 40 | theorem stableCoordinateChart_source (H : M14StableSet G T τ x E) |
| 41 | (b : Module.Basis (Fin n) ℝ (G.Horizontal x)) : |
| 42 | (stableCoordinateChart H b).source = b.euclideanCoordinates ⁻¹' H.carrier := rfl |
| 43 | |
| 44 | /-- The coordinate chart retains the exact stable endpoint image, |
| 45 | Morgan-Tian Lemma 6.71, p. 141. -/ |
| 46 | theorem stableCoordinateChart_target (H : M14StableSet G T τ x E) |
| 47 | (b : Module.Basis (Fin n) ℝ (G.Horizontal x)) : |
| 48 | (stableCoordinateChart H b).target = H.endpoint_slice_map '' H.carrier := rfl |
| 49 | |
| 50 | /-- The forward coordinate map is the supplied slice endpoint map in the |
| 51 | specified source coordinates, Morgan-Tian Lemma 6.71, p. 141. -/ |
| 52 | theorem stableCoordinateChart_apply (H : M14StableSet G T τ x E) |
| 53 | (b : Module.Basis (Fin n) ℝ (G.Horizontal x)) (z : EuclideanSpace ℝ (Fin n)) : |
| 54 | stableCoordinateChart H b z = H.endpoint_slice_map (b.euclideanCoordinates z) := rfl |
| 55 | |
| 56 | /-- The Euclidean stable endpoint chart is smooth on its actual source, |
| 57 | Morgan-Tian Proposition 6.28 and Lemma 6.71, pp. 117, 141. -/ |
| 58 | theorem stableCoordinateChart_smooth (H : M14StableSet G T τ x E) |
| 59 | (b : Module.Basis (Fin n) ℝ (G.Horizontal x)) : |
| 60 | ContMDiffOn (𝓡 n) (𝓡 n) ∞ (stableCoordinateChart H b) |
| 61 | (stableCoordinateChart H b).source := by |
| 62 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := |
| 63 | ⟨G.spacetime.horizontalMetric.toRiemannianMetric⟩ |
| 64 | have hs : ContMDiffOn (𝓘(ℝ, G.Horizontal x)) (𝓡 n) ∞ |
| 65 | H.endpoint_slice_map H.carrier := H.endpoint_slice_smooth |
| 66 | exact hs.comp b.euclideanCoordinates.toContinuousLinearMap.contMDiff.contMDiffOn |
| 67 | (fun _ hz => hz) |
| 68 | |
| 69 | /-- The inverse coordinate chart is smooth on the actual stable image, |
| 70 | Morgan-Tian Proposition 6.28 and Lemma 6.71, pp. 117, 141. -/ |
| 71 | theorem stableCoordinateChart_symm_smooth (H : M14StableSet G T τ x E) |
| 72 | (b : Module.Basis (Fin n) ℝ (G.Horizontal x)) : |
| 73 | ContMDiffOn (𝓡 n) (𝓡 n) ∞ (stableCoordinateChart H b).symm |
| 74 | (stableCoordinateChart H b).target := by |
| 75 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := |
| 76 | ⟨G.spacetime.horizontalMetric.toRiemannianMetric⟩ |
| 77 | have hs : ContMDiffOn (𝓡 n) (𝓘(ℝ, G.Horizontal x)) ∞ |
| 78 | (stableSliceChart H).symm (stableSliceChart H).target := |
| 79 | stableSliceChart_symm_smooth H |
| 80 | exact b.euclideanCoordinates.symm.toContinuousLinearMap.contMDiff.comp_contMDiffOn hs |
| 81 | |
| 82 | set_option maxHeartbeats 800000 in |
| 83 | -- Elaborating the dependent slice derivative unfolds the selected metric instances. |
| 84 | /-- The coordinate chart differential uses the same source basis and actual |
| 85 | endpoint tangent map as the metric Jacobian in Lemma 6.71, p. 141. -/ |
| 86 | theorem stableCoordinateChart_differential (H : M14StableSet G T τ x E) |
| 87 | (b : Module.Basis (Fin n) ℝ (G.Horizontal x)) |
| 88 | (z : EuclideanSpace ℝ (Fin n)) |
| 89 | (hz : b.euclideanCoordinates z ∈ H.carrier) (v : EuclideanSpace ℝ (Fin n)) : |
| 90 | mfderiv (𝓡 n) (𝓡 n) (stableCoordinateChart H b) z v = |
| 91 | M14EndpointTangentDifferential G (b.euclideanCoordinates z) hz |
| 92 | (b.euclideanCoordinates v) := by |
| 93 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := |
| 94 | ⟨G.spacetime.horizontalMetric.toRiemannianMetric⟩ |
| 95 | let C := b.euclideanCoordinates |
| 96 | have hs : ContMDiffOn (𝓘(ℝ, G.Horizontal x)) (𝓡 n) ∞ |
| 97 | H.endpoint_slice_map H.carrier := H.endpoint_slice_smooth |
| 98 | have hf := (hs.contMDiffAt (H.carrier_open.mem_nhds hz)).mdifferentiableAt (by simp) |
| 99 | rw [endpointTangentDifferential_eq_mfderiv] |
| 100 | change mfderiv (𝓡 n) (𝓡 n) (H.endpoint_slice_map ∘ C) z v = |
| 101 | mfderiv (𝓘(ℝ, G.Horizontal x)) (𝓡 n) H.endpoint_slice_map (C z) (C v) |
| 102 | have hd := mfderiv_comp_apply z hf C.differentiableAt.mdifferentiableAt v |
| 103 | rw [mfderiv_eq_fderiv, C.fderiv] at hd |
| 104 | exact hd |
| 105 | |
| 106 | end PoincareMT.M14 |