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.Reference.ConeArea |
| 2 | import Mathlib.Analysis.Complex.Angle |
| 3 | import Mathlib.Analysis.Complex.Isometry |
| 4 | import Mathlib.MeasureTheory.Measure.Haar.InnerProductSpace |
| 5 | |
| 6 | /-! |
| 7 | # Reference cone area in the Euclidean complex plane |
| 8 | |
| 9 | The actual real-product cone calculation transfers by the canonical |
| 10 | volume-preserving complex coordinates. Its parameter is proved to be |
| 11 | the Euclidean angle between the two generating rays. |
| 12 | |
| 13 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481, especially Claim 19.40, pp. |
| 14 | 470-471. The explicit coordinate-mesh and regional Gauss--Bonnet constructions are project |
| 15 | derivations. |
| 16 | -/ |
| 17 | |
| 18 | noncomputable section |
| 19 | set_option autoImplicit false |
| 20 | set_option backward.isDefEq.respectTransparency false |
| 21 | |
| 22 | open Set MeasureTheory InnerProductGeometry |
| 23 | open scoped ENNReal Topology |
| 24 | |
| 25 | namespace PoincareMT |
| 26 | |
| 27 | /-- The reference complex ray makes exactly the prescribed angle with the positive real ray. |
| 28 | Source: Morgan--Tian Proposition 19.35, printed pp. 467-481, especially Claim 19.40, pp. |
| 29 | 470-471; the explicit project tangent-fan derivation is reviewed in |
| 30 | `proof-work/tasks/M64/reviews/2026-09-27-round1-intrinsic-fans.md`, Mathematical Checks. -/ |
| 31 | theorem m64Intrinsic_complex_reference_angle |
| 32 | {a : ℝ} (ha : a ∈ Ioo (0 : ℝ) Real.pi) : |
| 33 | angle (1 : ℂ) ((Real.cos a : ℂ) + (Real.sin a : ℂ) * Complex.I) = a := by |
| 34 | have hsin := Real.sin_pos_of_pos_of_lt_pi ha.1 ha.2 |
| 35 | have hne : (Real.cos a : ℂ) + (Real.sin a : ℂ) * Complex.I ≠ 0 := by |
| 36 | intro h |
| 37 | have hi := congrArg Complex.im h |
| 38 | simp only [Complex.add_im, Complex.ofReal_im, Complex.mul_im, Complex.I_im, |
| 39 | Complex.I_re, Complex.ofReal_re, mul_one, zero_mul, add_zero, zero_add, |
| 40 | Complex.zero_im] at hi |
| 41 | exact hsin.ne' hi |
| 42 | have harg : Complex.arg ((Real.cos a : ℂ) + (Real.sin a : ℂ) * Complex.I) = a := by |
| 43 | simpa only [Complex.ofReal_cos, Complex.ofReal_sin] using |
| 44 | (Complex.arg_cos_add_sin_mul_I ⟨by linarith [Real.pi_pos, ha.1], ha.2.le⟩) |
| 45 | rw [Complex.angle_one_left hne, harg, abs_of_pos ha.1] |
| 46 | |
| 47 | /-- The positive cone of the reference complex rays has its actual metric disk-sector area. |
| 48 | Source: Morgan--Tian Proposition 19.35, printed pp. 467-481, especially Claim 19.40, pp. |
| 49 | 470-471; the explicit project tangent-fan derivation is reviewed in |
| 50 | `proof-work/tasks/M64/reviews/2026-09-27-round1-intrinsic-fans.md`, Mathematical Checks. -/ |
| 51 | theorem m64Intrinsic_complex_reference_cone_volume |
| 52 | {R a : ℝ} (hR : 0 < R) (ha : a ∈ Ioo (0 : ℝ) Real.pi) : |
| 53 | volume {z : ℂ | ‖z‖ < R ∧ ∃ s t : ℝ, 0 < s ∧ 0 < t ∧ |
| 54 | z = (s : ℂ) + (t : ℂ) * ((Real.cos a : ℂ) + (Real.sin a : ℂ) * Complex.I)} = |
| 55 | ENNReal.ofReal (R ^ 2 / 2) * ENNReal.ofReal a := by |
| 56 | have hnorm (z : ℂ) : ‖z‖ < R ↔ z.re ^ 2 + z.im ^ 2 < R ^ 2 := by |
| 57 | have hsquare : ‖z‖ ^ 2 = z.re ^ 2 + z.im ^ 2 := by |
| 58 | simpa only [Complex.normSq_apply, pow_two] using (Complex.normSq_eq_norm_sq z).symm |
| 59 | constructor <;> intro h |
| 60 | · rw [← hsquare] |
| 61 | nlinarith [norm_nonneg z] |
| 62 | · rw [← hsquare] at h |
| 63 | nlinarith [norm_nonneg z] |
| 64 | have hcone (z : ℂ) : |
| 65 | (∃ s t : ℝ, 0 < s ∧ 0 < t ∧ |
| 66 | z = (s : ℂ) + (t : ℂ) * ((Real.cos a : ℂ) + (Real.sin a : ℂ) * Complex.I)) ↔ |
| 67 | ∃ s t : ℝ, 0 < s ∧ 0 < t ∧ |
| 68 | (z.re, z.im) = (s + t * Real.cos a, t * Real.sin a) := by |
| 69 | constructor |
| 70 | · rintro ⟨s, t, hs, ht, rfl⟩ |
| 71 | refine ⟨s, t, hs, ht, ?_⟩ |
| 72 | apply Prod.ext <;> |
| 73 | simp only [Complex.add_re, Complex.add_im, Complex.mul_re, Complex.mul_im, |
| 74 | Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, |
| 75 | mul_zero, zero_mul, mul_one, add_zero, zero_add, sub_zero] |
| 76 | · rintro ⟨s, t, hs, ht, heq⟩ |
| 77 | refine ⟨s, t, hs, ht, ?_⟩ |
| 78 | apply Complex.ext |
| 79 | · simpa only [Complex.add_re, Complex.mul_re, Complex.mul_im, |
| 80 | Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, |
| 81 | mul_zero, zero_mul, mul_one, add_zero, zero_add, sub_zero] using |
| 82 | congrArg Prod.fst heq |
| 83 | · simpa only [Complex.add_im, Complex.mul_re, Complex.mul_im, |
| 84 | Complex.ofReal_re, Complex.ofReal_im, Complex.I_re, Complex.I_im, |
| 85 | mul_zero, zero_mul, mul_one, add_zero, zero_add, sub_zero] using |
| 86 | congrArg Prod.snd heq |
| 87 | have hset : {z : ℂ | ‖z‖ < R ∧ ∃ s t : ℝ, 0 < s ∧ 0 < t ∧ |
| 88 | z = (s : ℂ) + (t : ℂ) * ((Real.cos a : ℂ) + (Real.sin a : ℂ) * Complex.I)} = |
| 89 | Complex.measurableEquivRealProd ⁻¹' {p : ℝ × ℝ | p.1 ^ 2 + p.2 ^ 2 < R ^ 2 ∧ |
| 90 | ∃ s t : ℝ, 0 < s ∧ 0 < t ∧ p = (s + t * Real.cos a, t * Real.sin a)} := by |
| 91 | ext z |
| 92 | change (_ ∧ _) ↔ (z.re ^ 2 + z.im ^ 2 < R ^ 2 ∧ _) |
| 93 | rw [hnorm, hcone] |
| 94 | rfl |
| 95 | rw [hset, Complex.volume_preserving_equiv_real_prod.measure_preimage_equiv] |
| 96 | exact m64Intrinsic_reference_positive_cone_volume hR ha |
| 97 | |
| 98 | end PoincareMT |