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.Variation.Coordinates.ClosedChartCoefficients |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.EndpointMomentum |
| 3 | |
| 4 | /-! Adapted from Mapher `PoincareMT/Proofs/M08/EndpointChartRegularity.lean` at |
| 5 | `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ |
| 6 | |
| 7 | |
| 8 | /-! |
| 9 | # Closed-interval regularity of a finite-energy Euler curve in one chart |
| 10 | |
| 11 | The supplied derivative is used only on the interior. Its momentum has a |
| 12 | new continuous endpoint representative, and the closed phase equation |
| 13 | provides every endpoint jet. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | noncomputable section |
| 20 | |
| 21 | open Set Filter MeasureTheory |
| 22 | open scoped Manifold ContDiff Bundle Topology intervalIntegral |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT.LGeometry |
| 27 | |
| 28 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 29 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 30 | |
| 31 | noncomputable local instance endpointChartRegularityDualNormedGroup : |
| 32 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 33 | ContinuousLinearMap.toNormedAddCommGroup |
| 34 | |
| 35 | noncomputable local instance endpointChartRegularityDualNormedSpace : |
| 36 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 37 | ContinuousLinearMap.toNormedSpace |
| 38 | |
| 39 | noncomputable local instance endpointChartRegularityBilinNormedGroup : |
| 40 | NormedAddCommGroup (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 41 | ContinuousLinearMap.toNormedAddCommGroup |
| 42 | |
| 43 | noncomputable local instance endpointChartRegularityBilinNormedSpace : |
| 44 | NormedSpace ℝ (EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) := |
| 45 | ContinuousLinearMap.toNormedSpace |
| 46 | |
| 47 | set_option maxHeartbeats 1000000 in |
| 48 | theorem endpoint_chart_phase_contDiffOn {J : Set ℝ} (F : RicciFlow n M J) |
| 49 | (hM04 : RicciFlowCurvatureTheory.{u}) (T : ℝ) (x : M) {a b : ℝ} |
| 50 | (hab : a < b) (u d : ℝ → EuclideanSpace ℝ (Fin n)) |
| 51 | (hu : ContinuousOn u (Icc a b)) |
| 52 | (hud : ∀ s ∈ Ioo a b, HasDerivAt u (d s) s) |
| 53 | (hd : MemLp d 2 (volume.restrict (Icc a b))) |
| 54 | (htarget : MapsTo u (Icc a b) (extChartAt (𝓡 n) x).target) |
| 55 | (htime : ∀ s ∈ Icc a b, T - s ^ 2 ∈ J) |
| 56 | (hmomentum : ∀ s ∈ Ioo a b, |
| 57 | HasDerivAt (fun r ↦ chartMetricOperator F T x (r, u r) (d r)) |
| 58 | (chartForceVector |
| 59 | (spatialWithinFDeriv (Icc a b) (extChartAt (𝓡 n) x).target |
| 60 | (chartActionMetric F T x) (s, u s)) |
| 61 | (spatialWithinFDeriv (Icc a b) (extChartAt (𝓡 n) x).target |
| 62 | (chartActionPotential F T x) (s, u s)) (d s)) s) : |
| 63 | ∃ Pbar : ℝ → EuclideanSpace ℝ (Fin n), |
| 64 | ContDiffOn ℝ ∞ (fun s ↦ (u s, Pbar s)) (Icc a b) ∧ |
| 65 | EqOn Pbar (fun s ↦ chartMetricOperator F T x (s, u s) (d s)) (Ioo a b) ∧ |
| 66 | ∀ s ∈ Icc a b, HasDerivWithinAt (fun r ↦ (u r, Pbar r)) |
| 67 | (closedChartEulerPhase F T x (Icc a b) s (u s, Pbar s)) (Icc a b) s := by |
| 68 | let G := fun s ↦ chartActionMetric F T x (s, u s) |
| 69 | let DG := fun s ↦ spatialWithinFDeriv (Icc a b) (extChartAt (𝓡 n) x).target |
| 70 | (chartActionMetric F T x) (s, u s) |
| 71 | let DV := fun s ↦ spatialWithinFDeriv (Icc a b) (extChartAt (𝓡 n) x).target |
| 72 | (chartActionPotential F T x) (s, u s) |
| 73 | let A := fun s ↦ chartMetricOperator F T x (s, u s) |
| 74 | let B := fun s ↦ Ring.inverse (A s) |
| 75 | let P := fun s ↦ A s (d s) |
| 76 | let Q := fun s ↦ chartForceVector (DG s) (DV s) (d s) |
| 77 | have hpair : ContinuousOn (fun s ↦ (s, u s)) (Icc a b) := |
| 78 | continuousOn_id.prodMk hu |
| 79 | have hmap : MapsTo (fun s ↦ (s, u s)) (Icc a b) |
| 80 | (Icc a b ×ˢ (extChartAt (𝓡 n) x).target) := |
| 81 | fun s hs ↦ ⟨hs, htarget hs⟩ |
| 82 | have hU := isOpen_extChartAt_target (I := 𝓡 n) x |
| 83 | have hG : ContinuousOn G (Icc a b) := |
| 84 | (chartActionMetric_closed_contDiffOn F T x htime).continuousOn.comp hpair hmap |
| 85 | have hDG : ContinuousOn DG (Icc a b) := |
| 86 | (spatialWithinFDeriv_contDiffOn (uniqueDiffOn_Icc hab) hU _ |
| 87 | (chartActionMetric_closed_contDiffOn F T x htime)).continuousOn.comp hpair hmap |
| 88 | have hDV : ContinuousOn DV (Icc a b) := |
| 89 | (spatialWithinFDeriv_contDiffOn (uniqueDiffOn_Icc hab) hU _ |
| 90 | (chartActionPotential_closed_contDiffOn F hM04 T x htime)).continuousOn.comp hpair hmap |
| 91 | have hB : ContinuousOn B (Icc a b) := |
| 92 | (chartMetricInverse_closed_contDiffOn F T x htime).continuousOn.comp hpair hmap |
| 93 | have hinv (s : ℝ) (hs : s ∈ Icc a b) (v : EuclideanSpace ℝ (Fin n)) : |
| 94 | B s (A s v) = v := |
| 95 | inverse_operator_apply _ (chartMetricOperator_isUnit_of_target F T x (htarget hs)) v |
| 96 | obtain ⟨C₀, hC₀⟩ := isCompact_Icc.exists_bound_of_continuousOn hG |
| 97 | obtain ⟨C₁, hC₁⟩ := isCompact_Icc.exists_bound_of_continuousOn hDG |
| 98 | obtain ⟨C₂, hC₂⟩ := isCompact_Icc.exists_bound_of_continuousOn hDV |
| 99 | let C := |C₀| + |C₁| + |C₂| |
| 100 | have hC : 0 ≤ C := by dsimp only [C]; positivity |
| 101 | have hbound : ∀ s ∈ Icc a b, ‖G s‖ ≤ C ∧ ‖DG s‖ ≤ C ∧ ‖DV s‖ ≤ C := by |
| 102 | intro s hs |
| 103 | have h₀ := hC₀ s hs |
| 104 | have h₁ := hC₁ s hs |
| 105 | have h₂ := hC₂ s hs |
| 106 | dsimp only [C] |
| 107 | refine ⟨?_, ?_, ?_⟩ <;> |
| 108 | linarith [le_abs_self C₀, le_abs_self C₁, le_abs_self C₂, |
| 109 | abs_nonneg C₀, abs_nonneg C₁, abs_nonneg C₂] |
| 110 | have hQ : IntervalIntegrable Q volume a b := |
| 111 | (chart_momentum_force_intervalIntegrable hab.le hC d hd G DG DV hG hDG hDV hbound).2 |
| 112 | obtain ⟨c, q, Pbar, hPbar, hq, hPc, hqc, hPeq, hqeq, _, hudbar, _⟩ := |
| 113 | endpoint_velocity_of_momentum hab u d P Q hu hud hd A B hB hinv |
| 114 | (fun _ _ ↦ rfl) hQ hmomentum |
| 115 | let Qbar := fun s ↦ chartForceVector (DG s) (DV s) (q s) |
| 116 | have hQbar : ContinuousOn Qbar (Icc a b) := |
| 117 | chartForceVector_continuousOn hDG hDV hqc |
| 118 | have hQeq : EqOn Qbar Q (Ioo a b) := by |
| 119 | intro s hs |
| 120 | dsimp only [Qbar, Q] |
| 121 | rw [hqeq hs] |
| 122 | have hPdbar (s : ℝ) (hs : s ∈ Icc a b) : |
| 123 | HasDerivWithinAt Pbar (Qbar s) (Icc a b) s := by |
| 124 | rw [show Pbar = (fun r ↦ c + ∫ t in a..r, Q t) from funext hPbar] |
| 125 | exact endpoint_momentum_derivative_of_continuous_force hab c Q Qbar hQeq hQbar s hs |
| 126 | have hinvq (s : ℝ) : |
| 127 | Ring.inverse (chartMetricOperator F T x (s, u s)) (Pbar s) = q s := |
| 128 | (hq s).symm |
| 129 | have hphase (s : ℝ) (hs : s ∈ Icc a b) : |
| 130 | HasDerivWithinAt (fun r ↦ (u r, Pbar r)) |
| 131 | (closedChartEulerPhase F T x (Icc a b) s (u s, Pbar s)) (Icc a b) s := by |
| 132 | simpa only [closedChartEulerPhase, hinvq s, Qbar, DG, DV] using |
| 133 | (hudbar s hs).prodMk (hPdbar s hs) |
| 134 | have hphasemem : MapsTo (fun s ↦ (u s, Pbar s)) (Icc a b) |
| 135 | ((extChartAt (𝓡 n) x).target ×ˢ univ) := |
| 136 | fun s hs ↦ ⟨htarget hs, mem_univ _⟩ |
| 137 | have hsmooth := ODE.contDiffOn_enat_Icc_of_hasDerivWithinAt (n := ⊤) |
| 138 | (closedChartEulerPhase_contDiffOn F hM04 T x (uniqueDiffOn_Icc hab) htime) |
| 139 | hphase hphasemem |
| 140 | exact ⟨Pbar, hsmooth, hPeq, hphase⟩ |
| 141 | |
| 142 | end PoincareMT.LGeometry |