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.Analysis.Elliptic.Regularity.Iteration.Bootstrap |
| 2 | import PoincareLib.Analysis.Elliptic.Regularity.Sobolev.Embedding.SmoothRepresentative |
| 3 | |
| 4 | /-! |
| 5 | # Smooth representatives of weak elliptic eigenfunctions |
| 6 | |
| 7 | Compact-local L2 hypotheses and the original distributional equation give |
| 8 | every local Sobolev order. Sobolev embedding and uniqueness of continuous |
| 9 | representatives then give a smooth representative on the open domain. |
| 10 | -/ |
| 11 | |
| 12 | open Set MeasureTheory |
| 13 | open scoped ContDiff |
| 14 | |
| 15 | namespace Poincare.Analysis.Elliptic |
| 16 | |
| 17 | theorem exists_smooth_representative |
| 18 | {n : ℕ} (hn : 0 < n) |
| 19 | {O : Set (EuclideanSpace ℝ (Fin n))} (hO : IsOpen O) |
| 20 | (A : EuclideanSpace ℝ (Fin n) → Matrix (Fin n) (Fin n) ℝ) |
| 21 | (c u : EuclideanSpace ℝ (Fin n) → ℝ) |
| 22 | (p : Fin n → EuclideanSpace ℝ (Fin n) → ℝ) |
| 23 | (hA : ∀ i j, ContDiffOn ℝ ∞ (fun x => A x i j) O) |
| 24 | (hpos : ∀ x ∈ O, (A x).PosDef) |
| 25 | (hc : ContDiffOn ℝ ∞ c O) |
| 26 | (hu : ∀ K, IsCompact K → K ⊆ O → MemLp u 2 (volume.restrict K)) |
| 27 | (hp : ∀ i K, IsCompact K → K ⊆ O → MemLp (p i) 2 (volume.restrict K)) |
| 28 | (hpartial : ∀ i φ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ O → |
| 29 | (∫ x in O, u x * fderiv ℝ φ x (EuclideanSpace.single i 1)) = |
| 30 | -(∫ x in O, p i x * φ x)) |
| 31 | (heq : ∀ φ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ O → |
| 32 | (∫ x in O, ∑ i, ∑ j, A x i j * p j x * |
| 33 | fderiv ℝ φ x (EuclideanSpace.single i 1)) = |
| 34 | ∫ x in O, c x * u x * φ x) : |
| 35 | ∃ U : EuclideanSpace ℝ (Fin n) → ℝ, |
| 36 | ContDiffOn ℝ ∞ U O ∧ U =ᵐ[volume.restrict O] u := by |
| 37 | let : NeZero n := ⟨Nat.ne_of_gt hn⟩ |
| 38 | apply Sobolev.EuclideanIteratedEmbedding.exists_smooth_representative_of_memWkp_locally |
| 39 | intro x hx k |
| 40 | obtain ⟨V, hV, hxV, hVc, hVO, B, hBA, hBc⟩ := |
| 41 | exists_global_elliptic_extension hO (isCompact_singleton (x := x)) |
| 42 | (singleton_subset_iff.mpr hx) A c hA hpos hc |
| 43 | have hVO' : V ⊆ O := subset_closure.trans hVO |
| 44 | have huV := (hu (closure V) hVc hVO).mono_measure |
| 45 | (Measure.restrict_mono subset_closure le_rfl) |
| 46 | have hpV (i : Fin n) := (hp i (closure V) hVc hVO).mono_measure |
| 47 | (Measure.restrict_mono subset_closure le_rfl) |
| 48 | have hwV (i : Fin n) : Sobolev.Weak.HasWeakPartialDeriv i (p i) u V := |
| 49 | (show Sobolev.Weak.HasWeakPartialDeriv i (p i) u O from hpartial i).restrict hV hVO' |
| 50 | have hposV : ∀ y ∈ V, (B.a y).PosDef := by |
| 51 | intro y hy |
| 52 | rw [hBA hy] |
| 53 | exact hpos y (hVO' hy) |
| 54 | have heqV : Iteration.WeakEquation V (Iteration.matrixFlux B.a p) |
| 55 | (fun y => B.c y * u y) := by |
| 56 | intro φ hφ hφc hφV |
| 57 | have he := weakEquation_congr_restrict hVO' hBA (fun _ _ _ => rfl) heq |
| 58 | φ hφ hφc hφV |
| 59 | calc |
| 60 | _ = ∫ y in V, c y * u y * φ y := he |
| 61 | _ = _ := by |
| 62 | apply integral_congr_ae |
| 63 | filter_upwards [ae_restrict_mem hV.measurableSet] with y hy |
| 64 | rw [hBc hy] |
| 65 | obtain ⟨W, hW, hxW, hWV, huW⟩ := |
| 66 | Iteration.memWkpLocally_all_of_weakEigenfunction hV B.smooth_a hposV B.smooth_c |
| 67 | huV hpV hwV heqV k x (hxV (mem_singleton x)) |
| 68 | exact ⟨W, hW, hxW, hWV.trans hVO', huW⟩ |
| 69 | |
| 70 | end Poincare.Analysis.Elliptic |