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.SourceNames.ReducedLength |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.Calculus.Local.ParametricPathSubstitution |
| 4 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Coordinates.ClosedChartCoefficients |
| 5 | |
| 6 | /-! |
| 7 | # Smooth substitution for actual closed-time fields |
| 8 | |
| 9 | Morgan-Tian Lemma 6.18, pp. 113-114. Restricting a field to a compact |
| 10 | time set retains its actual within coefficients. M08's genuine spatial |
| 11 | derivative and M09's bounded pointwise operator give smooth substitution |
| 12 | on the Banach path space, without an ambient extension of time. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped ContDiff |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M14 |
| 23 | |
| 24 | variable {E F : Type u} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 25 | [NormedAddCommGroup F] [NormedSpace ℝ F] {C : Set ℝ} |
| 26 | |
| 27 | /-- Bundle a field on its actual time subtype, using only its continuous |
| 28 | values on that time set, the closed-time restriction for Lemma 6.18, |
| 29 | pp. 113-114. -/ |
| 30 | def closedTimeField (f : ℝ × E → F) (hf : ContinuousOn f (C ×ˢ univ)) : C(C × E, F) := |
| 31 | ⟨fun z => f (z.1.val, z.2), hf.comp_continuous |
| 32 | ((continuous_subtype_val.comp continuous_fst).prodMk continuous_snd) |
| 33 | (fun z => ⟨z.1.property, mem_univ _⟩)⟩ |
| 34 | |
| 35 | /-- Substitute a continuous state path into the actual closed-time field, |
| 36 | the path-space operator used for Lemma 6.18, pp. 113-114. -/ |
| 37 | def closedTimePostcomp [CompactSpace C] (f : ℝ × E → F) |
| 38 | (hf : ContinuousOn f (C ×ˢ univ)) : C(C, E) → C(C, F) := |
| 39 | parametricPostcomp (closedTimeField f hf) |
| 40 | |
| 41 | /-- Restricting the time set preserves the genuine state derivative at |
| 42 | each retained point. This is the coefficient compatibility required |
| 43 | for closed-time local dependence in Lemma 6.18, pp. 113-114. -/ |
| 44 | theorem spatialWithinFDeriv_subset_time {D : Set ℝ} {U : Set E} (hU : IsOpen U) |
| 45 | (f : ℝ × E → F) (hf : ContDiffOn ℝ ∞ f (C ×ˢ U)) (hDC : D ⊆ C) |
| 46 | {t : ℝ} {x : E} (ht : t ∈ D) (hx : x ∈ U) : |
| 47 | M08.spatialWithinFDeriv D U f (t, x) = M08.spatialWithinFDeriv C U f (t, x) := |
| 48 | (M08.hasFDerivAt_spatialWithin hU f (hf.mono (prod_mono hDC Subset.rfl)) ht hx).unique |
| 49 | (M08.hasFDerivAt_spatialWithin hU f hf (hDC ht) hx) |
| 50 | |
| 51 | /-- The actual spatial within differential gives the path-space |
| 52 | derivative while keeping the compact time parameter fixed, |
| 53 | Lemma 6.18, pp. 113-114. -/ |
| 54 | theorem hasFDerivAt_closedTimePostcomp [CompactSpace C] [FiniteDimensional ℝ E] |
| 55 | (hC : UniqueDiffOn ℝ C) (f : ℝ × E → F) (hf : ContDiffOn ℝ ∞ f (C ×ˢ univ)) |
| 56 | (φ : C(C, E)) : |
| 57 | HasFDerivAt (closedTimePostcomp f hf.continuousOn) |
| 58 | (Proofs.M09.pointwiseLinear |
| 59 | (closedTimePostcomp (M08.spatialWithinFDeriv C univ f) |
| 60 | (M08.spatialWithinFDeriv_contDiffOn hC isOpen_univ f hf).continuousOn φ)) φ := by |
| 61 | apply hasFDerivAt_parametricPostcomp |
| 62 | intro t x |
| 63 | exact M08.hasFDerivAt_spatialWithin isOpen_univ f hf t.property (mem_univ x) |
| 64 | |
| 65 | /-- Substitution by a smooth actual closed-time field has every finite |
| 66 | derivative order in the path variable. This is the induction underlying |
| 67 | smooth initial-state dependence in Lemma 6.18, pp. 113-114. -/ |
| 68 | theorem closedTimePostcomp_contDiff_nat [CompactSpace C] [FiniteDimensional ℝ E] |
| 69 | (hC : UniqueDiffOn ℝ C) (k : ℕ) (f : ℝ × E → F) |
| 70 | (hf : ContDiffOn ℝ ∞ f (C ×ˢ univ)) : |
| 71 | ContDiff ℝ k (closedTimePostcomp f hf.continuousOn) := by |
| 72 | induction k generalizing F with |
| 73 | | zero => |
| 74 | exact contDiff_zero.mpr (continuous_parametricPostcomp (closedTimeField f hf.continuousOn)) |
| 75 | | succ k ih => |
| 76 | have hD := M08.spatialWithinFDeriv_contDiffOn hC isOpen_univ f hf |
| 77 | simp only [Nat.cast_add, Nat.cast_one] |
| 78 | refine contDiff_succ_iff_hasFDerivAt.mpr |
| 79 | ⟨fun φ => Proofs.M09.pointwiseLinear |
| 80 | (closedTimePostcomp (M08.spatialWithinFDeriv C univ f) hD.continuousOn φ), ?_, |
| 81 | fun φ => hasFDerivAt_closedTimePostcomp hC f hf φ⟩ |
| 82 | exact (Proofs.M09.pointwiseOperator (K := C) (E := E) (F := F)).contDiff.comp |
| 83 | (ih (M08.spatialWithinFDeriv C univ f) hD) |
| 84 | |
| 85 | /-- A smooth actual closed-time field induces smooth substitution on |
| 86 | continuous state paths, with no regularity assertion about its off-time |
| 87 | representative, Lemma 6.18, pp. 113-114. -/ |
| 88 | theorem closedTimePostcomp_contDiff [CompactSpace C] [FiniteDimensional ℝ E] |
| 89 | (hC : UniqueDiffOn ℝ C) (f : ℝ × E → F) (hf : ContDiffOn ℝ ∞ f (C ×ˢ univ)) : |
| 90 | ContDiff ℝ ∞ (closedTimePostcomp f hf.continuousOn) := |
| 91 | contDiff_infty.mpr fun k => closedTimePostcomp_contDiff_nat hC k f hf |
| 92 | |
| 93 | end PoincareMT.M14 |