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.ReducedGeometry.ReducedLength.Variation.Adapted.CompactAdaptedField |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Adapted.AdaptedPairingConstancy |
| 3 | import Mathlib.LinearAlgebra.FiniteDimensional.Lemmas |
| 4 | |
| 5 | /-! |
| 6 | # Constructed orthonormal adapted frames |
| 7 | |
| 8 | Each initial basis vector has an actual transported field. Their common |
| 9 | open domain and metric conservation give an orthonormal frame there. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option maxSynthPendingDepth 3 |
| 14 | |
| 15 | open scoped Manifold ContDiff Bundle Topology RealInnerProductSpace |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedLength |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 23 | [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | theorem exists_adapted_orthonormal_frame {J : Set ℝ} [T2Space M] (F : RicciFlow n M J) |
| 26 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 27 | (γ : ℝ → M) (U : Set ℝ) (hU : IsOpen U) (hconnU : IsPreconnected U) |
| 28 | (htime : U ⊆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 29 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ U) |
| 30 | (a c s0 : ℝ) (hKU : Set.Icc a c ⊆ U) (hs0 : s0 ∈ Set.Icc a c) |
| 31 | (e : Fin n → TangentSpace (𝓡 n) (γ s0)) |
| 32 | (he : ∀ i j, (F.metric (T - s0 ^ 2)).inner (γ s0) (e i) (e j) = |
| 33 | if i = j then 1 else 0) : |
| 34 | ∃ (D : Set ℝ) (P : Fin n → ∀ t, TangentSpace (𝓡 n) (γ t)), |
| 35 | IsOpen D ∧ IsPreconnected D ∧ Set.Icc a c ⊆ D ∧ D ⊆ U ∧ |
| 36 | (∀ i, P i s0 = e i) ∧ (∀ i, IsAdaptedFieldOn F T γ (P i) D) ∧ |
| 37 | ∀ t ∈ D, ∀ i j, (F.metric (T - t ^ 2)).inner (γ t) (P i t) (P j t) = |
| 38 | if i = j then 1 else 0 := by |
| 39 | classical |
| 40 | choose D P hD hconn hKD hDU hP0 hP using fun i : Fin n ↦ |
| 41 | exists_adaptedFieldOn_Icc F T b hb hwindow γ U hU htime hγ a c s0 hKU hs0 (e i) |
| 42 | let W := U ∩ ⋂ i, D i |
| 43 | have hW : IsOpen W := hU.inter (isOpen_iInter_of_finite hD) |
| 44 | have hconnW : IsPreconnected W := |
| 45 | (hconnU.ordConnected.inter (Set.ordConnected_iInter fun i ↦ (hconn i).ordConnected)).isPreconnected |
| 46 | have hKW : Set.Icc a c ⊆ W := fun t ht ↦ |
| 47 | ⟨hKU ht, Set.mem_iInter.mpr (fun i ↦ hKD i ht)⟩ |
| 48 | have hWi (i : Fin n) : W ⊆ D i := fun _ ht ↦ Set.mem_iInter.mp ht.2 i |
| 49 | have hPW (i : Fin n) := (hP i).mono (hWi i) |
| 50 | refine ⟨W, P, hW, hconnW, hKW, Set.inter_subset_left, hP0, hPW, ?_⟩ |
| 51 | intro t ht i j |
| 52 | have hp := IsAdaptedFieldOn.pairing_eq F T b hb hwindow γ (P i) (P j) W |
| 53 | hW hconnW (fun _ h ↦ htime h.1) (hγ.mono Set.inter_subset_left) |
| 54 | (hPW i) (hPW j) t s0 ht (hKW hs0) |
| 55 | rw [hp, hP0 i, hP0 j] |
| 56 | exact he i j |
| 57 | |
| 58 | set_option backward.isDefEq.respectTransparency false in |
| 59 | theorem exists_orthonormalBasis_of_metric_pairing (g : RiemannianMetric n M) (p : M) |
| 60 | (v : Fin n → TangentSpace (𝓡 n) p) |
| 61 | (hv : ∀ i j, g.inner p (v i) (v j) = if i = j then 1 else 0) : |
| 62 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 63 | ⟨g.toRiemannianMetric⟩ |
| 64 | ∃ e : OrthonormalBasis (Fin n) ℝ (TangentSpace (𝓡 n) p), ∀ i, e i = v i := by |
| 65 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 66 | ⟨g.toRiemannianMetric⟩ |
| 67 | letI : FiniteDimensional ℝ (TangentSpace (𝓡 n) p) := |
| 68 | inferInstanceAs (FiniteDimensional ℝ (EuclideanSpace ℝ (Fin n))) |
| 69 | have hon : Orthonormal ℝ v := orthonormal_iff_ite.mpr hv |
| 70 | have hdim : Module.finrank ℝ (TangentSpace (𝓡 n) p) = n := by |
| 71 | change Module.finrank ℝ (EuclideanSpace ℝ (Fin n)) = n |
| 72 | simp |
| 73 | have hsp := hon.linearIndependent.span_eq_top_of_card_eq_finrank' |
| 74 | (by simpa only [Fintype.card_fin] using hdim.symm) |
| 75 | refine ⟨OrthonormalBasis.mk hon hsp.ge, ?_⟩ |
| 76 | intro i |
| 77 | exact congrFun (OrthonormalBasis.coe_mk hon hsp.ge) i |
| 78 | |
| 79 | set_option backward.isDefEq.respectTransparency false in |
| 80 | theorem exists_initial_orthonormal_vectors (g : RiemannianMetric n M) (p : M) : |
| 81 | ∃ e : Fin n → TangentSpace (𝓡 n) p, |
| 82 | ∀ i j, g.inner p (e i) (e j) = if i = j then 1 else 0 := by |
| 83 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 84 | ⟨g.toRiemannianMetric⟩ |
| 85 | have hdim : Module.finrank ℝ (TangentSpace (𝓡 n) p) = n := by |
| 86 | change Module.finrank ℝ (EuclideanSpace ℝ (Fin n)) = n |
| 87 | simp |
| 88 | let e := (g.orthonormalBasis p).reindex (finCongr hdim) |
| 89 | exact ⟨e, orthonormal_iff_ite.mp e.orthonormal⟩ |
| 90 | |
| 91 | end PoincareMT.ReducedLength |