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.Riemannian.MinimalSurface.Sphere.Analysis.Smoothing.Supported.Extension |
| 2 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.Analysis.Smoothing.Supported.Variation |
| 3 | import PoincareLib.Geometry.Riemannian.MinimalSurface.Sphere.StereographicConformal |
| 4 | |
| 5 | /-! |
| 6 | # Compactly supported sphere variations in a target chart |
| 7 | |
| 8 | Morgan-Tian Claim 18.12, printed pp. 426-427, first-variation derivation. |
| 9 | Extend a compact plane displacement through the fixed sphere chart by |
| 10 | zero, then apply the supported target-chart variation. This produces |
| 11 | actual jointly smooth variations allowed by the stationarity contract. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Function |
| 18 | open scoped Manifold ContDiff |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] |
| 26 | |
| 27 | /-- The actual sphere variation associated with a plane displacement |
| 28 | in one target chart. Source: MT Claim 18.12, pp. 426-427. -/ |
| 29 | noncomputable def m60SupportedSphereVariation (b : M) (f : UnitTwoSphere → M) |
| 30 | (V : LoopPlane → EuclideanSpace ℝ (Fin n)) : ℝ × UnitTwoSphere → M := |
| 31 | let c := chartAt (EuclideanSpace ℝ (Fin n)) b |
| 32 | M60.supportedChartVariation c (f ⁻¹' c.source) f |
| 33 | (M60.supportedChartExtension m60SphereChart V) |
| 34 | |
| 35 | /-- Extending through the sphere chart preserves every plane value. |
| 36 | Source: MT Claim 18.12, pp. 426-427, supported variation derivation. -/ |
| 37 | theorem m60SphereDisplacement_parameter (V : LoopPlane → EuclideanSpace ℝ (Fin n)) |
| 38 | (z : LoopPlane) : |
| 39 | M60.supportedChartExtension m60SphereChart V (m60SphereParameter z) = V z := by |
| 40 | have hz : z ∈ m60SphereChart.target := by simp [m60SphereChart] |
| 41 | change M60.supportedChartExtension m60SphereChart V (m60SphereChart.symm z) = V z |
| 42 | rw [M60.supportedChartExtension_of_mem m60SphereChart V (m60SphereChart.map_target hz)] |
| 43 | exact congrArg V (m60SphereChart.right_inv hz) |
| 44 | |
| 45 | /-- The sphere variation starts at the specified sphere map. |
| 46 | Source: MT Claim 18.12, pp. 426-427. -/ |
| 47 | theorem m60SupportedSphereVariation_zero (b : M) (f : UnitTwoSphere → M) |
| 48 | (V : LoopPlane → EuclideanSpace ℝ (Fin n)) (p : UnitTwoSphere) : |
| 49 | m60SupportedSphereVariation b f V (0, p) = f p := |
| 50 | M60.supportedChartVariation_zero _ _ f _ (fun _ hp => hp) p |
| 51 | |
| 52 | /-- On the target patch the plane variation is the affine displacement |
| 53 | followed by the actual inverse chart. Source: MT Claim 18.12, pp. 426-427. -/ |
| 54 | theorem m60SupportedSphereVariation_parameter (b : M) (f : UnitTwoSphere → M) |
| 55 | (V : LoopPlane → EuclideanSpace ℝ (Fin n)) (s : ℝ) (z : LoopPlane) |
| 56 | (hz : f (m60SphereParameter z) ∈ (chartAt (EuclideanSpace ℝ (Fin n)) b).source) : |
| 57 | m60SupportedSphereVariation b f V (s, m60SphereParameter z) = |
| 58 | (chartAt (EuclideanSpace ℝ (Fin n)) b).symm |
| 59 | (chartAt (EuclideanSpace ℝ (Fin n)) b (f (m60SphereParameter z)) + s • V z) := by |
| 60 | rw [m60SupportedSphereVariation, M60.supportedChartVariation_of_mem _ _ f _ s hz, |
| 61 | m60SphereDisplacement_parameter] |
| 62 | |
| 63 | /-- Outside the plane displacement's support the varied plane map is |
| 64 | exactly the original map, for every time. Source: MT Claim 18.12, pp. 426-427. -/ |
| 65 | theorem m60SupportedSphereVariation_eq_of_notMem_tsupport (b : M) |
| 66 | (f : UnitTwoSphere → M) (V : LoopPlane → EuclideanSpace ℝ (Fin n)) |
| 67 | (s : ℝ) {z : LoopPlane} (hz : z ∉ tsupport V) : |
| 68 | m60SupportedSphereVariation b f V (s, m60SphereParameter z) = f (m60SphereParameter z) := by |
| 69 | exact M40.chartPerturb_eq_of_zero (chartAt (EuclideanSpace ℝ (Fin n)) b) |
| 70 | (Prod.snd ⁻¹' (f ⁻¹' (chartAt (EuclideanSpace ℝ (Fin n)) b).source)) (f ∘ Prod.snd) |
| 71 | (fun q : ℝ × UnitTwoSphere => q.1 • M60.supportedChartExtension m60SphereChart V q.2) |
| 72 | (fun _ hp => hp) (by |
| 73 | change s • M60.supportedChartExtension m60SphereChart V (m60SphereParameter z) = 0 |
| 74 | rw [m60SphereDisplacement_parameter, image_eq_zero_of_notMem_tsupport hz, smul_zero]) |
| 75 | |
| 76 | variable [IsManifold (𝓡 n) ∞ M] |
| 77 | |
| 78 | /-- Every smooth compactly supported plane displacement inside a target |
| 79 | chart gives an admissible smooth sphere variation on a positive common |
| 80 | time interval. Source: MT Claim 18.12, pp. 426-427. -/ |
| 81 | theorem m60SupportedSphereVariation_exists_interval (b : M) (f : UnitTwoSphere → M) |
| 82 | (hf : ContMDiff (𝓡 2) (𝓡 n) ∞ f) |
| 83 | (V : LoopPlane → EuclideanSpace ℝ (Fin n)) (hV : ContDiff ℝ ∞ V) |
| 84 | (hcompact : HasCompactSupport V) |
| 85 | (hsupport : ∀ z ∈ tsupport V, |
| 86 | f (m60SphereParameter z) ∈ (chartAt (EuclideanSpace ℝ (Fin n)) b).source) : |
| 87 | ∃ ε : ℝ, 0 < ε ∧ |
| 88 | ContMDiffOn ((𝓘(ℝ, ℝ)).prod (𝓡 2)) (𝓡 n) ∞ (m60SupportedSphereVariation b f V) |
| 89 | (Ioo (-ε) ε ×ˢ (univ : Set UnitTwoSphere)) ∧ |
| 90 | ∀ s ∈ Ioo (-ε) ε, ∀ z : LoopPlane, |
| 91 | f (m60SphereParameter z) ∈ (chartAt (EuclideanSpace ℝ (Fin n)) b).source → |
| 92 | m60SupportedSphereVariation b f V (s, m60SphereParameter z) ∈ |
| 93 | (chartAt (EuclideanSpace ℝ (Fin n)) b).source ∧ |
| 94 | chartAt (EuclideanSpace ℝ (Fin n)) b |
| 95 | (m60SupportedSphereVariation b f V (s, m60SphereParameter z)) = |
| 96 | chartAt (EuclideanSpace ℝ (Fin n)) b (f (m60SphereParameter z)) + s • V z := by |
| 97 | let c := chartAt (EuclideanSpace ℝ (Fin n)) b |
| 98 | let W := M60.supportedChartExtension m60SphereChart V |
| 99 | let U := f ⁻¹' c.source |
| 100 | have hU : IsOpen U := c.open_source.preimage hf.continuous |
| 101 | have htarget : tsupport V ⊆ m60SphereChart.target := by simp [m60SphereChart] |
| 102 | have hchart : ContMDiffOn (𝓡 2) (𝓡 2) ∞ m60SphereChart m60SphereChart.source := by |
| 103 | rw [m60SphereChart_eq_chartAt] |
| 104 | exact contMDiffOn_chart |
| 105 | have hW := M60.contMDiff_supportedChartExtension m60SphereChart hchart hV hcompact htarget |
| 106 | have hWcompact := M60.hasCompactSupport_supportedChartExtension m60SphereChart hcompact htarget |
| 107 | have hWsupport : tsupport W ⊆ U := by |
| 108 | intro p hp |
| 109 | obtain ⟨z, hz, rfl⟩ := M60.tsupport_supportedChartExtension_subset |
| 110 | m60SphereChart hcompact htarget hp |
| 111 | exact hsupport z hz |
| 112 | obtain ⟨ε, hε, hrange⟩ := M60.exists_supportedChartVariation_interval c hU |
| 113 | hf.continuous.continuousOn hW.continuous hWcompact hWsupport (fun _ hp => hp) |
| 114 | refine ⟨ε, hε, M60.contMDiffOn_supportedChartVariation c hU hf hW |
| 115 | contMDiffOn_chart contMDiffOn_chart_symm hWsupport (fun _ hp => hp) hrange, ?_⟩ |
| 116 | intro s hs z hz |
| 117 | rw [m60SupportedSphereVariation_parameter b f V s z hz] |
| 118 | have hr : c (f (m60SphereParameter z)) + s • V z ∈ c.target := by |
| 119 | simpa only [W, m60SphereDisplacement_parameter] using hrange s hs (m60SphereParameter z) hz |
| 120 | exact ⟨c.map_target hr, c.right_inv hr⟩ |
| 121 | |
| 122 | end PoincareMT |