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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.SourceGeometry.NeckGeometry.SourceNeckRegion |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.CapGeometry.CapScalarBand |
| 4 | |
| 5 | /-! |
| 6 | # The whole-path cap barrier from actual source-neck contact |
| 7 | |
| 8 | Morgan--Tian Claim 10.4, pp. 249-251. Scalar control at an actual point of |
| 9 | the selected neck union puts a contacting cap in the original minimizing |
| 10 | region and excludes both original endpoints. The relative cap barrier then |
| 11 | excludes its closed core from the whole path. A later boundary hit need not |
| 12 | be localized to the retained scalar band. The source carrier is unchanged. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.M28 |
| 23 | |
| 24 | /-- Contact with the actual source-neck union places a cap in the original |
| 25 | scalar component and excludes its closed core from the entire original |
| 26 | regional minimizer. The scalar bounds are derived at the contact point; |
| 27 | there is no scalar-band or retained-time premise on a potential later hit. -/ |
| 28 | theorem exists_source_cap_whole_path_avoidance_accuracy : |
| 29 | ∃ epsilon₀ : ℝ, 0 < epsilon₀ ∧ epsilon₀ ≤ (1 / 200 : ℝ) ∧ |
| 30 | ∀ {epsilon C A D₀ D : ℝ} (E : SameTimeCounterexample.{u} epsilon C A D₀ D) |
| 31 | (S : CounterexampleNeckSegment E), |
| 32 | 0 < E.flow.scalar ⟨E.time, E.basepoint⟩ → epsilon ≤ epsilon₀ → |
| 33 | ∀ K : CapCertificate (E.flow.metric E.time), K.epsilon = epsilon → |
| 34 | K.cap_constant ≤ C → ∀ x ∈ S.neckCarrierUnion, x ∈ K.carrier → |
| 35 | K.carrier ⊆ S.source_region.cover.X ∧ |
| 36 | S.path 0 ∉ K.carrier ∧ S.path 1 ∉ K.carrier ∧ |
| 37 | Disjoint K.closed_core (S.path '' Icc (0 : ℝ) 1) := by |
| 38 | obtain ⟨epsilonR, hRpos, hRsmall, hregion⟩ := |
| 39 | exists_source_neck_region_accuracy.{u} |
| 40 | let epsilon₀ := min epsilonR neckShorteningEpsilon |
| 41 | refine ⟨epsilon₀, lt_min hRpos neckShorteningEpsilon_pos, |
| 42 | (min_le_left _ _).trans hRsmall, ?_⟩ |
| 43 | intro epsilon C A D₀ D E S hQ hsmall K hepsilon hKC x hx hxK |
| 44 | obtain ⟨hcomponent, _, hbounds⟩ := |
| 45 | hregion E S hQ (hsmall.trans (min_le_left _ _)) |
| 46 | obtain ⟨hlow, hhigh⟩ := hbounds x hx |
| 47 | let B := max C 2 |
| 48 | let Q := E.flow.scalar ⟨E.time, E.basepoint⟩ |
| 49 | have hB : 2 ≤ B := le_max_right C 2 |
| 50 | have hBpos : 0 < B := lt_of_lt_of_le (by norm_num) hB |
| 51 | have hKB : K.cap_constant ≤ B := hKC.trans (le_max_left C 2) |
| 52 | have hBsq : 2 * B ≤ B ^ 2 := by |
| 53 | simpa only [pow_two] using mul_le_mul_of_nonneg_right hB hBpos.le |
| 54 | have hBsqQ := mul_le_mul_of_nonneg_right hBsq hQ.le |
| 55 | have hlow' : 16 * B * Q ≤ (E.flow.connection E.time).scalarCurvature x := by |
| 56 | change 16 * B * Q ≤ E.flow.scalar ⟨E.time, x⟩ |
| 57 | nlinarith only [hlow, hBsqQ] |
| 58 | have hcap : K.carrier ⊆ S.source_region.cover.X := by |
| 59 | have hsub := K.carrier_subset_scalar_component |
| 60 | (E.flow.connection E.time) hKB hQ hxK hlow' |
| 61 | change K.carrier ⊆ connectedComponentIn |
| 62 | {p | 4 * Q < E.flow.scalar ⟨E.time, p⟩} x at hsub |
| 63 | have heq := connectedComponentIn_eq |
| 64 | (S.source_region.cover_set ▸ hcomponent hx) |
| 65 | rw [← heq, ← S.source_region.cover_set] at hsub |
| 66 | exact hsub |
| 67 | have hstart : S.path 0 ∉ K.carrier := by |
| 68 | intro hmem |
| 69 | have hratio := K.scalar_lt_mul (E.flow.connection E.time) hKB hmem hxK |
| 70 | change E.flow.scalar ⟨E.time, x⟩ < B * E.flow.scalar ⟨E.time, S.path 0⟩ |
| 71 | at hratio |
| 72 | have hscale := mul_le_mul_of_nonneg_left S.source_region.lower_scalar hBpos.le |
| 73 | nlinarith only [hratio, hscale, hlow] |
| 74 | have hend : S.path 1 ∉ K.carrier := by |
| 75 | intro hmem |
| 76 | have hratio := K.scalar_lt_mul (E.flow.connection E.time) hKB hxK hmem |
| 77 | change E.flow.scalar ⟨E.time, S.path 1⟩ < B * E.flow.scalar ⟨E.time, x⟩ |
| 78 | at hratio |
| 79 | have hcut : E.flow.scalar ⟨E.time, S.path S.upper⟩ * (2 * B) = |
| 80 | E.flow.scalar ⟨E.time, S.path 1⟩ := by |
| 81 | rw [S.upper_scalar_eq] |
| 82 | exact div_mul_cancel₀ _ (mul_pos (by norm_num) hBpos).ne' |
| 83 | have hscale := mul_le_mul_of_nonneg_left hhigh hBpos.le |
| 84 | nlinarith only [hratio, hcut, hscale] |
| 85 | refine ⟨hcap, hstart, hend, ?_⟩ |
| 86 | apply disjoint_left.mpr |
| 87 | rintro y hycore ⟨t, ht, rfl⟩ |
| 88 | have hshort : K.epsilon ≤ neckShorteningEpsilon := by |
| 89 | rw [hepsilon] |
| 90 | exact hsmall.trans (min_le_right _ _) |
| 91 | rcases K.endpoint_mem_of_intrinsic_minimizer hshort |
| 92 | (hcap.trans S.source_region.cover_subset) ht S.path_smooth |
| 93 | S.source_region.path_mem S.source_region.finite_length |
| 94 | S.source_region.minimizing hycore with hzero | hone |
| 95 | · exact hstart hzero |
| 96 | · exact hend hone |
| 97 | |
| 98 | end PoincareMT.M28 |