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.Surgery.StandardCap.Persistence.SourceNames.Metric |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Scalar.Calculus.UniformCoordinateJets |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Scalar.Round.RoundPullback |
| 4 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Persistence.Scalar.Round.RoundModelCoordinates |
| 5 | |
| 6 | /-! |
| 7 | # Coordinate error jets from the intrinsic round comparison |
| 8 | |
| 9 | A local realization of the model metric transports the actual covariant |
| 10 | error tensor to Euclidean coordinates. Its ordinary derivatives are then |
| 11 | bounded by the uniform reverse estimate. Morgan--Tian, Definition 9.76, |
| 12 | Lemma 11.2 and Lemma 16.8, pp. 372-373; M44 derivation 30. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | namespace PoincareMT.M44 |
| 22 | |
| 23 | open M36 |
| 24 | |
| 25 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 26 | |
| 27 | /-- A locally smooth bilinear error has the same intrinsic jet norms |
| 28 | as its actual target tensor under a local model isometry. Smooth |
| 29 | extension is used only as a germ. Source: Definition 9.76; |
| 30 | M44 derivation 30. -/ |
| 31 | theorem local_bilinear_covariant_norm_eq_pullback |
| 32 | {M : Type*} [TopologicalSpace M] [ChartedSpace E M] [IsManifold (𝓡 3) ∞ M] |
| 33 | {g : RiemannianMetric 3 E} {h : RiemannianMetric 3 M} |
| 34 | (D : LeviCivitaData g) (D' : LeviCivitaData h) |
| 35 | {f : E → M} {U : Set E} (hU : IsOpen U) |
| 36 | (hf : ContMDiffOn (𝓡 3) (𝓡 3) ∞ f U) |
| 37 | (hinv : ∀ y ∈ U, (mfderiv (𝓡 3) (𝓡 3) f y).IsInvertible) |
| 38 | (hmetric : ∀ y ∈ U, ∀ u v : E, |
| 39 | g.inner y u v = h.inner (f y) (mfderiv (𝓡 3) (𝓡 3) f y u) |
| 40 | (mfderiv (𝓡 3) (𝓡 3) f y v)) |
| 41 | {A : E → E →L[ℝ] E →L[ℝ] ℝ} (hA : ContDiffOn ℝ ∞ A U) |
| 42 | {T : CovariantTensorEvaluation 3 M 2} (hT : IsSmoothCovariantTensor T) |
| 43 | (hAT : ∀ y ∈ U, ∀ v : Fin 2 → E, |
| 44 | A y (v 0) (v 1) - g.inner y (v 0) (v 1) = |
| 45 | T (f y) (fun i => mfderiv (𝓡 3) (𝓡 3) f y (v i))) |
| 46 | (j : ℕ) {x : E} (hx : x ∈ U) : |
| 47 | g.tensorNorm (D.iteratedCovariantTensorDerivative (k := 2) |
| 48 | (fun y v => A y (v 0) (v 1) - g.inner y (v 0) (v 1)) j) x = |
| 49 | h.tensorNorm (D'.iteratedCovariantTensorDerivative T j) (f x) := by |
| 50 | have hg : ContDiff ℝ ∞ g.euclideanCoefficients := |
| 51 | contDiff_iff_contDiffAt.mpr g.contDiffAt_euclideanCoefficients |
| 52 | obtain ⟨B, hB, heq⟩ := exists_comparison_smooth_germ hU (hA.sub hg.contDiffOn) hx |
| 53 | let S : CovariantTensorEvaluation 3 E 2 := fun y v => B y (v 0) (v 1) |
| 54 | have hS : IsSmoothCovariantTensor S := comparison_bilinear_isSmooth hB |
| 55 | have hSeq : S =ᶠ[𝓝 x] |
| 56 | (fun (y : E) (v : Fin 2 → E) => A y (v 0) (v 1) - g.inner y (v 0) (v 1)) := by |
| 57 | filter_upwards [heq] with y hy |
| 58 | funext v |
| 59 | change B y (v 0) (v 1) = _ |
| 60 | rw [hy] |
| 61 | rfl |
| 62 | have hjet := (comparison_iteratedCovariantTensorDerivative_eventuallyEq D hSeq j).self_of_nhds |
| 63 | have hnorm : g.tensorNorm (D.iteratedCovariantTensorDerivative S j) x = |
| 64 | g.tensorNorm (D.iteratedCovariantTensorDerivative (k := 2) |
| 65 | (fun y v => A y (v 0) (v 1) - g.inner y (v 0) (v 1)) j) x := by |
| 66 | unfold RiemannianMetric.tensorNorm |
| 67 | rw [hjet] |
| 68 | rfl |
| 69 | obtain ⟨V, hV, hVo, hxV⟩ := mem_nhds_iff.mp (inter_mem (hU.mem_nhds hx) hSeq) |
| 70 | have hsub : V ⊆ U := fun y hy => (hV hy).1 |
| 71 | rw [← hnorm] |
| 72 | apply tensorNorm_iterated_eq_of_metric_pullback D D' hVo (hf.mono hsub) |
| 73 | (fun y hy => hinv y (hsub hy)) (fun y hy => hmetric y (hsub hy)) hS hT |
| 74 | (fun y hy v => ?_) j hxV |
| 75 | rw [(hV hy).2] |
| 76 | exact hAT y (hsub hy) v |
| 77 | |
| 78 | end PoincareMT.M44 |