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.Compactness.GeometricLimit.Overlap.SourceMetric |
| 2 | import PoincareLib.Geometry.Riemannian.Coordinates.TransitionLimit |
| 3 | |
| 4 | /-! |
| 5 | # Metric coefficient compatibility on distance-limit overlaps |
| 6 | |
| 7 | The original transitions preserve their source pullback metrics. Convergence |
| 8 | of the coordinate coefficients and transition differentials passes this |
| 9 | identity to the constructed zero-distance transition. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | open Set Filter Metric Poincare.Gluing Poincare.Analysis.Calculus |
| 14 | open scoped Topology NNReal Manifold ContDiff |
| 15 | |
| 16 | namespace PoincareMT.ChartDistance |
| 17 | |
| 18 | variable {ι : Type*} {n : ℕ} |
| 19 | (U : ι → Set (EuclideanSpace ℝ (Fin n))) (hU : ∀ i, IsOpen (U i)) |
| 20 | [∀ i, Nonempty (Piece U i)] |
| 21 | {M : ℕ → Type*} [∀ k, MetricSpace (M k)] |
| 22 | [∀ k, ChartedSpace (EuclideanSpace ℝ (Fin n)) (M k)] |
| 23 | [∀ k, IsManifold (𝓡 n) ∞ (M k)] |
| 24 | {e : ∀ k i, Piece U i → M k} |
| 25 | {D : ∀ i j, C(Piece U i × Piece U j, ℝ)} |
| 26 | (hD : ∀ i j x y, Tendsto (fun k => dist (e k i x) (e k j y)) atTop |
| 27 | (𝓝 (D i j (x, y)))) |
| 28 | (L : ι → ℝ≥0) (he : ∀ k i, LipschitzWith (L i) (e k i)) |
| 29 | (c : ι → ℝ) (hc : ∀ i, 0 < c i) |
| 30 | (hlower : ∀ k i x y, c i * dist x y ≤ dist (e k i x) (e k i y)) |
| 31 | (hopen : ∀ k i, Topology.IsOpenEmbedding (e k i)) |
| 32 | (hconn : ∀ k (p : M k) r, IsPreconnected (ball p r)) |
| 33 | (hsmooth : letI : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 34 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 35 | ∀ k i, IsLocalDiffeomorph (𝓡 n) (𝓡 n) ∞ (e k i)) |
| 36 | |
| 37 | include hD he hc hlower hopen hconn hsmooth in |
| 38 | theorem limit_coefficients_transition |
| 39 | (g : ∀ k, RiemannianMetric n (M k)) |
| 40 | (B : ι → EuclideanSpace ℝ (Fin n) → |
| 41 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 42 | (hB : ∀ i, TendstoLocallyUniformlyOn |
| 43 | (fun k => (g k).pullbackCoefficients (chartParametrization U hU (e k i))) |
| 44 | (B i) atTop (U i)) |
| 45 | (hBcont : ∀ i, ContinuousOn (B i) (U i)) |
| 46 | (i j : ι) |
| 47 | (hbound : LocallyEventuallyBoundedDerivatives |
| 48 | (Subtype.val '' overlap (fun i j => D i j) i j) |
| 49 | (fun k => coordinateRepresentative U hU |
| 50 | (fun x => Function.invFun (e k j) (e k i x)))) : |
| 51 | let f := coordinateRepresentative U hU (transition (fun i j => D i j) i j) |
| 52 | ∀ x ∈ Subtype.val '' overlap (fun i j => D i j) i j, ∀ v w, |
| 53 | B j (f x) (fderiv ℝ f x v) (fderiv ℝ f x w) = B i x v w := by |
| 54 | let : ∀ i, ChartedSpace (EuclideanSpace ℝ (Fin n)) (Piece U i) := |
| 55 | fun i => (hU i).isOpenEmbedding_subtypeVal.singletonChartedSpace |
| 56 | let : ∀ i, IsManifold (𝓡 n) ∞ (Piece U i) := |
| 57 | fun i => (hU i).isOpenEmbedding_subtypeVal.isManifold_singleton |
| 58 | let : ∀ i, LocallyCompactSpace (Piece U i) := fun i => (hU i).locallyCompactSpace |
| 59 | apply CoordinateTransition.pullback_eq_of_tendsto (hU j) |
| 60 | (Aseq := fun k => (g k).pullbackCoefficients (chartParametrization U hU (e k i))) |
| 61 | (Bseq := fun k => (g k).pullbackCoefficients (chartParametrization U hU (e k j))) |
| 62 | (fseq := fun k => coordinateRepresentative U hU |
| 63 | (fun x => Function.invFun (e k j) (e k i x))) |
| 64 | ?_ (hB j) (hBcont j) ?_ ?_ ?_ ?_ |
| 65 | · intro x hx v w |
| 66 | obtain ⟨x, hx, rfl⟩ := hx |
| 67 | exact ((ContinuousLinearMap.apply ℝ ℝ w).continuous.tendsto _).comp |
| 68 | (((ContinuousLinearMap.apply ℝ (_ →L[ℝ] ℝ) v).continuous.tendsto _).comp |
| 69 | ((hB i).tendsto_at x.property)) |
| 70 | · rintro _ ⟨x, hx, rfl⟩ |
| 71 | rw [coordinateRepresentative_apply] |
| 72 | exact (transition (fun i j => D i j) i j x).property |
| 73 | · intro x hx |
| 74 | exact coordinate_source_transition_tendsto U hU hD L he c hc hlower hopen hconn i j hx |
| 75 | · intro x hx v |
| 76 | have hjet := tendsto_coordinate_source_transition_jet U hU hD L he c hc hlower |
| 77 | hopen hconn hsmooth i j hbound 1 hx |
| 78 | have hev := ContinuousMultilinearMap.uniformContinuous_eval_const |
| 79 | (𝕜 := ℝ) (F := EuclideanSpace ℝ (Fin n)) (fun _ : Fin 1 => v) |
| 80 | simpa only [Function.comp_def, iteratedFDeriv_one_apply] using |
| 81 | (hev.continuous.tendsto _).comp hjet |
| 82 | · rintro _ ⟨x, hx, rfl⟩ |
| 83 | obtain ⟨V, _, hxV, K, _, hrep⟩ := |
| 84 | exists_source_transition_neighborhood hD L he c hc hlower hopen hconn hx |
| 85 | filter_upwards [hrep] with k hk v w |
| 86 | exact source_transition_pullbackCoefficients U hU (g k) (hsmooth k i).contMDiff |
| 87 | (hsmooth k j) (hopen k j).injective (hopen k j).isOpen_range x |
| 88 | (image_subset_range _ _ (hk x hxV).1) v w |
| 89 | |
| 90 | end PoincareMT.ChartDistance |