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.ReducedGeometry.ReducedVolume.Metric.Comparison.SmoothMetric |
| 2 | import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Basic |
| 3 | |
| 4 | /-! |
| 5 | # Extending one static Euclidean identification to the closed time interval |
| 6 | |
| 7 | The given flow is continuous within its closed time domain. Equality of |
| 8 | each metric pairing with one fixed diffeomorphism on the open backward |
| 9 | interval therefore extends to both endpoints by density. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Bundle ContinuousLinearMap Filter Set |
| 15 | open scoped Manifold ContDiff Bundle Topology |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.ReducedVolume |
| 20 | |
| 21 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 23 | {J : Set ℝ} {F : RicciFlow n M J} {T b : ℝ} |
| 24 | |
| 25 | set_option backward.isDefEq.respectTransparency false in |
| 26 | /-- Every actual fixed tangent pairing is continuous on the closed backward interval. -/ |
| 27 | theorem metric_pairing_continuousOn_backward |
| 28 | (hwindow : Icc (T - b) T ⊆ J) (q : M) (v w : TangentSpace (𝓡 n) q) : |
| 29 | ContinuousOn (fun s : ℝ ↦ (F.metric (T - s)).inner q v w) (Icc 0 b) := by |
| 30 | intro s hs |
| 31 | have htime : T - s ∈ J := hwindow ⟨by linarith [hs.2], by linarith [hs.1]⟩ |
| 32 | have hm := F.smooth.continuousOn (T - s, q) ⟨htime, mem_univ q⟩ |
| 33 | rw [continuousWithinAt_hom_bundle] at hm |
| 34 | have hc : ContinuousWithinAt |
| 35 | (fun z : ℝ × M ↦ inCoordinates (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓡 n)) |
| 36 | (EuclideanSpace ℝ (Fin n) →L[ℝ] ℝ) |
| 37 | (fun y ↦ TangentSpace (𝓡 n) y →L[ℝ] ℝ) |
| 38 | q z.2 q z.2 ((F.metric z.1).inner z.2)) |
| 39 | (J ×ˢ univ) (T - s, q) := hm.2 |
| 40 | have hcoord : ContinuousWithinAt (fun r : ℝ ↦ backwardMetricCoordinates F T q (q, r)) |
| 41 | (Icc 0 b) s := by |
| 42 | apply hc.comp (x := s) |
| 43 | ((continuousAt_const.sub continuousAt_id).prodMk continuousAt_const).continuousWithinAt |
| 44 | intro r hr |
| 45 | change (T - r, q) ∈ J ×ˢ univ |
| 46 | exact ⟨hwindow ⟨by linarith [hr.2], by linarith [hr.1]⟩, mem_univ _⟩ |
| 47 | let L := (trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 48 | (TangentSpace (𝓡 n)) q).continuousLinearMapAt ℝ q |
| 49 | have heval := (hcoord.clm_apply (continuousWithinAt_const (b := L v))).clm_apply |
| 50 | (continuousWithinAt_const (b := L w)) |
| 51 | have heq : (fun r : ℝ ↦ backwardMetricCoordinates F T q (q, r) (L v) (L w)) = |
| 52 | (fun r ↦ (F.metric (T - r)).inner q v w) := by |
| 53 | funext r |
| 54 | exact backwardMetricCoordinates_apply q (q, r) (mem_chart_source _ _) v w |
| 55 | rwa [heq] at heval |
| 56 | |
| 57 | /-- The same interior Euclidean identification extends to both closed time endpoints. -/ |
| 58 | theorem staticEuclideanFlowOn_of_interior_metric_eq |
| 59 | (hb : 0 < b) (hwindow : Icc (T - b) T ⊆ J) |
| 60 | (e : Diffeomorph (𝓡 n) (𝓡 n) M (EuclideanSpace ℝ (Fin n)) ∞) |
| 61 | (heq : ∀ s ∈ Ioo 0 b, ∀ q : M, ∀ v w : TangentSpace (𝓡 n) q, |
| 62 | (F.metric (T - s)).inner q v w = |
| 63 | inner ℝ (mfderiv (𝓡 n) (𝓡 n) e q v) (mfderiv (𝓡 n) (𝓡 n) e q w)) : |
| 64 | IsStaticEuclideanFlowOn F (Icc (T - b) T) := by |
| 65 | refine ⟨e, ?_⟩ |
| 66 | intro t ht q v w |
| 67 | have hopen : EqOn (fun s : ℝ ↦ (F.metric (T - s)).inner q v w) |
| 68 | (fun _ ↦ inner ℝ (mfderiv (𝓡 n) (𝓡 n) e q v) (mfderiv (𝓡 n) (𝓡 n) e q w)) |
| 69 | (Ioo 0 b) := fun s hs ↦ heq s hs q v w |
| 70 | have hclosed := hopen.of_subset_closure (metric_pairing_continuousOn_backward hwindow q v w) |
| 71 | continuousOn_const Ioo_subset_Icc_self (by rw [closure_Ioo hb.ne]) |
| 72 | have htime : T - t ∈ Icc 0 b := ⟨by linarith [ht.2], by linarith [ht.1]⟩ |
| 73 | simpa only [sub_sub_cancel] using hclosed htime |
| 74 | |
| 75 | end PoincareMT.ReducedVolume |