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.Uniqueness.Imports |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.RawFlow.SectionalDistanceSupport |
| 3 | |
| 4 | /-! |
| 5 | # Time supports for the sectional distance barrier |
| 6 | |
| 7 | Morgan-Tian Lemma 12.6, p. 297. The actual distance majorant and sectional |
| 8 | velocity supply the upper time test required by compact comparison. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | set_option backward.isDefEq.respectTransparency false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | |
| 17 | namespace PoincareMT.M35.Uniqueness |
| 18 | |
| 19 | theorem raw_sectional_barrier_time_support {g₀ : StandardInitialMetric} |
| 20 | (G : PartialStandardCapFlow g₀) {s K C ε : ℝ} |
| 21 | (hs : s ∈ Ico 0 G.lifetime) (hε : 0 < ε) |
| 22 | (hnorm : ∀ x, (G.flow.connection s).curvatureTensorNorm x ≤ K) |
| 23 | {S : Set StandardCapSpace} (y : StandardCapSpace × StandardSectionalPair) |
| 24 | (hyS : y.1 ∈ interior S) |
| 25 | (hsupp : ∀ η > 0, ∃ ψ : ℝ → StandardCapSpace → ℝ, ∃ v : ℝ, |
| 26 | ContMDiffAt (𝓡 3) 𝓘(ℝ, ℝ) ∞ (ψ s) y.1 ∧ |
| 27 | ψ s y.1 = rawDistanceSquare G 0 s y.1 ∧ |
| 28 | (∀ᶠ a in 𝓝 y.1, rawDistanceSquare G 0 s a ≤ ψ s a) ∧ |
| 29 | (∀ r ∈ Icc 0 s, rawDistanceSquare G 0 r y.1 ≤ ψ r y.1) ∧ |
| 30 | HasDerivAt (fun r => ψ r y.1) v s ∧ |
| 31 | -C * rawDistanceSquare G 0 s y.1 - η ≤ |
| 32 | v - (G.flow.connection s).laplacian (ψ s) y.1) : |
| 33 | let w := fun r (z : StandardCapSpace × StandardSectionalPair) => |
| 34 | rawSectionalRayleigh G r z + |
| 35 | ε * Real.exp ((C + 11 * K) * r) * rawDistanceSquare G 0 r z.1 |
| 36 | (∀ z : StandardCapSpace × StandardSectionalPair, z.1 ∈ S → w s y ≤ w s z) → |
| 37 | w s y < 0 → ∀ δ > 0, ∃ χ : ℝ → ℝ, ∃ v : ℝ, |
| 38 | χ s = w s y ∧ (∀ᶠ r in 𝓝[Icc 0 s] s, w r y ≤ χ r) ∧ |
| 39 | HasDerivWithinAt χ v (Icc 0 s) s ∧ -(-(11 * K)) * w s y - δ ≤ v := by |
| 40 | intro w hmin hneg δ hδ |
| 41 | let q := rawSectionalRayleigh G |
| 42 | let μ := rawDistanceSquare G (0 : StandardCapSpace) |
| 43 | let L := 11 * K |
| 44 | let A := C + L |
| 45 | let c := ε * Real.exp (A * s) |
| 46 | have hc : 0 < c := mul_pos hε (Real.exp_pos _) |
| 47 | have hμ : 0 < μ s y.1 := by dsimp [μ, rawDistanceSquare]; positivity |
| 48 | obtain ⟨ψ, vμ, hψsmooth, hψtouch, hψspace, hψtime, hψderiv, hψheat⟩ := |
| 49 | hsupp (δ / c) (by positivity) |
| 50 | obtain ⟨vq, hdq, hqheat⟩ := raw_sectional_velocity_at_distance_minimum G |
| 51 | hs hc y hyS hψsmooth hψtouch hψspace hmin |
| 52 | have hqneg : q s y < 0 := by |
| 53 | change q s y + c * μ s y.1 < 0 at hneg |
| 54 | have hprod := mul_pos hc hμ |
| 55 | linarith |
| 56 | have hrate := rawSectionalRayleigh_reaction_bound G hnorm y |
| 57 | have hqvelocity : L * q s y ≤ vq + c * (G.flow.connection s).laplacian (ψ s) y.1 := by |
| 58 | have hh := mul_le_mul_of_nonpos_left hrate hqneg.le |
| 59 | change -(c * (G.flow.connection s).laplacian (ψ s) y.1) + |
| 60 | q s y * ((G.flow.connection s).scalarCurvature y.1 - 2 * q s y) ≤ vq at hqheat |
| 61 | dsimp only [L] |
| 62 | nlinarith only [hh, hqheat] |
| 63 | let χ : ℝ → ℝ := fun r => q r y + ε * Real.exp (A * r) * ψ r y.1 |
| 64 | have htouch : χ s = w s y := by dsimp [χ, w]; rw [hψtouch] |
| 65 | have htime : ∀ᶠ r in 𝓝[Icc 0 s] s, w r y ≤ χ r := by |
| 66 | filter_upwards [self_mem_nhdsWithin] with r hr |
| 67 | exact add_le_add le_rfl (mul_le_mul_of_nonneg_left (hψtime r hr) (by positivity)) |
| 68 | have hederiv : HasDerivAt (fun r => ε * Real.exp (A * r)) (c * A) s := by |
| 69 | convert! (((hasDerivAt_id s).const_mul A).exp.const_mul ε) using 1 |
| 70 | dsimp only [c, id_eq] |
| 71 | ring |
| 72 | have hderiv : HasDerivWithinAt χ (vq + c * (A * ψ s y.1 + vμ)) (Icc 0 s) s := by |
| 73 | convert! (hdq.mono (show Icc 0 s ⊆ Ico 0 G.lifetime from |
| 74 | fun r hr => ⟨hr.1, hr.2.trans_lt hs.2⟩)).add |
| 75 | (hederiv.mul hψderiv).hasDerivWithinAt using 1 |
| 76 | ring |
| 77 | refine ⟨χ, vq + c * (A * ψ s y.1 + vμ), htouch, htime, hderiv, ?_⟩ |
| 78 | have hδeq : c * (δ / c) = δ := mul_div_cancel₀ δ hc.ne' |
| 79 | have hscaled := mul_le_mul_of_nonneg_left hψheat hc.le |
| 80 | rw [mul_sub, hδeq] at hscaled |
| 81 | rw [hψtouch] |
| 82 | change -(-L) * (q s y + c * μ s y.1) - δ ≤ vq + c * (A * μ s y.1 + vμ) |
| 83 | change c * (-C * μ s y.1) - δ ≤ |
| 84 | c * (vμ - (G.flow.connection s).laplacian (ψ s) y.1) at hscaled |
| 85 | dsimp only [A] |
| 86 | nlinarith only [hqvelocity, hscaled] |
| 87 | |
| 88 | end PoincareMT.M35.Uniqueness |