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.Variation.AdaptedFields.AdaptedGlobal |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Measure.Jacobian.MetricBases |
| 3 | import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas |
| 4 | |
| 5 | /-! |
| 6 | # Actual orthonormal frames along square-root paths |
| 7 | |
| 8 | Initialize an orthonormal horizontal basis and apply actual adapted |
| 9 | transport to each vector. Metric conservation preserves its Gram |
| 10 | matrix; finite-dimensional linear independence makes it a basis at |
| 11 | every time. Morgan-Tian Lemma 6.36 and Proposition 6.43, pp. 122, 127-128. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M14 |
| 22 | |
| 23 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 24 | {I : SpacetimeInterval} {G : GeneralizedLGeometryTransport n X time I} |
| 25 | |
| 26 | private theorem horizontal_t2Space {q : G.Point} : T2Space (G.Horizontal q) := |
| 27 | FiberBundle.t2Space (EuclideanSpace ℝ (Fin n)) G.Horizontal q |
| 28 | |
| 29 | attribute [local instance] horizontal_t2Space |
| 30 | |
| 31 | /-- Every orthonormal family of n actual horizontal vectors is an |
| 32 | actual basis, including dimension zero, Proposition 6.43, pp. 127-128. -/ |
| 33 | theorem horizontalBasis_of_orthonormal (q : G.Point) (v : Fin n → G.Horizontal q) |
| 34 | (hv : ∀ i j, G.spacetime.horizontalMetric.inner q (v i) (v j) = if i = j then 1 else 0) : |
| 35 | ∃ b : Module.Basis (Fin n) ℝ (G.Horizontal q), ∀ i, b i = v i := by |
| 36 | let : Bundle.RiemannianBundle (G.Horizontal : G.Point → Type _) := |
| 37 | ⟨G.spacetime.horizontalMetric.toRiemannianMetric⟩ |
| 38 | let : FiniteDimensional ℝ (G.Horizontal q) := |
| 39 | VectorBundle.finiteDimensional ℝ (EuclideanSpace ℝ (Fin n)) G.Horizontal q |
| 40 | have ho : Orthonormal ℝ v := orthonormal_iff_ite.mpr hv |
| 41 | have hdim : Fintype.card (Fin n) = Module.finrank ℝ (G.Horizontal q) := by |
| 42 | rw [VectorBundle.finrank_eq ℝ (EuclideanSpace ℝ (Fin n)) G.Horizontal q] |
| 43 | simp |
| 44 | refine ⟨basisOfLinearIndependentOfCardEqFinrank' v ho.linearIndependent hdim, ?_⟩ |
| 45 | intro i |
| 46 | exact congrFun (coe_basisOfLinearIndependentOfCardEqFinrank' v ho.linearIndependent hdim) i |
| 47 | |
| 48 | variable {T τ₁ τ₂ : ℝ} {x y : G.Point} {p : M14BackwardPath G T τ₁ τ₂ x y} |
| 49 | (R : M14SquareRootPath G p) |
| 50 | |
| 51 | /-- A smooth actual unit-adapted orthonormal frame exists on the full |
| 52 | closed square interval and is a basis at every time, Lemma 6.36 and |
| 53 | Proposition 6.43, pp. 122, 127-128. -/ |
| 54 | theorem exists_horizontalUnitAdaptedFrame |
| 55 | (hM04 : RicciFlowCurvatureTheory.{0}) (hM12 : GeneralizedRicciGaugeTheory.{u} n) : |
| 56 | ∃ P : Fin n → ∀ s, G.Horizontal (R.curve s), |
| 57 | (∀ i, IsHorizontalUnitAdaptedFieldOn R (Real.sqrt τ₁) (Real.sqrt τ₂) (P i)) ∧ |
| 58 | (∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, ∀ i j, |
| 59 | G.spacetime.horizontalMetric.inner (R.curve s) (P i s) (P j s) = |
| 60 | if i = j then 1 else 0) ∧ |
| 61 | ∀ s ∈ M14SqrtParameterInterval τ₁ τ₂, |
| 62 | ∃ b : Module.Basis (Fin n) ℝ (G.Horizontal (R.curve s)), ∀ i, b i = P i s := by |
| 63 | classical |
| 64 | obtain ⟨b₀, hb₀⟩ := exists_orthonormal_horizontalBasis G (R.curve (Real.sqrt τ₁)) |
| 65 | choose P hP hP₀ using fun i => exists_horizontalUnitAdaptedField R hM04 hM12 (b₀ i) |
| 66 | have hpair (s : ℝ) (hs : s ∈ M14SqrtParameterInterval τ₁ τ₂) (i j : Fin n) : |
| 67 | G.spacetime.horizontalMetric.inner (R.curve s) (P i s) (P j s) = |
| 68 | if i = j then 1 else 0 := by |
| 69 | rw [horizontalUnitAdapted_pair_eq hM12 (hP i) (hP j) |
| 70 | (left_mem_Icc.mpr (Real.sqrt_lt_sqrt p.tau_nonneg p.tau_lt).le) hs, hP₀ i, hP₀ j] |
| 71 | exact hb₀ i j |
| 72 | exact ⟨P, hP, hpair, fun s hs => horizontalBasis_of_orthonormal (R.curve s) |
| 73 | (fun i => P i s) (hpair s hs)⟩ |
| 74 | |
| 75 | end PoincareMT.M14 |