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.LocalIntegrability |
| 2 | import Mathlib.MeasureTheory.Function.L2Space |
| 3 | import Mathlib.Analysis.Calculus.ContDiff.Basic |
| 4 | |
| 5 | /-! |
| 6 | # Equivalent local square-integrability conditions |
| 7 | |
| 8 | Square integrability on open neighborhoods is equivalent to square |
| 9 | integrability on every compact subset. This formulation is independent of |
| 10 | the local Sobolev predicates used in elliptic regularity iteration. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | open Set MeasureTheory Topology |
| 16 | open scoped ENNReal ContDiff |
| 17 | |
| 18 | namespace Poincare.Analysis.Elliptic |
| 19 | |
| 20 | variable {n : ℕ} |
| 21 | local notation "E" => EuclideanSpace ℝ (Fin n) |
| 22 | |
| 23 | theorem memLp_two_restrict_union {u : E → ℝ} {s t : Set E} |
| 24 | (hs : MemLp u 2 (volume.restrict s)) (ht : MemLp u 2 (volume.restrict t)) : |
| 25 | MemLp u 2 (volume.restrict (s ∪ t)) := by |
| 26 | apply (memLp_two_iff_integrable_sq |
| 27 | (aestronglyMeasurable_union_iff.mpr ⟨hs.1, ht.1⟩)).mpr |
| 28 | exact IntegrableOn.union hs.integrable_sq ht.integrable_sq |
| 29 | |
| 30 | theorem memLp_two_restrict_finset_biUnion {ι : Type*} {u : E → ℝ} |
| 31 | (s : Finset ι) (V : ι → Set E) (h : ∀ i ∈ s, MemLp u 2 (volume.restrict (V i))) : |
| 32 | MemLp u 2 (volume.restrict (⋃ i ∈ s, V i)) := by |
| 33 | classical |
| 34 | induction s using Finset.induction_on with |
| 35 | | empty => simp |
| 36 | | @insert i s hi ih => |
| 37 | rw [Finset.set_biUnion_insert] |
| 38 | exact memLp_two_restrict_union (h i (Finset.mem_insert_self i s)) |
| 39 | (ih (fun j hj => h j (Finset.mem_insert_of_mem hj))) |
| 40 | |
| 41 | /-- Neighborhood-local `L2` gives `L2` on every compact subset, by a finite subcover. -/ |
| 42 | theorem compact_memLp_of_local_memLp {O : Set E} {u : E → ℝ} |
| 43 | (hu : ∀ x ∈ O, ∃ V : Set E, IsOpen V ∧ x ∈ V ∧ V ⊆ O ∧ |
| 44 | MemLp u 2 (volume.restrict V)) : |
| 45 | ∀ K, IsCompact K → K ⊆ O → MemLp u 2 (volume.restrict K) := by |
| 46 | classical |
| 47 | intro K hK hKO |
| 48 | choose V hV hxV hVO huV using fun x : K => hu x (hKO x.property) |
| 49 | obtain ⟨s, hs⟩ := hK.elim_finite_subcover V hV (fun x hx => |
| 50 | mem_iUnion.mpr ⟨⟨x, hx⟩, hxV ⟨x, hx⟩⟩) |
| 51 | exact (memLp_two_restrict_finset_biUnion s V (fun x _ => huV x)).mono_measure |
| 52 | (Measure.restrict_mono hs le_rfl) |
| 53 | |
| 54 | /-- Compact-local `L2` gives `L2` on an open ball about each point of the domain. -/ |
| 55 | theorem local_memLp_of_compact_memLp {O : Set E} {u : E → ℝ} (hO : IsOpen O) |
| 56 | (hu : ∀ K, IsCompact K → K ⊆ O → MemLp u 2 (volume.restrict K)) : |
| 57 | ∀ x ∈ O, ∃ V : Set E, IsOpen V ∧ x ∈ V ∧ V ⊆ O ∧ |
| 58 | MemLp u 2 (volume.restrict V) := by |
| 59 | intro x hx |
| 60 | obtain ⟨r, hr, hball⟩ := Metric.nhds_basis_closedBall.mem_iff.mp (hO.mem_nhds hx) |
| 61 | refine ⟨Metric.ball x r, Metric.isOpen_ball, Metric.mem_ball_self hr, |
| 62 | Metric.ball_subset_closedBall.trans hball, ?_⟩ |
| 63 | exact (hu (Metric.closedBall x r) (isCompact_closedBall x r) hball).mono_measure |
| 64 | (Measure.restrict_mono Metric.ball_subset_closedBall le_rfl) |
| 65 | |
| 66 | theorem local_memLp_iff_compact_memLp {O : Set E} {u : E → ℝ} (hO : IsOpen O) : |
| 67 | (∀ x ∈ O, ∃ V : Set E, IsOpen V ∧ x ∈ V ∧ V ⊆ O ∧ |
| 68 | MemLp u 2 (volume.restrict V)) ↔ |
| 69 | ∀ K, IsCompact K → K ⊆ O → MemLp u 2 (volume.restrict K) := |
| 70 | ⟨compact_memLp_of_local_memLp, local_memLp_of_compact_memLp hO⟩ |
| 71 | |
| 72 | /-- Continuous coefficients preserve neighborhood-local square integrability. -/ |
| 73 | theorem local_memLp_mul_continuousOn {O : Set E} {u c : E → ℝ} (hO : IsOpen O) |
| 74 | (hc : ContinuousOn c O) |
| 75 | (hu : ∀ x ∈ O, ∃ V : Set E, IsOpen V ∧ x ∈ V ∧ V ⊆ O ∧ |
| 76 | MemLp u 2 (volume.restrict V)) : |
| 77 | ∀ x ∈ O, ∃ V : Set E, IsOpen V ∧ x ∈ V ∧ V ⊆ O ∧ |
| 78 | MemLp (fun y => c y * u y) 2 (volume.restrict V) := by |
| 79 | apply local_memLp_of_compact_memLp hO |
| 80 | intro K hK hKO |
| 81 | exact compact_memLp_mul_continuousOn hc (compact_memLp_of_local_memLp hu) hK hKO |
| 82 | |
| 83 | /-- Smooth coefficients preserve the compact-local `L2` hypotheses of the weak equation. -/ |
| 84 | theorem compact_memLp_mul_contDiffOn {O : Set E} {u c : E → ℝ} {k : WithTop ℕ∞} |
| 85 | (hc : ContDiffOn ℝ k c O) |
| 86 | (hu : ∀ K, IsCompact K → K ⊆ O → MemLp u 2 (volume.restrict K)) : |
| 87 | ∀ K, IsCompact K → K ⊆ O → |
| 88 | MemLp (fun y => c y * u y) 2 (volume.restrict K) := by |
| 89 | intro K hK hKO |
| 90 | exact compact_memLp_mul_continuousOn hc.continuousOn hu hK hKO |
| 91 | |
| 92 | end Poincare.Analysis.Elliptic |