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.Area.MinimalSphere.Round.Metric |
| 2 | import Mathlib.Geometry.Manifold.Algebra.Structures |
| 3 | |
| 4 | /-! |
| 5 | # The smooth factor of a weakly conformal sphere |
| 6 | |
| 7 | Morgan-Tian Claim 18.12, printed pp. 426-427. A pointwise unit tangent |
| 8 | direction defines the unique conformal scale. A quotient on smooth |
| 9 | local tangent fields proves smoothness without a global sphere frame. |
| 10 | Its zero set is exactly the actual differential-zero set. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set Filter |
| 17 | open scoped Manifold ContDiff Topology Bundle |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT |
| 22 | |
| 23 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 24 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 25 | |
| 26 | /-- The squared length of the first centered round unit tangent image. |
| 27 | For weakly conformal maps this is the intrinsic conformal factor. |
| 28 | Source: MT Claim 18.12, pp. 426-427. -/ |
| 29 | noncomputable def m60SphereConformalFactor (g : RiemannianMetric n M) |
| 30 | (f : UnitTwoSphere → M) (p : UnitTwoSphere) : ℝ := |
| 31 | g.inner (f p) (mfderiv (𝓡 2) (𝓡 n) f p (EuclideanSpace.basisFun (Fin 2) ℝ 0)) |
| 32 | (mfderiv (𝓡 2) (𝓡 n) f p (EuclideanSpace.basisFun (Fin 2) ℝ 0)) |
| 33 | |
| 34 | /-- The displayed conformal factor is nonnegative for every total map. |
| 35 | Source: MT Claim 18.12, pp. 426-427. -/ |
| 36 | theorem m60SphereConformalFactor_nonneg (g : RiemannianMetric n M) |
| 37 | (f : UnitTwoSphere → M) (p : UnitTwoSphere) : |
| 38 | 0 ≤ m60SphereConformalFactor g f p := by |
| 39 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 n) : M → Type _) := |
| 40 | ⟨g.toRiemannianMetric⟩ |
| 41 | exact real_inner_self_nonneg (x := mfderiv (𝓡 2) (𝓡 n) f p |
| 42 | (EuclideanSpace.basisFun (Fin 2) ℝ 0)) |
| 43 | |
| 44 | /-- Weak conformality identifies the pointwise definition with its |
| 45 | unique intrinsic scale. Source: MT Claim 18.12, pp. 426-427. -/ |
| 46 | theorem m60SphereConformalFactor_spec (g : RiemannianMetric n M) |
| 47 | (f : UnitTwoSphere → M) (hc : M60WeaklyConformal g f) |
| 48 | (p : UnitTwoSphere) (v w : TangentSpace (𝓡 2) p) : |
| 49 | g.inner (f p) (mfderiv (𝓡 2) (𝓡 n) f p v) (mfderiv (𝓡 2) (𝓡 n) f p w) = |
| 50 | m60SphereConformalFactor g f p * m60RoundSphereInner p v w := by |
| 51 | obtain ⟨s, -, hs⟩ := hc p |
| 52 | have he : m60RoundSphereInner p (EuclideanSpace.basisFun (Fin 2) ℝ 0) |
| 53 | (EuclideanSpace.basisFun (Fin 2) ℝ 0) = 1 := by |
| 54 | rw [m60RoundSphereInner_eq_inner] |
| 55 | change inner ℝ (EuclideanSpace.basisFun (Fin 2) ℝ 0) |
| 56 | (EuclideanSpace.basisFun (Fin 2) ℝ 0) = 1 |
| 57 | simp only [real_inner_self_eq_norm_sq, OrthonormalBasis.norm_eq_one, one_pow] |
| 58 | have hscale : m60SphereConformalFactor g f p = s := by |
| 59 | unfold m60SphereConformalFactor |
| 60 | rw [hs, he, mul_one] |
| 61 | rw [hscale] |
| 62 | exact hs v w |
| 63 | |
| 64 | /-- The conformal factor vanishes exactly on the actual branch set. |
| 65 | Source: MT Claim 18.12, pp. 426-427. -/ |
| 66 | theorem m60SphereConformalFactor_eq_zero_iff (g : RiemannianMetric n M) |
| 67 | (f : UnitTwoSphere → M) (hc : M60WeaklyConformal g f) (p : UnitTwoSphere) : |
| 68 | m60SphereConformalFactor g f p = 0 ↔ p ∈ m60SphereBranchSet (n := n) f := by |
| 69 | constructor |
| 70 | · intro h |
| 71 | change mfderiv (𝓡 2) (𝓡 n) f p = 0 |
| 72 | ext v |
| 73 | change mfderiv (𝓡 2) (𝓡 n) f p v = 0 |
| 74 | by_contra hv |
| 75 | have hp := g.pos (f p) _ hv |
| 76 | rw [m60SphereConformalFactor_spec g f hc, h, zero_mul] at hp |
| 77 | exact lt_irrefl 0 hp |
| 78 | · intro h |
| 79 | change mfderiv (𝓡 2) (𝓡 n) f p = 0 at h |
| 80 | simp [m60SphereConformalFactor, h] |
| 81 | |
| 82 | /-- A smooth weakly conformal sphere has a smooth factor even at its |
| 83 | branches. Source: MT Claim 18.12, pp. 426-427, local quotient derivation. -/ |
| 84 | theorem m60SphereConformalFactor_contMDiff (g : RiemannianMetric n M) |
| 85 | (f : UnitTwoSphere → M) (hf : ContMDiff (𝓡 2) (𝓡 n) ∞ f) |
| 86 | (hc : M60WeaklyConformal g f) : |
| 87 | ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ (m60SphereConformalFactor g f) := by |
| 88 | intro p |
| 89 | let v : TangentSpace (𝓡 2) p := EuclideanSpace.basisFun (Fin 2) ℝ 0 |
| 90 | let V := FiberBundle.extend LoopPlane v |
| 91 | have hV : ContMDiffAt (𝓡 2) ((𝓡 2).prod (𝓡 2)) ∞ |
| 92 | (fun q => (⟨q, V q⟩ : TangentBundle (𝓡 2) UnitTwoSphere)) p := |
| 93 | FiberBundle.contMDiffAt_extend (𝓡 2) LoopPlane v |
| 94 | let A : UnitTwoSphere → ℝ := fun q => |
| 95 | M60.metricPullbackForm (n := 2) g f q (V q) (V q) |
| 96 | let B : UnitTwoSphere → ℝ := fun q => m60RoundSphereMetric.inner q (V q) (V q) |
| 97 | have hA : ContMDiffAt (𝓡 2) 𝓘(ℝ, ℝ) ∞ A p := by |
| 98 | have h := (M60.metricPullbackForm_contMDiffAt g (hf p)).clm_bundle_apply₂ |
| 99 | (F₃ := ℝ) (E₃ := Bundle.Trivial UnitTwoSphere ℝ) hV hV |
| 100 | simpa using (Bundle.contMDiffAt_totalSpace.mp h).2 |
| 101 | have hB : ContMDiffAt (𝓡 2) 𝓘(ℝ, ℝ) ∞ B p := by |
| 102 | have h := (m60RoundSphereMetric.contMDiff p).clm_bundle_apply₂ |
| 103 | (F₃ := ℝ) (E₃ := Bundle.Trivial UnitTwoSphere ℝ) hV hV |
| 104 | simpa using (Bundle.contMDiffAt_totalSpace.mp h).2 |
| 105 | have hBp : B p = 1 := by |
| 106 | dsimp only [B, V] |
| 107 | rw [FiberBundle.extend_apply_self, m60RoundSphereMetric_inner, |
| 108 | m60RoundSphereInner_eq_inner] |
| 109 | change inner ℝ (EuclideanSpace.basisFun (Fin 2) ℝ 0) |
| 110 | (EuclideanSpace.basisFun (Fin 2) ℝ 0) = 1 |
| 111 | simp only [real_inner_self_eq_norm_sq, OrthonormalBasis.norm_eq_one, one_pow] |
| 112 | have hne : B p ≠ 0 := by rw [hBp]; norm_num |
| 113 | apply (hA.div₀ hB hne).congr_of_eventuallyEq |
| 114 | filter_upwards [hB.continuousAt.eventually_ne hne] with q hq |
| 115 | change m60SphereConformalFactor g f q = A q / B q |
| 116 | dsimp only [A, B] |
| 117 | rw [M60.metricPullbackForm_apply, m60SphereConformalFactor_spec g f hc, |
| 118 | m60RoundSphereMetric_inner] |
| 119 | exact (mul_div_cancel_right₀ _ hq).symm |
| 120 | |
| 121 | end PoincareMT |