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.Blowup.Construction.PartialLimits.CoordinateMetricFamily |
| 2 | import PoincareLib.Geometry.RicciFlow.Blowup.Construction.PartialLimits.WithinFlowService |
| 3 | |
| 4 | /-! |
| 5 | # Actual local flows from coordinate coefficients |
| 6 | |
| 7 | The canonical chart of an open Euclidean subtype identifies its actual |
| 8 | metric coefficients with the given bilinear field. Full within jets on |
| 9 | that same domain therefore feed the explicit lower flow supplier. |
| 10 | |
| 11 | This is the local flow-realization step of Morgan--Tian Proposition 5.14, |
| 12 | pp. 90-91. The lower supplier remains an explicit hypothesis; its equation |
| 13 | limit theorem is not rederived here. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set Filter TopologicalSpace |
| 20 | open scoped Manifold ContDiff Bundle Topology |
| 21 | |
| 22 | namespace PoincareMT.M30 |
| 23 | |
| 24 | private theorem opens_extChartAt_target |
| 25 | {n : ℕ} (U : Opens (EuclideanSpace ℝ (Fin n))) (p : U) : |
| 26 | (extChartAt (𝓡 n) p).target = (U : Set (EuclideanSpace ℝ (Fin n))) := by |
| 27 | simp [Opens.chartAt_eq, OpenPartialHomeomorph.subtypeRestr] |
| 28 | |
| 29 | private theorem pullbackCoefficients_opensChart |
| 30 | {n : ℕ} (U : Opens (EuclideanSpace ℝ (Fin n))) |
| 31 | (g : RiemannianMetric n U) (p x : U) : |
| 32 | g.pullbackCoefficients (extChartAt (𝓡 n) p).symm |
| 33 | (x : EuclideanSpace ℝ (Fin n)) = g.inner x := by |
| 34 | have hd := mfderivWithin_range_extChartAt_symm (I := 𝓡 n) (x := x) |
| 35 | rw [ModelWithCorners.range_eq_univ, mfderivWithin_univ] at hd |
| 36 | have hc : extChartAt (𝓡 n) p = extChartAt (𝓡 n) x := by |
| 37 | simp [extChartAt, Opens.chartAt_eq] |
| 38 | rw [hc] |
| 39 | ext v w |
| 40 | change g.inner ((extChartAt (𝓡 n) x).symm x) |
| 41 | (mfderiv (𝓡 n) (𝓡 n) (extChartAt (𝓡 n) x).symm x v) |
| 42 | (mfderiv (𝓡 n) (𝓡 n) (extChartAt (𝓡 n) x).symm x w) = g.inner x v w |
| 43 | have hx : (extChartAt (𝓡 n) x).symm (x : EuclideanSpace ℝ (Fin n)) = x := |
| 44 | (extChartAt (𝓡 n) x).left_inv (mem_extChartAt_source x) |
| 45 | change mfderiv (𝓡 n) (𝓡 n) (extChartAt (𝓡 n) x).symm |
| 46 | (x : EuclideanSpace ℝ (Fin n)) = ContinuousLinearMap.id ℝ _ at hd |
| 47 | rw [hd, hx] |
| 48 | rfl |
| 49 | |
| 50 | set_option synthInstance.maxHeartbeats 100000 in |
| 51 | -- The full bilinear within jets require additional dependent instance search. |
| 52 | /-- Actual source flows and positive coordinate limits give a local flow, |
| 53 | conditional on the exact lower within-jet supplier (Proposition 5.14, |
| 54 | pp. 90-91). The open carrier and all included times are preserved. -/ |
| 55 | theorem exists_flow_of_coordinate_coefficients |
| 56 | (hFlow : WithinBilinearFlowService.{0}) |
| 57 | {n : ℕ} (U : Opens (EuclideanSpace ℝ (Fin n))) |
| 58 | {J : Set ℝ} (hJ : UniqueDiffOn ℝ J) |
| 59 | (Fseq : ℕ → RicciFlow n U J) |
| 60 | (Bseq : ℕ → ℝ × EuclideanSpace ℝ (Fin n) → |
| 61 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 62 | (B : ℝ × EuclideanSpace ℝ (Fin n) → |
| 63 | EuclideanSpace ℝ (Fin n) →L[ℝ] EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 64 | (hB : ContDiffOn ℝ ∞ B (J ×ˢ (U : Set (EuclideanSpace ℝ (Fin n))))) |
| 65 | (hcoeff : ∀ k t, t ∈ J → ∀ (x : U) (v w : TangentSpace (𝓡 n) x), |
| 66 | ((Fseq k).metric t).inner x v w = Bseq k (t, x) v w) |
| 67 | (hsymm : ∀ t ∈ J, ∀ x ∈ U, ∀ v w, B (t, x) v w = B (t, x) w v) |
| 68 | (hlower : ∀ t ∈ J, ∀ x ∈ U, ∃ c : ℝ, 0 < c ∧ |
| 69 | ∀ v, c * ‖v‖ ^ 2 ≤ B (t, x) v v) |
| 70 | (hjets : ∀ m (K : Set (ℝ × EuclideanSpace ℝ (Fin n))), |
| 71 | IsCompact K → K ⊆ J ×ˢ (U : Set (EuclideanSpace ℝ (Fin n))) → |
| 72 | TendstoUniformlyOn |
| 73 | (fun k => iteratedFDerivWithin ℝ m (Bseq k) |
| 74 | (J ×ˢ (U : Set (EuclideanSpace ℝ (Fin n))))) |
| 75 | (iteratedFDerivWithin ℝ m B |
| 76 | (J ×ˢ (U : Set (EuclideanSpace ℝ (Fin n))))) atTop K) : |
| 77 | ∃ F : RicciFlow n U J, ∀ t ∈ J, |
| 78 | ∀ (x : U) (v w : TangentSpace (𝓡 n) x), |
| 79 | (F.metric t).inner x v w = B (t, x) v w := by |
| 80 | obtain ⟨t₀, ht₀⟩ := (Fseq 0).nontrivial.nonempty |
| 81 | obtain ⟨g, hg, hgcoeff⟩ := |
| 82 | exists_smooth_metricFamily_of_coefficients U t₀ ht₀ B hB hsymm hlower |
| 83 | obtain ⟨F, hF⟩ := hFlow Fseq g hJ hg (by |
| 84 | intro p m K hK hKdomain |
| 85 | rw [opens_extChartAt_target U p] at hKdomain ⊢ |
| 86 | have hsource (k : ℕ) : EqOn |
| 87 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 88 | ((Fseq k).metric z.1).pullbackCoefficients (extChartAt (𝓡 n) p).symm z.2) |
| 89 | (Bseq k) (J ×ˢ (U : Set (EuclideanSpace ℝ (Fin n)))) := by |
| 90 | intro z hz |
| 91 | dsimp only |
| 92 | rw [pullbackCoefficients_opensChart U ((Fseq k).metric z.1) p ⟨z.2, hz.2⟩] |
| 93 | ext v w |
| 94 | exact hcoeff k z.1 hz.1 ⟨z.2, hz.2⟩ v w |
| 95 | have htarget : EqOn |
| 96 | (fun z : ℝ × EuclideanSpace ℝ (Fin n) => |
| 97 | (g z.1).pullbackCoefficients (extChartAt (𝓡 n) p).symm z.2) |
| 98 | B (J ×ˢ (U : Set (EuclideanSpace ℝ (Fin n)))) := by |
| 99 | intro z hz |
| 100 | dsimp only |
| 101 | rw [pullbackCoefficients_opensChart U (g z.1) p ⟨z.2, hz.2⟩] |
| 102 | ext v w |
| 103 | exact hgcoeff z.1 hz.1 ⟨z.2, hz.2⟩ v w |
| 104 | exact ((hjets m K hK hKdomain).congr |
| 105 | (Eventually.of_forall fun k => |
| 106 | ((hsource k).iteratedFDerivWithin m).symm.mono hKdomain)).congr_right |
| 107 | ((htarget.iteratedFDerivWithin m).symm.mono hKdomain)) |
| 108 | refine ⟨F, ?_⟩ |
| 109 | simpa only [hF] using hgcoeff |
| 110 | |
| 111 | end PoincareMT.M30 |