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.Interval.Charts |
| 2 | import Mathlib.Geometry.Manifold.VectorField.Pullback |
| 3 | import Mathlib.Topology.Algebra.Module.FiniteDimension |
| 4 | |
| 5 | /-! |
| 6 | # The actual positive interval tangent |
| 7 | |
| 8 | The real inclusion has the same local derivative as the corresponding closed |
| 9 | segment inclusion. Its inverse applied to 1 is smooth by smooth pullback of |
| 10 | the constant vector field on the real line. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | open PoincareMT |
| 20 | |
| 21 | namespace Poincare.Spacetime.Realization |
| 22 | |
| 23 | theorem interval_inclusion_mfderiv_eq (I : SpacetimeInterval) (t : I.domain) : |
| 24 | letI := intervalChartedSpace I |
| 25 | let D := intervalSegmentAt I t |
| 26 | letI : Fact (D.left < D.right) := ⟨D.lt⟩ |
| 27 | mfderiv (𝓡∂ 1) 𝓘(ℝ) (Subtype.val : I.domain → ℝ) t = |
| 28 | mfderiv (𝓡∂ 1) 𝓘(ℝ) (Subtype.val : Icc D.left D.right → ℝ) (D.toSegment t) := by |
| 29 | let := intervalChartedSpace I |
| 30 | let D := intervalSegmentAt I t |
| 31 | let : Fact (D.left < D.right) := ⟨D.lt⟩ |
| 32 | dsimp only |
| 33 | rw [((interval_inclusion_smooth I t).mdifferentiableAt (by simp)).mfderiv, |
| 34 | ((contMDiff_subtypeVal_Icc (n := ∞) (D.toSegment t)).mdifferentiableAt (by simp)).mfderiv] |
| 35 | rfl |
| 36 | |
| 37 | theorem interval_inclusion_surjective (I : SpacetimeInterval) (t : I.domain) : |
| 38 | letI := intervalChartedSpace I |
| 39 | Function.Surjective (mfderiv (𝓡∂ 1) 𝓘(ℝ) (Subtype.val : I.domain → ℝ) t) := by |
| 40 | let := intervalChartedSpace I |
| 41 | let D := intervalSegmentAt I t |
| 42 | let : Fact (D.left < D.right) := ⟨D.lt⟩ |
| 43 | change Function.Surjective |
| 44 | (show EuclideanSpace ℝ (Fin 1) → ℝ from |
| 45 | mfderiv (𝓡∂ 1) 𝓘(ℝ) (Subtype.val : I.domain → ℝ) t) |
| 46 | intro r |
| 47 | refine ⟨r • (1 : TangentSpace (𝓡∂ 1) (D.toSegment t)), ?_⟩ |
| 48 | rw [interval_inclusion_mfderiv_eq] |
| 49 | change mfderiv (𝓡∂ 1) 𝓘(ℝ) (Subtype.val : Icc D.left D.right → ℝ) |
| 50 | (D.toSegment t) (r • (1 : TangentSpace (𝓡∂ 1) (D.toSegment t))) = r |
| 51 | rw [map_smul, mfderiv_subtypeVal_Icc_one (D.toSegment t)] |
| 52 | exact mul_one r |
| 53 | |
| 54 | theorem interval_inclusion_bijective (I : SpacetimeInterval) (t : I.domain) : |
| 55 | letI := intervalChartedSpace I |
| 56 | Function.Bijective (mfderiv (𝓡∂ 1) 𝓘(ℝ) (Subtype.val : I.domain → ℝ) t) := by |
| 57 | let := intervalChartedSpace I |
| 58 | let f : EuclideanSpace ℝ (Fin 1) →L[ℝ] ℝ := |
| 59 | mfderiv (𝓡∂ 1) 𝓘(ℝ) (Subtype.val : I.domain → ℝ) t |
| 60 | change Function.Bijective f |
| 61 | have hdim : Module.finrank ℝ (EuclideanSpace ℝ (Fin 1)) = Module.finrank ℝ ℝ := by |
| 62 | simp |
| 63 | exact ⟨(LinearMap.injective_iff_surjective_of_finrank_eq_finrank (f := f.toLinearMap) hdim).mpr |
| 64 | (interval_inclusion_surjective I t), interval_inclusion_surjective I t⟩ |
| 65 | |
| 66 | noncomputable def intervalInclusionDerivative (I : SpacetimeInterval) : |
| 67 | letI := intervalChartedSpace I |
| 68 | ∀ t : I.domain, TangentSpace (𝓡∂ 1) t ≃L[ℝ] ℝ := by |
| 69 | letI := intervalChartedSpace I |
| 70 | intro t |
| 71 | change EuclideanSpace ℝ (Fin 1) ≃L[ℝ] ℝ |
| 72 | exact (LinearEquiv.ofBijective |
| 73 | (show EuclideanSpace ℝ (Fin 1) →ₗ[ℝ] ℝ from |
| 74 | (mfderiv (𝓡∂ 1) 𝓘(ℝ) (Subtype.val : I.domain → ℝ) t).toLinearMap) |
| 75 | (interval_inclusion_bijective I t)).toContinuousLinearEquiv |
| 76 | |
| 77 | theorem intervalInclusionDerivative_eq (I : SpacetimeInterval) : |
| 78 | letI := intervalChartedSpace I |
| 79 | ∀ t : I.domain, (intervalInclusionDerivative I t).toContinuousLinearMap = |
| 80 | mfderiv (𝓡∂ 1) 𝓘(ℝ) (Subtype.val : I.domain → ℝ) t := by |
| 81 | intro t |
| 82 | rfl |
| 83 | |
| 84 | theorem interval_positive_tangent_smooth (I : SpacetimeInterval) : |
| 85 | letI := intervalChartedSpace I |
| 86 | letI : IsManifold (𝓡∂ 1) ∞ I.domain := interval_isManifold I |
| 87 | ContMDiff (𝓡∂ 1) ((𝓡∂ 1).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin 1))) ∞ |
| 88 | (fun t : I.domain ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin 1)) |
| 89 | (E := (TangentSpace (𝓡∂ 1) : I.domain → Type _)) t |
| 90 | ((intervalInclusionDerivative I t).symm 1)) := by |
| 91 | let := intervalChartedSpace I |
| 92 | let : IsManifold (𝓡∂ 1) ∞ I.domain := interval_isManifold I |
| 93 | have hconst : ContMDiff 𝓘(ℝ) (𝓘(ℝ).prod 𝓘(ℝ)) ∞ |
| 94 | (fun x : ℝ ↦ Bundle.TotalSpace.mk' ℝ |
| 95 | (E := (TangentSpace 𝓘(ℝ) : ℝ → Type _)) x (1 : ℝ)) := |
| 96 | contMDiff_vectorSpace_iff_contDiff.mpr contDiff_const |
| 97 | have hinv : ∀ t : I.domain, |
| 98 | (mfderiv (𝓡∂ 1) 𝓘(ℝ) (Subtype.val : I.domain → ℝ) t).IsInvertible := |
| 99 | fun t ↦ ⟨intervalInclusionDerivative I t, intervalInclusionDerivative_eq I t⟩ |
| 100 | have hpull := hconst.mpullback_vectorField (interval_inclusion_smooth I) hinv (by simp) |
| 101 | simp only [VectorField.mpullback, ← intervalInclusionDerivative_eq, |
| 102 | ContinuousLinearMap.inverse_equiv] at hpull |
| 103 | convert! hpull |
| 104 | |
| 105 | /-- All smooth interval data concern exactly the supplied interval subtype. -/ |
| 106 | noncomputable def smoothInterval (I : SpacetimeInterval) : SmoothSpacetimeInterval I where |
| 107 | chartedSpace := intervalChartedSpace I |
| 108 | isManifold := interval_isManifold I |
| 109 | inclusion_smooth := interval_inclusion_smooth I |
| 110 | boundary_eq := interval_boundary_eq I |
| 111 | inclusionDerivative := intervalInclusionDerivative I |
| 112 | inclusionDerivative_eq := intervalInclusionDerivative_eq I |
| 113 | positive_tangent_smooth := interval_positive_tangent_smooth I |
| 114 | |
| 115 | end Poincare.Spacetime.Realization |