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.CurveShortening.Comparison.AnnularEvolution.Plateau.Weak.ReplacementIntegration |
| 2 | |
| 3 | /-! |
| 4 | # The exact flux defect of a weak replacement |
| 5 | |
| 6 | Integral splitting transports a local Green flux defect to the global |
| 7 | piecewise map. This allows a boundary half-cone to change its diameter |
| 8 | trace. Source: Lemaire 1982, p. 102; M64's free-boundary- |
| 9 | replacement derivation. |
| 10 | |
| 11 | Morgan--Tian context: Lemma 19.15, printed pp. 447-449. This project analytic helper |
| 12 | supports the actual annular minimizer and boundary regularity construction. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option warningAsError true |
| 17 | |
| 18 | noncomputable section |
| 19 | |
| 20 | open Set Filter MeasureTheory |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | /-- A prescribed local Green flux defect is the exact global defect of the actual piecewise |
| 25 | fields. Source: the integral-splitting step in M64's free-boundary-replacement derivation. |
| 26 | Source/construction: |
| 27 | proof-work/tasks/M64/derivations/2026-09-26-free-boundary-replacement.md, Missing interface. -/ |
| 28 | theorem m64WeakReplacement_flux_defect |
| 29 | {X E : Type*} [MeasurableSpace X] [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 30 | {mu : Measure X} {S K : Set X} [DecidablePred (· ∈ K)] |
| 31 | (hK : MeasurableSet K) (hKS : K ⊆ S) |
| 32 | (u0 u1 v0 v1 : X → E) (phi psi : X → ℝ) (delta : E) |
| 33 | (hu0 : MemLp u0 2 (mu.restrict S)) (hu1 : MemLp u1 2 (mu.restrict K)) |
| 34 | (hv0 : MemLp v0 2 (mu.restrict S)) (hv1 : MemLp v1 2 (mu.restrict K)) |
| 35 | (hphi : MemLp phi 2 (mu.restrict S)) (hpsi : MemLp psi 2 (mu.restrict S)) |
| 36 | (hgreen : (∫ x in K, phi x • v1 x ∂mu) + (∫ x in K, psi x • u1 x ∂mu) = |
| 37 | (∫ x in K, phi x • v0 x ∂mu) + (∫ x in K, psi x • u0 x ∂mu) + delta) : |
| 38 | (∫ x in S, phi x • K.piecewise v1 v0 x ∂mu) + |
| 39 | (∫ x in S, psi x • K.piecewise u1 u0 x ∂mu) = |
| 40 | (∫ x in S, phi x • v0 x ∂mu) + (∫ x in S, psi x • u0 x ∂mu) + delta := by |
| 41 | have hpK := hphi.mono_measure (Measure.restrict_mono hKS le_rfl) |
| 42 | have hqK := hpsi.mono_measure (Measure.restrict_mono hKS le_rfl) |
| 43 | have heqv : (fun x => phi x • K.piecewise v1 v0 x) = |
| 44 | K.piecewise (fun x => phi x • v1 x) (fun x => phi x • v0 x) := by |
| 45 | funext x |
| 46 | by_cases hx : x ∈ K <;> simp only [piecewise, hx, if_true, if_false] |
| 47 | have hequ : (fun x => psi x • K.piecewise u1 u0 x) = |
| 48 | K.piecewise (fun x => psi x • u1 x) (fun x => psi x • u0 x) := by |
| 49 | funext x |
| 50 | by_cases hx : x ∈ K <;> simp only [piecewise, hx, if_true, if_false] |
| 51 | rw [heqv, hequ, |
| 52 | m64Integral_piecewise_of_subset hK hKS (m64L2_test_integrable hv1 hpK) |
| 53 | (m64L2_test_integrable hv0 hphi), |
| 54 | m64Integral_piecewise_of_subset hK hKS (m64L2_test_integrable hu1 hqK) |
| 55 | (m64L2_test_integrable hu0 hpsi)] |
| 56 | calc |
| 57 | _ = ((∫ x in S, phi x • v0 x ∂mu) + (∫ x in S, psi x • u0 x ∂mu)) + |
| 58 | ((∫ x in K, phi x • v1 x ∂mu) + (∫ x in K, psi x • u1 x ∂mu)) - |
| 59 | ((∫ x in K, phi x • v0 x ∂mu) + (∫ x in K, psi x • u0 x ∂mu)) := by abel |
| 60 | _ = _ := by rw [hgreen]; abel |
| 61 | |
| 62 | end PoincareMT |