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.IntrinsicComparison.Tangent.ContactsNull |
| 2 | |
| 3 | /-! |
| 4 | # Retaining every transverse regular contact |
| 5 | |
| 6 | Removing a measurable null superset of all regular tangent-contact bases |
| 7 | preserves every weighted base integral and leaves only transverse regular |
| 8 | contacts. This supports the formal retained-base treatment of Morgan--Tian, |
| 9 | Lemma 19.46, pp. 474--478. See |
| 10 | `derivations/2026-09-25-null-tangent-contact-bases.md`. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set MeasureTheory |
| 17 | open scoped Topology ContDiff Manifold Matrix ENNReal |
| 18 | |
| 19 | namespace PoincareMT |
| 20 | |
| 21 | /-- Every measurable base set has a full-measure measurable subset on which |
| 22 | all regular contacts with a smooth target curve are transverse. The retained |
| 23 | set is chosen independently of the contact parameters and of both classes of |
| 24 | weights. This supports the formal retained-base treatment of Morgan--Tian, |
| 25 | Lemma 19.46, pp. 474--478. -/ |
| 26 | theorem m64Intrinsic_exists_transverse_retained_bases |
| 27 | (e : AnnulusCoordinates → AnnulusCoordinates) (he : ContDiff ℝ ∞ e) |
| 28 | {target : ℝ → AnnulusCoordinates} (htarget : ContDiff ℝ ∞ target) |
| 29 | {S : Set ℝ} (hS : MeasurableSet S) : |
| 30 | ∃ Z : Set ℝ, MeasurableSet Z ∧ Z ⊆ S ∧ Z =ᵐ[volume] S ∧ |
| 31 | (∀ w : ℝ → ℝ≥0∞, (∫⁻ a in Z, w a) = ∫⁻ a in S, w a) ∧ |
| 32 | (∀ w : ℝ → ℝ, (∫ a in Z, w a) = ∫ a in S, w a) ∧ |
| 33 | ∀ a ∈ Z, ∀ t s : ℝ, e !₂[a, t] = target s → |
| 34 | Function.Injective (mfderiv (𝓡 2) (𝓡 2) e !₂[a, t]) → |
| 35 | LinearIndependent ℝ |
| 36 | (![deriv target s, fderiv ℝ e !₂[a, t] !₂[0, 1]] : |
| 37 | Fin 2 → AnnulusCoordinates) := by |
| 38 | let Bad : Set ℝ := {a : ℝ | ∃ t s : ℝ, |
| 39 | e !₂[a, t] = target s ∧ |
| 40 | Function.Injective (mfderiv (𝓡 2) (𝓡 2) e !₂[a, t]) ∧ |
| 41 | ¬ LinearIndependent ℝ |
| 42 | (![deriv target s, fderiv ℝ e !₂[a, t] !₂[0, 1]] : |
| 43 | Fin 2 → AnnulusCoordinates)} |
| 44 | have hBad : volume Bad = 0 := |
| 45 | m64Intrinsic_curve_tangent_bases_null e he htarget |
| 46 | obtain ⟨E, hBadE, hE, hE0⟩ := exists_measurable_superset_of_null hBad |
| 47 | let Z := S \ E |
| 48 | have hZS : Z =ᵐ[volume] S := sdiff_null_ae_eq_self hE0 |
| 49 | have hrestrict : volume.restrict Z = volume.restrict S := |
| 50 | Measure.restrict_congr_set hZS |
| 51 | refine ⟨Z, hS.diff hE, sdiff_subset, hZS, ?_, ?_, ?_⟩ |
| 52 | · intro w |
| 53 | rw [hrestrict] |
| 54 | · intro w |
| 55 | rw [hrestrict] |
| 56 | · intro a ha t s hcontact hinj |
| 57 | change a ∈ S \ E at ha |
| 58 | by_contra hind |
| 59 | have haBad : a ∈ Bad := ⟨t, s, hcontact, hinj, hind⟩ |
| 60 | exact ha.2 (hBadE haBad) |
| 61 | |
| 62 | end PoincareMT |