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 | /- Adapted from Mapher `PoincareMT/Proofs/M03/Existence/PullbackMetricNative.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Geometry.Riemannian.Connection |
| 6 | import Mathlib.Geometry.Manifold.Diffeomorph |
| 7 | import Mathlib.Geometry.Manifold.VectorBundle.ContMDiffSection |
| 8 | |
| 9 | /-! |
| 10 | # Native pullback metric construction |
| 11 | |
| 12 | This file constructs the metric pulled back by a smooth diffeomorphism. The |
| 13 | smoothness of the bundled bilinear section is supplied by the producer that |
| 14 | constructs the diffeomorphism family; the metric itself is constructed here |
| 15 | without importing an external Ricci-flow formalization. |
| 16 | -/ |
| 17 | |
| 18 | set_option autoImplicit false |
| 19 | set_option maxHeartbeats 1600000 |
| 20 | |
| 21 | open scoped Manifold ContDiff Bundle |
| 22 | |
| 23 | noncomputable section |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT |
| 28 | |
| 29 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 31 | [IsManifold (𝓡 n) ∞ M] |
| 32 | |
| 33 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 34 | local notation "FiberBilin" => |
| 35 | fun x : M => TangentSpace (𝓡 n) x →L[ℝ] TangentSpace (𝓡 n) x →L[ℝ] ℝ |
| 36 | |
| 37 | noncomputable def pinner (g : RiemannianMetric n M) |
| 38 | (Φ : Diffeomorph (𝓡 n) (𝓡 n) M M ∞) (x : M) : |
| 39 | TangentSpace (𝓡 n) x →L[ℝ] TangentSpace (𝓡 n) x →L[ℝ] ℝ := by |
| 40 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 41 | ⟨g.toRiemannianMetric⟩ |
| 42 | let A := Φ.mfderivToContinuousLinearEquiv (by simp) x |
| 43 | exact (((ContinuousLinearMap.precompL (𝕜 := ℝ) (TangentSpace (𝓡 n) x) |
| 44 | (g.inner (Φ x))) A.toContinuousLinearMap).comp A.toContinuousLinearMap).flip |
| 45 | |
| 46 | theorem pinner_apply (g : RiemannianMetric n M) |
| 47 | (Φ : Diffeomorph (𝓡 n) (𝓡 n) M M ∞) (x : M) |
| 48 | (v w : TangentSpace (𝓡 n) x) : |
| 49 | pinner g Φ x v w = g.inner (Φ x) (mfderiv (𝓡 n) (𝓡 n) Φ x v) |
| 50 | (mfderiv (𝓡 n) (𝓡 n) Φ x w) := by |
| 51 | simp [pinner, Diffeomorph.mfderivToContinuousLinearEquiv_coe] |
| 52 | |
| 53 | noncomputable def pullbackMetric (g : RiemannianMetric n M) |
| 54 | (Φ : Diffeomorph (𝓡 n) (𝓡 n) M M ∞) |
| 55 | (hsmooth : ContMDiff (𝓡 n) |
| 56 | ((𝓡 n).prod 𝓘(ℝ, E →L[ℝ] E →L[ℝ] ℝ)) ∞ |
| 57 | (fun x : M => Bundle.TotalSpace.mk' |
| 58 | (E →L[ℝ] E →L[ℝ] ℝ) x (pinner g Φ x))) : |
| 59 | RiemannianMetric n M where |
| 60 | inner := pinner g Φ |
| 61 | symm x v w := by |
| 62 | rw [pinner_apply, pinner_apply, g.symm] |
| 63 | pos x v hv := by |
| 64 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 65 | ⟨g.toRiemannianMetric⟩ |
| 66 | let A := Φ.mfderivToContinuousLinearEquiv (by simp) x |
| 67 | apply g.pos (Φ x) (A v) |
| 68 | intro hz |
| 69 | apply hv |
| 70 | exact A.injective (by simpa using hz) |
| 71 | isVonNBounded x := by |
| 72 | letI : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 73 | ⟨g.toRiemannianMetric⟩ |
| 74 | let A := Φ.mfderivToContinuousLinearEquiv (by simp) x |
| 75 | let Ainv := A.symm.toContinuousLinearMap |
| 76 | refine ((g.isVonNBounded (Φ x)).image Ainv).subset ?_ |
| 77 | intro v hv |
| 78 | refine ⟨A v, ?_, ?_⟩ |
| 79 | · change g.inner (Φ x) (A v) (A v) < 1 |
| 80 | exact hv |
| 81 | · exact A.symm_apply_apply v |
| 82 | contMDiff := hsmooth |
| 83 | |
| 84 | theorem pullbackMetric_inner (g : RiemannianMetric n M) |
| 85 | (Φ : Diffeomorph (𝓡 n) (𝓡 n) M M ∞) (hsmooth : ContMDiff (𝓡 n) |
| 86 | ((𝓡 n).prod 𝓘(ℝ, E →L[ℝ] E →L[ℝ] ℝ)) ∞ |
| 87 | (fun x : M => Bundle.TotalSpace.mk' |
| 88 | (E →L[ℝ] E →L[ℝ] ℝ) x (pinner g Φ x))) |
| 89 | (x : M) (v w : TangentSpace (𝓡 n) x) : |
| 90 | (pullbackMetric g Φ hsmooth).inner x v w = |
| 91 | g.inner (Φ x) (mfderiv (𝓡 n) (𝓡 n) Φ x v) |
| 92 | (mfderiv (𝓡 n) (𝓡 n) Φ x w) := by |
| 93 | exact pinner_apply g Φ x v w |
| 94 | |
| 95 | theorem pullbackMetric_refl (g : RiemannianMetric n M) |
| 96 | (hsmooth : ContMDiff (𝓡 n) |
| 97 | ((𝓡 n).prod 𝓘(ℝ, E →L[ℝ] E →L[ℝ] ℝ)) ∞ |
| 98 | (fun x : M => Bundle.TotalSpace.mk' |
| 99 | (E →L[ℝ] E →L[ℝ] ℝ) x |
| 100 | (pinner g (Diffeomorph.refl (𝓡 n) M ∞) x))) : |
| 101 | pullbackMetric g (Diffeomorph.refl (𝓡 n) M ∞) hsmooth = g := by |
| 102 | have hinner : ∀ x (v w : TangentSpace (𝓡 n) x), |
| 103 | (pullbackMetric g (Diffeomorph.refl (𝓡 n) M ∞) hsmooth).inner x v w = |
| 104 | g.inner x v w := by |
| 105 | intro x v w |
| 106 | rw [pullbackMetric_inner] |
| 107 | simp only [Diffeomorph.coe_refl, mfderiv_id, |
| 108 | ContinuousLinearMap.id_apply, id_eq] |
| 109 | change g.inner x v w = g.inner x v w |
| 110 | rfl |
| 111 | have hp := hinner |
| 112 | cases h₁ : pullbackMetric g (Diffeomorph.refl (𝓡 n) M ∞) hsmooth |
| 113 | cases h₂ : g |
| 114 | rw [h₁, h₂] at hp |
| 115 | simp only [Bundle.ContMDiffRiemannianMetric.mk.injEq] |
| 116 | funext x |
| 117 | apply ContinuousLinearMap.ext |
| 118 | intro v |
| 119 | apply ContinuousLinearMap.ext |
| 120 | intro w |
| 121 | exact hp x v w |
| 122 | |
| 123 | end PoincareMT |