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.LGeometry.Jacobi.Index.IndexPairAlgebra |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.ChartEulerEquation |
| 3 | |
| 4 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/IndexContinuity.lean` at |
| 5 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 6 | |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | noncomputable section |
| 12 | |
| 13 | open Set Filter Topology |
| 14 | open scoped Manifold ContDiff Bundle |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.LGeometry |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | |
| 23 | local instance indexContinuityDualGroup : NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 24 | ContinuousLinearMap.toNormedAddCommGroup |
| 25 | local instance indexContinuityDualSpace : NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 26 | ContinuousLinearMap.toNormedSpace |
| 27 | local instance indexContinuityBilinGroup : |
| 28 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 29 | ContinuousLinearMap.toNormedAddCommGroup |
| 30 | local instance indexContinuityBilinSpace : |
| 31 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 32 | ContinuousLinearMap.toNormedSpace |
| 33 | |
| 34 | theorem alongField_chartCoordinates_contDiffOn {C : Set ℝ} (x : M) (α : ℝ → M) |
| 35 | (Y : ∀ s, TangentSpace (𝓡 n) (α s)) |
| 36 | (hY : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 37 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (Y s)) C) |
| 38 | (hsrc : MapsTo α C (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : |
| 39 | ContDiffOn ℝ ∞ (fun s ↦ |
| 40 | (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x |
| 41 | (Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (Y s))).2) C := by |
| 42 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x |
| 43 | have h := e.contMDiffOn.comp hY (fun s hs ↦ e.mem_source.mpr (hsrc hs)) |
| 44 | exact ContMDiffOn.contDiffOn (fun s hs ↦ (h s hs).snd) |
| 45 | |
| 46 | set_option maxHeartbeats 1600000 in |
| 47 | theorem jacobiPairResidual_contDiffOn {J : Set ℝ} (F : RicciFlow n M J) |
| 48 | (hM04 : RicciFlowCurvatureTheory.{u}) (T : ℝ) {a b : ℝ} (hab : a < b) |
| 49 | (htime : ∀ r ∈ Icc a b, T - r ^ 2 ∈ J) |
| 50 | {U : Set ℝ} (hU : IsOpen U) (hCU : Icc a b ⊆ U) |
| 51 | (α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 52 | (Y P DP W : ∀ s, TangentSpace (𝓡 n) (α s)) |
| 53 | (hY : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 54 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (Y s)) (Icc a b)) |
| 55 | (hP : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 56 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (P s)) (Icc a b)) |
| 57 | (hDP : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 58 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (DP s)) (Icc a b)) |
| 59 | (hW : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 60 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (W s)) (Icc a b)) : |
| 61 | ContDiffOn ℝ ∞ (fun s ↦ jacobiPairResidual F T α (Icc a b) s |
| 62 | (Y s) (P s) (DP s) (W s)) (Icc a b) := by |
| 63 | intro s hs |
| 64 | let x := α s |
| 65 | let N := U ∩ α ⁻¹' (chartAt (EuclideanSpace ℝ (Fin n)) x).source |
| 66 | let C := Icc a b ∩ N |
| 67 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) x |
| 68 | let coord := fun (H : ∀ r, TangentSpace (𝓡 n) (α r)) (r : ℝ) ↦ |
| 69 | (e (Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α r) (H r))).2 |
| 70 | have hN : IsOpen N := hα.continuousOn.isOpen_inter_preimage hU |
| 71 | (chartAt (EuclideanSpace ℝ (Fin n)) x).open_source |
| 72 | have hsN : s ∈ N := ⟨hCU hs, mem_chart_source _ _⟩ |
| 73 | have hsrc : MapsTo α C (chartAt (EuclideanSpace ℝ (Fin n)) x).source := fun r hr ↦ hr.2.2 |
| 74 | have hcoord (H : ∀ r, TangentSpace (𝓡 n) (α r)) |
| 75 | (hH : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 76 | (fun r ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α r) (H r)) (Icc a b)) : |
| 77 | ContDiffOn ℝ ∞ (coord H) C := |
| 78 | alongField_chartCoordinates_contDiffOn x α H (hH.mono inter_subset_left) hsrc |
| 79 | have hq : ContDiffOn ℝ ∞ ((extChartAt (𝓡 n) x) ∘ α) C := |
| 80 | chart_curve_contDiffOn x α (hα.mono (inter_subset_right.trans inter_subset_left)) hsrc |
| 81 | have hmap : MapsTo (fun r ↦ (r, extChartAt (𝓡 n) x (α r))) C |
| 82 | (Icc a b ×ˢ (extChartAt (𝓡 n) x).target) := by |
| 83 | intro r hr |
| 84 | exact ⟨hr.1, (extChartAt (𝓡 n) x).map_source |
| 85 | (by simpa only [extChartAt_source] using hsrc hr)⟩ |
| 86 | have hG := (chartActionMetric_closed_contDiffOn F T x htime).comp |
| 87 | (f := fun r ↦ (r, extChartAt (𝓡 n) x (α r))) (contDiffOn_id.prodMk hq) hmap |
| 88 | obtain ⟨_, _, hK, hH⟩ := jacobiAlongCoefficients_contDiffOn F hM04 T x α |
| 89 | (uniqueDiffOn_Icc hab) htime (show C ⊆ Icc a b from inter_subset_left) hU |
| 90 | (show C ⊆ U from inter_subset_right.trans inter_subset_left) hα hsrc |
| 91 | have hform := (((hG.clm_apply (hcoord DP hDP)).clm_apply (hcoord W hW)).sub |
| 92 | ((hK.clm_apply (hcoord Y hY)).clm_apply (hcoord W hW))).add |
| 93 | ((hH.clm_apply (hcoord P hP)).clm_apply (hcoord W hW)) |
| 94 | have hactual : ContDiffOn ℝ ∞ (fun r ↦ jacobiPairResidual F T α (Icc a b) r |
| 95 | (Y r) (P r) (DP r) (W r)) C := by |
| 96 | apply hform.congr |
| 97 | intro r hr |
| 98 | have hαr := ((hα r hr.2.1).contMDiffAt (hU.mem_nhds hr.2.1)).mdifferentiableAt (by simp) |
| 99 | have hid := jacobiPairResidual_chart F hM04 T hab htime x α hr.1 (hsrc hr) hαr |
| 100 | (coord Y r) (coord P r) (coord DP r) (coord W r) |
| 101 | simpa only [coord, e, Function.comp_apply, chartFrame_coordinates_at (hsrc hr)] using hid |
| 102 | exact (contDiffWithinAt_inter (hN.mem_nhds hsN)).mp (hactual s ⟨hs, hsN⟩) |
| 103 | |
| 104 | theorem regularizedIndexPairDensity_contDiffOn {J : Set ℝ} (F : RicciFlow n M J) |
| 105 | (hM04 : RicciFlowCurvatureTheory.{u}) (T : ℝ) {a b : ℝ} (hab : a < b) |
| 106 | (htime : ∀ r ∈ Icc a b, T - r ^ 2 ∈ J) |
| 107 | {U : Set ℝ} (hU : IsOpen U) (hCU : Icc a b ⊆ U) |
| 108 | (α : ℝ → M) (hα : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ α U) |
| 109 | (Y W DY DW : ∀ s, TangentSpace (𝓡 n) (α s)) |
| 110 | (hY : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 111 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (Y s)) (Icc a b)) |
| 112 | (hW : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 113 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (W s)) (Icc a b)) |
| 114 | (hDY : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 115 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (DY s)) (Icc a b)) |
| 116 | (hDW : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 117 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) (DW s)) (Icc a b)) : |
| 118 | ContDiffOn ℝ ∞ (fun s ↦ regularizedIndexPairDensity F T α (Icc a b) s |
| 119 | (Y s) (W s) (DY s) (DW s)) (Icc a b) := by |
| 120 | have hzero : ContMDiffOn (𝓘(ℝ, ℝ)) ((𝓡 n).prod (𝓡 n)) ∞ |
| 121 | (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (α s) |
| 122 | (0 : TangentSpace (𝓡 n) (α s))) (Icc a b) := |
| 123 | (Bundle.contMDiff_zeroSection ℝ (TangentSpace (𝓡 n))).comp_contMDiffOn (hα.mono hCU) |
| 124 | have hres := jacobiPairResidual_contDiffOn F hM04 T hab htime hU hCU α hα |
| 125 | Y (fun _ ↦ 0) (fun _ ↦ 0) W hY hzero hzero hW |
| 126 | have hpair := movingMetric_pair_contMDiffOn F (fun s ↦ T - s ^ 2) α DY DW |
| 127 | (contDiff_const.sub (contDiff_id.pow 2)).contMDiff.contMDiffOn (hα.mono hCU) hDY hDW htime |
| 128 | exact hpair.contDiffOn.sub hres |
| 129 | |
| 130 | end PoincareMT.LGeometry |
| 131 |