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.Comparison.Basic |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Comparison.Distance.PathBounds |
| 3 | /-! |
| 4 | # The actual local surgery output inside a selected child |
| 5 | |
| 6 | Proposition 15.12, Morgan--Tian p. 365. A local metric-preserving embedding |
| 7 | whose image lies in the child is nonexpanding for ambient Riemannian |
| 8 | distances. This transports the event-owned collapse estimate without |
| 9 | identifying ambient distance with distance intrinsic to an embedded image. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle ENNReal Topology |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.SurgeryComparison |
| 19 | |
| 20 | variable {g₀ : StandardInitialMetric} {K : MetricSurgeryConstants} |
| 21 | {P : SurgeryParameters} {slice : ℝ → GeneralizedSliceCarrier.{u}} |
| 22 | {metric : ∀ t, RiemannianMetric 3 (slice t).carrier} {T : ℝ} |
| 23 | (E : SurgeryEventData g₀ K P slice metric T) (i : Fin E.cap_count) |
| 24 | (C : SurgerySelectedComponent (slice T)) |
| 25 | |
| 26 | /-- The event's local embedding expressed in the actual child carrier, |
| 27 | as used in Proposition 15.12, Morgan--Tian p. 365. -/ |
| 28 | noncomputable def localChildEmbedding : |
| 29 | (E.local_result i).output.carrier → C.carrier.carrier := |
| 30 | C.inverse ∘ E.local_embed i |
| 31 | |
| 32 | /-- Restriction to a child containing the entire local output preserves |
| 33 | its actual ambient image (Proposition 15.12, p. 365). -/ |
| 34 | theorem inclusion_localChildEmbedding |
| 35 | (hC : Set.range (E.local_embed i) ⊆ Set.range C.inclusion) |
| 36 | (x : (E.local_result i).output.carrier) : |
| 37 | C.inclusion (localChildEmbedding E i C x) = E.local_embed i x := by |
| 38 | obtain ⟨y, hy⟩ := hC (Set.mem_range_self x) |
| 39 | change C.inclusion (C.inverse (E.local_embed i x)) = E.local_embed i x |
| 40 | rw [← hy, C.left_inverse] |
| 41 | |
| 42 | /-- The local output inclusion is globally smooth once its image is known |
| 43 | to lie in the selected child (Proposition 15.12, p. 365). -/ |
| 44 | theorem localChildEmbedding_smooth |
| 45 | (hC : Set.range (E.local_embed i) ⊆ Set.range C.inclusion) : |
| 46 | ContMDiff (𝓡 3) (𝓡 3) ∞ (localChildEmbedding E i C) := by |
| 47 | apply contMDiffOn_univ.mp |
| 48 | exact C.inverse_smooth.comp (E.local_embed_smooth i).contMDiffOn |
| 49 | (fun x _ => hC (Set.mem_range_self x)) |
| 50 | |
| 51 | /-- The child-valued local embedding preserves the actual output metric. |
| 52 | This uses the two recorded pullbacks, not a global distance isometry; |
| 53 | Proposition 15.12, Morgan--Tian p. 365. -/ |
| 54 | theorem localChildEmbedding_metric |
| 55 | (hC : Set.range (E.local_embed i) ⊆ Set.range C.inclusion) |
| 56 | (gC : RiemannianMetric 3 C.carrier.carrier) |
| 57 | (hpull : ∀ x v w, (metric T).inner (C.inclusion x) |
| 58 | (mfderiv (𝓡 3) (𝓡 3) C.inclusion x v) |
| 59 | (mfderiv (𝓡 3) (𝓡 3) C.inclusion x w) = gC.inner x v w) |
| 60 | (x : (E.local_result i).output.carrier) (v w : TangentSpace (𝓡 3) x) : |
| 61 | gC.inner (localChildEmbedding E i C x) |
| 62 | (mfderiv (𝓡 3) (𝓡 3) (localChildEmbedding E i C) x v) |
| 63 | (mfderiv (𝓡 3) (𝓡 3) (localChildEmbedding E i C) x w) = |
| 64 | (E.local_result i).metric.inner x v w := by |
| 65 | have heq : C.inclusion ∘ localChildEmbedding E i C = E.local_embed i := |
| 66 | funext (inclusion_localChildEmbedding E i C hC) |
| 67 | calc |
| 68 | _ = (metric T).inner ((C.inclusion ∘ localChildEmbedding E i C) x) |
| 69 | (mfderiv (𝓡 3) (𝓡 3) (C.inclusion ∘ localChildEmbedding E i C) x v) |
| 70 | (mfderiv (𝓡 3) (𝓡 3) (C.inclusion ∘ localChildEmbedding E i C) x w) := by |
| 71 | rw [mfderiv_comp x (C.inclusion_smooth.mdifferentiable (by simp) _) |
| 72 | ((localChildEmbedding_smooth E i C hC).mdifferentiable (by simp) x)] |
| 73 | exact (hpull _ _ _).symm |
| 74 | _ = _ := by |
| 75 | rw [heq] |
| 76 | exact E.local_metric i x v w |
| 77 | |
| 78 | /-- The local output inclusion cannot increase ambient distance in the |
| 79 | selected child. This is the embedding step of Proposition 15.12, p. 365. -/ |
| 80 | theorem localChildEmbedding_edist_le |
| 81 | (hC : Set.range (E.local_embed i) ⊆ Set.range C.inclusion) |
| 82 | (gC : RiemannianMetric 3 C.carrier.carrier) |
| 83 | (hpull : ∀ x v w, (metric T).inner (C.inclusion x) |
| 84 | (mfderiv (𝓡 3) (𝓡 3) C.inclusion x v) |
| 85 | (mfderiv (𝓡 3) (𝓡 3) C.inclusion x w) = gC.inner x v w) |
| 86 | (x y : (E.local_result i).output.carrier) : |
| 87 | gC.edist (localChildEmbedding E i C x) (localChildEmbedding E i C y) ≤ |
| 88 | (E.local_result i).metric.edist x y := by |
| 89 | have hb := metric_edist_le_mul_of_pullback (E.local_result i).metric gC |
| 90 | (C := 1) zero_lt_one (localChildEmbedding_smooth E i C hC) |
| 91 | (fun z v => by |
| 92 | rw [localChildEmbedding_metric E i C hC gC hpull] |
| 93 | simp) x y |
| 94 | simpa using hb |
| 95 | |
| 96 | /-- The stored collapse is nonexpanding from intrinsic neck distance |
| 97 | after transport to the actual child. This combines Theorem 13.2(3), |
| 98 | pp. 332-333, with Proposition 15.12, p. 365. -/ |
| 99 | theorem localChildCollapse_edist_le |
| 100 | (hC : Set.range (E.local_embed i) ⊆ Set.range C.inclusion) |
| 101 | (gC : RiemannianMetric 3 C.carrier.carrier) |
| 102 | (hpull : ∀ x v w, (metric T).inner (C.inclusion x) |
| 103 | (mfderiv (𝓡 3) (𝓡 3) C.inclusion x v) |
| 104 | (mfderiv (𝓡 3) (𝓡 3) C.inclusion x w) = gC.inner x v w) |
| 105 | (x : E.terminal.carrier) (hx : x ∈ (E.necks i).neck.carrier) |
| 106 | (y : E.terminal.carrier) (hy : y ∈ (E.necks i).neck.carrier) : |
| 107 | gC.edist (localChildEmbedding E i C ((E.local_result i).collapse x)) |
| 108 | (localChildEmbedding E i C ((E.local_result i).collapse y)) ≤ |
| 109 | intrinsicEDist E.limit_metric (E.necks i).neck.carrier x y := |
| 110 | (localChildEmbedding_edist_le E i C hC gC hpull _ _).trans |
| 111 | ((E.local_result i).distance_decreasing x hx y hy) |
| 112 | |
| 113 | end PoincareMT.SurgeryComparison |