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.Generalized.ReducedGeometry.Calculus.ODE.Paths.ClosedPathCurrying |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.ODE.Paths.ClosedPathJointSmooth |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Coordinates.ChartConnectionVariation |
| 5 | |
| 6 | /-! |
| 7 | # Smooth actual primitives of closed-time families |
| 8 | |
| 9 | The action regularity in Morgan-Tian Lemma 6.22, pp. 115-116. |
| 10 | Actual within time jets remain smooth on the original closed slab. |
| 11 | Their smooth continuous-path representatives and the bounded primitive |
| 12 | give joint smoothness of the genuine variable-upper-limit integral. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped ContDiff Topology intervalIntegral |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M14 |
| 23 | |
| 24 | variable {E F : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 25 | [FiniteDimensional ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 26 | {C : Set ℝ} {U : Set E} |
| 27 | |
| 28 | /-- Repeated actual within time derivatives on the retained closed |
| 29 | slab, the time jets used for the primitive in Lemma 6.22, pp. 115-116. -/ |
| 30 | noncomputable def closedFamilyTimeJet (C : Set ℝ) (U : Set E) (f : ℝ × E → F) : |
| 31 | ℕ → ℝ × E → F |
| 32 | | 0 => f |
| 33 | | j + 1 => M08.timeWithinFDeriv C U (closedFamilyTimeJet C U f j) |
| 34 | |
| 35 | omit [FiniteDimensional ℝ E] in |
| 36 | /-- Every actual time jet remains smooth on its original closed |
| 37 | time and open parameter rectangle, the regularity step for |
| 38 | Lemma 6.22, pp. 115-116. -/ |
| 39 | theorem closedFamilyTimeJet_contDiffOn (hC : UniqueDiffOn ℝ C) (hU : IsOpen U) |
| 40 | (f : ℝ × E → F) (hf : ContDiffOn ℝ ∞ f (C ×ˢ U)) (j : ℕ) : |
| 41 | ContDiffOn ℝ ∞ (closedFamilyTimeJet C U f j) (C ×ˢ U) := by |
| 42 | induction j with |
| 43 | | zero => exact hf |
| 44 | | succ j ih => exact M08.timeWithinFDeriv_contDiffOn hC hU _ ih |
| 45 | |
| 46 | /-- Integrating a jointly smooth density on a closed time interval |
| 47 | gives a jointly smooth actual primitive through both endpoints, |
| 48 | without an extension across physical time, Lemma 6.22, pp. 115-116. -/ |
| 49 | theorem closedFamilyPrimitive_contDiffOn [CompleteSpace F] |
| 50 | {a b : ℝ} (hab : a < b) (hU : IsOpen U) |
| 51 | (f : ℝ × E → F) (hf : ContDiffOn ℝ ∞ f (Icc a b ×ˢ U)) : |
| 52 | ContDiffOn ℝ ∞ (fun z : E × ℝ => ∫ t in a..z.2, f (t, z.1)) (U ×ˢ Icc a b) := by |
| 53 | let t₀ : Icc a b := ⟨a, le_rfl, hab.le⟩ |
| 54 | have hJ := closedFamilyTimeJet_contDiffOn (uniqueDiffOn_Icc hab) hU f hf |
| 55 | choose Φ hΦ hvalue using fun j => |
| 56 | exists_contDiffOn_closedPathFamily (uniqueDiffOn_Icc hab) hU |
| 57 | (closedFamilyTimeJet (Icc a b) U f j) (hJ j) |
| 58 | let Ψ : ℕ → E → C(Icc a b, F) |
| 59 | | 0 => fun x => closedPathPrimitive t₀ (Φ 0 x) |
| 60 | | j + 1 => Φ j |
| 61 | have hΨ (j : ℕ) : ContDiffOn ℝ ∞ (Ψ j) U := by |
| 62 | cases j with |
| 63 | | zero => exact (closedPathPrimitive (E := F) t₀).contDiff.comp_contDiffOn (hΦ 0) |
| 64 | | succ j => exact hΦ j |
| 65 | have ht (j : ℕ) (x : E) (hx : x ∈ U) (r : Icc a b) : HasDerivWithinAt |
| 66 | (fun s => Ψ j x (projIcc a b hab.le s)) (Ψ (j + 1) x r) (Icc a b) r.val := by |
| 67 | cases j with |
| 68 | | zero => exact closedPathPrimitive_hasDerivWithinAt t₀ r (Φ 0 x) |
| 69 | | succ j => |
| 70 | change HasDerivWithinAt (fun s => Φ j x (projIcc a b hab.le s)) (Φ (j + 1) x r) |
| 71 | (Icc a b) r.val |
| 72 | rw [hvalue (j + 1) x hx r] |
| 73 | apply (M08.hasDerivWithinAt_timeWithin _ (hJ j) r.property hx).congr_of_mem _ r.property |
| 74 | intro s hs |
| 75 | rw [hvalue j x hx, projIcc_of_mem hab.le hs] |
| 76 | have h := closedPath_timeJets_contDiff hab t₀ hU Ψ hΨ ht |
| 77 | apply h.congr |
| 78 | intro z hz |
| 79 | change (∫ t in a..z.2, f (t, z.1)) = |
| 80 | closedPathPrimitive t₀ (Φ 0 z.1) (projIcc a b hab.le z.2) |
| 81 | rw [closedPathPrimitive_apply, projIcc_of_mem hab.le hz.2] |
| 82 | apply intervalIntegral.integral_congr_Ioo_of_le hz.2.1 |
| 83 | intro t ht |
| 84 | have htC : t ∈ Icc a b := ⟨ht.1.le, ht.2.le.trans hz.2.2⟩ |
| 85 | change f (t, z.1) = Φ 0 z.1 (projIcc a b hab.le t) |
| 86 | rw [projIcc_of_mem hab.le htC] |
| 87 | exact (hvalue 0 z.1 hz.1 ⟨t, htC⟩).symm |
| 88 | |
| 89 | end PoincareMT.M14 |