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.ReducedLength.Variation.Adapted.MaximalAdaptedField |
| 2 | import Mathlib.Data.Set.Piecewise |
| 3 | |
| 4 | /-! |
| 5 | # Gluing a restart of adapted transport |
| 6 | |
| 7 | The fields agree on their open interval overlap. Their union is therefore |
| 8 | an actual smooth adapted solution through the original initial value. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open scoped Manifold ContDiff Bundle Topology |
| 14 | open Filter |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.ReducedLength |
| 19 | |
| 20 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 22 | [IsManifold (𝓡 n) ∞ M] [T2Space M] |
| 23 | |
| 24 | theorem exists_adaptedIntervalSolution_union {J : Set ℝ} {F : RicciFlow n M J} |
| 25 | {T : ℝ} {γ : ℝ → M} {U : Set ℝ} {s0 : ℝ} {v0 : TangentSpace (𝓡 n) (γ s0)} |
| 26 | (b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 27 | (htime : U ⊆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 28 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ U) |
| 29 | (A : AdaptedIntervalSolution F T γ U s0 v0) (s : ℝ) (hs : s ∈ A.domain) |
| 30 | (B : AdaptedIntervalSolution F T γ U s (A.field s)) : |
| 31 | ∃ C : AdaptedIntervalSolution F T γ U s0 v0, |
| 32 | C.domain = A.domain ∪ B.domain ∧ |
| 33 | (∀ t ∈ A.domain, C.field t = A.field t) ∧ |
| 34 | (∀ t ∈ B.domain, C.field t = B.field t) := by |
| 35 | classical |
| 36 | have hp := adaptedField_eqOn F T b hb hwindow γ A.field B.field |
| 37 | (A.domain ∩ B.domain) (A.open_domain.inter B.open_domain) |
| 38 | (A.preconnected_domain.ordConnected.inter B.preconnected_domain.ordConnected).isPreconnected |
| 39 | (fun _ ht ↦ htime (A.domain_subset ht.1)) |
| 40 | (hγ.mono (fun _ ht ↦ A.domain_subset ht.1)) |
| 41 | (A.adapted.mono Set.inter_subset_left) (B.adapted.mono Set.inter_subset_right) |
| 42 | s ⟨hs, B.initial_mem⟩ B.initial_value.symm |
| 43 | let P : ∀ t, TangentSpace (𝓡 n) (γ t) := |
| 44 | fun t ↦ if t ∈ A.domain then A.field t else B.field t |
| 45 | have heA : ∀ t ∈ A.domain, P t = A.field t := fun t ht ↦ if_pos ht |
| 46 | have heB : ∀ t ∈ B.domain, P t = B.field t := by |
| 47 | intro t ht |
| 48 | by_cases htA : t ∈ A.domain |
| 49 | · exact (heA t htA).trans (hp t ⟨htA, ht⟩) |
| 50 | · exact if_neg htA |
| 51 | have hgA : ∀ t ∈ A.domain, ∀ᶠ r in 𝓝 t, P r = A.field r := by |
| 52 | intro t ht |
| 53 | filter_upwards [A.open_domain.mem_nhds ht] with r hr using heA r hr |
| 54 | have hgB : ∀ t ∈ B.domain, ∀ᶠ r in 𝓝 t, P r = B.field r := by |
| 55 | intro t ht |
| 56 | filter_upwards [B.open_domain.mem_nhds ht] with r hr using heB r hr |
| 57 | have hP : IsAdaptedFieldOn F T γ P (A.domain ∪ B.domain) := by |
| 58 | apply IsAdaptedFieldOn.of_locally |
| 59 | intro t ht |
| 60 | rcases ht with ht | ht |
| 61 | · exact ⟨A.field, A.domain, A.open_domain, ht, A.adapted, hgA t ht⟩ |
| 62 | · exact ⟨B.field, B.domain, B.open_domain, ht, B.adapted, hgB t ht⟩ |
| 63 | let C : AdaptedIntervalSolution F T γ U s0 v0 := { |
| 64 | domain := A.domain ∪ B.domain |
| 65 | open_domain := A.open_domain.union B.open_domain |
| 66 | preconnected_domain := A.preconnected_domain.union s hs B.initial_mem B.preconnected_domain |
| 67 | initial_mem := Or.inl A.initial_mem |
| 68 | domain_subset := fun _ ht ↦ ht.elim (fun h ↦ A.domain_subset h) (fun h ↦ B.domain_subset h) |
| 69 | field := P |
| 70 | adapted := hP |
| 71 | initial_value := (heA s0 A.initial_mem).trans A.initial_value |
| 72 | } |
| 73 | exact ⟨C, rfl, heA, heB⟩ |
| 74 | |
| 75 | theorem maximalAdaptedDomain_contains_restart {J : Set ℝ} (F : RicciFlow n M J) |
| 76 | (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T ⊆ J) |
| 77 | (γ : ℝ → M) (U : Set ℝ) (hU : IsOpen U) |
| 78 | (htime : U ⊆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) |
| 79 | (hγ : ContMDiffOn (𝓘(ℝ, ℝ)) (𝓡 n) ∞ γ U) |
| 80 | (s0 : ℝ) (hs0 : s0 ∈ U) (v0 : TangentSpace (𝓡 n) (γ s0)) |
| 81 | (s : ℝ) (hs : s ∈ maximalAdaptedDomain F T γ U s0 v0) |
| 82 | (B : AdaptedIntervalSolution F T γ U s (maximalAdaptedField F T γ U s0 v0 s)) : |
| 83 | B.domain ⊆ maximalAdaptedDomain F T γ U s0 v0 := by |
| 84 | let A := maximalAdaptedSolution F T b hb hwindow γ U hU htime hγ s0 hs0 v0 |
| 85 | obtain ⟨C, hC, _, _⟩ := exists_adaptedIntervalSolution_union b hb hwindow htime hγ A s hs B |
| 86 | intro t ht |
| 87 | exact C.domain_subset_maximal (hC.symm ▸ Or.inr ht) |
| 88 | |
| 89 | end PoincareMT.ReducedLength |