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.Splitting.MaximumPrinciple.ChartOperator |
| 2 | import PoincareLib.Geometry.RicciFlow.MetricFamily.PullbackCoefficients |
| 3 | |
| 4 | /-! |
| 5 | # Closed-time regularity of the chart heat operator |
| 6 | |
| 7 | Spatial derivatives of a smooth metric family remain jointly smooth within |
| 8 | the time interval. Thus its actual inverse chart metric and Christoffel drift |
| 9 | are continuous through both time endpoints. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | set_option maxSynthPendingDepth 8 |
| 16 | |
| 17 | open Set Filter Bundle |
| 18 | open scoped Manifold ContDiff Topology |
| 19 | |
| 20 | namespace PoincareMT.RicciFlow.Splitting.MaximumPrinciple |
| 21 | |
| 22 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 24 | |
| 25 | private theorem pullback_coefficients_smooth_within |
| 26 | {g : ℝ → RiemannianMetric n M} {J : Set ℝ} |
| 27 | (hg : RiemannianMetric.IsSmoothFamilyOn g J) |
| 28 | {f : EuclideanSpace ℝ (Fin n) → M} {x : EuclideanSpace ℝ (Fin n)} |
| 29 | (hf : ContMDiffAt (𝓡 n) (𝓡 n) ∞ f x) {t : ℝ} (ht : t ∈ J) : |
| 30 | ContDiffWithinAt ℝ ∞ |
| 31 | (fun p : ℝ × EuclideanSpace ℝ (Fin n) => (g p.1).pullbackCoefficients f p.2) |
| 32 | (J ×ˢ univ) (t, x) := by |
| 33 | have hs := Poincare.Gluing.inducedForm_family_contMDiffWithinAt hg hf ht |
| 34 | have hc := ((contMDiffWithinAt_hom_bundle _).mp hs).2 |
| 35 | simp only [RiemannianMetric.constant_chart_bilinear_coordinates |
| 36 | (n := n) (M := EuclideanSpace ℝ (Fin n)) (fun _ _ => rfl)] at hc |
| 37 | have hid : ContMDiffWithinAt 𝓘(ℝ, ℝ × EuclideanSpace ℝ (Fin n)) |
| 38 | (𝓘(ℝ, ℝ).prod (𝓡 n)) ∞ |
| 39 | (fun p : ℝ × EuclideanSpace ℝ (Fin n) => (p.1, p.2)) |
| 40 | (J ×ˢ univ) (t, x) := |
| 41 | contDiffWithinAt_fst.contMDiffWithinAt.prodMk contDiffWithinAt_snd.contMDiffWithinAt |
| 42 | convert! (hc.comp (t, x) hid (fun _ hp => hp)).contDiffWithinAt using 1 |
| 43 | |
| 44 | theorem contDiffOn_chartMetric {g : ℝ → RiemannianMetric n M} {J : Set ℝ} |
| 45 | (hg : RiemannianMetric.IsSmoothFamilyOn g J) (p : M) : |
| 46 | ContDiffOn ℝ ∞ |
| 47 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => chartMetric (g z.1) p z.2) |
| 48 | (J ×ˢ (extChartAt (𝓡 n) p).target) := by |
| 49 | intro z hz |
| 50 | apply (pullback_coefficients_smooth_within hg |
| 51 | ((contMDiffOn_extChartAt_symm p).contMDiffAt |
| 52 | ((isOpen_extChartAt_target p).mem_nhds hz.2)) hz.1).mono |
| 53 | exact prod_mono_right (subset_univ _) |
| 54 | |
| 55 | private theorem spatialFDeriv_within |
| 56 | {V E : Type*} [NormedAddCommGroup V] [NormedSpace ℝ V] |
| 57 | [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 58 | {f : ℝ × V → E} {J : Set ℝ} {U : Set V} |
| 59 | (hf : ContDiffOn ℝ ∞ f (J ×ˢ U)) (hJ : UniqueDiffOn ℝ J) (hU : IsOpen U) : |
| 60 | ContDiffOn ℝ ∞ (fun z : ℝ × V => fderiv ℝ (fun x => f (z.1, x)) z.2) |
| 61 | (J ×ˢ U) := by |
| 62 | have hd := (hf.fderivWithin (hJ.prod hU.uniqueDiffOn) (m := ∞) (by simp)).clm_comp |
| 63 | (contDiffOn_const (c := ContinuousLinearMap.inr ℝ ℝ V)) |
| 64 | apply hd.congr |
| 65 | intro z hz |
| 66 | have hcomp := ((hf z hz).differentiableWithinAt (by simp)).hasFDerivWithinAt.comp z.2 |
| 67 | (((hasFDerivAt_const z.1 z.2).prodMk (hasFDerivAt_id z.2)).hasFDerivWithinAt) |
| 68 | (show MapsTo (fun x : V => (z.1, x)) U (J ×ˢ U) from fun _ hx => ⟨hz.1, hx⟩) |
| 69 | exact (hcomp.hasFDerivAt (hU.mem_nhds hz.2)).fderiv |
| 70 | |
| 71 | theorem contDiffOn_chartMetric_inverse {g : ℝ → RiemannianMetric n M} {J : Set ℝ} |
| 72 | (hg : RiemannianMetric.IsSmoothFamilyOn g J) (p : M) : |
| 73 | ContDiffOn ℝ ∞ |
| 74 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => (chartMetric (g z.1) p z.2).inverse) |
| 75 | (J ×ˢ (extChartAt (𝓡 n) p).target) := by |
| 76 | intro z hz |
| 77 | exact (((g z.1).isInvertible_chartCoefficients p hz.2).contDiffAt_map_inverse).comp_contDiffWithinAt |
| 78 | z (contDiffOn_chartMetric hg p z hz) |
| 79 | |
| 80 | theorem contDiffOn_chartDrift {g : ℝ → RiemannianMetric n M} {J : Set ℝ} |
| 81 | (hg : RiemannianMetric.IsSmoothFamilyOn g J) (hJ : UniqueDiffOn ℝ J) (p : M) : |
| 82 | ContDiffOn ℝ ∞ |
| 83 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => chartDrift (g z.1) p z.2) |
| 84 | (J ×ˢ (extChartAt (𝓡 n) p).target) := by |
| 85 | have hi := contDiffOn_chartMetric_inverse hg p |
| 86 | have hd := spatialFDeriv_within (contDiffOn_chartMetric hg p) hJ |
| 87 | (isOpen_extChartAt_target p) |
| 88 | have hf : ContDiff ℝ ∞ (fun A : |
| 89 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ => A.flip) := |
| 90 | (ContinuousLinearMap.flipₗᵢ ℝ (EuclideanSpace ℝ (Fin n)) |
| 91 | (EuclideanSpace ℝ (Fin n)) ℝ).contDiff |
| 92 | have hf' : ContDiff ℝ ∞ (fun A : |
| 93 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] |
| 94 | EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ => A.flip) := |
| 95 | (ContinuousLinearMap.flipₗᵢ ℝ (EuclideanSpace ℝ (Fin n)) |
| 96 | (EuclideanSpace ℝ (Fin n)) (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ)).contDiff |
| 97 | let E := EuclideanSpace ℝ (Fin n) |
| 98 | let flipL := (ContinuousLinearMap.flipₗᵢ ℝ E E ℝ).toLinearIsometry.toContinuousLinearMap |
| 99 | change ContDiffOn ℝ ∞ (fun z : ℝ × E => ∑ i, |
| 100 | ((ContinuousLinearMap.compL ℝ E (E →L[ℝ] ℝ) E |
| 101 | (chartMetric (g z.1) p z.2).inverse).comp |
| 102 | ((2⁻¹ : ℝ) • (fderiv ℝ (chartMetric (g z.1) p) z.2 + |
| 103 | (flipL.comp (fderiv ℝ (chartMetric (g z.1) p) z.2)).flip - |
| 104 | flipL.comp (fderiv ℝ (chartMetric (g z.1) p) z.2).flip))) |
| 105 | (EuclideanSpace.basisFun (Fin n) ℝ i) |
| 106 | ((chartMetric (g z.1) p z.2).inverse (EuclideanSpace.proj i))) _ |
| 107 | fun_prop |
| 108 | |
| 109 | end PoincareMT.RicciFlow.Splitting.MaximumPrinciple |