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.InteriorEstimates.Embedding.Ball |
| 2 | import PoincareLib.Analysis.Elliptic.Regularity.InteriorEstimates.Sobolev.ProfileCalculus |
| 3 | import PoincareLib.Analysis.Elliptic.Regularity.InteriorEstimates.Sobolev.L2 |
| 4 | |
| 5 | /-! |
| 6 | # Uniform L2 Sobolev embedding on compact subsets |
| 7 | -/ |
| 8 | |
| 9 | noncomputable section |
| 10 | |
| 11 | open Set MeasureTheory Metric |
| 12 | open scoped ENNReal ContDiff |
| 13 | |
| 14 | namespace Poincare.Analysis.Elliptic.InteriorEstimates |
| 15 | |
| 16 | variable {d : ℕ} [NeZero d] |
| 17 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 18 | |
| 19 | omit [NeZero d] in |
| 20 | theorem derivativeProfile_ne_top_on_precompact {V : Set E} |
| 21 | (hVc : IsCompact (closure V)) (r : ℕ) {u : E → ℝ} (hu : ContDiff ℝ ∞ u) : |
| 22 | derivativeProfile 2 V r u ≠ ⊤ := by |
| 23 | apply ENNReal.sum_ne_top.mpr |
| 24 | intro j hj |
| 25 | have hm : MemLp (fun x => ‖iteratedFDeriv ℝ j u x‖) 2 (volume.restrict V) := |
| 26 | (continuous_memLp_on_compact |
| 27 | (hu.continuous_iteratedFDeriv (by exact_mod_cast le_top)).norm hVc).mono_measure |
| 28 | (Measure.restrict_mono subset_closure le_rfl) |
| 29 | exact hm.eLpNorm_ne_top |
| 30 | |
| 31 | /-- The constant is uniform over every point of the compact set and every |
| 32 | smooth function. The pointwise formulation also covers an empty compact set. -/ |
| 33 | theorem smooth_jet_le_l2_derivativeProfile_on_compact |
| 34 | {K V : Set E} (hK : IsCompact K) (hV : IsOpen V) |
| 35 | (hVc : IsCompact (closure V)) (hKV : K ⊆ V) (m : ℕ) : |
| 36 | ∃ C : ℝ, 0 < C ∧ ∀ {u : E → ℝ}, ContDiff ℝ ∞ u → ∀ x ∈ K, |
| 37 | ‖iteratedFDeriv ℝ m u x‖ ≤ C * (derivativeProfile 2 V (m + 1 + d) u).toReal := by |
| 38 | classical |
| 39 | have hballs : ∀ x : K, ∃ R : ℝ, 0 < R ∧ ball (x : E) R ⊆ V := by |
| 40 | intro x |
| 41 | exact Metric.isOpen_iff.mp hV x (hKV x.property) |
| 42 | choose R hR hRV using hballs |
| 43 | choose A hA hbound using fun x : K => |
| 44 | smooth_jet_le_l2_derivativeProfile (d := d) (x₀ := (x : E)) (hR x) m |
| 45 | obtain ⟨s, hs⟩ := hK.elim_finite_subcover (fun x : K => ball (x : E) (R x / 2)) |
| 46 | (fun _ => isOpen_ball) (fun x hx => |
| 47 | mem_iUnion.mpr ⟨⟨x, hx⟩, mem_ball_self (half_pos (hR ⟨x, hx⟩))⟩) |
| 48 | have hsnonneg : 0 ≤ ∑ x ∈ s, A x := Finset.sum_nonneg (fun x _ => hA x) |
| 49 | refine ⟨1 + ∑ x ∈ s, A x, add_pos_of_pos_of_nonneg zero_lt_one hsnonneg, ?_⟩ |
| 50 | intro u hu x hx |
| 51 | obtain ⟨y, hys, hxy⟩ := mem_iUnion₂.mp (hs hx) |
| 52 | have hprofile : (derivativeProfile 2 (ball (y : E) (R y)) (m + 1 + d) u).toReal ≤ |
| 53 | (derivativeProfile 2 V (m + 1 + d) u).toReal := |
| 54 | ENNReal.toReal_mono (derivativeProfile_ne_top_on_precompact hVc _ hu) |
| 55 | (derivativeProfile_mono_set (hRV y) 2 _ u) |
| 56 | apply (hbound y hu x hxy).trans |
| 57 | apply mul_le_mul |
| 58 | · exact (Finset.single_le_sum (fun z hz => hA z) hys).trans (le_add_of_nonneg_left zero_le_one) |
| 59 | · exact hprofile |
| 60 | · exact ENNReal.toReal_nonneg |
| 61 | · exact add_nonneg zero_le_one hsnonneg |
| 62 | |
| 63 | end Poincare.Analysis.Elliptic.InteriorEstimates |