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.Topology.Manifold.Poincare.Final.Compatibility.SourceNames |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.CanonicalInduction.Limit.Cap.LimitCapSourceMetric |
| 3 | |
| 4 | /-! |
| 5 | # Whole-ball bottom distance on the actual finite source |
| 6 | |
| 7 | The M46 quadratic bound controls forward paths inside the original |
| 8 | terminal ball. MT Lemma 17.7; limit-cap-source-distance.md, D2. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option backward.isDefEq.respectTransparency false |
| 13 | |
| 14 | open Set |
| 15 | open scoped Manifold ContDiff Bundle ENNReal |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.M47 |
| 20 | |
| 21 | private theorem finite_source_tangent_bound |
| 22 | {C D : GeneralizedSliceCarrier.{u}} |
| 23 | (g : RiemannianMetric 3 C.carrier) (h : RiemannianMetric 3 D.carrier) |
| 24 | (x : C.carrier) (y : D.carrier) |
| 25 | (v : TangentSpace (𝓡 3) x) (w : TangentSpace (𝓡 3) y) |
| 26 | {Q B : ℝ} (hQ : 0 < Q) (hB : 0 ≤ B) |
| 27 | (hbound : Q * h.inner y w w ≤ B * g.inner x v v) : |
| 28 | h.tangentNorm y w ≤ (Real.sqrt B / Real.sqrt Q) * g.tangentNorm x v := by |
| 29 | have hg : 0 ≤ g.inner x v v := by |
| 30 | by_cases hv : v = 0 |
| 31 | · simp [hv] |
| 32 | · exact (g.pos x v hv).le |
| 33 | change Real.sqrt (h.inner y w w) ≤ |
| 34 | (Real.sqrt B / Real.sqrt Q) * Real.sqrt (g.inner x v v) |
| 35 | apply Real.sqrt_le_iff.mpr |
| 36 | refine ⟨by positivity, ?_⟩ |
| 37 | rw [mul_pow, div_pow, Real.sq_sqrt hB, Real.sq_sqrt hQ.le, Real.sq_sqrt hg, |
| 38 | div_mul_eq_mul_div] |
| 39 | exact (le_div_iff₀ hQ).mpr (by nlinarith only [hbound]) |
| 40 | |
| 41 | /-- Every pair in the actual terminal ball has a fixed normalized |
| 42 | bottom-distance bound, including a cap contact anywhere in that ball. -/ |
| 43 | theorem finite_source_ball_bottom_distance |
| 44 | (P : M44CapPersistencePredecessors.{u}) {F : SurgeryFlowData.{u}} |
| 45 | {C : GeneralizedSliceCarrier.{u}} (hpinch : SurgeryFlowPinched F) |
| 46 | (g : RiemannianMetric 3 C.carrier) (o : C.carrier) |
| 47 | {base Q a T K R : ℝ} (hR : 0 < R) (hK : 0 ≤ K) (ha : a ∈ Icc (-T) 0) |
| 48 | (e : SurgeryFlowCylinder F C base Q (Icc a 0) (g.ball o R)) |
| 49 | (hRm : ∀ s (hs : s ∈ Icc a 0), ∀ x ∈ g.ball o R, |
| 50 | (F.connection (base + s / Q)).curvatureTensorNorm (e.forward s hs x) ≤ K * Q) |
| 51 | (hterminal : ∀ x ∈ g.ball o R, ∀ v : TangentSpace (𝓡 3) x, |
| 52 | e.pullbackInner 0 ⟨ha.2, le_rfl⟩ x v v ≤ 2 * g.inner x v v) : |
| 53 | ∀ contact ∈ g.ball o R, ∀ x ∈ g.ball o R, |
| 54 | (F.metric (base + a / Q)).edist |
| 55 | (e.forward a ⟨le_rfl, ha.2⟩ contact) (e.forward a ⟨le_rfl, ha.2⟩ x) ≤ |
| 56 | ENNReal.ofReal ((2 * Real.sqrt (2 * Real.exp (6 * K * T)) * R) / Real.sqrt Q) := by |
| 57 | let h := F.metric (base + a / Q) |
| 58 | let bottom : a ∈ Icc a 0 := ⟨le_rfl, ha.2⟩ |
| 59 | let L := Real.sqrt (2 * Real.exp (6 * K * T)) |
| 60 | have hQ := e.scale_pos |
| 61 | have hL : 0 < L := Real.sqrt_pos.mpr (by positivity) |
| 62 | have hfactor : 0 < L / Real.sqrt Q := div_pos hL (Real.sqrt_pos.mpr hQ) |
| 63 | have hU : IsOpen (g.ball o R) := M04.initial_ball_isOpen g o R |
| 64 | have hquad (x : C.carrier) (hx : x ∈ g.ball o R) (v : TangentSpace (𝓡 3) x) : |
| 65 | e.pullbackInner a bottom x v v ≤ 2 * Real.exp (6 * K * T) * g.inner x v v := by |
| 66 | calc |
| 67 | _ ≤ Real.exp (6 * K * T) * e.pullbackInner 0 ⟨ha.2, le_rfl⟩ x v v := |
| 68 | finite_source_metric_exp_upper P hpinch e hU ha hK hRm a bottom x hx v |
| 69 | _ ≤ Real.exp (6 * K * T) * (2 * g.inner x v v) := |
| 70 | mul_le_mul_of_nonneg_left (hterminal x hx v) (Real.exp_pos _).le |
| 71 | _ = _ := by ring |
| 72 | have hnorm (x : C.carrier) (hx : x ∈ g.ball o R) (v : TangentSpace (𝓡 3) x) : |
| 73 | h.tangentNorm (e.forward a bottom x) |
| 74 | (mfderiv (𝓡 3) (𝓡 3) (e.forward a bottom) x v) ≤ |
| 75 | (L / Real.sqrt Q) * g.tangentNorm x v := |
| 76 | finite_source_tangent_bound (D := F.slice (base + a / Q)) g h x |
| 77 | (e.forward a bottom x) v (mfderiv (𝓡 3) (𝓡 3) (e.forward a bottom) x v) |
| 78 | hQ (by positivity) (hquad x hx v) |
| 79 | have himage := g.image_ball_subset_ball_of_tangentNorm_le_on_open h |
| 80 | (e.forward a bottom) hU ((e.forward_smooth a bottom).of_le (by simp)) hfactor |
| 81 | hnorm (Subset.refl (g.ball o R)) (le_rfl : (L / Real.sqrt Q) * R ≤ _) |
| 82 | intro contact hcontact x hx |
| 83 | have hc := himage (mem_image_of_mem _ hcontact) |
| 84 | have hx' := himage (mem_image_of_mem _ hx) |
| 85 | change h.edist (e.forward a bottom o) (e.forward a bottom contact) < |
| 86 | ENNReal.ofReal ((L / Real.sqrt Q) * R) at hc |
| 87 | change h.edist (e.forward a bottom o) (e.forward a bottom x) < |
| 88 | ENNReal.ofReal ((L / Real.sqrt Q) * R) at hx' |
| 89 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : (F.slice (base + a / Q)).carrier → |
| 90 | Type _) := ⟨h.toRiemannianMetric⟩ |
| 91 | have hreverse : h.edist (e.forward a bottom contact) (e.forward a bottom o) = |
| 92 | h.edist (e.forward a bottom o) (e.forward a bottom contact) := |
| 93 | Manifold.riemannianEDist_comm |
| 94 | calc |
| 95 | _ ≤ h.edist (e.forward a bottom contact) (e.forward a bottom o) + |
| 96 | h.edist (e.forward a bottom o) (e.forward a bottom x) := |
| 97 | Manifold.riemannianEDist_triangle |
| 98 | _ ≤ ENNReal.ofReal ((L / Real.sqrt Q) * R) + |
| 99 | ENNReal.ofReal ((L / Real.sqrt Q) * R) := by |
| 100 | rw [hreverse] |
| 101 | exact add_le_add hc.le hx'.le |
| 102 | _ = ENNReal.ofReal ((2 * L * R) / Real.sqrt Q) := by |
| 103 | rw [← ENNReal.ofReal_add (by positivity) (by positivity)] |
| 104 | congr 1 |
| 105 | ring |
| 106 | |
| 107 | end PoincareMT.M47 |