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.PartialLimits.RegularSets.EuclideanImageDistance |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Analysis.Geometry.CanonicalDomainInclusion |
| 4 | |
| 5 | /-! |
| 6 | # Literal pullback metrics on canonical coordinate domains |
| 7 | |
| 8 | Every source metric is pulled back by the |
| 9 | given partial diffeomorphism restricted to its actual open image. The |
| 10 | canonical coordinate derivative is the identity, and the original-region |
| 11 | distance bridge retains this exact pullback. |
| 12 | Source: Morgan--Tian pp. 263-265; M28 derivation159, Sections2-3. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 21 | |
| 22 | namespace PoincareMT.M28 |
| 23 | |
| 24 | local notation "E" => EuclideanSpace ℝ (Fin 3) |
| 25 | |
| 26 | variable {N : Type*} [TopologicalSpace N] [ChartedSpace E N] [IsManifold (𝓡 3) ∞ N] |
| 27 | |
| 28 | /-- Pull the actual ambient metric back by the given chart onto the |
| 29 | canonical source domain, using its literal open image. |
| 30 | Source: MT pp. 263-265; derivation159, Section2. -/ |
| 31 | def canonicalImageMetric |
| 32 | (g : RiemannianMetric 3 N) |
| 33 | (e : PartialDiffeomorph (𝓡 3) (𝓡 3) E N ∞) |
| 34 | (V : TopologicalSpace.Opens E) [Nonempty V] |
| 35 | (hsource : (V : Set E) ⊆ e.source) : |
| 36 | letI := V.isOpen.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 37 | letI := V.isOpen.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 3) (n := ∞) |
| 38 | RiemannianMetric 3 V := by |
| 39 | let := V.isOpen.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 40 | let := V.isOpen.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 3) (n := ∞) |
| 41 | let W : TopologicalSpace.Opens N := |
| 42 | ⟨e '' (V : Set E), e.toOpenPartialHomeomorph.isOpen_image_of_subset_source |
| 43 | V.isOpen hsource⟩ |
| 44 | let D := e.diffeomorphOnCanonicalSource V W hsource rfl |
| 45 | exact g.pullbackOfLocalDiffeomorph ((Subtype.val : W → N) ∘ D) |
| 46 | (diffeomorph_openImageMap_isLocalDiffeomorph W D) |
| 47 | |
| 48 | /-- In the fixed singleton chart the pullback metric has the original |
| 49 | ambient pullback coefficients, with no change of coordinates. |
| 50 | Source: MT pp. 263-265; derivation159, Section2. -/ |
| 51 | theorem canonicalImageMetric_inner |
| 52 | (g : RiemannianMetric 3 N) |
| 53 | (e : PartialDiffeomorph (𝓡 3) (𝓡 3) E N ∞) |
| 54 | (V : TopologicalSpace.Opens E) [Nonempty V] |
| 55 | (hsource : (V : Set E) ⊆ e.source) : |
| 56 | letI := V.isOpen.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 57 | letI := V.isOpen.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 3) (n := ∞) |
| 58 | ∀ (x : V) (v w : E), |
| 59 | (canonicalImageMetric g e V hsource).inner x v w = |
| 60 | g.pullbackCoefficients e x v w := by |
| 61 | let := V.isOpen.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 62 | let := V.isOpen.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 3) (n := ∞) |
| 63 | intro x v w |
| 64 | have hi : MDifferentiableAt (𝓡 3) (𝓡 3) (Subtype.val : V → E) x := |
| 65 | (Poincare.isLocalDiffeomorph_subtypeVal |
| 66 | (𝓡 3) (V : Set E) V.isOpen ∞ x).mdifferentiableAt (by simp) |
| 67 | have he : MDifferentiableAt (𝓡 3) (𝓡 3) e (x : E) := |
| 68 | e.mdifferentiableAt (by simp) (hsource x.property) |
| 69 | have hdval : mfderiv (𝓡 3) (𝓡 3) (Subtype.val : V → E) x = |
| 70 | ContinuousLinearMap.id ℝ E := mfderiv_extChartAt_self |
| 71 | have hderiv (z : E) : mfderiv (𝓡 3) (𝓡 3) (e ∘ (Subtype.val : V → E)) x z = |
| 72 | mfderiv (𝓡 3) (𝓡 3) e (x : E) z := by |
| 73 | have hcomp := mfderiv_comp_apply x he hi z |
| 74 | have hdz : mfderiv (𝓡 3) (𝓡 3) (Subtype.val : V → E) x z = z := |
| 75 | congrArg (fun L : E →L[ℝ] E => L z) hdval |
| 76 | exact hcomp.trans (congrArg (mfderiv (𝓡 3) (𝓡 3) e (x : E)) hdz) |
| 77 | change g.inner (e (x : E)) |
| 78 | (mfderiv (𝓡 3) (𝓡 3) (e ∘ (Subtype.val : V → E)) x v) |
| 79 | (mfderiv (𝓡 3) (𝓡 3) (e ∘ (Subtype.val : V → E)) x w) = |
| 80 | g.inner (e (x : E)) (mfderiv (𝓡 3) (𝓡 3) e (x : E) v) |
| 81 | (mfderiv (𝓡 3) (𝓡 3) e (x : E) w) |
| 82 | rw [hderiv v, hderiv w] |
| 83 | |
| 84 | /-- The checked image-buffer theorem identifies this concrete pullback |
| 85 | distance with the unchanged original open region on the inner ball. |
| 86 | Both finiteness bounds are retained before taking real values. |
| 87 | Source: MT pp. 263-265; derivations132 and159, Section3. -/ |
| 88 | theorem canonicalImageMetric_originalOpen_edist |
| 89 | [T2Space N] (g : RiemannianMetric 3 N) |
| 90 | (e : PartialDiffeomorph (𝓡 3) (𝓡 3) E N ∞) |
| 91 | (U : TopologicalSpace.Opens N) {a : ℝ} (ha : 0 < a) |
| 92 | (hsource : Metric.ball (0 : E) a ⊆ e.source) |
| 93 | (hinside : e '' Metric.ball (0 : E) a ⊆ (U : Set N)) |
| 94 | (hbound : ∀ z ∈ Metric.ball (0 : E) a, ∀ v : E, |
| 95 | (1 / 8 : ℝ) * ‖v‖ ^ 2 ≤ g.pullbackCoefficients e z v v ∧ |
| 96 | g.pullbackCoefficients e z v v ≤ (9 / 2 : ℝ) * ‖v‖ ^ 2) : |
| 97 | let V : TopologicalSpace.Opens E := ⟨Metric.ball 0 a, Metric.isOpen_ball⟩ |
| 98 | letI : Nonempty V := ⟨⟨0, Metric.mem_ball_self ha⟩⟩ |
| 99 | letI := V.isOpen.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 100 | letI := V.isOpen.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 3) (n := ∞) |
| 101 | ∀ (x y : V), x.val ∈ Metric.closedBall (0 : E) (a / 64) → |
| 102 | y.val ∈ Metric.closedBall (0 : E) (a / 64) → |
| 103 | (intrinsicOpenMetric g U).edist |
| 104 | ⟨e x, hinside ⟨x, x.property, rfl⟩⟩ |
| 105 | ⟨e y, hinside ⟨y, y.property, rfl⟩⟩ = |
| 106 | (canonicalImageMetric g e V hsource).edist x y ∧ |
| 107 | (canonicalImageMetric g e V hsource).edist x y ≤ |
| 108 | ENNReal.ofReal (Real.sqrt (9 / 2 : ℝ)) * edist (x : E) (y : E) ∧ |
| 109 | (canonicalImageMetric g e V hsource).edist x y < ENNReal.ofReal (a / 8) := by |
| 110 | intro V |
| 111 | let : Nonempty V := ⟨⟨0, Metric.mem_ball_self ha⟩⟩ |
| 112 | let := V.isOpen.isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 113 | let := V.isOpen.isOpenEmbedding_subtypeVal.isManifold_singleton (I := 𝓡 3) (n := ∞) |
| 114 | intro x y hx hy |
| 115 | let W : TopologicalSpace.Opens N := |
| 116 | ⟨e '' (V : Set E), e.toOpenPartialHomeomorph.isOpen_image_of_subset_source |
| 117 | V.isOpen hsource⟩ |
| 118 | let D := e.diffeomorphOnCanonicalSource V W hsource rfl |
| 119 | exact originalOpen_edist_eq_openImagePullback_of_euclidean_bounds |
| 120 | g e U W ha hsource rfl hinside |
| 121 | (fun z hz v => (hbound z hz v).1) (fun z hz v => (hbound z hz v).2) |
| 122 | D x y hx hy rfl rfl |
| 123 | |
| 124 | end PoincareMT.M28 |