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.SourceNames.LGeometry |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Minimization.Charts.WeakVelocity |
| 3 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Minimization.Charts.ChartRegularity |
| 4 | import Mathlib.Analysis.ODE.PicardLindelof |
| 5 | |
| 6 | /-! |
| 7 | # Smoothness from a continuous weak momentum equation |
| 8 | |
| 9 | The analytic regularity step after Morgan-Tian Lemma 6.4 and |
| 10 | Definition 6.7, pp. 107-108. M08's weak-momentum primitive, continuous |
| 11 | primitive derivative and smooth inverse-operator lemmas convert a C1 |
| 12 | curve into an actual smooth phase ODE. This is the coefficient-independent |
| 13 | part of the proof pattern in M08 ChartEulerRegularity. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set Filter MeasureTheory |
| 19 | open scoped ContDiff Topology intervalIntegral |
| 20 | |
| 21 | namespace ODE |
| 22 | |
| 23 | variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] |
| 24 | |
| 25 | /-- A C1 curve with invertible smooth momentum coefficients and a smooth |
| 26 | force is smooth when its actual momentum satisfies the weak equation. |
| 27 | The pointwise momentum equation holds at both closed endpoints as well, |
| 28 | the regularity argument after Lemma 6.4, pp. 107-108. -/ |
| 29 | theorem contDiffOn_of_weak_linear_momentum {a b : ℝ} (hab : a < b) |
| 30 | {S : Set E} (A : ℝ × E → E →L[ℝ] E) (F : ℝ → E × E → E) |
| 31 | (hA : ContDiffOn ℝ ∞ A (Icc a b ×ˢ S)) |
| 32 | (hunit : ∀ z ∈ Icc a b ×ˢ S, IsUnit (A z)) |
| 33 | (hF : ContDiffOn ℝ ∞ (Function.uncurry F) (Icc a b ×ˢ (S ×ˢ univ))) |
| 34 | (u : ℝ → E) (hu : ContDiffOn ℝ 1 u (Icc a b)) (hmem : MapsTo u (Icc a b) S) |
| 35 | (hweak : ∀ φ : ℝ → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → |
| 36 | tsupport φ ⊆ Ioo a b → |
| 37 | (∫ s in a..b, deriv φ s • A (s, u s) (derivWithin u (Icc a b) s)) = |
| 38 | -(∫ s in a..b, φ s • F s (u s, derivWithin u (Icc a b) s))) : |
| 39 | ContDiffOn ℝ ∞ u (Icc a b) ∧ ∀ s ∈ Icc a b, |
| 40 | HasDerivWithinAt (fun t => A (t, u t) (derivWithin u (Icc a b) t)) |
| 41 | (F s (u s, derivWithin u (Icc a b) s)) (Icc a b) s := by |
| 42 | let C := Icc a b |
| 43 | let q := derivWithin u C |
| 44 | let P := fun s => A (s, u s) (q s) |
| 45 | let Q := fun s => F s (u s, q s) |
| 46 | have hq : ContinuousOn q C := hu.continuousOn_derivWithin (uniqueDiffOn_Icc hab) le_rfl |
| 47 | have hud (s : ℝ) (hs : s ∈ C) : HasDerivWithinAt u (q s) C s := |
| 48 | ((hu.differentiableOn (by simp)) s hs).hasDerivWithinAt |
| 49 | have hgraph : ContinuousOn (fun s => (s, u s)) C := |
| 50 | continuousOn_id.prodMk hu.continuousOn |
| 51 | have hgraphmem : MapsTo (fun s => (s, u s)) C (C ×ˢ S) := |
| 52 | fun _ hs => ⟨hs, hmem hs⟩ |
| 53 | have hP : ContinuousOn P C := (hA.continuousOn.comp hgraph hgraphmem).clm_apply hq |
| 54 | have hQ : ContinuousOn Q C := hF.continuousOn.comp |
| 55 | (continuousOn_id.prodMk (hu.continuousOn.prodMk hq)) |
| 56 | (fun _ hs => ⟨hs, hmem hs, mem_univ _⟩) |
| 57 | have hPint : IntervalIntegrable P volume a b := hP.intervalIntegrable_of_Icc hab.le |
| 58 | have hQint : IntervalIntegrable Q volume a b := hQ.intervalIntegrable_of_Icc hab.le |
| 59 | obtain ⟨c, hc⟩ := PoincareMT.M08.weak_momentum_primitive hab P Q hPint hQint hweak |
| 60 | have hprimitive (s : ℝ) (hs : s ∈ C) : P s = c + ∫ r in a..s, Q r := by |
| 61 | have h := intervalIntegral.continuousOn_primitive_interval' hQint left_mem_uIcc |
| 62 | rw [uIcc_of_le hab.le] at h |
| 63 | exact (Measure.eqOn_Icc_of_ae_eq volume hab.ne hc hP (continuousOn_const.add h)) hs |
| 64 | have hca : c = P a := by |
| 65 | simpa only [intervalIntegral.integral_same, add_zero] using |
| 66 | (hprimitive a ⟨le_rfl, hab.le⟩).symm |
| 67 | have hPprimitive (s : ℝ) (hs : s ∈ C) : P s = P a + ∫ r in a..s, Q r := by |
| 68 | rw [hprimitive s hs, hca] |
| 69 | obtain ⟨hPd, _⟩ := PoincareMT.M08.continuous_primitive_regular hab P Q hQ hPprimitive |
| 70 | let phase := fun t (z : E × E) => |
| 71 | let v := Ring.inverse (A (t, z.1)) z.2 |
| 72 | (v, F t (z.1, v)) |
| 73 | let Ω := C ×ˢ (S ×ˢ (univ : Set E)) |
| 74 | let k := fun z : ℝ × (E × E) => (z.1, z.2.1) |
| 75 | have hk : ContDiffOn ℝ ∞ k Ω := contDiffOn_fst.prodMk contDiffOn_snd.fst |
| 76 | have hmap : MapsTo k Ω (C ×ˢ S) := fun _ hz => ⟨hz.1, hz.2.1⟩ |
| 77 | have hB := (PoincareMT.M08.contDiffOn_inverse_operator A hA hunit).comp hk hmap |
| 78 | have hv := hB.clm_apply contDiffOn_snd.snd |
| 79 | have hforce := hF.comp (contDiffOn_fst.prodMk (contDiffOn_snd.fst.prodMk hv)) |
| 80 | (fun _ hz => ⟨hz.1, hz.2.1, mem_univ _⟩) |
| 81 | have hphase : ContDiffOn ℝ ∞ (Function.uncurry phase) Ω := hv.prodMk hforce |
| 82 | have hinv (s : ℝ) (hs : s ∈ C) : Ring.inverse (A (s, u s)) (P s) = q s := |
| 83 | PoincareMT.M08.inverse_operator_apply _ (hunit _ (hgraphmem hs)) (q s) |
| 84 | have hphaseDeriv (s : ℝ) (hs : s ∈ C) : |
| 85 | HasDerivWithinAt (fun t => (u t, P t)) (phase s (u s, P s)) C s := by |
| 86 | simpa only [phase, hinv s hs] using (hud s hs).prodMk (hPd s hs) |
| 87 | have hphaseMem : MapsTo (fun s => (u s, P s)) C (S ×ˢ univ) := |
| 88 | fun _ hs => ⟨hmem hs, mem_univ _⟩ |
| 89 | have hsmooth := contDiffOn_enat_Icc_of_hasDerivWithinAt (n := ⊤) hphase hphaseDeriv hphaseMem |
| 90 | exact ⟨hsmooth.fst, hPd⟩ |
| 91 | |
| 92 | end ODE |