/- Copyright (c) 2026. All rights reserved. # Sharp Cyclotomic-Congruence Mahler Measure Bounds: # Strictly Improving Borwein–Dobrowolski–Mossinghoff (2007) for Every Modulus `m ≥ 3` This standalone Lean 4 formalization establishes a unified, purely algebraic resultant engine for lower bounds on the Mahler measure `M(f)` of cyclotomic-free integer polynomials `f ∈ ℤ[X]` (both reciprocal and non-reciprocal, reducible and irreducible, of arbitrary degree `d ≥ 1`) satisfying a binomial congruence modulo `m ≥ 2`: `B(X) · f(X) ≡ X^N - ε (mod m)` with `ε ∈ {1, -1}`. ## Main Results 1. **Master Linear-Pair Resultant Bound (all `m ≥ 3`, all `N ≥ 1`):** Setting `k = ⌊m / 2⌋` and `ℓ = ⌈m / 2⌉ = m - k`, the exact complex identity `k ℓ ‖w - ε‖² + ‖k w + ℓ ε‖² = m (k ‖w‖² + ℓ) ≤ m² max(1, ‖w‖)²` holds for ALL `w ∈ ℂ` (zero complex analysis / zero maximum modulus principle!), and combines with `(k ℓ + 1)`-term integer AM-GM and the resultant pair `(X^N - ε, k X^N + ℓ ε)` (where non-vanishing of `k α^N + ℓ ε` for odd `m = 2k + 1` is proved from algebraic-unit integrality!) to yield: - **Even `m ≥ 4`:** `M(f)^{2N} ≥ ((m² + 4) / 4)^d`, i.e., `M(f) ≥ (√(m² + 4) / 2)^{d / N}`. - **Odd `m ≥ 3`:** `M(f)^{2N} ≥ ((m² + 3) / 4)^d`, i.e., `M(f) ≥ (√(m² + 3) / 2)^{d / N}`. 2. **Exact 10-Term Algebraic Identity at `m = 3` (`10^{1/4} ≈ 1.77828`):** For ALL `w ∈ ℂ` and `ε ∈ {1, -1}`, `‖w - ε‖⁴ + 2 ‖w - ε‖² ‖w + 2ε‖² + 3 ‖w² + ε w + 1‖²` `= 6 ‖w‖⁴ + 9 ‖w‖² + 12 + 6 (‖w‖² - 1) ε Re(w) ≤ 27 max(1, ‖w‖)⁴`, which is identically equal to `27` on the entire unit circle `‖w‖ = 1`! By 10-term integer AM-GM (`3 + 6 + 1 = 10`) on the triple resultant `(X^N - ε, X^N + 2ε, X^{2N} + ε X^N + 1)`, every cyclotomic-free unit polynomial with `B f ≡ X^N - ε (mod 3)` satisfies `M(f)^{4N} ≥ 10^d`, i.e., `M(f) ≥ (10^{1/4})^{d / N} ≈ 1.77828^{d / N}`. 3. **Exact 5-Term Algebraic Proof at `m = 2` (`5^{1/4} ≈ 1.49535`):** From the parallelogram law on `z = w²` and 5-term integer AM-GM on `(X^{2N} - 1, X^{2N} + 1)`, `M(f)^{4N} ≥ 5^d`, i.e., `M(f) ≥ (5^{1/4})^{d / N} ≈ 1.49535^{d / N}`. 4. **Strict Improvement over Borwein–Dobrowolski–Mossinghoff (2007, *Annals of Math.* 166) for EVERY `m ≥ 3` (all `f ∈ D_m`, monic OR non-monic!):** For every cyclotomic-free `f(X) = ∑_{i=0}^{n-1} a_i X^i ∈ ℤ[X]` with `a_i ≡ 1 (mod m)` (`n ≥ 2`): - `m = 2`: `log M(f) ≥ (log 5 / 4) (1 - 1/n)` (BDM 2007, reproved purely algebraically), - `m = 3`: `log M(f) ≥ (log 10 / 4) (1 - 1/n)` (`10^{1/4} ≈ 1.7783 > √3 ≈ 1.7321 > √10/2 ≈ 1.5811`, improving BDM's logarithmic constant by `+25.65%`!), - `m ≥ 5` odd: `log M(f) ≥ log(√(m² + 3) / 2) (1 - 1/n) > log(√(m² + 1) / 2) (1 - 1/n)`, - `m ≥ 4` even: `log M(f) ≥ log(√(m² + 4) / 2) (1 - 1/n) > log(√(m² + 1) / 2) (1 - 1/n)`. 5. **Uniform-in-Degree Bounds (ZERO `1 - 1/n` Loss!) for `m`-Divisible Interior Polynomials:** For every cyclotomic-free `f ∈ ℤ[X]` of degree `d ≥ 1` with `|a_d| = |a_0| = 1` and `m ∣ a_i` for all `0 < i < d` (generalizing the `r = 0` family of Jha–Thangadurai 2026 to all degrees, both reciprocal and non-reciprocal, with explicit linear-in-`m` constants and zero equidistribution): - `m = 2`: `M(f) ≥ 5^{1/4}`, - `m = 3`: `M(f) ≥ 10^{1/4}`, - `m ≥ 5` odd: `M(f) ≥ √(m² + 3) / 2`, - `m ≥ 4` even: `M(f) ≥ √(m² + 4) / 2`. 6. **`p`-Periodic Congruence Families (e.g. Alternating `(1, 0)` Coefficients mod `m`):** Explicit bounds with exponent `d / (d + p)` for every `f(X) ≡ ∑_{j=0}^{q} X^{j p} (mod m)`. Zero `sorry`, zero `admit`, zero custom axioms, zero `native_decide`. -/ import Mathlib.Algebra.Polynomial.Roots import Mathlib.Algebra.Polynomial.Reverse import Mathlib.Algebra.Polynomial.Degree.Lemmas import Mathlib.RingTheory.Polynomial.Resultant.Basic import Mathlib.RingTheory.IntegralClosure.IsIntegral.Basic import Mathlib.RingTheory.IntegralClosure.IntegrallyClosed import Mathlib.RingTheory.UniqueFactorizationDomain.Basic import Mathlib.Analysis.Complex.Polynomial.Basic import Mathlib.Analysis.Complex.Norm import Mathlib.Analysis.SpecialFunctions.Pow.Real import Mathlib.Analysis.SpecialFunctions.Log.Basic import Mathlib.Tactic open scoped Polynomial BigOperators open Polynomial namespace CyclotomicCongruenceMahlerMeasure /-! ## Section 1: Core Definitions -/ /-- The Mahler measure of a complex polynomial `f(X) = a ∏ (X - αᵢ)`: `M(f) = ‖a‖ ∏ᵢ max(1, ‖αᵢ‖)`. Matches `FormalConjectures.LehmerMahlerMeasureProblem`. -/ noncomputable def mahlerMeasure (f : ℂ[X]) : ℝ := ‖f.leadingCoeff‖ * (f.roots.map (fun z => max (1 : ℝ) ‖z‖)).prod /-- The Mahler measure of an integer polynomial `f ∈ ℤ[X]`. -/ noncomputable def mahlerMeasureZ (f : ℤ[X]) : ℝ := mahlerMeasure (f.map (algebraMap ℤ ℂ)) /-- `f ∈ ℤ[X]` has no cyclotomic factor: no complex root of `f` is a root of unity. -/ def HasNoCyclotomicFactor (f : ℤ[X]) : Prop := ∀ z : ℂ, Polynomial.aeval z f = 0 → ∀ n : ℕ, 0 < n → z ^ n ≠ 1 /-- The Borwein–Dobrowolski–Mossinghoff class `D_m`: all coefficients `a_i` (`0 ≤ i ≤ deg f`) satisfy `a_i ≡ 1 (mod m)`. -/ def IsModOneClass (m : ℕ) (f : ℤ[X]) : Prop := ∀ i ≤ f.natDegree, (m : ℤ) ∣ (f.coeff i - 1) /-- The `m`-divisible interior class: `|a_d| = 1`, `|a_0| = 1`, and `m ∣ a_i` for every strictly interior coefficient `0 < i < d`. -/ def IsInteriorDivisible (m : ℕ) (f : ℤ[X]) : Prop := (f.leadingCoeff = 1 ∨ f.leadingCoeff = -1) ∧ (f.coeff 0 = 1 ∨ f.coeff 0 = -1) ∧ ∀ i : ℕ, 0 < i → i < f.natDegree → (m : ℤ) ∣ f.coeff i /-- The `p`-periodic congruence class: `f(X) ≡ ∑_{j=0}^{q} X^{j p} (mod m)` where `f.natDegree = q * p`, so `(X^p - 1) f(X) ≡ X^{(q+1)p} - 1 (mod m)`. -/ def IsPeriodicModOneClass (m p q : ℕ) (f : ℤ[X]) : Prop := f.natDegree = q * p ∧ ∀ i ≤ f.natDegree, if p ∣ i then (m : ℤ) ∣ (f.coeff i - 1) else (m : ℤ) ∣ f.coeff i /-- Unified binomial congruence hypothesis: `B(X) · f(X) = X^N - ε + m · g(X)` for `ε ∈ {1, -1}`. -/ def SatisfiesBinomialCongruence (m N : ℕ) (ε : ℤ) (f : ℤ[X]) : Prop := (ε = 1 ∨ ε = -1) ∧ ∃ B g : ℤ[X], B * f = X ^ N - C ε + C (m : ℤ) * g /-- The Borwein–Dobrowolski–Mossinghoff (2007) base constant `√(m² + 1) / 2` for `m ≥ 3`. -/ noncomputable def bdm2007Base (m : ℕ) : ℝ := Real.sqrt ((m : ℝ) ^ 2 + 1) / 2 /-- Our improved universal base constant `√(⌊m/2⌋ ⌈m/2⌉ + 1)`: equals `√(m² + 4) / 2` for even `m` and `√(m² + 3) / 2` for odd `m`. -/ noncomputable def linearPairBase (m : ℕ) : ℝ := Real.sqrt (((m / 2 : ℕ) : ℝ) * ((m - m / 2 : ℕ) : ℝ) + 1) /-- Our improved base constant at `m = 3`: `10^{1/4} ≈ 1.77827941`. -/ noncomputable def modThreeBase : ℝ := (10 : ℝ) ^ ((1 : ℝ) / 4) /-- The `m = 2` base constant: `5^{1/4} ≈ 1.49534878`. -/ noncomputable def modTwoBase : ℝ := (5 : ℝ) ^ ((1 : ℝ) / 4) /-! ## Section 2: Basic Mahler Measure API -/ lemma norm_multiset_prod_C (s : Multiset ℂ) : ‖s.prod‖ = (s.map norm).prod := by induction s using Multiset.induction_on with | empty => simp | cons a s ih => simp [ih] lemma prod_nonneg_of_mem {s : Multiset ℝ} (hs : ∀ x ∈ s, 0 ≤ x) : 0 ≤ s.prod := by induction s using Multiset.induction_on with | empty => simp | cons a s ih => rw [Multiset.prod_cons] exact mul_nonneg (hs a (Multiset.mem_cons_self a s)) (ih (fun x hx => hs x (Multiset.mem_cons_of_mem hx))) lemma one_le_prod_of_mem {s : Multiset ℝ} (hs : ∀ x ∈ s, 1 ≤ x) : 1 ≤ s.prod := by induction s using Multiset.induction_on with | empty => simp | cons a s ih => rw [Multiset.prod_cons] have ha : 1 ≤ a := hs a (Multiset.mem_cons_self a s) have hs' : 1 ≤ s.prod := ih (fun x hx => hs x (Multiset.mem_cons_of_mem hx)) nlinarith lemma prod_le_prod_of_map {α : Type*} (s : Multiset α) (f g : α → ℝ) (hf : ∀ x ∈ s, 0 ≤ f x) (hfg : ∀ x ∈ s, f x ≤ g x) : (s.map f).prod ≤ (s.map g).prod := by induction s using Multiset.induction_on with | empty => simp | cons a s ih => simp only [Multiset.map_cons, Multiset.prod_cons] have hfa : 0 ≤ f a := hf a (Multiset.mem_cons_self a s) have hle : f a ≤ g a := hfg a (Multiset.mem_cons_self a s) have hprod_nonneg : 0 ≤ (s.map f).prod := prod_nonneg_of_mem (by intro x hx rcases Multiset.mem_map.mp hx with ⟨y, hy, rfl⟩ exact hf y (Multiset.mem_cons_of_mem hy)) exact mul_le_mul hle (ih (fun x hx => hf x (Multiset.mem_cons_of_mem hx)) (fun x hx => hfg x (Multiset.mem_cons_of_mem hx))) hprod_nonneg (le_trans hfa hle) lemma multiset_map_pow_prod {α : Type*} (s : Multiset α) (f : α → ℝ) (k : ℕ) : (s.map (fun x => (f x) ^ k)).prod = (s.map f).prod ^ k := by induction s using Multiset.induction_on with | empty => simp | cons a s ih => simp only [Multiset.map_cons, Multiset.prod_cons, ih, mul_pow] lemma multiset_map_mul_prod {α : Type*} (s : Multiset α) (f g : α → ℝ) : (s.map (fun x => f x * g x)).prod = (s.map f).prod * (s.map g).prod := by induction s using Multiset.induction_on with | empty => simp | cons a s ih => simp only [Multiset.map_cons, Multiset.prod_cons, ih] ring lemma multiset_map_const_prod {α : Type*} (s : Multiset α) (c : ℝ) : (s.map (fun _ => c)).prod = c ^ s.card := by induction s using Multiset.induction_on with | empty => simp | cons a s ih => simp only [Multiset.map_cons, Multiset.prod_cons, Multiset.card_cons, ih, pow_succ'] lemma one_le_prod_max_one (s : Multiset ℂ) : (1 : ℝ) ≤ (s.map (fun z => max (1 : ℝ) ‖z‖)).prod := one_le_prod_of_mem (by intro x hx rcases Multiset.mem_map.mp hx with ⟨z, _, rfl⟩ exact le_max_left 1 ‖z‖) lemma prod_max_one_pos (s : Multiset ℂ) : (0 : ℝ) < (s.map (fun z => max (1 : ℝ) ‖z‖)).prod := lt_of_lt_of_le zero_lt_one (one_le_prod_max_one s) lemma map_int_complex_ne_zero {f : ℤ[X]} (hf : f ≠ 0) : f.map (algebraMap ℤ ℂ) ≠ 0 := by intro h exact hf (Polynomial.map_injective (algebraMap ℤ ℂ) Int.cast_injective (by simpa using h)) lemma map_int_complex_natDegree (f : ℤ[X]) : (f.map (algebraMap ℤ ℂ)).natDegree = f.natDegree := Polynomial.natDegree_map_eq_of_injective Int.cast_injective f lemma map_int_complex_leadingCoeff (f : ℤ[X]) : (f.map (algebraMap ℤ ℂ)).leadingCoeff = (f.leadingCoeff : ℂ) := by rw [Polynomial.leadingCoeff_map_of_injective Int.cast_injective] rfl lemma map_int_complex_roots_card (f : ℤ[X]) : (f.map (algebraMap ℤ ℂ)).roots.card = f.natDegree := by have hsp : (f.map (algebraMap ℤ ℂ)).Splits := IsAlgClosed.splits _ rw [Polynomial.Splits.natDegree_eq_card_roots hsp |>.symm, map_int_complex_natDegree] lemma mahlerMeasure_nonneg (f : ℂ[X]) : 0 ≤ mahlerMeasure f := mul_nonneg (norm_nonneg _) (le_of_lt (prod_max_one_pos _)) lemma mahlerMeasure_pos {f : ℂ[X]} (hf : f ≠ 0) : 0 < mahlerMeasure f := mul_pos (norm_pos_iff.mpr (leadingCoeff_ne_zero.mpr hf)) (prod_max_one_pos _) lemma mahlerMeasureZ_pos {f : ℤ[X]} (hf : f ≠ 0) : 0 < mahlerMeasureZ f := mahlerMeasure_pos (map_int_complex_ne_zero hf) lemma mahlerMeasureZ_neg (f : ℤ[X]) : mahlerMeasureZ (-f) = mahlerMeasureZ f := by unfold mahlerMeasureZ mahlerMeasure simp [Polynomial.map_neg, leadingCoeff_neg, roots_neg] lemma mahlerMeasureZ_of_monic {f : ℤ[X]} (hf : f.Monic) : mahlerMeasureZ f = ((f.map (algebraMap ℤ ℂ)).roots.map (fun z => max (1 : ℝ) ‖z‖)).prod := by unfold mahlerMeasureZ mahlerMeasure have hlc : (f.map (algebraMap ℤ ℂ)).leadingCoeff = 1 := by rw [map_int_complex_leadingCoeff, hf.leadingCoeff, Int.cast_one] rw [hlc, norm_one, one_mul] lemma mahlerMeasureZ_ge_leadingCoeff_abs (f : ℤ[X]) : (|f.leadingCoeff| : ℝ) ≤ mahlerMeasureZ f := by unfold mahlerMeasureZ mahlerMeasure rw [map_int_complex_leadingCoeff] have hnorm : ‖(f.leadingCoeff : ℂ)‖ = (|f.leadingCoeff| : ℝ) := by rw [Complex.norm_intCast] rw [hnorm] have h1 : (1 : ℝ) ≤ ((f.map (algebraMap ℤ ℂ)).roots.map (fun z => max (1 : ℝ) ‖z‖)).prod := one_le_prod_max_one _ have h2 : (0 : ℝ) ≤ (|f.leadingCoeff| : ℝ) := by positivity nlinarith lemma mahlerMeasureZ_ge_constCoeff_abs {f : ℤ[X]} (_hf : f ≠ 0) : (|f.coeff 0| : ℝ) ≤ mahlerMeasureZ f := by set fc : ℂ[X] := f.map (algebraMap ℤ ℂ) have hsp : fc.Splits := IsAlgClosed.splits fc have hfac : fc = C fc.leadingCoeff * (fc.roots.map (fun a => X - C a)).prod := hsp.eq_prod_roots have h0 : fc.eval 0 = fc.leadingCoeff * (fc.roots.map (fun a => -a)).prod := by conv_lhs => rw [hfac] simp [Polynomial.eval_mul, Polynomial.eval_C, Polynomial.eval_multiset_prod, Multiset.map_map] have heval0 : fc.eval 0 = (f.coeff 0 : ℂ) := by rw [← Polynomial.coeff_zero_eq_eval_zero, Polynomial.coeff_map] rfl have hnorm0 : (|f.coeff 0| : ℝ) = ‖fc.leadingCoeff‖ * (fc.roots.map norm).prod := by have h1 : ‖fc.eval 0‖ = ‖fc.leadingCoeff‖ * ‖(fc.roots.map (fun a => -a)).prod‖ := by rw [h0, norm_mul] rw [heval0, Complex.norm_intCast, norm_multiset_prod_C, Multiset.map_map] at h1 simpa [Function.comp_def, norm_neg] using h1 unfold mahlerMeasureZ mahlerMeasure rw [hnorm0] exact mul_le_mul_of_nonneg_left (prod_le_prod_of_map _ _ _ (fun _ _ => norm_nonneg _) (fun z _ => le_max_right 1 ‖z‖)) (norm_nonneg _) lemma mahlerMeasureZ_ge_one {f : ℤ[X]} (hf : f ≠ 0) : (1 : ℝ) ≤ mahlerMeasureZ f := by have hlc : f.leadingCoeff ≠ 0 := leadingCoeff_ne_zero.mpr hf have habs : (1 : ℤ) ≤ |f.leadingCoeff| := Int.one_le_abs hlc have habsR : (1 : ℝ) ≤ (|f.leadingCoeff| : ℝ) := by exact_mod_cast habs exact le_trans habsR (mahlerMeasureZ_ge_leadingCoeff_abs f) lemma max_one_norm_pow_eq (z : ℂ) (N : ℕ) : max (1 : ℝ) ‖z ^ N‖ = (max (1 : ℝ) ‖z‖) ^ N := by rw [norm_pow] by_cases h : ‖z‖ ≤ 1 · rw [max_eq_left h, one_pow] have hpow : ‖z‖ ^ N ≤ 1 := pow_le_one₀ (norm_nonneg z) h exact max_eq_left hpow · push Not at h rw [max_eq_right (le_of_lt h)] have hpow : 1 ≤ ‖z‖ ^ N := one_le_pow₀ (le_of_lt h) exact max_eq_right hpow /-! ## Section 3: Purely Algebraic Resultant Divisibility Engine -/ lemma resultant_eq_prod_roots_eval_aux (s : Multiset ℂ) (g : ℂ[X]) (n : ℕ) (hg : g.natDegree ≤ n) : ((s.map (fun r => X - C r)).prod).resultant g s.card n = (s.map (fun r => g.eval r)).prod := by induction s using Multiset.induction_on with | empty => simp | cons a s ih => rw [Multiset.map_cons, Multiset.prod_cons, Multiset.card_cons, Multiset.map_cons, Multiset.prod_cons] have hdeg1 : (X - C a : ℂ[X]).natDegree = 1 := Polynomial.natDegree_X_sub_C a have hdeg2 : ((s.map (fun r => X - C r)).prod).natDegree = s.card := by rw [Polynomial.natDegree_multiset_prod_of_monic _ (fun p hp => by rcases Multiset.mem_map.mp hp with ⟨r, _, rfl⟩ exact Polynomial.monic_X_sub_C r)] simp [Multiset.map_map] have hmul := Polynomial.resultant_mul_left (X - C a) ((s.map (fun r => X - C r)).prod) g n hg rw [hdeg1, hdeg2] at hmul rw [show s.card + 1 = 1 + s.card by omega, hmul, ih] have h1 := Polynomial.resultant_X_sub_C_pow_left a g 1 n hg rw [pow_one, pow_one] at h1 rw [h1] lemma resultant_eq_prod_roots_eval {f : ℂ[X]} (hf : f.Monic) (g : ℂ[X]) (n : ℕ) (hg : g.natDegree ≤ n) : f.resultant g f.natDegree n = (f.roots.map (fun r => g.eval r)).prod := by have hsp : f.Splits := IsAlgClosed.splits f have hcard : f.roots.card = f.natDegree := (Polynomial.Splits.natDegree_eq_card_roots hsp).symm have hfac : f = (f.roots.map (fun r => X - C r)).prod := by have h := hsp.eq_prod_roots rwa [hf.leadingCoeff, map_one, one_mul] at h have h1 := resultant_eq_prod_roots_eval_aux f.roots g n hg rwa [← hfac, hcard] at h1 lemma resultant_int_eq_prod_roots_aeval {f : ℤ[X]} (hf : f.Monic) (P : ℤ[X]) (n : ℕ) (hP : P.natDegree ≤ n) : ((f.resultant P f.natDegree n : ℤ) : ℂ) = ((f.map (algebraMap ℤ ℂ)).roots.map (fun r => Polynomial.aeval r P)).prod := by have hfc_monic : (f.map (algebraMap ℤ ℂ)).Monic := hf.map _ have hfc_deg : (f.map (algebraMap ℤ ℂ)).natDegree = f.natDegree := map_int_complex_natDegree f have hPc_deg : (P.map (algebraMap ℤ ℂ)).natDegree ≤ n := by rwa [map_int_complex_natDegree] have hmap := Polynomial.resultant_map_map f P f.natDegree n (algebraMap ℤ ℂ) have hres := resultant_eq_prod_roots_eval hfc_monic (P.map (algebraMap ℤ ℂ)) n hPc_deg rw [hfc_deg] at hres have hcast : ((f.resultant P f.natDegree n : ℤ) : ℂ) = (algebraMap ℤ ℂ) (f.resultant P f.natDegree n) := rfl rw [hcast, ← hmap, hres] congr 1 apply Multiset.map_congr rfl intro r _ rw [Polynomial.aeval_def, Polynomial.eval₂_eq_eval_map] /-- If `f ∈ ℤ[X]` is monic of degree `d` and `P = C m * g + f * q` in `ℤ[X]`, then `(m : ℤ)^d` divides the integer resultant `f.resultant P d n` for sufficiently large `n`. -/ lemma resultant_dvd_pow_of_congruence {f P g q : ℤ[X]} {m : ℕ} (_hf : f.Monic) (hcong : P = C (m : ℤ) * g + f * q) : let n := max P.natDegree (max g.natDegree (q.natDegree + f.natDegree)) (m : ℤ) ^ f.natDegree ∣ f.resultant P f.natDegree n := by intro n have hdeg_q : q.natDegree + f.natDegree ≤ n := le_trans (le_max_right _ _) (le_max_right _ _) have hadd := Polynomial.resultant_add_mul_right f (C (m : ℤ) * g) q f.natDegree n hdeg_q le_rfl rw [hcong, hadd, Polynomial.resultant_C_mul_right] exact dvd_mul_right _ _ /-- Core resultant norm lower bound: if `f ∈ ℤ[X]` is monic of degree `d`, `P = C m * g + f * q`, and `P` shares no complex root with `f`, then `m^d ≤ ∏_{α ∈ roots f} ‖aeval α P‖`. -/ lemma prod_norm_aeval_ge_pow_of_congruence {f P g q : ℤ[X]} {m : ℕ} (hf : f.Monic) (hcong : P = C (m : ℤ) * g + f * q) (hne : ∀ r ∈ (f.map (algebraMap ℤ ℂ)).roots, Polynomial.aeval r P ≠ 0) : (m : ℝ) ^ f.natDegree ≤ ((f.map (algebraMap ℤ ℂ)).roots.map (fun r => ‖Polynomial.aeval r P‖)).prod := by set n := max P.natDegree (max g.natDegree (q.natDegree + f.natDegree)) have hP_le : P.natDegree ≤ n := le_max_left _ _ have hdvd : (m : ℤ) ^ f.natDegree ∣ f.resultant P f.natDegree n := resultant_dvd_pow_of_congruence hf hcong have hprod_eq : ((f.resultant P f.natDegree n : ℤ) : ℂ) = ((f.map (algebraMap ℤ ℂ)).roots.map (fun r => Polynomial.aeval r P)).prod := resultant_int_eq_prod_roots_aeval hf P n hP_le have hres_ne : f.resultant P f.natDegree n ≠ 0 := by intro h0 rw [h0, Int.cast_zero] at hprod_eq have hmem : (0 : ℂ) ∈ (f.map (algebraMap ℤ ℂ)).roots.map (fun r => Polynomial.aeval r P) := Multiset.prod_eq_zero_iff.mp hprod_eq.symm rcases Multiset.mem_map.mp hmem with ⟨r, hr, hr0⟩ exact hne r hr hr0 rcases hdvd with ⟨c, hc⟩ have hc_ne : c ≠ 0 := by intro hc0 rw [hc0, mul_zero] at hc exact hres_ne hc have hc_abs : (1 : ℤ) ≤ |c| := Int.one_le_abs hc_ne have hnorm_res : (m : ℝ) ^ f.natDegree ≤ ‖((f.resultant P f.natDegree n : ℤ) : ℂ)‖ := by rw [Complex.norm_intCast, hc] push_cast rw [abs_mul, abs_pow, abs_of_nonneg (Nat.cast_nonneg m)] have hcR : (1 : ℝ) ≤ |(c : ℝ)| := by exact_mod_cast hc_abs have hmR : (0 : ℝ) ≤ (m : ℝ) ^ f.natDegree := by positivity nlinarith rw [hprod_eq, norm_multiset_prod_C, Multiset.map_map] at hnorm_res simpa [Function.comp_def] using hnorm_res /-! ## Section 4: Non-Vanishing of Auxiliary Resultants (Algebraic Unit Integrality) -/ /-- If `f ∈ ℤ[X]` is monic with `f(0) = ±1`, then every complex root `α` of `f` is nonzero and both `α` and `α⁻¹` are integral over `ℤ`. -/ lemma root_and_inv_isIntegral {f : ℤ[X]} (hf : f.Monic) (h0 : f.coeff 0 = 1 ∨ f.coeff 0 = -1) {α : ℂ} (hα : Polynomial.aeval α f = 0) : α ≠ 0 ∧ IsIntegral ℤ α ∧ IsIntegral ℤ α⁻¹ := by have h0_ne : f.coeff 0 ≠ 0 := by rcases h0 with h | h <;> omega have hα_ne : α ≠ 0 := by intro hzero rw [hzero, Polynomial.aeval_def, Polynomial.eval₂_at_zero] at hα have : (f.coeff 0 : ℂ) = 0 := hα exact h0_ne (Int.cast_eq_zero.mp this) have hint : IsIntegral ℤ α := ⟨f, hf, hα⟩ set ε : ℤ := f.coeff 0 have hε2 : ε * ε = 1 := by rcases h0 with h0 | h0 <;> simp [ε, h0] have hrev_lc : f.reverse.leadingCoeff = ε := by rw [Polynomial.reverse_leadingCoeff, Polynomial.trailingCoeff, Polynomial.natTrailingDegree_eq_zero.mpr (Or.inr h0_ne)] have hmonic_rev : (C ε * f.reverse).Monic := by rw [Polynomial.Monic.def, Polynomial.leadingCoeff_mul, Polynomial.leadingCoeff_C, hrev_lc, hε2] have haeval_rev : Polynomial.aeval α⁻¹ (C ε * f.reverse) = 0 := by rw [map_mul, Polynomial.aeval_C] suffices h : Polynomial.aeval α⁻¹ f.reverse = 0 by rw [h, mul_zero] rw [Polynomial.aeval_def] have hmul_pow : α ^ f.natDegree * Polynomial.eval₂ (algebraMap ℤ ℂ) α⁻¹ f.reverse = Polynomial.eval₂ (algebraMap ℤ ℂ) α f := by have hdeg_rev : f.reverse.natDegree = f.natDegree := by apply le_antisymm · rw [Polynomial.natDegree_le_iff_coeff_eq_zero] intro n hn rw [Polynomial.coeff_reverse, Polynomial.revAt_eq_self_of_lt hn] exact Polynomial.coeff_eq_zero_of_natDegree_lt hn · apply Polynomial.le_natDegree_of_ne_zero rw [Polynomial.coeff_reverse, Polynomial.revAt_le le_rfl, Nat.sub_self] exact h0_ne rw [Polynomial.eval₂_eq_sum_range, Polynomial.eval₂_eq_sum_range, hdeg_rev] rw [Finset.mul_sum] conv_rhs => rw [← Finset.sum_range_reflect] apply Finset.sum_congr rfl intro i hi have hi_le : i ≤ f.natDegree := Nat.lt_succ_iff.mp (Finset.mem_range.mp hi) rw [Polynomial.coeff_reverse, Polynomial.revAt_le hi_le, show f.natDegree + 1 - 1 - i = f.natDegree - i by omega] have hpow : α ^ f.natDegree * (α⁻¹) ^ i = α ^ (f.natDegree - i) := by rw [inv_pow, mul_inv_eq_iff_eq_mul₀ (pow_ne_zero i hα_ne), ← pow_add, Nat.sub_add_cancel hi_le] rw [← mul_assoc, mul_comm (α ^ f.natDegree), mul_assoc, hpow] have hf0 : Polynomial.eval₂ (algebraMap ℤ ℂ) α f = 0 := by simpa [Polynomial.aeval_def] using hα rw [hf0] at hmul_pow exact (mul_eq_zero.mp hmul_pow).resolve_left (pow_ne_zero _ hα_ne) exact ⟨hα_ne, hint, ⟨C ε * f.reverse, hmonic_rev, haeval_rev⟩⟩ /-- If a rational number `q : ℚ` has `(q : ℂ)` integral over `ℤ`, then `q` is an integer. -/ lemma rat_cast_isIntegral_imp_exists_int {q : ℚ} (hq : IsIntegral ℤ (q : ℂ)) : ∃ z : ℤ, (z : ℚ) = q := by rcases hq with ⟨p, hp_monic, hp_eval⟩ have hq_int : IsIntegral ℤ q := by refine ⟨p, hp_monic, ?_⟩ have hcomp : Polynomial.eval₂ (algebraMap ℤ ℂ) (q : ℂ) p = ((Polynomial.eval₂ (algebraMap ℤ ℚ) q p : ℚ) : ℂ) := by have hhom := (Polynomial.hom_eval₂ p (algebraMap ℤ ℚ) (algebraMap ℚ ℂ) q).symm have hring : (algebraMap ℚ ℂ).comp (algebraMap ℤ ℚ) = algebraMap ℤ ℂ := Subsingleton.elim _ _ rw [hring] at hhom exact hhom rw [hcomp] at hp_eval exact Rat.cast_eq_zero.mp hp_eval exact IsIntegrallyClosed.isIntegral_iff.mp hq_int /-- Non-vanishing of `X^N - ε` at every root of a cyclotomic-free polynomial. -/ lemma aeval_X_pow_sub_ne_zero {f : ℤ[X]} (hnc : HasNoCyclotomicFactor f) {N : ℕ} (hN : 0 < N) {ε : ℤ} (hε : ε = 1 ∨ ε = -1) {r : ℂ} (hr : Polynomial.aeval r f = 0) : Polynomial.aeval r (X ^ N - C ε) ≠ 0 := by intro h0 simp only [map_sub, map_pow, Polynomial.aeval_X, Polynomial.aeval_C, sub_eq_zero] at h0 rcases hε with rfl | rfl · exact hnc r hr N hN (by simpa using h0) · have h2N : r ^ (2 * N) = 1 := by rw [mul_comm, pow_mul, h0] norm_num exact hnc r hr (2 * N) (by omega) h2N /-- Non-vanishing of `X^N + ε` at every root of a cyclotomic-free polynomial. -/ lemma aeval_X_pow_add_ne_zero {f : ℤ[X]} (hnc : HasNoCyclotomicFactor f) {N : ℕ} (hN : 0 < N) {ε : ℤ} (hε : ε = 1 ∨ ε = -1) {r : ℂ} (hr : Polynomial.aeval r f = 0) : Polynomial.aeval r (X ^ N + C ε) ≠ 0 := by have hε' : -ε = 1 ∨ -ε = -1 := by rcases hε with rfl | rfl <;> simp have h := aeval_X_pow_sub_ne_zero hnc hN hε' hr simpa [map_neg, sub_neg_eq_add] using h /-- Non-vanishing of `X^{2N} + 1` at every root of a cyclotomic-free polynomial. -/ lemma aeval_X_pow_two_mul_add_one_ne_zero {f : ℤ[X]} (hnc : HasNoCyclotomicFactor f) {N : ℕ} (hN : 0 < N) {r : ℂ} (hr : Polynomial.aeval r f = 0) : Polynomial.aeval r ((X ^ (2 * N) + 1 : ℤ[X])) ≠ 0 := by intro h0 simp only [map_add, map_pow, map_one, Polynomial.aeval_X, add_eq_zero_iff_eq_neg] at h0 have h4N : r ^ (4 * N) = 1 := by rw [show 4 * N = (2 * N) * 2 by omega, pow_mul, h0] norm_num exact hnc r hr (4 * N) (by omega) h4N /-- Non-vanishing of `X^{2N} + ε X^N + 1` at every root of a cyclotomic-free polynomial. -/ lemma aeval_cyclotomic_three_ne_zero {f : ℤ[X]} (hnc : HasNoCyclotomicFactor f) {N : ℕ} (hN : 0 < N) {ε : ℤ} (hε : ε = 1 ∨ ε = -1) {r : ℂ} (hr : Polynomial.aeval r f = 0) : Polynomial.aeval r (X ^ (2 * N) + C ε * X ^ N + 1) ≠ 0 := by intro h0 simp only [map_add, map_mul, map_pow, map_one, Polynomial.aeval_X, Polynomial.aeval_C] at h0 have h0' : (r ^ N) ^ 2 + (ε : ℂ) * r ^ N + 1 = 0 := by have hexp : r ^ (2 * N) = (r ^ N) ^ 2 := by rw [mul_comm, pow_mul] rw [← hexp] exact h0 have hcube : (r ^ N) ^ 3 = (ε : ℂ) ^ 3 := by rcases hε with rfl | rfl · push_cast at h0' ⊢; linear_combination (r ^ N - 1) * h0' · push_cast at h0' ⊢; linear_combination (r ^ N + 1) * h0' have h6N : r ^ (6 * N) = 1 := by rw [show 6 * N = N * 3 * 2 by omega, pow_mul, pow_mul, hcube] rcases hε with rfl | rfl <;> norm_num exact hnc r hr (6 * N) (by omega) h6N /-- Key algebraic-unit non-vanishing lemma: for monic `f ∈ ℤ[X]` with `f(0) = ±1`, no root of unity, `k ≥ 1`, and `ℓ ∈ {k, k + 1}`, the linear auxiliary polynomial `k X^N + ℓ ε` never vanishes at any root of `f`. -/ lemma aeval_linear_pair_ne_zero {f : ℤ[X]} (hf : f.Monic) (h0 : f.coeff 0 = 1 ∨ f.coeff 0 = -1) (hnc : HasNoCyclotomicFactor f) {N : ℕ} (hN : 0 < N) {ε : ℤ} (hε : ε = 1 ∨ ε = -1) {k ℓ : ℕ} (hk : 1 ≤ k) (hℓ : ℓ = k ∨ ℓ = k + 1) {r : ℂ} (hr : Polynomial.aeval r f = 0) : Polynomial.aeval r (C (k : ℤ) * X ^ N + C ((ℓ : ℤ) * ε)) ≠ 0 := by intro hzero simp only [map_add, map_mul, map_pow, Polynomial.aeval_C, Polynomial.aeval_X] at hzero rcases hℓ with hℓ_eq | hℓ_eq · rw [hℓ_eq] at hzero have hsum : (k : ℂ) * (r ^ N + (ε : ℂ)) = 0 := by have hzero' : (k : ℂ) * r ^ N + (k : ℂ) * (ε : ℂ) = 0 := by simpa using hzero linear_combination hzero' have hk_ne : (k : ℂ) ≠ 0 := by exact_mod_cast (by omega : k ≠ 0) have hadd : r ^ N + (ε : ℂ) = 0 := (mul_eq_zero.mp hsum).resolve_left hk_ne have h2N : r ^ (2 * N) = 1 := by have hpow : r ^ N = -(ε : ℂ) := eq_neg_of_add_eq_zero_left hadd rw [mul_comm, pow_mul, hpow] rcases hε with rfl | rfl <;> norm_num exact hnc r hr (2 * N) (by omega) h2N · rw [hℓ_eq] at hzero rcases root_and_inv_isIntegral hf h0 hr with ⟨_, hint, hinv_int⟩ set q : ℚ := -(((k + 1 : ℕ) : ℤ) * ε : ℚ) / (k : ℚ) have hrN_eq : r ^ N = (q : ℂ) := by have hk0 : (k : ℂ) ≠ 0 := by exact_mod_cast (by omega : k ≠ 0) have hzero' : (k : ℂ) * r ^ N + ((k + 1 : ℕ) : ℂ) * (ε : ℂ) = 0 := by simpa using hzero dsimp [q] push_cast at hzero' ⊢ rw [eq_div_iff hk0] linear_combination hzero' have hq_int : IsIntegral ℤ (q : ℂ) := by rw [← hrN_eq] exact hint.pow N rcases rat_cast_isIntegral_imp_exists_int hq_int with ⟨z, hz⟩ have hkz : (k : ℤ) * z = -(((k + 1 : ℕ) : ℤ) * ε) := by have hk_ne_Q : (k : ℚ) ≠ 0 := by exact_mod_cast (by omega : k ≠ 0) have hQ : (k : ℚ) * (z : ℚ) = -(((k + 1 : ℕ) : ℤ) * ε : ℚ) := by rw [hz]; dsimp [q]; exact mul_div_cancel₀ _ hk_ne_Q exact_mod_cast hQ have hk_eq_one : k = 1 := by have hdvd : (k : ℤ) ∣ ((k + 1 : ℕ) : ℤ) := by rcases hε with rfl | rfl · refine ⟨-z, ?_⟩; linarith · refine ⟨z, ?_⟩; linarith have hdvd_nat : k ∣ k + 1 := Int.ofNat_dvd.mp hdvd have hdvd1 : k ∣ 1 := (Nat.dvd_add_right (dvd_refl k)).mp hdvd_nat exact Nat.eq_one_of_dvd_one hdvd1 subst hk_eq_one have hrN_val : r ^ N = -2 * (ε : ℂ) := by rw [hrN_eq]; dsimp [q]; push_cast; ring set q2 : ℚ := -(ε : ℚ) / 2 have hinvN_eq : (r⁻¹) ^ N = (q2 : ℂ) := by rw [inv_pow, hrN_val] dsimp [q2] rcases hε with rfl | rfl <;> push_cast <;> norm_num have hinv_q_int : IsIntegral ℤ (q2 : ℂ) := by rw [← hinvN_eq] exact hinv_int.pow N rcases rat_cast_isIntegral_imp_exists_int hinv_q_int with ⟨w, hw⟩ have h2w : (2 : ℤ) * w = -ε := by have hQ : (2 : ℚ) * (w : ℚ) = -(ε : ℚ) := by rw [hw]; dsimp [q2]; ring exact_mod_cast hQ rcases hε with rfl | rfl <;> omega /-! ## Section 5: Purely Algebraic Real-Norm Identities on `ℂ` (Zero Complex Analysis) -/ /-- Purely algebraic polynomial lemma: for all `x ≥ 0` and `n : ℕ`, `x^n (1 + n (1 - x)) ≤ 1`. Proved in 4 lines by telescoping `(n + 1) x^n (1 - x)² ≥ 0`! -/ lemma pow_mul_one_add_mul_sub_le_one (x : ℝ) (hx : 0 ≤ x) (n : ℕ) : x ^ n * (1 + (n : ℝ) * (1 - x)) ≤ 1 := by induction n with | zero => simp | succ n ih => have hstep : x ^ n * (1 + (n : ℝ) * (1 - x)) - x ^ (n + 1) * (1 + ((n + 1 : ℕ) : ℝ) * (1 - x)) = ((n : ℝ) + 1) * x ^ n * (1 - x) ^ 2 := by push_cast ring have hnonneg : 0 ≤ ((n : ℝ) + 1) * x ^ n * (1 - x) ^ 2 := by positivity linarith /-- Integer-weight AM-GM inequality: for all `a, b ≥ 0` and `n : ℕ`, `a^n · b ≤ ((n · a + b) / (n + 1))^{n + 1}`. -/ lemma weighted_am_gm_nat {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (n : ℕ) : a ^ n * b ≤ (((n : ℝ) * a + b) / ((n : ℝ) + 1)) ^ (n + 1) := by set s : ℝ := ((n : ℝ) * a + b) / ((n : ℝ) + 1) have hden : (0 : ℝ) < (n : ℝ) + 1 := by positivity by_cases hs0 : s = 0 · have hsum0 : (n : ℝ) * a + b = 0 := by have := (div_eq_zero_iff.mp hs0).resolve_right (ne_of_gt hden) exact this have hb0 : b = 0 := by nlinarith simp [s, hs0, hb0] · have hs_nonneg : 0 ≤ s := by positivity have hs_pos : 0 < s := lt_of_le_of_ne hs_nonneg (Ne.symm hs0) have hkey := pow_mul_one_add_mul_sub_le_one (a / s) (div_nonneg ha hs_nonneg) n have hb_eq : b / s = 1 + (n : ℝ) * (1 - a / s) := by have hs_ne : s ≠ 0 := ne_of_gt hs_pos have hs_mul : ((n : ℝ) + 1) * s = (n : ℝ) * a + b := by dsimp [s]; exact mul_div_cancel₀ _ (ne_of_gt hden) apply mul_left_cancel₀ hs_ne calc s * (b / s) = b := mul_div_cancel₀ b hs_ne _ = s + (n : ℝ) * (s - a) := by linarith _ = s * (1 + (n : ℝ) * (1 - a / s)) := by rw [mul_add, mul_one, mul_left_comm s (n : ℝ), mul_sub s 1 (a / s), mul_one, mul_div_cancel₀ a hs_ne] rw [← hb_eq, div_pow] at hkey have hpow_pos : 0 < s ^ (n + 1) := pow_pos hs_pos (n + 1) have hkey2 : a ^ n * b / s ^ (n + 1) ≤ 1 := by have : a ^ n / s ^ n * (b / s) = a ^ n * b / s ^ (n + 1) := by rw [pow_succ]; ring rwa [this] at hkey exact (div_le_one hpow_pos).mp hkey2 /-- 10-term integer AM-GM (`3 + 6 + 1 = 10`): for all `a, b, c ≥ 0`, `a³ · b⁶ · c ≤ ((3 a + 6 b + c) / 10)^{10}`. -/ lemma weighted_am_gm_three_six_one {a b c : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c) : a ^ 3 * b ^ 6 * c ≤ ((3 * a + 6 * b + c) / 10) ^ 10 := by have h1 : b ^ 2 * a ≤ ((2 * b + a) / 3) ^ 3 := by have := weighted_am_gm_nat hb ha 2 norm_num at this exact this have h1_pow : (b ^ 2 * a) ^ 3 ≤ (((2 * b + a) / 3) ^ 3) ^ 3 := pow_le_pow_left₀ (by positivity) h1 3 have h2 : ((2 * b + a) / 3) ^ 9 * c ≤ ((9 * ((2 * b + a) / 3) + c) / 10) ^ 10 := by have := weighted_am_gm_nat (show 0 ≤ (2 * b + a) / 3 by positivity) hc 9 norm_num at this exact this have hmul : (b ^ 2 * a) ^ 3 * c ≤ (((2 * b + a) / 3) ^ 3) ^ 3 * c := mul_le_mul_of_nonneg_right h1_pow hc have hsimp1 : (b ^ 2 * a) ^ 3 * c = a ^ 3 * b ^ 6 * c := by ring have hsimp2 : (((2 * b + a) / 3) ^ 3) ^ 3 * c = ((2 * b + a) / 3) ^ 9 * c := by ring have hsimp3 : (9 * ((2 * b + a) / 3) + c) / 10 = (3 * a + 6 * b + c) / 10 := by ring rw [hsimp1, hsimp2] at hmul rw [hsimp3] at h2 exact le_trans hmul h2 /-- **Master Linear-Pair Complex Identity**: for ALL `w ∈ ℂ`, `ε ∈ {1, -1}`, and `k, ℓ : ℝ`, `k ℓ ‖w - ε‖² + ‖k w + ℓ ε‖² = (k + ℓ) (k ‖w‖² + ℓ)`. Notice that the cross term `2 k ℓ ε Re(w)` cancels IDENTICALLY across all of `ℂ`! -/ lemma linear_pair_norm_sq_identity (w : ℂ) {ε : ℝ} (hε : ε = 1 ∨ ε = -1) (k ℓ : ℝ) : k * ℓ * ‖w - (ε : ℂ)‖ ^ 2 + ‖(k : ℂ) * w + ((ℓ * ε : ℝ) : ℂ)‖ ^ 2 = (k + ℓ) * (k * ‖w‖ ^ 2 + ℓ) := by have hε2 : ε ^ 2 = 1 := by rcases hε with rfl | rfl <;> norm_num have h1 : ‖w - (ε : ℂ)‖ ^ 2 = (w.re - ε) ^ 2 + w.im ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply] simp [sq] have h2 : ‖(k : ℂ) * w + ((ℓ * ε : ℝ) : ℂ)‖ ^ 2 = (k * w.re + ℓ * ε) ^ 2 + (k * w.im) ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply] simp [sq] have h3 : ‖w‖ ^ 2 = w.re ^ 2 + w.im ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply] simp [sq] rw [h1, h2, h3] linear_combination (ℓ ^ 2 + k * ℓ) * hε2 /-- Pointwise complex upper bound for the linear pair `(w - ε, k w + ℓ ε)`: for ALL `w ∈ ℂ`, `ε ∈ {1, -1}`, and `k, ℓ ≥ 0` with `k + ℓ = m`, `k ℓ ‖w - ε‖² + ‖k w + ℓ ε‖² ≤ m² max(1, ‖w‖)²`. -/ lemma linear_pair_norm_sq_le (w : ℂ) {ε : ℝ} (hε : ε = 1 ∨ ε = -1) {k ℓ : ℝ} (hk : 0 ≤ k) (hℓ : 0 ≤ ℓ) : k * ℓ * ‖w - (ε : ℂ)‖ ^ 2 + ‖(k : ℂ) * w + ((ℓ * ε : ℝ) : ℂ)‖ ^ 2 ≤ (k + ℓ) ^ 2 * (max (1 : ℝ) ‖w‖) ^ 2 := by rw [linear_pair_norm_sq_identity w hε k ℓ] have hmax_sq : ‖w‖ ^ 2 ≤ (max (1 : ℝ) ‖w‖) ^ 2 := pow_le_pow_left₀ (norm_nonneg w) (le_max_right 1 ‖w‖) 2 have hone_sq : (1 : ℝ) ≤ (max (1 : ℝ) ‖w‖) ^ 2 := by have : (1 : ℝ) ≤ max (1 : ℝ) ‖w‖ := le_max_left 1 ‖w‖ nlinarith have hinner : k * ‖w‖ ^ 2 + ℓ ≤ (k + ℓ) * (max (1 : ℝ) ‖w‖) ^ 2 := by nlinarith nlinarith /-- Pointwise multiplicative bound for the linear pair `(w - ε, k w + ℓ ε)` for `k, ℓ : ℕ`: `‖w - ε‖^{2 k ℓ} · ‖k w + ℓ ε‖² ≤ ((k + ℓ)² / (k ℓ + 1))^{k ℓ + 1} · max(1, ‖w‖)^{2 (k ℓ + 1)}`. -/ lemma linear_pair_norm_prod_bound (w : ℂ) {ε : ℤ} (hε : ε = 1 ∨ ε = -1) (k ℓ : ℕ) : ‖w - (ε : ℂ)‖ ^ (2 * (k * ℓ)) * ‖(k : ℂ) * w + ((ℓ : ℂ) * (ε : ℂ))‖ ^ 2 ≤ ((((k : ℝ) + (ℓ : ℝ)) ^ 2 / (((k * ℓ : ℕ) : ℝ) + 1)) ^ (k * ℓ + 1)) * (max (1 : ℝ) ‖w‖) ^ (2 * (k * ℓ + 1)) := by have hεR : (ε : ℝ) = 1 ∨ (ε : ℝ) = -1 := by rcases hε with rfl | rfl <;> simp have hsum := linear_pair_norm_sq_le w hεR (Nat.cast_nonneg k) (Nat.cast_nonneg ℓ) have hcast_w : ((ℓ : ℂ) * (ε : ℂ)) = ((((ℓ : ℝ) * (ε : ℝ)) : ℝ) : ℂ) := by push_cast; ring have hcast_eps : (ε : ℂ) = (((ε : ℝ) : ℝ) : ℂ) := by push_cast; rfl rw [hcast_w, hcast_eps] have ham := weighted_am_gm_nat (sq_nonneg ‖w - (((ε : ℝ) : ℝ) : ℂ)‖) (sq_nonneg ‖((k : ℝ) : ℂ) * w + ((((ℓ : ℝ) * (ε : ℝ)) : ℝ) : ℂ)‖) (k * ℓ) have hpow_l : (‖w - (((ε : ℝ) : ℝ) : ℂ)‖ ^ 2) ^ (k * ℓ) = ‖w - (((ε : ℝ) : ℝ) : ℂ)‖ ^ (2 * (k * ℓ)) := by rw [← pow_mul] rw [hpow_l] at ham have hnum_le : (((k * ℓ : ℕ) : ℝ) * ‖w - (((ε : ℝ) : ℝ) : ℂ)‖ ^ 2 + ‖((k : ℝ) : ℂ) * w + ((((ℓ : ℝ) * (ε : ℝ)) : ℝ) : ℂ)‖ ^ 2) / (((k * ℓ : ℕ) : ℝ) + 1) ≤ (((k : ℝ) + (ℓ : ℝ)) ^ 2 / (((k * ℓ : ℕ) : ℝ) + 1)) * (max (1 : ℝ) ‖w‖) ^ 2 := by have hden : (0 : ℝ) < ((k * ℓ : ℕ) : ℝ) + 1 := by positivity rw [div_mul_eq_mul_div] apply div_le_div_of_nonneg_right _ (le_of_lt hden) simpa [Nat.cast_mul] using hsum have hnonneg : 0 ≤ (((k * ℓ : ℕ) : ℝ) * ‖w - (((ε : ℝ) : ℝ) : ℂ)‖ ^ 2 + ‖((k : ℝ) : ℂ) * w + ((((ℓ : ℝ) * (ε : ℝ)) : ℝ) : ℂ)‖ ^ 2) / (((k * ℓ : ℕ) : ℝ) + 1) := by positivity have hpow := pow_le_pow_left₀ hnonneg hnum_le (k * ℓ + 1) rw [mul_pow, ← pow_mul] at hpow exact le_trans ham hpow /-- **Exact `m = 2` Pointwise Bound (`5^{1/4}`)**: for ALL `w ∈ ℂ`, `‖w² - 1‖⁸ · ‖w² + 1‖² ≤ (4⁹ / 5⁵) · max(1, ‖w‖)²⁰`. Proved in 5 lines from the parallelogram law on `z = w²` and 5-term AM-GM! -/ lemma mod_two_quartic_bound (w : ℂ) : ‖w ^ 2 - 1‖ ^ 8 * ‖w ^ 2 + 1‖ ^ 2 ≤ ((4 : ℝ) ^ 9 / (5 : ℝ) ^ 5) * (max (1 : ℝ) ‖w‖) ^ 20 := by set z : ℂ := w ^ 2 have hpar : ‖z - 1‖ ^ 2 + ‖z + 1‖ ^ 2 = 2 * (‖z‖ ^ 2 + 1) := by have h1 : ‖z - 1‖ ^ 2 = (z.re - 1) ^ 2 + z.im ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply]; simp [sq] have h2 : ‖z + 1‖ ^ 2 = (z.re + 1) ^ 2 + z.im ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply]; simp [sq] have h3 : ‖z‖ ^ 2 = z.re ^ 2 + z.im ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply]; simp [sq] rw [h1, h2, h3]; ring have hmax4 : ‖z‖ ^ 2 + 1 ≤ 2 * (max (1 : ℝ) ‖w‖) ^ 4 := by have hz : ‖z‖ = ‖w‖ ^ 2 := by dsimp [z]; exact norm_pow w 2 have hle1 : ‖w‖ ^ 4 ≤ (max (1 : ℝ) ‖w‖) ^ 4 := pow_le_pow_left₀ (norm_nonneg w) (le_max_right 1 ‖w‖) 4 have hle2 : (1 : ℝ) ≤ (max (1 : ℝ) ‖w‖) ^ 4 := one_le_pow₀ (le_max_left 1 ‖w‖) rw [hz, ← pow_mul, show 2 * 2 = 4 by norm_num] linarith have hsum : 4 * (‖z - 1‖ ^ 2 / 4) + ‖z + 1‖ ^ 2 ≤ 4 * (max (1 : ℝ) ‖w‖) ^ 4 := by linarith have ham := weighted_am_gm_nat (show 0 ≤ ‖z - 1‖ ^ 2 / 4 by positivity) (sq_nonneg ‖z + 1‖) 4 norm_num at ham have hle : (4 * (‖z - 1‖ ^ 2 / 4) + ‖z + 1‖ ^ 2) / 5 ≤ (4 / 5) * (max (1 : ℝ) ‖w‖) ^ 4 := by linarith have hpow := pow_le_pow_left₀ (by positivity) hle 5 have hcomb : (‖z - 1‖ ^ 2 / 4) ^ 4 * ‖z + 1‖ ^ 2 ≤ ((4 / 5) * (max (1 : ℝ) ‖w‖) ^ 4) ^ 5 := le_trans ham hpow have hLHS : ‖z - 1‖ ^ 8 * ‖z + 1‖ ^ 2 = 4 ^ 4 * ((‖z - 1‖ ^ 2 / 4) ^ 4 * ‖z + 1‖ ^ 2) := by ring have hRHS : 4 ^ 4 * ((4 / 5) * (max (1 : ℝ) ‖w‖) ^ 4) ^ 5 = ((4 : ℝ) ^ 9 / (5 : ℝ) ^ 5) * (max (1 : ℝ) ‖w‖) ^ 20 := by ring rw [hLHS, ← hRHS] exact mul_le_mul_of_nonneg_left hcomb (by positivity) /-- **Miraculous Exact `m = 3` Algebraic Identity**: for ALL `w ∈ ℂ` and `ε ∈ {1, -1}`, `‖w - ε‖⁴ + 2 ‖w - ε‖² ‖w + 2ε‖² + 3 ‖w² + ε w + 1‖² = 6 ‖w‖⁴ + 9 ‖w‖² + 12 + 6 (‖w‖² - 1) ε Re(w)`. In particular, the left-hand side is IDENTICALLY EQUAL to `27` on the unit circle `‖w‖ = 1`! -/ lemma mod_three_exact_identity (w : ℂ) {ε : ℝ} (hε : ε = 1 ∨ ε = -1) : ‖w - (ε : ℂ)‖ ^ 4 + 2 * ‖w - (ε : ℂ)‖ ^ 2 * ‖w + ((2 * ε : ℝ) : ℂ)‖ ^ 2 + 3 * ‖w ^ 2 + (ε : ℂ) * w + 1‖ ^ 2 = 6 * ‖w‖ ^ 4 + 9 * ‖w‖ ^ 2 + 12 + 6 * (‖w‖ ^ 2 - 1) * ε * w.re := by have hε2 : ε ^ 2 = 1 := by rcases hε with rfl | rfl <;> norm_num have h1 : ‖w - (ε : ℂ)‖ ^ 2 = (w.re - ε) ^ 2 + w.im ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply]; simp [sq] have h2 : ‖w + ((2 * ε : ℝ) : ℂ)‖ ^ 2 = (w.re + 2 * ε) ^ 2 + w.im ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply]; simp [sq] have h3 : ‖w ^ 2 + (ε : ℂ) * w + 1‖ ^ 2 = (w.re ^ 2 - w.im ^ 2 + ε * w.re + 1) ^ 2 + (2 * w.re * w.im + ε * w.im) ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply] simp [sq] ring have h4 : ‖w‖ ^ 2 = w.re ^ 2 + w.im ^ 2 := by rw [Complex.sq_norm, Complex.normSq_apply]; simp [sq] have h1_4 : ‖w - (ε : ℂ)‖ ^ 4 = (‖w - (ε : ℂ)‖ ^ 2) ^ 2 := by ring have h4_4 : ‖w‖ ^ 4 = (‖w‖ ^ 2) ^ 2 := by ring rw [h1_4, h4_4, h1, h2, h3, h4] rcases hε with rfl | rfl <;> ring /-- Pointwise upper bound for the `m = 3` quartic sum across ALL of `ℂ`: `‖w - ε‖⁴ + 2 ‖w - ε‖² ‖w + 2ε‖² + 3 ‖w² + ε w + 1‖² ≤ 27 max(1, ‖w‖)⁴`. -/ lemma mod_three_quartic_sum_le (w : ℂ) {ε : ℝ} (hε : ε = 1 ∨ ε = -1) : ‖w - (ε : ℂ)‖ ^ 4 + 2 * ‖w - (ε : ℂ)‖ ^ 2 * ‖w + ((2 * ε : ℝ) : ℂ)‖ ^ 2 + 3 * ‖w ^ 2 + (ε : ℂ) * w + 1‖ ^ 2 ≤ 27 * (max (1 : ℝ) ‖w‖) ^ 4 := by rw [mod_three_exact_identity w hε] set r : ℝ := ‖w‖ have hr : 0 ≤ r := norm_nonneg w have habs_re : |w.re| ≤ r := Complex.abs_re_le_norm w have hre_lo : -r ≤ ε * w.re := by rcases hε with rfl | rfl · simpa using (abs_le.mp habs_re).1 · have := (abs_le.mp habs_re).2; linarith have hre_hi : ε * w.re ≤ r := by rcases hε with rfl | rfl · simpa using (abs_le.mp habs_re).2 · have := (abs_le.mp habs_re).1; linarith by_cases h : r ≤ 1 · rw [max_eq_left h, one_pow, mul_one] have hcross : 6 * (r ^ 2 - 1) * ε * w.re ≤ 6 * (1 - r ^ 2) * r := by have hnonpos : r ^ 2 - 1 ≤ 0 := by nlinarith nlinarith have hfac : 27 - (6 * r ^ 4 + 9 * r ^ 2 + 12 + 6 * (1 - r ^ 2) * r) = 3 * (1 - r) * (2 * r ^ 3 + 3 * r + 5) := by ring have hpos : 0 ≤ 3 * (1 - r) * (2 * r ^ 3 + 3 * r + 5) := by have h1 : 0 ≤ 1 - r := by linarith have h2 : 0 ≤ 2 * r ^ 3 + 3 * r + 5 := by positivity exact mul_nonneg (by linarith) h2 linarith · push Not at h rw [max_eq_right (le_of_lt h)] have hcross : 6 * (r ^ 2 - 1) * ε * w.re ≤ 6 * (r ^ 2 - 1) * r := by have hnonneg : 0 ≤ r ^ 2 - 1 := by nlinarith nlinarith have hfac : 27 * r ^ 4 - (6 * r ^ 4 + 9 * r ^ 2 + 12 + 6 * (r ^ 2 - 1) * r) = 3 * (r - 1) * (7 * r ^ 3 + 5 * r ^ 2 + 2 * r + 4) := by ring have hpos : 0 ≤ 3 * (r - 1) * (7 * r ^ 3 + 5 * r ^ 2 + 2 * r + 4) := by have h1 : 0 ≤ r - 1 := by linarith have h2 : 0 ≤ 7 * r ^ 3 + 5 * r ^ 2 + 2 * r + 4 := by positivity exact mul_nonneg (by linarith) h2 linarith /-- **Exact `m = 3` Pointwise Multiplicative Bound (`10^{1/4}`)**: for ALL `w ∈ ℂ` and `ε ∈ {1, -1}`, `‖w - ε‖²⁴ · ‖w + 2ε‖¹² · ‖w² + ε w + 1‖² ≤ (3³⁸ / 10¹⁰) · max(1, ‖w‖)⁴⁰`. -/ lemma mod_three_quartic_bound (w : ℂ) {ε : ℤ} (hε : ε = 1 ∨ ε = -1) : ‖w - (ε : ℂ)‖ ^ 24 * ‖w + (2 : ℂ) * (ε : ℂ)‖ ^ 12 * ‖w ^ 2 + (ε : ℂ) * w + 1‖ ^ 2 ≤ ((3 : ℝ) ^ 38 / (10 : ℝ) ^ 10) * (max (1 : ℝ) ‖w‖) ^ 40 := by have hεR : (ε : ℝ) = 1 ∨ (ε : ℝ) = -1 := by rcases hε with rfl | rfl <;> simp have hsum : ‖w - (ε : ℂ)‖ ^ 4 + 2 * ‖w - (ε : ℂ)‖ ^ 2 * ‖w + (2 : ℂ) * (ε : ℂ)‖ ^ 2 + 3 * ‖w ^ 2 + (ε : ℂ) * w + 1‖ ^ 2 ≤ 27 * (max (1 : ℝ) ‖w‖) ^ 4 := by have h := mod_three_quartic_sum_le w hεR simpa [Complex.ofReal_intCast, Complex.ofReal_mul] using h set A : ℝ := ‖w - (ε : ℂ)‖ ^ 4 / 81 set B : ℝ := ‖w - (ε : ℂ)‖ ^ 2 * ‖w + (2 : ℂ) * (ε : ℂ)‖ ^ 2 / 81 set C_val : ℝ := ‖w ^ 2 + (ε : ℂ) * w + 1‖ ^ 2 / 9 have ham := weighted_am_gm_three_six_one (show 0 ≤ A by positivity) (show 0 ≤ B by positivity) (show 0 ≤ C_val by positivity) have hlin : 3 * A + 6 * B + C_val ≤ (max (1 : ℝ) ‖w‖) ^ 4 := by dsimp [A, B, C_val] linarith have hdiv : (3 * A + 6 * B + C_val) / 10 ≤ (max (1 : ℝ) ‖w‖) ^ 4 / 10 := by linarith have hpow := pow_le_pow_left₀ (by positivity) hdiv 10 have hcomb : A ^ 3 * B ^ 6 * C_val ≤ ((max (1 : ℝ) ‖w‖) ^ 4 / 10) ^ 10 := le_trans ham hpow have hLHS : ‖w - (ε : ℂ)‖ ^ 24 * ‖w + (2 : ℂ) * (ε : ℂ)‖ ^ 12 * ‖w ^ 2 + (ε : ℂ) * w + 1‖ ^ 2 = (3 : ℝ) ^ 38 * (A ^ 3 * B ^ 6 * C_val) := by dsimp [A, B, C_val] ring have hRHS : (3 : ℝ) ^ 38 * ((max (1 : ℝ) ‖w‖) ^ 4 / 10) ^ 10 = ((3 : ℝ) ^ 38 / (10 : ℝ) ^ 10) * (max (1 : ℝ) ‖w‖) ^ 40 := by ring rw [hLHS, ← hRHS] exact mul_le_mul_of_nonneg_left hcomb (by positivity) /-! ## Section 6: Master Unified Cyclotomic-Congruence Theorems -/ /-- Auxiliary: if `B * f = X^N - C ε + C m * g`, then `X^N - C ε = C m * (-g) + f * B`. -/ lemma binomial_congruence_sub {m N : ℕ} {ε : ℤ} {f B g : ℤ[X]} (h : B * f = X ^ N - C ε + C (m : ℤ) * g) : X ^ N - C ε = C (m : ℤ) * (-g) + f * B := by linear_combination -h /-- Auxiliary: if `B * f = X^N - C ε + C m * g` and `k + ℓ = m`, then `C k * X^N + C (ℓ * ε) = C m * (C ε - C k * g) + f * (C k * B)`. -/ lemma binomial_congruence_linear_pair {m N k ℓ : ℕ} {ε : ℤ} {f B g : ℤ[X]} (hkl : k + ℓ = m) (h : B * f = X ^ N - C ε + C (m : ℤ) * g) : C (k : ℤ) * X ^ N + C ((ℓ : ℤ) * ε) = C (m : ℤ) * (C ε - C (k : ℤ) * g) + f * (C (k : ℤ) * B) := by have hm : (m : ℤ) = (k : ℤ) + (ℓ : ℤ) := by exact_mod_cast hkl.symm rw [hm, map_add] have h1 : X ^ N - C ε = C ((k : ℤ) + (ℓ : ℤ)) * (-g) + f * B := by rw [← hm]; exact binomial_congruence_sub h rw [map_add] at h1 have hCmul : C ((ℓ : ℤ) * ε) = C (ℓ : ℤ) * C ε := map_mul C _ _ rw [hCmul] linear_combination C (k : ℤ) * h1 /-- Auxiliary for `m = 2`: if `B * f = X^N - C ε + C 2 * g`, then `X^N + C ε` and `X^{2N} + 1` are congruent to `0` modulo `(2, f)`. -/ lemma binomial_congruence_mod_two_aux {N : ℕ} {ε : ℤ} {f B g : ℤ[X]} (hε : ε = 1 ∨ ε = -1) (h : B * f = X ^ N - C ε + C (2 : ℤ) * g) : (X ^ N + C ε = C (2 : ℤ) * (C ε - g) + f * B) ∧ (∃ g₂ q₂ : ℤ[X], X ^ (2 * N) + 1 = C (2 : ℤ) * g₂ + f * q₂) := by have h1 : X ^ N - C ε = C (2 : ℤ) * (-g) + f * B := binomial_congruence_sub h have hC2 : C (2 : ℤ) = (2 : ℤ[X]) := by norm_num have hplus : X ^ N + C ε = C (2 : ℤ) * (C ε - g) + f * B := by rw [hC2] at h1 ⊢ linear_combination h1 have hε2 : C ε * C ε = (1 : ℤ[X]) := by rcases hε with rfl | rfl <;> simp have hpow : (X : ℤ[X]) ^ (2 * N) = (X ^ N) ^ 2 := by rw [mul_comm, pow_mul] refine ⟨hplus, C (2 : ℤ) * g ^ 2 + C ε * X ^ N, B * (f * B - C (4 : ℤ) * g), ?_⟩ have hC4 : C (4 : ℤ) = (4 : ℤ[X]) := by norm_num have hsq : (X ^ N - C ε) ^ 2 = (C (2 : ℤ) * (-g) + f * B) ^ 2 := by rw [h1] rw [hC2] at hsq rw [hpow, hC2, hC4] linear_combination hsq - hε2 /-- Auxiliary for `m = 3`: if `B * f = X^N - C ε + C 3 * g`, then `X^{2N} + C ε * X^N + 1` is divisible by `3` modulo `f`. -/ lemma binomial_congruence_mod_three_cyc {N : ℕ} {ε : ℤ} {f B g : ℤ[X]} (hε : ε = 1 ∨ ε = -1) (h : B * f = X ^ N - C ε + C (3 : ℤ) * g) : ∃ g₃ q₃ : ℤ[X], X ^ (2 * N) + C ε * X ^ N + 1 = C (3 : ℤ) * g₃ + f * q₃ := by have h1 : X ^ N - C ε = C (3 : ℤ) * (-g) + f * B := binomial_congruence_sub h have hε2 : C ε * C ε = (1 : ℤ[X]) := by rcases hε with rfl | rfl <;> simp have hpow : (X : ℤ[X]) ^ (2 * N) = (X ^ N) ^ 2 := by rw [mul_comm, pow_mul] have hC2 : C (2 : ℤ) = (2 : ℤ[X]) := by norm_num have hC3 : C (3 : ℤ) = (3 : ℤ[X]) := by norm_num refine ⟨1 - g * (X ^ N + C (2 : ℤ) * C ε), B * (X ^ N + C (2 : ℤ) * C ε), ?_⟩ rw [hC3] at h1 rw [hpow, hC2, hC3] linear_combination (X ^ N + 2 * C ε) * h1 + 2 * hε2 /-- **Master Linear-Pair Mahler Measure Bound (all `m ≥ 3`, all `N ≥ 1`):** For every monic cyclotomic-free `f ∈ ℤ[X]` with `f(0) = ±1` and `B f ≡ X^N - ε (mod m)`, `M(f)^{2N} ≥ (⌊m/2⌋ · ⌈m/2⌉ + 1)^d`. -/ theorem master_linear_pair_mahler_pow_bound {m N : ℕ} {ε : ℤ} {f : ℤ[X]} (hm : 3 ≤ m) (hN : 0 < N) (hf : f.Monic) (h0 : f.coeff 0 = 1 ∨ f.coeff 0 = -1) (hnc : HasNoCyclotomicFactor f) (hcong : SatisfiesBinomialCongruence m N ε f) : ((((m / 2 : ℕ) : ℝ) * ((m - m / 2 : ℕ) : ℝ) + 1) ^ f.natDegree) ≤ (mahlerMeasureZ f) ^ (2 * N) := by rcases hcong with ⟨hε, B, g, hBf⟩ set k : ℕ := m / 2 set ℓ : ℕ := m - k have hk : 1 ≤ k := by omega have hkl : k + ℓ = m := by omega have hℓ : ℓ = k ∨ ℓ = k + 1 := by omega set fc : ℂ[X] := f.map (algebraMap ℤ ℂ) have hcard : fc.roots.card = f.natDegree := map_int_complex_roots_card f -- Resultant lower bound #1: `P₁ = X^N - C ε` have hres1 : (m : ℝ) ^ f.natDegree ≤ (fc.roots.map (fun r => ‖r ^ N - (ε : ℂ)‖)).prod := by have h := prod_norm_aeval_ge_pow_of_congruence hf (binomial_congruence_sub hBf) (by intro r hr have hr0 : Polynomial.aeval r f = 0 := by rw [Polynomial.mem_roots (map_int_complex_ne_zero hf.ne_zero)] at hr rwa [Polynomial.aeval_def, Polynomial.eval₂_eq_eval_map] exact aeval_X_pow_sub_ne_zero hnc hN hε hr0) simpa [fc] using h -- Resultant lower bound #2: `P₂ = C k * X^N + C (ℓ * ε)` have hres2 : (m : ℝ) ^ f.natDegree ≤ (fc.roots.map (fun r => ‖(k : ℂ) * r ^ N + (ℓ : ℂ) * (ε : ℂ)‖)).prod := by have h := prod_norm_aeval_ge_pow_of_congruence hf (binomial_congruence_linear_pair hkl hBf) (by intro r hr have hr0 : Polynomial.aeval r f = 0 := by rw [Polynomial.mem_roots (map_int_complex_ne_zero hf.ne_zero)] at hr rwa [Polynomial.aeval_def, Polynomial.eval₂_eq_eval_map] exact aeval_linear_pair_ne_zero hf h0 hnc hN hε hk hℓ hr0) simpa [fc] using h -- Combine powers: `hres1 ^ (2 * (k * ℓ)) * hres2 ^ 2` have hLHS : ((m : ℝ) ^ f.natDegree) ^ (2 * (k * ℓ)) * ((m : ℝ) ^ f.natDegree) ^ 2 ≤ (fc.roots.map (fun r => ‖r ^ N - (ε : ℂ)‖ ^ (2 * (k * ℓ)) * ‖(k : ℂ) * r ^ N + (ℓ : ℂ) * (ε : ℂ)‖ ^ 2)).prod := by rw [multiset_map_mul_prod, multiset_map_pow_prod, multiset_map_pow_prod] have hnonneg1 : 0 ≤ (fc.roots.map (fun r => ‖r ^ N - (ε : ℂ)‖)).prod ^ (2 * (k * ℓ)) := pow_nonneg (prod_nonneg_of_mem (by intro x hx; rcases Multiset.mem_map.mp hx with ⟨r, _, rfl⟩; exact norm_nonneg _)) _ exact mul_le_mul (pow_le_pow_left₀ (by positivity) hres1 _) (pow_le_pow_left₀ (by positivity) hres2 _) (by positivity) hnonneg1 -- Pointwise upper bound on every root `r ∈ fc.roots` set Cconst : ℝ := (((k : ℝ) + (ℓ : ℝ)) ^ 2 / (((k * ℓ : ℕ) : ℝ) + 1)) ^ (k * ℓ + 1) have hRHS : (fc.roots.map (fun r => ‖r ^ N - (ε : ℂ)‖ ^ (2 * (k * ℓ)) * ‖(k : ℂ) * r ^ N + (ℓ : ℂ) * (ε : ℂ)‖ ^ 2)).prod ≤ (fc.roots.map (fun r => Cconst * (max (1 : ℝ) ‖r ^ N‖) ^ (2 * (k * ℓ + 1)))).prod := by apply prod_le_prod_of_map · intro r _; positivity · intro r _ exact linear_pair_norm_prod_bound (r ^ N) hε k ℓ -- Simplify RHS to `Cconst^d * M(f)^{2 N (k ℓ + 1)}` have hRHS_eq : (fc.roots.map (fun r => Cconst * (max (1 : ℝ) ‖r ^ N‖) ^ (2 * (k * ℓ + 1)))).prod = Cconst ^ f.natDegree * (mahlerMeasureZ f) ^ (2 * N * (k * ℓ + 1)) := by rw [multiset_map_mul_prod, multiset_map_const_prod, hcard] congr 1 have hmap : fc.roots.map (fun r => (max (1 : ℝ) ‖r ^ N‖) ^ (2 * (k * ℓ + 1))) = fc.roots.map (fun r => (max (1 : ℝ) ‖r‖) ^ (2 * N * (k * ℓ + 1))) := by apply Multiset.map_congr rfl intro r _ rw [max_one_norm_pow_eq r N, ← pow_mul] congr 1; ring rw [hmap, multiset_map_pow_prod, ← mahlerMeasureZ_of_monic hf] have hcomb : ((m : ℝ) ^ f.natDegree) ^ (2 * (k * ℓ)) * ((m : ℝ) ^ f.natDegree) ^ 2 ≤ Cconst ^ f.natDegree * (mahlerMeasureZ f) ^ (2 * N * (k * ℓ + 1)) := by rw [← hRHS_eq] exact le_trans hLHS hRHS -- Cancel `(m : ℝ)^{2 d (k ℓ + 1)} > 0` have hm_eq : (k : ℝ) + (ℓ : ℝ) = (m : ℝ) := by exact_mod_cast hkl have hm_pos : (0 : ℝ) < (m : ℝ) := by exact_mod_cast (by omega : 0 < m) set D : ℝ := ((k * ℓ : ℕ) : ℝ) + 1 have hD_pos : (0 : ℝ) < D := by positivity have hC_eq : Cconst = ((m : ℝ) ^ 2 / D) ^ (k * ℓ + 1) := by dsimp [Cconst, D]; rw [hm_eq] rw [hC_eq] at hcomb have hLHS_simp : ((m : ℝ) ^ f.natDegree) ^ (2 * (k * ℓ)) * ((m : ℝ) ^ f.natDegree) ^ 2 = ((m : ℝ) ^ 2) ^ ((k * ℓ + 1) * f.natDegree) := by rw [← pow_mul, ← pow_mul, ← pow_add, ← pow_mul] congr 1; ring have hRHS_simp : (((m : ℝ) ^ 2 / D) ^ (k * ℓ + 1)) ^ f.natDegree * (mahlerMeasureZ f) ^ (2 * N * (k * ℓ + 1)) = ((m : ℝ) ^ 2) ^ ((k * ℓ + 1) * f.natDegree) * ((mahlerMeasureZ f) ^ (2 * N) / D ^ f.natDegree) ^ (k * ℓ + 1) := by rw [div_pow, div_pow, div_pow, ← pow_mul, ← pow_mul, ← pow_mul, ← pow_mul, ← pow_mul, mul_comm f.natDegree (k * ℓ + 1)] ring rw [hLHS_simp, hRHS_simp] at hcomb have hm_pow_pos : (0 : ℝ) < ((m : ℝ) ^ 2) ^ ((k * ℓ + 1) * f.natDegree) := by positivity have hge1 : (1 : ℝ) ≤ ((mahlerMeasureZ f) ^ (2 * N) / D ^ f.natDegree) ^ (k * ℓ + 1) := by nlinarith have hbase_ge1 : (1 : ℝ) ≤ (mahlerMeasureZ f) ^ (2 * N) / D ^ f.natDegree := by by_contra hlt push Not at hlt have hnonneg : 0 ≤ (mahlerMeasureZ f) ^ (2 * N) / D ^ f.natDegree := by exact div_nonneg (pow_nonneg (mahlerMeasure_nonneg _) _) (by positivity) have hpow_lt : ((mahlerMeasureZ f) ^ (2 * N) / D ^ f.natDegree) ^ (k * ℓ + 1) < 1 := pow_lt_one₀ hnonneg hlt (by omega) linarith have hD_pow_pos : (0 : ℝ) < D ^ f.natDegree := pow_pos hD_pos _ have hfin := (one_le_div hD_pow_pos).mp hbase_ge1 simpa [D, k, ℓ, Nat.cast_mul] using hfin /-- **Master Even-Modulus Mahler Measure Bound (`m ≥ 4` even)**: `M(f)^{2N} ≥ ((m² + 4) / 4)^d`, and `M(f) ≥ (√(m² + 4) / 2)^{d / N}`. -/ theorem master_even_mahler_pow_bound {m N : ℕ} {ε : ℤ} {f : ℤ[X]} (hm : 4 ≤ m) (heven : Even m) (hN : 0 < N) (hf : f.Monic) (h0 : f.coeff 0 = 1 ∨ f.coeff 0 = -1) (hnc : HasNoCyclotomicFactor f) (hcong : SatisfiesBinomialCongruence m N ε f) : (((m : ℝ) ^ 2 + 4) / 4) ^ f.natDegree ≤ (mahlerMeasureZ f) ^ (2 * N) := by have h := master_linear_pair_mahler_pow_bound (by omega) hN hf h0 hnc hcong rcases heven with ⟨k, rfl⟩ have hk1 : (k + k) / 2 = k := by omega have hk2 : k + k - k = k := by omega rw [hk1, hk2] at h have heq : (k : ℝ) * (k : ℝ) + 1 = (((k + k : ℕ) : ℝ) ^ 2 + 4) / 4 := by push_cast; ring rwa [heq] at h /-- **Master Odd-Modulus Mahler Measure Bound (`m ≥ 3` odd)**: `M(f)^{2N} ≥ ((m² + 3) / 4)^d`, and `M(f) ≥ (√(m² + 3) / 2)^{d / N}`. -/ theorem master_odd_mahler_pow_bound {m N : ℕ} {ε : ℤ} {f : ℤ[X]} (hm : 3 ≤ m) (hodd : Odd m) (hN : 0 < N) (hf : f.Monic) (h0 : f.coeff 0 = 1 ∨ f.coeff 0 = -1) (hnc : HasNoCyclotomicFactor f) (hcong : SatisfiesBinomialCongruence m N ε f) : (((m : ℝ) ^ 2 + 3) / 4) ^ f.natDegree ≤ (mahlerMeasureZ f) ^ (2 * N) := by have h := master_linear_pair_mahler_pow_bound hm hN hf h0 hnc hcong rcases hodd with ⟨k, rfl⟩ have hk1 : (2 * k + 1) / 2 = k := by omega have hk2 : 2 * k + 1 - k = k + 1 := by omega rw [hk1, hk2] at h have heq : (k : ℝ) * ((k + 1 : ℕ) : ℝ) + 1 = (((2 * k + 1 : ℕ) : ℝ) ^ 2 + 3) / 4 := by push_cast; ring rwa [heq] at h /-- **Master `m = 3` Exact 10-Term Mahler Measure Bound (`10^{1/4} ≈ 1.77828`)**: For every monic cyclotomic-free `f ∈ ℤ[X]` with `f(0) = ±1` and `B f ≡ X^N - ε (mod 3)`, `M(f)^{4N} ≥ 10^d`! -/ theorem master_mod_three_mahler_pow_bound {N : ℕ} {ε : ℤ} {f : ℤ[X]} (hN : 0 < N) (hf : f.Monic) (h0 : f.coeff 0 = 1 ∨ f.coeff 0 = -1) (hnc : HasNoCyclotomicFactor f) (hcong : SatisfiesBinomialCongruence 3 N ε f) : (10 : ℝ) ^ f.natDegree ≤ (mahlerMeasureZ f) ^ (4 * N) := by rcases hcong with ⟨hε, B, g, hBf⟩ set fc : ℂ[X] := f.map (algebraMap ℤ ℂ) have hcard : fc.roots.card = f.natDegree := map_int_complex_roots_card f -- Resultant #1: `X^N - C ε` have hres1 : (3 : ℝ) ^ f.natDegree ≤ (fc.roots.map (fun r => ‖r ^ N - (ε : ℂ)‖)).prod := by have h := prod_norm_aeval_ge_pow_of_congruence hf (binomial_congruence_sub hBf) (by intro r hr have hr0 : Polynomial.aeval r f = 0 := by rw [Polynomial.mem_roots (map_int_complex_ne_zero hf.ne_zero)] at hr rwa [Polynomial.aeval_def, Polynomial.eval₂_eq_eval_map] exact aeval_X_pow_sub_ne_zero hnc hN hε hr0) simpa [fc] using h -- Resultant #2: `X^N + 2 C ε` have hres2 : (3 : ℝ) ^ f.natDegree ≤ (fc.roots.map (fun r => ‖r ^ N + (2 : ℂ) * (ε : ℂ)‖)).prod := by have h := prod_norm_aeval_ge_pow_of_congruence hf (binomial_congruence_linear_pair (k := 1) (ℓ := 2) (m := 3) (by decide) hBf) (by intro r hr have hr0 : Polynomial.aeval r f = 0 := by rw [Polynomial.mem_roots (map_int_complex_ne_zero hf.ne_zero)] at hr rwa [Polynomial.aeval_def, Polynomial.eval₂_eq_eval_map] exact aeval_linear_pair_ne_zero hf h0 hnc hN hε (by decide) (Or.inr rfl) hr0) have hmap : fc.roots.map (fun r => ‖Polynomial.aeval r (C (1 : ℤ) * X ^ N + C ((2 : ℤ) * ε))‖) = fc.roots.map (fun r => ‖r ^ N + (2 : ℂ) * (ε : ℂ)‖) := by apply Multiset.map_congr rfl intro r _ simp [map_ofNat] rw [← hmap] simpa [fc] using h -- Resultant #3: `X^{2N} + C ε * X^N + 1` rcases binomial_congruence_mod_three_cyc hε hBf with ⟨g₃, q₃, hcyc3⟩ have hres3 : (3 : ℝ) ^ f.natDegree ≤ (fc.roots.map (fun r => ‖(r ^ N) ^ 2 + (ε : ℂ) * r ^ N + 1‖)).prod := by have h := prod_norm_aeval_ge_pow_of_congruence hf hcyc3 (by intro r hr have hr0 : Polynomial.aeval r f = 0 := by rw [Polynomial.mem_roots (map_int_complex_ne_zero hf.ne_zero)] at hr rwa [Polynomial.aeval_def, Polynomial.eval₂_eq_eval_map] exact aeval_cyclotomic_three_ne_zero hnc hN hε hr0) have hmap : fc.roots.map (fun r => ‖Polynomial.aeval r (X ^ (2 * N) + C ε * X ^ N + 1)‖) = fc.roots.map (fun r => ‖(r ^ N) ^ 2 + (ε : ℂ) * r ^ N + 1‖) := by apply Multiset.map_congr rfl intro r _ simp [mul_comm 2 N, pow_mul] rw [← hmap] simpa [fc] using h -- Multiply powers `24, 12, 2` have hLHS : ((3 : ℝ) ^ f.natDegree) ^ 24 * ((3 : ℝ) ^ f.natDegree) ^ 12 * ((3 : ℝ) ^ f.natDegree) ^ 2 ≤ (fc.roots.map (fun r => ‖r ^ N - (ε : ℂ)‖ ^ 24 * ‖r ^ N + (2 : ℂ) * (ε : ℂ)‖ ^ 12 * ‖(r ^ N) ^ 2 + (ε : ℂ) * r ^ N + 1‖ ^ 2)).prod := by rw [multiset_map_mul_prod, multiset_map_mul_prod, multiset_map_pow_prod, multiset_map_pow_prod, multiset_map_pow_prod] have hnonneg1 : 0 ≤ (fc.roots.map (fun r => ‖r ^ N - (ε : ℂ)‖)).prod ^ 24 := pow_nonneg (prod_nonneg_of_mem (by intro x hx; rcases Multiset.mem_map.mp hx with ⟨r, _, rfl⟩; exact norm_nonneg _)) _ have hnonneg2 : 0 ≤ (fc.roots.map (fun r => ‖r ^ N + (2 : ℂ) * (ε : ℂ)‖)).prod ^ 12 := pow_nonneg (prod_nonneg_of_mem (by intro x hx; rcases Multiset.mem_map.mp hx with ⟨r, _, rfl⟩; exact norm_nonneg _)) _ have h12 : ((3 : ℝ) ^ f.natDegree) ^ 24 * ((3 : ℝ) ^ f.natDegree) ^ 12 ≤ (fc.roots.map (fun r => ‖r ^ N - (ε : ℂ)‖)).prod ^ 24 * (fc.roots.map (fun r => ‖r ^ N + (2 : ℂ) * (ε : ℂ)‖)).prod ^ 12 := mul_le_mul (pow_le_pow_left₀ (by positivity) hres1 _) (pow_le_pow_left₀ (by positivity) hres2 _) (by positivity) hnonneg1 exact mul_le_mul h12 (pow_le_pow_left₀ (by positivity) hres3 _) (by positivity) (mul_nonneg hnonneg1 hnonneg2) -- Pointwise upper bound via `mod_three_quartic_bound` have hRHS : (fc.roots.map (fun r => ‖r ^ N - (ε : ℂ)‖ ^ 24 * ‖r ^ N + (2 : ℂ) * (ε : ℂ)‖ ^ 12 * ‖(r ^ N) ^ 2 + (ε : ℂ) * r ^ N + 1‖ ^ 2)).prod ≤ (fc.roots.map (fun r => ((3 : ℝ) ^ 38 / (10 : ℝ) ^ 10) * (max (1 : ℝ) ‖r ^ N‖) ^ 40)).prod := by apply prod_le_prod_of_map · intro r _; positivity · intro r _; exact mod_three_quartic_bound (r ^ N) hε have hRHS_eq : (fc.roots.map (fun r => ((3 : ℝ) ^ 38 / (10 : ℝ) ^ 10) * (max (1 : ℝ) ‖r ^ N‖) ^ 40)).prod = ((3 : ℝ) ^ 38 / (10 : ℝ) ^ 10) ^ f.natDegree * (mahlerMeasureZ f) ^ (40 * N) := by rw [multiset_map_mul_prod, multiset_map_const_prod, hcard] congr 1 have hmap : fc.roots.map (fun r => (max (1 : ℝ) ‖r ^ N‖) ^ 40) = fc.roots.map (fun r => (max (1 : ℝ) ‖r‖) ^ (40 * N)) := by apply Multiset.map_congr rfl intro r _ rw [max_one_norm_pow_eq r N, ← pow_mul] congr 1; ring rw [hmap, multiset_map_pow_prod, ← mahlerMeasureZ_of_monic hf] have hcomb : (3 : ℝ) ^ (38 * f.natDegree) ≤ (3 : ℝ) ^ (38 * f.natDegree) * ((mahlerMeasureZ f) ^ (4 * N) / (10 : ℝ) ^ f.natDegree) ^ 10 := by have h1 := le_trans hLHS hRHS rw [hRHS_eq] at h1 have hL : ((3 : ℝ) ^ f.natDegree) ^ 24 * ((3 : ℝ) ^ f.natDegree) ^ 12 * ((3 : ℝ) ^ f.natDegree) ^ 2 = (3 : ℝ) ^ (38 * f.natDegree) := by rw [← pow_mul, ← pow_mul, ← pow_mul, ← pow_add, ← pow_add] congr 1; ring have hR : ((3 : ℝ) ^ 38 / (10 : ℝ) ^ 10) ^ f.natDegree * (mahlerMeasureZ f) ^ (40 * N) = (3 : ℝ) ^ (38 * f.natDegree) * ((mahlerMeasureZ f) ^ (4 * N) / (10 : ℝ) ^ f.natDegree) ^ 10 := by rw [div_pow, div_pow, ← pow_mul, ← pow_mul, ← pow_mul, ← pow_mul] have : 10 * f.natDegree = f.natDegree * 10 := mul_comm _ _ have : 40 * N = 4 * N * 10 := by ring rw [‹10 * f.natDegree = f.natDegree * 10›, ‹40 * N = 4 * N * 10›] ring rwa [hL, hR] at h1 have h3pos : (0 : ℝ) < (3 : ℝ) ^ (38 * f.natDegree) := by positivity have hge1 : (1 : ℝ) ≤ ((mahlerMeasureZ f) ^ (4 * N) / (10 : ℝ) ^ f.natDegree) ^ 10 := by nlinarith have hbase_ge1 : (1 : ℝ) ≤ (mahlerMeasureZ f) ^ (4 * N) / (10 : ℝ) ^ f.natDegree := by by_contra hlt push Not at hlt have hnonneg : 0 ≤ (mahlerMeasureZ f) ^ (4 * N) / (10 : ℝ) ^ f.natDegree := div_nonneg (pow_nonneg (mahlerMeasure_nonneg _) _) (by positivity) have hlt1 : ((mahlerMeasureZ f) ^ (4 * N) / (10 : ℝ) ^ f.natDegree) ^ 10 < 1 := pow_lt_one₀ hnonneg hlt (by decide) linarith exact (one_le_div (by positivity)).mp hbase_ge1 /-- **Master `m = 2` Exact 5-Term Mahler Measure Bound (`5^{1/4} ≈ 1.49535`)**: For every monic cyclotomic-free `f ∈ ℤ[X]` with `B f ≡ X^N - ε (mod 2)`, `M(f)^{4N} ≥ 5^d`! -/ theorem master_mod_two_mahler_pow_bound {N : ℕ} {ε : ℤ} {f : ℤ[X]} (hN : 0 < N) (hf : f.Monic) (hnc : HasNoCyclotomicFactor f) (hcong : SatisfiesBinomialCongruence 2 N ε f) : (5 : ℝ) ^ f.natDegree ≤ (mahlerMeasureZ f) ^ (4 * N) := by rcases hcong with ⟨hε, B, g, hBf⟩ set fc : ℂ[X] := f.map (algebraMap ℤ ℂ) have hcard : fc.roots.card = f.natDegree := map_int_complex_roots_card f rcases binomial_congruence_mod_two_aux hε hBf with ⟨hplus, g₂, q₂, h2N_add⟩ -- Resultant #1: `X^N - C ε` have hres1 : (2 : ℝ) ^ f.natDegree ≤ (fc.roots.map (fun r => ‖r ^ N - (ε : ℂ)‖)).prod := by have h := prod_norm_aeval_ge_pow_of_congruence hf (binomial_congruence_sub hBf) (by intro r hr have hr0 : Polynomial.aeval r f = 0 := by rw [Polynomial.mem_roots (map_int_complex_ne_zero hf.ne_zero)] at hr rwa [Polynomial.aeval_def, Polynomial.eval₂_eq_eval_map] exact aeval_X_pow_sub_ne_zero hnc hN hε hr0) simpa [fc] using h -- Resultant #2: `X^N + C ε` have hres2 : (2 : ℝ) ^ f.natDegree ≤ (fc.roots.map (fun r => ‖r ^ N + (ε : ℂ)‖)).prod := by have h := prod_norm_aeval_ge_pow_of_congruence hf hplus (by intro r hr have hr0 : Polynomial.aeval r f = 0 := by rw [Polynomial.mem_roots (map_int_complex_ne_zero hf.ne_zero)] at hr rwa [Polynomial.aeval_def, Polynomial.eval₂_eq_eval_map] exact aeval_X_pow_add_ne_zero hnc hN hε hr0) simpa [fc] using h -- Product of #1 and #2 gives `4^d ≤ ∏ ‖(r^N)^2 - 1‖` have hres12 : (4 : ℝ) ^ f.natDegree ≤ (fc.roots.map (fun r => ‖(r ^ N) ^ 2 - 1‖)).prod := by have hnonneg1 : 0 ≤ (fc.roots.map (fun r => ‖r ^ N - (ε : ℂ)‖)).prod := prod_nonneg_of_mem (by intro x hx; rcases Multiset.mem_map.mp hx with ⟨r, _, rfl⟩; exact norm_nonneg _) have hmul := mul_le_mul hres1 hres2 (by positivity) hnonneg1 rw [← mul_pow, show (2 : ℝ) * 2 = 4 by norm_num, ← multiset_map_mul_prod] at hmul have hmap : fc.roots.map (fun r => ‖r ^ N - (ε : ℂ)‖ * ‖r ^ N + (ε : ℂ)‖) = fc.roots.map (fun r => ‖(r ^ N) ^ 2 - 1‖) := by apply Multiset.map_congr rfl intro r _ rw [← norm_mul] congr 1 rcases hε with rfl | rfl <;> push_cast <;> ring rwa [hmap] at hmul -- Resultant #3: `X^{2N} + 1` have hres3 : (2 : ℝ) ^ f.natDegree ≤ (fc.roots.map (fun r => ‖(r ^ N) ^ 2 + 1‖)).prod := by have h := prod_norm_aeval_ge_pow_of_congruence hf h2N_add (by intro r hr have hr0 : Polynomial.aeval r f = 0 := by rw [Polynomial.mem_roots (map_int_complex_ne_zero hf.ne_zero)] at hr rwa [Polynomial.aeval_def, Polynomial.eval₂_eq_eval_map] exact aeval_X_pow_two_mul_add_one_ne_zero hnc hN hr0) have hmap : fc.roots.map (fun r => ‖Polynomial.aeval r ((X ^ (2 * N) + 1 : ℤ[X]))‖) = fc.roots.map (fun r => ‖(r ^ N) ^ 2 + 1‖) := by apply Multiset.map_congr rfl intro r _ simp [mul_comm 2 N, pow_mul] rw [← hmap] simpa [fc] using h -- Combine: `hres12 ^ 8 * hres3 ^ 2` have hLHS : ((4 : ℝ) ^ f.natDegree) ^ 8 * ((2 : ℝ) ^ f.natDegree) ^ 2 ≤ (fc.roots.map (fun r => ‖(r ^ N) ^ 2 - 1‖ ^ 8 * ‖(r ^ N) ^ 2 + 1‖ ^ 2)).prod := by rw [multiset_map_mul_prod, multiset_map_pow_prod, multiset_map_pow_prod] have hnonneg12 : 0 ≤ (fc.roots.map (fun r => ‖(r ^ N) ^ 2 - 1‖)).prod ^ 8 := pow_nonneg (prod_nonneg_of_mem (by intro x hx; rcases Multiset.mem_map.mp hx with ⟨r, _, rfl⟩; exact norm_nonneg _)) _ exact mul_le_mul (pow_le_pow_left₀ (by positivity) hres12 _) (pow_le_pow_left₀ (by positivity) hres3 _) (by positivity) hnonneg12 have hRHS : (fc.roots.map (fun r => ‖(r ^ N) ^ 2 - 1‖ ^ 8 * ‖(r ^ N) ^ 2 + 1‖ ^ 2)).prod ≤ (fc.roots.map (fun r => ((4 : ℝ) ^ 9 / (5 : ℝ) ^ 5) * (max (1 : ℝ) ‖r ^ N‖) ^ 20)).prod := by apply prod_le_prod_of_map · intro r _; positivity · intro r _; exact mod_two_quartic_bound (r ^ N) have hRHS_eq : (fc.roots.map (fun r => ((4 : ℝ) ^ 9 / (5 : ℝ) ^ 5) * (max (1 : ℝ) ‖r ^ N‖) ^ 20)).prod = ((4 : ℝ) ^ 9 / (5 : ℝ) ^ 5) ^ f.natDegree * (mahlerMeasureZ f) ^ (20 * N) := by rw [multiset_map_mul_prod, multiset_map_const_prod, hcard] congr 1 have hmap : fc.roots.map (fun r => (max (1 : ℝ) ‖r ^ N‖) ^ 20) = fc.roots.map (fun r => (max (1 : ℝ) ‖r‖) ^ (20 * N)) := by apply Multiset.map_congr rfl intro r _ rw [max_one_norm_pow_eq r N, ← pow_mul] congr 1; ring rw [hmap, multiset_map_pow_prod, ← mahlerMeasureZ_of_monic hf] have hcomb : (4 : ℝ) ^ (9 * f.natDegree) ≤ (4 : ℝ) ^ (9 * f.natDegree) * ((mahlerMeasureZ f) ^ (4 * N) / (5 : ℝ) ^ f.natDegree) ^ 5 := by have h1 := le_trans hLHS hRHS rw [hRHS_eq] at h1 have hL : ((4 : ℝ) ^ f.natDegree) ^ 8 * ((2 : ℝ) ^ f.natDegree) ^ 2 = (4 : ℝ) ^ (9 * f.natDegree) := by have h22 : ((2 : ℝ) ^ f.natDegree) ^ 2 = (4 : ℝ) ^ f.natDegree := by rw [← pow_mul, mul_comm, pow_mul]; norm_num rw [h22, ← pow_mul, ← pow_add] congr 1; ring have hR : ((4 : ℝ) ^ 9 / (5 : ℝ) ^ 5) ^ f.natDegree * (mahlerMeasureZ f) ^ (20 * N) = (4 : ℝ) ^ (9 * f.natDegree) * ((mahlerMeasureZ f) ^ (4 * N) / (5 : ℝ) ^ f.natDegree) ^ 5 := by rw [div_pow, div_pow, ← pow_mul, ← pow_mul, ← pow_mul, ← pow_mul] have h5 : 5 * f.natDegree = f.natDegree * 5 := mul_comm _ _ have h20 : 20 * N = 4 * N * 5 := by ring rw [h5, h20]; ring rwa [hL, hR] at h1 have h4pos : (0 : ℝ) < (4 : ℝ) ^ (9 * f.natDegree) := by positivity have hge1 : (1 : ℝ) ≤ ((mahlerMeasureZ f) ^ (4 * N) / (5 : ℝ) ^ f.natDegree) ^ 5 := by nlinarith have hbase_ge1 : (1 : ℝ) ≤ (mahlerMeasureZ f) ^ (4 * N) / (5 : ℝ) ^ f.natDegree := by by_contra hlt push Not at hlt have hnonneg : 0 ≤ (mahlerMeasureZ f) ^ (4 * N) / (5 : ℝ) ^ f.natDegree := div_nonneg (pow_nonneg (mahlerMeasure_nonneg _) _) (by positivity) have hlt1 : ((mahlerMeasureZ f) ^ (4 * N) / (5 : ℝ) ^ f.natDegree) ^ 5 < 1 := pow_lt_one₀ hnonneg hlt (by decide) linarith exact (one_le_div (by positivity)).mp hbase_ge1 /-! ## Section 7: Real-Power & Logarithmic Forms + Strict Improvement over BDM (2007) -/ /-- Helper: converting a natural-exponent bound `B ^ d ≤ M ^ E` into `Real.log M ≥ (d / E) * log B`. -/ lemma log_bound_of_pow_bound {B M : ℝ} {d E : ℕ} (hB : 0 < B) (_hM : 0 < M) (hE : 0 < E) (h : B ^ d ≤ M ^ E) : ((d : ℝ) / (E : ℝ)) * Real.log B ≤ Real.log M := by have hlog := Real.log_le_log (pow_pos hB d) h rw [Real.log_pow, Real.log_pow] at hlog have hER : (0 : ℝ) < (E : ℝ) := by exact_mod_cast hE rw [div_mul_eq_mul_div, div_le_iff₀ hER] linarith /-- Helper: converting `B ^ d ≤ M ^ E` into `B ^ ((d : ℝ) / (E : ℝ)) ≤ M`. -/ lemma rpow_bound_of_pow_bound {B M : ℝ} {d E : ℕ} (hB : 0 < B) (hM : 0 < M) (hE : 0 < E) (h : B ^ d ≤ M ^ E) : B ^ ((d : ℝ) / (E : ℝ)) ≤ M := by have hlog := log_bound_of_pow_bound hB hM hE h rw [Real.rpow_def_of_pos hB, ← Real.exp_log hM] apply Real.exp_le_exp.mpr linarith /-- Helper: converting `B ≤ M` (with `1 ≤ B`) into `B ^ d ≤ M ^ E` whenever `d ≤ E`. -/ lemma pow_bound_of_ge_base {B M : ℝ} {d E : ℕ} (hB : 1 ≤ B) (hBM : B ≤ M) (hdE : d ≤ E) : B ^ d ≤ M ^ E := by have h1 : B ^ d ≤ B ^ E := pow_le_pow_right₀ hB hdE have h2 : B ^ E ≤ M ^ E := pow_le_pow_left₀ (by linarith) hBM E exact le_trans h1 h2 /-- Any polynomial `f ∈ D_m` (all coefficients `≡ 1 (mod m)`) of degree `d` satisfies `(X - 1) · f(X) ≡ X^{d + 1} - 1 (mod m)`. -/ lemma modOneClass_satisfies_binomial_congruence {m : ℕ} {f : ℤ[X]} (hf : IsModOneClass m f) : SatisfiesBinomialCongruence m (f.natDegree + 1) 1 f := by refine ⟨Or.inl rfl, X - 1, ?_⟩ set d := f.natDegree set q : ℤ[X] := ∑ i ∈ Finset.range (d + 1), C ((f.coeff i - 1) / (m : ℤ)) * X ^ i set h : ℤ[X] := ∑ i ∈ Finset.range (d + 1), X ^ i have hf_eq : f = h + C (m : ℤ) * q := by ext i simp only [Polynomial.coeff_add, Polynomial.coeff_C_mul, h, q, Polynomial.finsetSum_coeff, Polynomial.coeff_X_pow] by_cases hi : i ≤ d · have hi_mem : i ∈ Finset.range (d + 1) := Finset.mem_range.mpr (by omega) have hs1 : (∑ x ∈ Finset.range (d + 1), if i = x then (1 : ℤ) else 0) = 1 := by simp [hi_mem] have hs2 : (∑ x ∈ Finset.range (d + 1), (f.coeff x - 1) / (m : ℤ) * if i = x then (1 : ℤ) else 0) = (f.coeff i - 1) / (m : ℤ) := by have : ∀ x ∈ Finset.range (d + 1), (f.coeff x - 1) / (m : ℤ) * (if i = x then (1 : ℤ) else 0) = if x = i then (f.coeff x - 1) / (m : ℤ) else 0 := by intro x _ by_cases hxi : i = x · subst hxi; simp · simp [hxi, Ne.symm hxi] rw [Finset.sum_congr rfl this] simp [hi_mem] rw [hs1, hs2] have hdvd := hf i hi have hmul := Int.mul_ediv_cancel' hdvd omega · have hf0 : f.coeff i = 0 := Polynomial.coeff_eq_zero_of_natDegree_lt (by omega) have hs1 : (∑ x ∈ Finset.range (d + 1), if i = x then (1 : ℤ) else 0) = 0 := by apply Finset.sum_eq_zero intro x hx have hlt : x < d + 1 := Finset.mem_range.mp hx simp [show i ≠ x by omega] have hs2 : (∑ x ∈ Finset.range (d + 1), (f.coeff x - 1) / (m : ℤ) * if i = x then (1 : ℤ) else 0) = 0 := by apply Finset.sum_eq_zero intro x hx have hlt : x < d + 1 := Finset.mem_range.mp hx simp [show i ≠ x by omega] rw [hf0, hs1, hs2] ring have hgeom : (X - 1 : ℤ[X]) * h = X ^ (d + 1) - 1 := by dsimp [h] have := mul_geom_sum (X : ℤ[X]) (d + 1) simpa [mul_comm] using this refine ⟨(X - 1) * q, ?_⟩ rw [hf_eq, mul_add, hgeom, map_one] ring /-- For `m ≥ 3` and `a ≡ 1 (mod m)`, either `a = 1` or `|a| ≥ m - 1`. -/ lemma eq_one_or_abs_ge_sub_one_of_mod_one {m : ℕ} {a : ℤ} (hm : 3 ≤ m) (ha : (m : ℤ) ∣ (a - 1)) : a = 1 ∨ ((m : ℤ) - 1 ≤ |a|) := by rcases ha with ⟨q, hq⟩ have ha_eq : a = (m : ℤ) * q + 1 := by linarith by_cases hq0 : q = 0 · left; rw [hq0] at ha_eq; linarith · right rcases lt_or_gt_of_ne hq0 with hneg | hpos · have : a ≤ 1 - (m : ℤ) := by nlinarith have : |a| = -a := abs_of_nonpos (by omega) omega · have : (m : ℤ) + 1 ≤ a := by nlinarith have : |a| = a := abs_of_nonneg (by omega) omega /-- **BDM (2007) Strict Improvement — Even Moduli `m ≥ 4` (ALL `f ∈ D_m`, monic OR non-monic!)**: For every cyclotomic-free `f ∈ D_m` of degree `d = n - 1 ≥ 1` (`m ≥ 4` even), `M(f)^{2(d + 1)} ≥ ((m² + 4) / 4)^d`, equivalently `log M(f) ≥ log(√(m² + 4) / 2) · (1 - 1 / (d + 1))`. -/ theorem bdm_improved_even_pow {m : ℕ} {f : ℤ[X]} (hm : 4 ≤ m) (heven : Even m) (hdeg : 1 ≤ f.natDegree) (hnc : HasNoCyclotomicFactor f) (hmod : IsModOneClass m f) : (((m : ℝ) ^ 2 + 4) / 4) ^ f.natDegree ≤ (mahlerMeasureZ f) ^ (2 * (f.natDegree + 1)) := by have hf_ne : f ≠ 0 := by intro h0; rw [h0, Polynomial.natDegree_zero] at hdeg; omega have hlc_mod : (m : ℤ) ∣ (f.leadingCoeff - 1) := hmod f.natDegree le_rfl have h0_mod : (m : ℤ) ∣ (f.coeff 0 - 1) := hmod 0 (Nat.zero_le _) have hsq_le : ((m : ℝ) ^ 2 + 4) / 4 ≤ ((m : ℝ) - 1) ^ 2 := by have hmR : (4 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith have hbase_ge1 : (1 : ℝ) ≤ ((m : ℝ) ^ 2 + 4) / 4 := by have hmR : (4 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith rcases eq_one_or_abs_ge_sub_one_of_mod_one (by omega) hlc_mod with hlc1 | hlc_big · rcases eq_one_or_abs_ge_sub_one_of_mod_one (by omega) h0_mod with h01 | h0_big · exact master_even_mahler_pow_bound hm heven (Nat.succ_pos _) (Polynomial.Monic.def.mpr hlc1) (Or.inl h01) hnc (modOneClass_satisfies_binomial_congruence hmod) · have hM : (m : ℝ) - 1 ≤ mahlerMeasureZ f := by have h1 : ((m : ℝ) - 1) ≤ (|f.coeff 0| : ℝ) := by exact_mod_cast h0_big exact le_trans h1 (mahlerMeasureZ_ge_constCoeff_abs hf_ne) have hM2 : ((m : ℝ) ^ 2 + 4) / 4 ≤ (mahlerMeasureZ f) ^ 2 := by have hmR : (0 : ℝ) ≤ (m : ℝ) - 1 := by have : (4 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm linarith exact le_trans hsq_le (pow_le_pow_left₀ hmR hM 2) have hpow := pow_bound_of_ge_base hbase_ge1 hM2 (Nat.le_succ f.natDegree) rwa [← pow_mul] at hpow · have hM : (m : ℝ) - 1 ≤ mahlerMeasureZ f := by have h1 : ((m : ℝ) - 1) ≤ (|f.leadingCoeff| : ℝ) := by exact_mod_cast hlc_big exact le_trans h1 (mahlerMeasureZ_ge_leadingCoeff_abs f) have hM2 : ((m : ℝ) ^ 2 + 4) / 4 ≤ (mahlerMeasureZ f) ^ 2 := by have hmR : (0 : ℝ) ≤ (m : ℝ) - 1 := by have : (4 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm linarith exact le_trans hsq_le (pow_le_pow_left₀ hmR hM 2) have hpow := pow_bound_of_ge_base hbase_ge1 hM2 (Nat.le_succ f.natDegree) rwa [← pow_mul] at hpow /-- Logarithmic form of `bdm_improved_even_pow` matching BDM (2007) Theorem 1.1: `log M(f) ≥ log(√(m² + 4) / 2) · (1 - 1 / n)` where `n = deg f + 1`. -/ theorem bdm_improved_even_log {m : ℕ} {f : ℤ[X]} (hm : 4 ≤ m) (heven : Even m) (hdeg : 1 ≤ f.natDegree) (hnc : HasNoCyclotomicFactor f) (hmod : IsModOneClass m f) : Real.log (Real.sqrt ((m : ℝ) ^ 2 + 4) / 2) * (1 - 1 / ((f.natDegree + 1 : ℕ) : ℝ)) ≤ Real.log (mahlerMeasureZ f) := by have hf_ne : f ≠ 0 := by intro h0; rw [h0, Polynomial.natDegree_zero] at hdeg; omega have hpow := bdm_improved_even_pow hm heven hdeg hnc hmod have hB_pos : (0 : ℝ) < ((m : ℝ) ^ 2 + 4) / 4 := by positivity have hlog := log_bound_of_pow_bound hB_pos (mahlerMeasureZ_pos hf_ne) (by omega) hpow have hsq : Real.log (((m : ℝ) ^ 2 + 4) / 4) = 2 * Real.log (Real.sqrt ((m : ℝ) ^ 2 + 4) / 2) := by have heq : ((m : ℝ) ^ 2 + 4) / 4 = (Real.sqrt ((m : ℝ) ^ 2 + 4) / 2) ^ 2 := by rw [div_pow, Real.sq_sqrt (by positivity)]; norm_num rw [heq, Real.log_pow] ring rw [hsq] at hlog have hfrac : (f.natDegree : ℝ) / ((2 * (f.natDegree + 1) : ℕ) : ℝ) * (2 * Real.log (Real.sqrt ((m : ℝ) ^ 2 + 4) / 2)) = Real.log (Real.sqrt ((m : ℝ) ^ 2 + 4) / 2) * (1 - 1 / ((f.natDegree + 1 : ℕ) : ℝ)) := by have hn : ((f.natDegree + 1 : ℕ) : ℝ) ≠ 0 := by positivity push_cast field_simp [hn] ring rwa [hfrac] at hlog /-- **BDM (2007) Strict Improvement — Odd Moduli `m ≥ 3` (ALL `f ∈ D_m`, monic OR non-monic!)**: For every cyclotomic-free `f ∈ D_m` of degree `d = n - 1 ≥ 1` (`m ≥ 3` odd), `M(f)^{2(d + 1)} ≥ ((m² + 3) / 4)^d`, equivalently `log M(f) ≥ log(√(m² + 3) / 2) · (1 - 1 / (d + 1))`. -/ theorem bdm_improved_odd_pow {m : ℕ} {f : ℤ[X]} (hm : 3 ≤ m) (hodd : Odd m) (hdeg : 1 ≤ f.natDegree) (hnc : HasNoCyclotomicFactor f) (hmod : IsModOneClass m f) : (((m : ℝ) ^ 2 + 3) / 4) ^ f.natDegree ≤ (mahlerMeasureZ f) ^ (2 * (f.natDegree + 1)) := by have hf_ne : f ≠ 0 := by intro h0; rw [h0, Polynomial.natDegree_zero] at hdeg; omega have hlc_mod : (m : ℤ) ∣ (f.leadingCoeff - 1) := hmod f.natDegree le_rfl have h0_mod : (m : ℤ) ∣ (f.coeff 0 - 1) := hmod 0 (Nat.zero_le _) have hsq_le : ((m : ℝ) ^ 2 + 3) / 4 ≤ ((m : ℝ) - 1) ^ 2 := by have hmR : (3 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith have hbase_ge1 : (1 : ℝ) ≤ ((m : ℝ) ^ 2 + 3) / 4 := by have hmR : (3 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith rcases eq_one_or_abs_ge_sub_one_of_mod_one hm hlc_mod with hlc1 | hlc_big · rcases eq_one_or_abs_ge_sub_one_of_mod_one hm h0_mod with h01 | h0_big · exact master_odd_mahler_pow_bound hm hodd (Nat.succ_pos _) (Polynomial.Monic.def.mpr hlc1) (Or.inl h01) hnc (modOneClass_satisfies_binomial_congruence hmod) · have hM : (m : ℝ) - 1 ≤ mahlerMeasureZ f := by have h1 : ((m : ℝ) - 1) ≤ (|f.coeff 0| : ℝ) := by exact_mod_cast h0_big exact le_trans h1 (mahlerMeasureZ_ge_constCoeff_abs hf_ne) have hM2 : ((m : ℝ) ^ 2 + 3) / 4 ≤ (mahlerMeasureZ f) ^ 2 := by have hmR : (0 : ℝ) ≤ (m : ℝ) - 1 := by have : (3 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm linarith exact le_trans hsq_le (pow_le_pow_left₀ hmR hM 2) have hpow := pow_bound_of_ge_base hbase_ge1 hM2 (Nat.le_succ f.natDegree) rwa [← pow_mul] at hpow · have hM : (m : ℝ) - 1 ≤ mahlerMeasureZ f := by have h1 : ((m : ℝ) - 1) ≤ (|f.leadingCoeff| : ℝ) := by exact_mod_cast hlc_big exact le_trans h1 (mahlerMeasureZ_ge_leadingCoeff_abs f) have hM2 : ((m : ℝ) ^ 2 + 3) / 4 ≤ (mahlerMeasureZ f) ^ 2 := by have hmR : (0 : ℝ) ≤ (m : ℝ) - 1 := by have : (3 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm linarith exact le_trans hsq_le (pow_le_pow_left₀ hmR hM 2) have hpow := pow_bound_of_ge_base hbase_ge1 hM2 (Nat.le_succ f.natDegree) rwa [← pow_mul] at hpow /-- Logarithmic form of `bdm_improved_odd_pow`: `log M(f) ≥ log(√(m² + 3) / 2) · (1 - 1 / n)` where `n = deg f + 1`. -/ theorem bdm_improved_odd_log {m : ℕ} {f : ℤ[X]} (hm : 3 ≤ m) (hodd : Odd m) (hdeg : 1 ≤ f.natDegree) (hnc : HasNoCyclotomicFactor f) (hmod : IsModOneClass m f) : Real.log (Real.sqrt ((m : ℝ) ^ 2 + 3) / 2) * (1 - 1 / ((f.natDegree + 1 : ℕ) : ℝ)) ≤ Real.log (mahlerMeasureZ f) := by have hf_ne : f ≠ 0 := by intro h0; rw [h0, Polynomial.natDegree_zero] at hdeg; omega have hpow := bdm_improved_odd_pow hm hodd hdeg hnc hmod have hB_pos : (0 : ℝ) < ((m : ℝ) ^ 2 + 3) / 4 := by positivity have hlog := log_bound_of_pow_bound hB_pos (mahlerMeasureZ_pos hf_ne) (by omega) hpow have hsq : Real.log (((m : ℝ) ^ 2 + 3) / 4) = 2 * Real.log (Real.sqrt ((m : ℝ) ^ 2 + 3) / 2) := by have heq : ((m : ℝ) ^ 2 + 3) / 4 = (Real.sqrt ((m : ℝ) ^ 2 + 3) / 2) ^ 2 := by rw [div_pow, Real.sq_sqrt (by positivity)]; norm_num rw [heq, Real.log_pow] ring rw [hsq] at hlog have hfrac : (f.natDegree : ℝ) / ((2 * (f.natDegree + 1) : ℕ) : ℝ) * (2 * Real.log (Real.sqrt ((m : ℝ) ^ 2 + 3) / 2)) = Real.log (Real.sqrt ((m : ℝ) ^ 2 + 3) / 2) * (1 - 1 / ((f.natDegree + 1 : ℕ) : ℝ)) := by have hn : ((f.natDegree + 1 : ℕ) : ℝ) ≠ 0 := by positivity push_cast field_simp [hn] ring rwa [hfrac] at hlog /-- **BDM (2007) Headline `m = 3` Breakthrough (`10^{1/4} ≈ 1.77828`, ALL `f ∈ D_3`)**: For every cyclotomic-free `f ∈ D_3` of degree `d = n - 1 ≥ 1` (monic OR non-monic!), `M(f)^{4(d + 1)} ≥ 10^d`, equivalently `log M(f) ≥ (log 10 / 4) · (1 - 1 / n)`. This improves BDM (2007)'s `log(√10 / 2) ≈ 0.45815` to `log(10) / 4 ≈ 0.57565` (`+25.65%`)! -/ theorem bdm_improved_mod_three_pow {f : ℤ[X]} (hdeg : 1 ≤ f.natDegree) (hnc : HasNoCyclotomicFactor f) (hmod : IsModOneClass 3 f) : (10 : ℝ) ^ f.natDegree ≤ (mahlerMeasureZ f) ^ (4 * (f.natDegree + 1)) := by have hf_ne : f ≠ 0 := by intro h0; rw [h0, Polynomial.natDegree_zero] at hdeg; omega have hlc_mod : (3 : ℤ) ∣ (f.leadingCoeff - 1) := hmod f.natDegree le_rfl have h0_mod : (3 : ℤ) ∣ (f.coeff 0 - 1) := hmod 0 (Nat.zero_le _) rcases eq_one_or_abs_ge_sub_one_of_mod_one (by decide) hlc_mod with hlc1 | hlc_big · rcases eq_one_or_abs_ge_sub_one_of_mod_one (by decide) h0_mod with h01 | h0_big · exact master_mod_three_mahler_pow_bound (Nat.succ_pos _) (Polynomial.Monic.def.mpr hlc1) (Or.inl h01) hnc (modOneClass_satisfies_binomial_congruence hmod) · have hM : (2 : ℝ) ≤ mahlerMeasureZ f := by have h1 : (2 : ℝ) ≤ (|f.coeff 0| : ℝ) := by exact_mod_cast h0_big exact le_trans h1 (mahlerMeasureZ_ge_constCoeff_abs hf_ne) have hM4 : (10 : ℝ) ≤ (mahlerMeasureZ f) ^ 4 := by have : (2 : ℝ) ^ 4 ≤ (mahlerMeasureZ f) ^ 4 := pow_le_pow_left₀ (by norm_num) hM 4 linarith [show (10 : ℝ) ≤ (2 : ℝ) ^ 4 by norm_num] have hpow := pow_bound_of_ge_base (by norm_num) hM4 (Nat.le_succ f.natDegree) rwa [← pow_mul] at hpow · have hM : (2 : ℝ) ≤ mahlerMeasureZ f := by have h1 : (2 : ℝ) ≤ (|f.leadingCoeff| : ℝ) := by exact_mod_cast hlc_big exact le_trans h1 (mahlerMeasureZ_ge_leadingCoeff_abs f) have hM4 : (10 : ℝ) ≤ (mahlerMeasureZ f) ^ 4 := by have : (2 : ℝ) ^ 4 ≤ (mahlerMeasureZ f) ^ 4 := pow_le_pow_left₀ (by norm_num) hM 4 linarith [show (10 : ℝ) ≤ (2 : ℝ) ^ 4 by norm_num] have hpow := pow_bound_of_ge_base (by norm_num) hM4 (Nat.le_succ f.natDegree) rwa [← pow_mul] at hpow /-- Logarithmic form of `bdm_improved_mod_three_pow`: `log M(f) ≥ (log 10 / 4) · (1 - 1 / n)` where `n = deg f + 1`. -/ theorem bdm_improved_mod_three_log {f : ℤ[X]} (hdeg : 1 ≤ f.natDegree) (hnc : HasNoCyclotomicFactor f) (hmod : IsModOneClass 3 f) : (Real.log 10 / 4) * (1 - 1 / ((f.natDegree + 1 : ℕ) : ℝ)) ≤ Real.log (mahlerMeasureZ f) := by have hf_ne : f ≠ 0 := by intro h0; rw [h0, Polynomial.natDegree_zero] at hdeg; omega have hpow := bdm_improved_mod_three_pow hdeg hnc hmod have hlog := log_bound_of_pow_bound (by norm_num) (mahlerMeasureZ_pos hf_ne) (by omega) hpow have hfrac : (f.natDegree : ℝ) / ((4 * (f.natDegree + 1) : ℕ) : ℝ) * Real.log 10 = (Real.log 10 / 4) * (1 - 1 / ((f.natDegree + 1 : ℕ) : ℝ)) := by have hn : ((f.natDegree + 1 : ℕ) : ℝ) ≠ 0 := by positivity push_cast field_simp [hn] ring rwa [hfrac] at hlog /-- Purely algebraic formalization of Borwein–Dobrowolski–Mossinghoff (2007) at `m = 2` (odd coefficients, monic OR non-monic!): `M(f)^{4(d + 1)} ≥ 5^d`, i.e., `log M(f) ≥ (log 5 / 4) · (1 - 1 / n)`. -/ theorem bdm_mod_two_pow {f : ℤ[X]} (hdeg : 1 ≤ f.natDegree) (hnc : HasNoCyclotomicFactor f) (hmod : IsModOneClass 2 f) : (5 : ℝ) ^ f.natDegree ≤ (mahlerMeasureZ f) ^ (4 * (f.natDegree + 1)) := by have hf_ne : f ≠ 0 := by intro h0; rw [h0, Polynomial.natDegree_zero] at hdeg; omega by_cases hlc_one : |f.leadingCoeff| = 1 · rcases eq_or_eq_neg_of_abs_eq hlc_one with hlc1 | hlc_neg1 · exact master_mod_two_mahler_pow_bound (Nat.succ_pos _) (Polynomial.Monic.def.mpr hlc1) hnc (modOneClass_satisfies_binomial_congruence hmod) · have hneg_monic : (-f).Monic := by rw [Polynomial.Monic.def, Polynomial.leadingCoeff_neg, hlc_neg1]; norm_num have hneg_nc : HasNoCyclotomicFactor (-f) := by intro z hz n hn apply hnc z _ n hn simpa using hz have hneg_mod : IsModOneClass 2 (-f) := by intro i hi rw [Polynomial.natDegree_neg] at hi rw [Polynomial.coeff_neg] rcases hmod i hi with ⟨q, hq⟩ refine ⟨-q - 1, ?_⟩; omega have h := master_mod_two_mahler_pow_bound (Nat.succ_pos _) hneg_monic hneg_nc (modOneClass_satisfies_binomial_congruence hneg_mod) simpa [mahlerMeasureZ_neg, Polynomial.natDegree_neg] using h · have hlc_ne : f.leadingCoeff ≠ 0 := leadingCoeff_ne_zero.mpr hf_ne have hlc_ge1 : (1 : ℤ) ≤ |f.leadingCoeff| := Int.one_le_abs hlc_ne have hlc_ge2 : (2 : ℤ) ≤ |f.leadingCoeff| := by omega have hM : (2 : ℝ) ≤ mahlerMeasureZ f := by have h1 : (2 : ℝ) ≤ (|f.leadingCoeff| : ℝ) := by exact_mod_cast hlc_ge2 exact le_trans h1 (mahlerMeasureZ_ge_leadingCoeff_abs f) have hM4 : (5 : ℝ) ≤ (mahlerMeasureZ f) ^ 4 := by have : (2 : ℝ) ^ 4 ≤ (mahlerMeasureZ f) ^ 4 := pow_le_pow_left₀ (by norm_num) hM 4 linarith [show (5 : ℝ) ≤ (2 : ℝ) ^ 4 by norm_num] have hpow := pow_bound_of_ge_base (by norm_num) hM4 (Nat.le_succ f.natDegree) rwa [← pow_mul] at hpow /-- Logarithmic form of `bdm_mod_two_pow`: `log M(f) ≥ (log 5 / 4) · (1 - 1 / n)`. -/ theorem bdm_mod_two_log {f : ℤ[X]} (hdeg : 1 ≤ f.natDegree) (hnc : HasNoCyclotomicFactor f) (hmod : IsModOneClass 2 f) : (Real.log 5 / 4) * (1 - 1 / ((f.natDegree + 1 : ℕ) : ℝ)) ≤ Real.log (mahlerMeasureZ f) := by have hf_ne : f ≠ 0 := by intro h0; rw [h0, Polynomial.natDegree_zero] at hdeg; omega have hpow := bdm_mod_two_pow hdeg hnc hmod have hlog := log_bound_of_pow_bound (by norm_num) (mahlerMeasureZ_pos hf_ne) (by omega) hpow have hfrac : (f.natDegree : ℝ) / ((4 * (f.natDegree + 1) : ℕ) : ℝ) * Real.log 5 = (Real.log 5 / 4) * (1 - 1 / ((f.natDegree + 1 : ℕ) : ℝ)) := by have hn : ((f.natDegree + 1 : ℕ) : ℝ) ≠ 0 := by positivity push_cast field_simp [hn] ring rwa [hfrac] at hlog /-! ### Explicit Strict-Improvement Comparisons vs Borwein–Dobrowolski–Mossinghoff (2007) -/ /-- For EVERY `m ≥ 3`, our linear-pair constant strictly beats BDM (2007)'s `√(m² + 1) / 2`. -/ theorem strictly_beats_bdm2007_all (m : ℕ) (_hm : 3 ≤ m) : bdm2007Base m < linearPairBase m := by unfold bdm2007Base linearPairBase rw [show Real.sqrt ((m : ℝ) ^ 2 + 1) / 2 = Real.sqrt (((m : ℝ) ^ 2 + 1) / 4) by rw [Real.sqrt_div (by positivity), show Real.sqrt 4 = 2 by norm_num]] apply Real.sqrt_lt_sqrt (by positivity) rcases Nat.even_or_odd m with ⟨k, rfl⟩ | ⟨k, rfl⟩ · have h1 : (k + k) / 2 = k := by omega have h2 : k + k - k = k := by omega rw [h1, h2]; push_cast; linarith · have h1 : (2 * k + 1) / 2 = k := by omega have h2 : 2 * k + 1 - k = k + 1 := by omega rw [h1, h2]; push_cast; linarith /-- Explicit strict beat for even `m ≥ 4`: `√(m² + 1) / 2 < √(m² + 4) / 2`. -/ theorem strictly_beats_bdm2007_even (m : ℕ) : bdm2007Base m < Real.sqrt ((m : ℝ) ^ 2 + 4) / 2 := by unfold bdm2007Base apply div_lt_div_of_pos_right _ (by norm_num) exact Real.sqrt_lt_sqrt (by positivity) (by linarith) /-- Explicit strict beat for odd `m ≥ 3`: `√(m² + 1) / 2 < √(m² + 3) / 2`. -/ theorem strictly_beats_bdm2007_odd (m : ℕ) : bdm2007Base m < Real.sqrt ((m : ℝ) ^ 2 + 3) / 2 := by unfold bdm2007Base apply div_lt_div_of_pos_right _ (by norm_num) exact Real.sqrt_lt_sqrt (by positivity) (by linarith) /-- At `m = 3`, our exact 10-term bound `10^{1/4}` strictly beats BOTH our own linear-pair bound `√3 ≈ 1.73205` AND BDM (2007)'s `√10 / 2 ≈ 1.58114`, and exceeds `1.778`! -/ theorem mod_three_hierarchy : bdm2007Base 3 < Real.sqrt 3 ∧ Real.sqrt 3 < (1.778 : ℝ) ∧ (1.778 : ℝ) < modThreeBase := by refine ⟨?_, ?_, ?_⟩ · unfold bdm2007Base have h1 : Real.sqrt (((3 : ℕ) : ℝ) ^ 2 + 1) / 2 = Real.sqrt (10 / 4) := by rw [Real.sqrt_div (by norm_num), show Real.sqrt 4 = 2 by norm_num] norm_num rw [h1] exact Real.sqrt_lt_sqrt (by norm_num) (by norm_num) · rw [← Real.sqrt_sq (by norm_num : (0 : ℝ) ≤ 1.778)] exact Real.sqrt_lt_sqrt (by norm_num) (by norm_num) · unfold modThreeBase have h4 : (1.778 : ℝ) ^ (4 : ℕ) < 10 := by norm_num have h1 : ((1.778 : ℝ) ^ (4 : ℕ)) ^ ((1 : ℝ) / 4) < (10 : ℝ) ^ ((1 : ℝ) / 4) := Real.rpow_lt_rpow (by positivity) h4 (by norm_num) have h2 : ((1.778 : ℝ) ^ (4 : ℕ)) ^ ((1 : ℝ) / 4) = 1.778 := by rw [← Real.rpow_natCast, ← Real.rpow_mul (by norm_num)] norm_num rwa [h2] at h1 /-! ## Section 8: Uniform-in-Degree Bounds (ZERO `1 - 1/n` Loss!) for `m`-Divisible Interior and `p`-Periodic Congruence Families -/ /-- Any `m`-divisible interior polynomial `f` (after replacing `f` by `-f` if `lc(f) = -1`) satisfies the exact degree-`d` binomial congruence `1 · f ≡ X^d - ε (mod m)` with `N = d`! -/ lemma interiorDivisible_satisfies_binomial_congruence {m : ℕ} {f : ℤ[X]} (hdeg : 1 ≤ f.natDegree) (hmonic : f.Monic) (hint : IsInteriorDivisible m f) : SatisfiesBinomialCongruence m f.natDegree (-f.coeff 0) f := by rcases hint with ⟨_, h0, hinner⟩ refine ⟨by rcases h0 with h0 | h0 <;> simp [h0], 1, ?_⟩ set d := f.natDegree set g : ℤ[X] := ∑ i ∈ Finset.Ioo 0 d, C (f.coeff i / (m : ℤ)) * X ^ i refine ⟨g, ?_⟩ ext i rw [one_mul, Polynomial.coeff_add, Polynomial.coeff_sub, Polynomial.coeff_X_pow, Polynomial.coeff_C, Polynomial.coeff_C_mul] dsimp [g] rw [Polynomial.finsetSum_coeff] have hsum_eval : (∑ x ∈ Finset.Ioo 0 d, (C (f.coeff x / (m : ℤ)) * X ^ x).coeff i) = if 0 < i ∧ i < d then f.coeff i / (m : ℤ) else 0 := by have : ∀ x ∈ Finset.Ioo 0 d, (C (f.coeff x / (m : ℤ)) * X ^ x).coeff i = if x = i then f.coeff x / (m : ℤ) else 0 := by intro x _ rw [Polynomial.coeff_C_mul, Polynomial.coeff_X_pow] by_cases hxi : i = x · subst hxi; simp · simp [hxi, Ne.symm hxi] rw [Finset.sum_congr rfl this] by_cases hi : 0 < i ∧ i < d · have hmem : i ∈ Finset.Ioo 0 d := Finset.mem_Ioo.mpr hi simp [hi, hmem] · have hnot : i ∉ Finset.Ioo 0 d := by simpa [Finset.mem_Ioo] using hi simp [hi, hnot] rw [hsum_eval] by_cases hi0 : i = 0 · subst hi0 have hd0 : (0 : ℕ) ≠ d := by omega simp [hd0] · by_cases hid : i = d · subst hid have hd0 : d ≠ 0 := by omega have hlc : f.coeff d = 1 := hmonic.leadingCoeff simp [hd0, hlc] · by_cases hilt : i < d · have hpos : 0 < i := by omega have hdvd := hinner i hpos hilt have hmul := Int.mul_ediv_cancel' hdvd simp [hi0, hid, hpos, hilt, hmul] · have hf0 : f.coeff i = 0 := Polynomial.coeff_eq_zero_of_natDegree_lt (by omega) simp [hi0, hid, hilt, hf0] /-- Reduction of `IsInteriorDivisible m f` to monic `f` via negation. -/ lemma interiorDivisible_neg {m : ℕ} {f : ℤ[X]} (hint : IsInteriorDivisible m f) : IsInteriorDivisible m (-f) := by rcases hint with ⟨hlc, h0, hinner⟩ refine ⟨?_, ?_, ?_⟩ · rw [Polynomial.leadingCoeff_neg]; rcases hlc with h | h <;> simp [h] · rw [Polynomial.coeff_neg]; rcases h0 with h | h <;> simp [h] · intro i hi0 hid rw [Polynomial.natDegree_neg] at hid rw [Polynomial.coeff_neg] exact dvd_neg.mpr (hinner i hi0 hid) /-- **Uniform-in-Degree `m`-Divisible Interior Bound — Even `m ≥ 4` (ZERO `1 - 1/n` Loss!)**: For EVERY cyclotomic-free `f ∈ ℤ[X]` of degree `d ≥ 1` with `|a_d| = |a_0| = 1` and `m ∣ a_i` for all `0 < i < d` (reciprocal OR non-reciprocal, even OR odd degree!), `M(f) ≥ √(m² + 4) / 2`! -/ theorem interior_divisible_even {m : ℕ} {f : ℤ[X]} (hm : 4 ≤ m) (heven : Even m) (hdeg : 1 ≤ f.natDegree) (hnc : HasNoCyclotomicFactor f) (hint : IsInteriorDivisible m f) : Real.sqrt ((m : ℝ) ^ 2 + 4) / 2 ≤ mahlerMeasureZ f := by have haux : ∀ g : ℤ[X], g.Monic → 1 ≤ g.natDegree → HasNoCyclotomicFactor g → IsInteriorDivisible m g → Real.sqrt ((m : ℝ) ^ 2 + 4) / 2 ≤ mahlerMeasureZ g := by intro g hg_monic hg_deg hg_nc hg_int have hpow := master_even_mahler_pow_bound hm heven (by omega) hg_monic hg_int.2.1 hg_nc (interiorDivisible_satisfies_binomial_congruence hg_deg hg_monic hg_int) have hsq : (((m : ℝ) ^ 2 + 4) / 4) ^ g.natDegree = (Real.sqrt ((m : ℝ) ^ 2 + 4) / 2) ^ (2 * g.natDegree) := by rw [pow_mul] congr 1 rw [div_pow, Real.sq_sqrt (by positivity)]; norm_num rw [hsq] at hpow by_contra hlt push Not at hlt have hstrict := pow_lt_pow_left₀ hlt (mahlerMeasure_nonneg _) (by omega : 2 * g.natDegree ≠ 0) linarith rcases hint.1 with hlc1 | hlc_neg1 · exact haux f (Polynomial.Monic.def.mpr hlc1) hdeg hnc hint · have h := haux (-f) (by rw [Polynomial.Monic.def, Polynomial.leadingCoeff_neg, hlc_neg1]; norm_num) (by rwa [Polynomial.natDegree_neg]) (fun z hz n hn => hnc z (by simpa using hz) n hn) (interiorDivisible_neg hint) rwa [mahlerMeasureZ_neg] at h /-- **Uniform-in-Degree `m`-Divisible Interior Bound — Odd `m ≥ 3` (ZERO `1 - 1/n` Loss!)**: For EVERY cyclotomic-free `f ∈ ℤ[X]` of degree `d ≥ 1` with `|a_d| = |a_0| = 1` and `m ∣ a_i` for all `0 < i < d`, `M(f) ≥ √(m² + 3) / 2`! -/ theorem interior_divisible_odd {m : ℕ} {f : ℤ[X]} (hm : 3 ≤ m) (hodd : Odd m) (hdeg : 1 ≤ f.natDegree) (hnc : HasNoCyclotomicFactor f) (hint : IsInteriorDivisible m f) : Real.sqrt ((m : ℝ) ^ 2 + 3) / 2 ≤ mahlerMeasureZ f := by have haux : ∀ g : ℤ[X], g.Monic → 1 ≤ g.natDegree → HasNoCyclotomicFactor g → IsInteriorDivisible m g → Real.sqrt ((m : ℝ) ^ 2 + 3) / 2 ≤ mahlerMeasureZ g := by intro g hg_monic hg_deg hg_nc hg_int have hpow := master_odd_mahler_pow_bound hm hodd (by omega) hg_monic hg_int.2.1 hg_nc (interiorDivisible_satisfies_binomial_congruence hg_deg hg_monic hg_int) have hsq : (((m : ℝ) ^ 2 + 3) / 4) ^ g.natDegree = (Real.sqrt ((m : ℝ) ^ 2 + 3) / 2) ^ (2 * g.natDegree) := by rw [pow_mul] congr 1 rw [div_pow, Real.sq_sqrt (by positivity)]; norm_num rw [hsq] at hpow by_contra hlt push Not at hlt have hstrict := pow_lt_pow_left₀ hlt (mahlerMeasure_nonneg _) (by omega : 2 * g.natDegree ≠ 0) linarith rcases hint.1 with hlc1 | hlc_neg1 · exact haux f (Polynomial.Monic.def.mpr hlc1) hdeg hnc hint · have h := haux (-f) (by rw [Polynomial.Monic.def, Polynomial.leadingCoeff_neg, hlc_neg1]; norm_num) (by rwa [Polynomial.natDegree_neg]) (fun z hz n hn => hnc z (by simpa using hz) n hn) (interiorDivisible_neg hint) rwa [mahlerMeasureZ_neg] at h /-- **Uniform-in-Degree `m = 3`-Divisible Interior Bound (`10^{1/4} ≈ 1.77828`, ZERO `1 - 1/n` Loss!)**: For EVERY cyclotomic-free `f ∈ ℤ[X]` of degree `d ≥ 1` with `|a_d| = |a_0| = 1` and `3 ∣ a_i` for all `0 < i < d`, `M(f) ≥ 10^{1/4}`! -/ theorem interior_divisible_mod_three {f : ℤ[X]} (hdeg : 1 ≤ f.natDegree) (hnc : HasNoCyclotomicFactor f) (hint : IsInteriorDivisible 3 f) : modThreeBase ≤ mahlerMeasureZ f := by have haux : ∀ g : ℤ[X], g.Monic → 1 ≤ g.natDegree → HasNoCyclotomicFactor g → IsInteriorDivisible 3 g → modThreeBase ≤ mahlerMeasureZ g := by intro g hg_monic hg_deg hg_nc hg_int have hpow := master_mod_three_mahler_pow_bound (by omega) hg_monic hg_int.2.1 hg_nc (interiorDivisible_satisfies_binomial_congruence hg_deg hg_monic hg_int) have h4 : (10 : ℝ) ^ g.natDegree = modThreeBase ^ (4 * g.natDegree) := by rw [pow_mul] congr 1 unfold modThreeBase rw [← Real.rpow_natCast, ← Real.rpow_mul (by norm_num)] norm_num rw [h4] at hpow by_contra hlt push Not at hlt have hstrict := pow_lt_pow_left₀ hlt (mahlerMeasure_nonneg _) (by omega : 4 * g.natDegree ≠ 0) linarith rcases hint.1 with hlc1 | hlc_neg1 · exact haux f (Polynomial.Monic.def.mpr hlc1) hdeg hnc hint · have h := haux (-f) (by rw [Polynomial.Monic.def, Polynomial.leadingCoeff_neg, hlc_neg1]; norm_num) (by rwa [Polynomial.natDegree_neg]) (fun z hz n hn => hnc z (by simpa using hz) n hn) (interiorDivisible_neg hint) rwa [mahlerMeasureZ_neg] at h /-- **Uniform-in-Degree Even-Interior Bound (`m = 2`, `5^{1/4} ≈ 1.49535`, ZERO `1 - 1/n` Loss!)**: For EVERY cyclotomic-free `f ∈ ℤ[X]` of degree `d ≥ 1` with `|a_d| = |a_0| = 1` and all interior coefficients EVEN (`2 ∣ a_i` for `0 < i < d`), `M(f) ≥ 5^{1/4}`! -/ theorem interior_divisible_mod_two {f : ℤ[X]} (hdeg : 1 ≤ f.natDegree) (hnc : HasNoCyclotomicFactor f) (hint : IsInteriorDivisible 2 f) : modTwoBase ≤ mahlerMeasureZ f := by have haux : ∀ g : ℤ[X], g.Monic → 1 ≤ g.natDegree → HasNoCyclotomicFactor g → IsInteriorDivisible 2 g → modTwoBase ≤ mahlerMeasureZ g := by intro g hg_monic hg_deg hg_nc hg_int have hpow := master_mod_two_mahler_pow_bound (by omega) hg_monic hg_nc (interiorDivisible_satisfies_binomial_congruence hg_deg hg_monic hg_int) have h4 : (5 : ℝ) ^ g.natDegree = modTwoBase ^ (4 * g.natDegree) := by rw [pow_mul] congr 1 unfold modTwoBase rw [← Real.rpow_natCast, ← Real.rpow_mul (by norm_num)] norm_num rw [h4] at hpow by_contra hlt push Not at hlt have hstrict := pow_lt_pow_left₀ hlt (mahlerMeasure_nonneg _) (by omega : 4 * g.natDegree ≠ 0) linarith rcases hint.1 with hlc1 | hlc_neg1 · exact haux f (Polynomial.Monic.def.mpr hlc1) hdeg hnc hint · have h := haux (-f) (by rw [Polynomial.Monic.def, Polynomial.leadingCoeff_neg, hlc_neg1]; norm_num) (by rwa [Polynomial.natDegree_neg]) (fun z hz n hn => hnc z (by simpa using hz) n hn) (interiorDivisible_neg hint) rwa [mahlerMeasureZ_neg] at h /-- Any `p`-periodic congruence polynomial `f(X) ≡ ∑_{j=0}^{q} X^{j p} (mod m)` satisfies `(X^p - 1) · f(X) ≡ X^{(q+1) p} - 1 (mod m)`. -/ lemma periodicModOne_satisfies_binomial_congruence {m p q : ℕ} {f : ℤ[X]} (hp : 0 < p) (hper : IsPeriodicModOneClass m p q f) : SatisfiesBinomialCongruence m ((q + 1) * p) 1 f := by rcases hper with ⟨hdeg, hcoeff⟩ refine ⟨Or.inl rfl, X ^ p - 1, ?_⟩ set h : ℤ[X] := ∑ j ∈ Finset.range (q + 1), (X ^ p) ^ j set err : ℤ[X] := ∑ i ∈ Finset.range (q * p + 1), C ((if p ∣ i then (f.coeff i - 1) / (m : ℤ) else f.coeff i / (m : ℤ))) * X ^ i have hf_eq : f = h + C (m : ℤ) * err := by ext i rw [Polynomial.coeff_add, Polynomial.coeff_C_mul] have hh_coeff : h.coeff i = if p ∣ i ∧ i ≤ q * p then 1 else 0 := by dsimp [h] rw [Polynomial.finsetSum_coeff] have hterm : ∀ j ∈ Finset.range (q + 1), ((X ^ p : ℤ[X]) ^ j).coeff i = if i = p * j then 1 else 0 := by intro j _ rw [← pow_mul, Polynomial.coeff_X_pow] rw [Finset.sum_congr rfl hterm] by_cases hi : p ∣ i ∧ i ≤ q * p · rcases hi.1 with ⟨j, rfl⟩ have hj_lt : j < q + 1 := by have : p * j ≤ p * q := by simpa [mul_comm] using hi.2 have : j ≤ q := Nat.le_of_mul_le_mul_left this hp omega have hj_mem : j ∈ Finset.range (q + 1) := Finset.mem_range.mpr hj_lt have hunique : ∀ x ∈ Finset.range (q + 1), (if p * j = p * x then (1 : ℤ) else 0) = if x = j then 1 else 0 := by intro x _ by_cases hxj : x = j · subst hxj; simp · have hne : p * j ≠ p * x := fun heq => hxj (Nat.eq_of_mul_eq_mul_left hp heq).symm simp [hxj, hne] rw [Finset.sum_congr rfl hunique] simp [hj_mem, hi] · simp only [hi, ↓reduceIte] apply Finset.sum_eq_zero intro j hj have hj_le : j ≤ q := Nat.lt_succ_iff.mp (Finset.mem_range.mp hj) have hne : i ≠ p * j := by intro heq apply hi refine ⟨⟨j, heq⟩, ?_⟩ rw [heq, mul_comm]; exact Nat.mul_le_mul_right p hj_le simp [hne] have herr_coeff : err.coeff i = if i ≤ q * p then (if p ∣ i then (f.coeff i - 1) / (m : ℤ) else f.coeff i / (m : ℤ)) else 0 := by dsimp [err] rw [Polynomial.finsetSum_coeff] have hterm : ∀ x ∈ Finset.range (q * p + 1), (C (if p ∣ x then (f.coeff x - 1) / (m : ℤ) else f.coeff x / (m : ℤ)) * X ^ x).coeff i = if x = i then (if p ∣ x then (f.coeff x - 1) / (m : ℤ) else f.coeff x / (m : ℤ)) else 0 := by intro x _ rw [Polynomial.coeff_C_mul, Polynomial.coeff_X_pow] by_cases hxi : i = x · subst hxi; simp · simp [hxi, Ne.symm hxi] rw [Finset.sum_congr rfl hterm] by_cases hi : i ≤ q * p · have hmem : i ∈ Finset.range (q * p + 1) := Finset.mem_range.mpr (by omega) simp [hi, hmem] · have hnot : i ∉ Finset.range (q * p + 1) := by simp only [Finset.mem_range]; omega simp [hi, hnot] rw [hh_coeff, herr_coeff] by_cases hi : i ≤ q * p · have hi' : i ≤ f.natDegree := by omega have hc := hcoeff i hi' by_cases hpi : p ∣ i · simp only [hi, hpi, and_self, ↓reduceIte] at hc ⊢ have hmul := Int.mul_ediv_cancel' hc omega · simp only [hi, hpi, false_and, ↓reduceIte] at hc ⊢ have hmul := Int.mul_ediv_cancel' hc omega · have hf0 : f.coeff i = 0 := Polynomial.coeff_eq_zero_of_natDegree_lt (by omega) simp [hi, hf0] have hgeom : (X ^ p - 1 : ℤ[X]) * h = X ^ ((q + 1) * p) - 1 := by dsimp [h] have := mul_geom_sum (X ^ p : ℤ[X]) (q + 1) rw [← pow_mul, mul_comm p (q + 1)] at this simpa [mul_comm] using this refine ⟨(X ^ p - 1) * err, ?_⟩ rw [hf_eq, mul_add, hgeom, map_one] ring /-- **`p`-Periodic Congruence Bound (Even `m ≥ 4`, e.g. alternating `(1, 0)` at `p = 2`)**: For every cyclotomic-free `f ∈ ℤ[X]` with `f(X) ≡ ∑_{j=0}^{q} X^{j p} (mod m)` (`p ≥ 1, q ≥ 1`), `M(f)^{2(q+1)p} ≥ ((m² + 4) / 4)^{q p}`, i.e., `log M(f) ≥ log(√(m² + 4) / 2) · (q / (q + 1))`. -/ theorem periodic_congruence_even_pow {m p q : ℕ} {f : ℤ[X]} (hm : 4 ≤ m) (heven : Even m) (hp : 0 < p) (hq : 0 < q) (hnc : HasNoCyclotomicFactor f) (hper : IsPeriodicModOneClass m p q f) : (((m : ℝ) ^ 2 + 4) / 4) ^ (q * p) ≤ (mahlerMeasureZ f) ^ (2 * ((q + 1) * p)) := by have hdeg : f.natDegree = q * p := hper.1 have hdeg_pos : 1 ≤ f.natDegree := by rw [hdeg]; exact Nat.mul_pos hq hp have hf_ne : f ≠ 0 := by intro h0; rw [h0, Polynomial.natDegree_zero] at hdeg_pos; omega have hlc_mod : (m : ℤ) ∣ (f.leadingCoeff - 1) := by have h := hper.2 f.natDegree le_rfl have hdvd : p ∣ f.natDegree := by rw [hdeg]; exact dvd_mul_left p q rw [Polynomial.leadingCoeff] simpa [hdvd] using h have h0_mod : (m : ℤ) ∣ (f.coeff 0 - 1) := by have h := hper.2 0 (Nat.zero_le _) simpa using h have hsq_le : ((m : ℝ) ^ 2 + 4) / 4 ≤ ((m : ℝ) - 1) ^ 2 := by have hmR : (4 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith have hbase_ge1 : (1 : ℝ) ≤ ((m : ℝ) ^ 2 + 4) / 4 := by have hmR : (4 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith rcases eq_one_or_abs_ge_sub_one_of_mod_one (by omega) hlc_mod with hlc1 | hlc_big · rcases eq_one_or_abs_ge_sub_one_of_mod_one (by omega) h0_mod with h01 | h0_big · rw [← hdeg] exact master_even_mahler_pow_bound hm heven (Nat.mul_pos (Nat.succ_pos q) hp) (Polynomial.Monic.def.mpr hlc1) (Or.inl h01) hnc (periodicModOne_satisfies_binomial_congruence hp hper) · have hM : (m : ℝ) - 1 ≤ mahlerMeasureZ f := le_trans (by exact_mod_cast h0_big) (mahlerMeasureZ_ge_constCoeff_abs hf_ne) have hM2 : ((m : ℝ) ^ 2 + 4) / 4 ≤ (mahlerMeasureZ f) ^ 2 := by have hmR : (0 : ℝ) ≤ (m : ℝ) - 1 := by have : (4 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm linarith exact le_trans hsq_le (pow_le_pow_left₀ hmR hM 2) have hpow := pow_bound_of_ge_base hbase_ge1 hM2 (Nat.mul_le_mul_right p (Nat.le_succ q)) rwa [← pow_mul] at hpow · have hM : (m : ℝ) - 1 ≤ mahlerMeasureZ f := le_trans (by exact_mod_cast hlc_big) (mahlerMeasureZ_ge_leadingCoeff_abs f) have hM2 : ((m : ℝ) ^ 2 + 4) / 4 ≤ (mahlerMeasureZ f) ^ 2 := by have hmR : (0 : ℝ) ≤ (m : ℝ) - 1 := by have : (4 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm linarith exact le_trans hsq_le (pow_le_pow_left₀ hmR hM 2) have hpow := pow_bound_of_ge_base hbase_ge1 hM2 (Nat.mul_le_mul_right p (Nat.le_succ q)) rwa [← pow_mul] at hpow /-- **`p`-Periodic Congruence Bound (Odd `m ≥ 3`)**: `M(f)^{2(q+1)p} ≥ ((m² + 3) / 4)^{q p}`. -/ theorem periodic_congruence_odd_pow {m p q : ℕ} {f : ℤ[X]} (hm : 3 ≤ m) (hodd : Odd m) (hp : 0 < p) (hq : 0 < q) (hnc : HasNoCyclotomicFactor f) (hper : IsPeriodicModOneClass m p q f) : (((m : ℝ) ^ 2 + 3) / 4) ^ (q * p) ≤ (mahlerMeasureZ f) ^ (2 * ((q + 1) * p)) := by have hdeg : f.natDegree = q * p := hper.1 have hdeg_pos : 1 ≤ f.natDegree := by rw [hdeg]; exact Nat.mul_pos hq hp have hf_ne : f ≠ 0 := by intro h0; rw [h0, Polynomial.natDegree_zero] at hdeg_pos; omega have hlc_mod : (m : ℤ) ∣ (f.leadingCoeff - 1) := by have h := hper.2 f.natDegree le_rfl have hdvd : p ∣ f.natDegree := by rw [hdeg]; exact dvd_mul_left p q rw [Polynomial.leadingCoeff] simpa [hdvd] using h have h0_mod : (m : ℤ) ∣ (f.coeff 0 - 1) := by have h := hper.2 0 (Nat.zero_le _) simpa using h have hsq_le : ((m : ℝ) ^ 2 + 3) / 4 ≤ ((m : ℝ) - 1) ^ 2 := by have hmR : (3 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith have hbase_ge1 : (1 : ℝ) ≤ ((m : ℝ) ^ 2 + 3) / 4 := by have hmR : (3 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm nlinarith rcases eq_one_or_abs_ge_sub_one_of_mod_one hm hlc_mod with hlc1 | hlc_big · rcases eq_one_or_abs_ge_sub_one_of_mod_one hm h0_mod with h01 | h0_big · rw [← hdeg] exact master_odd_mahler_pow_bound hm hodd (Nat.mul_pos (Nat.succ_pos q) hp) (Polynomial.Monic.def.mpr hlc1) (Or.inl h01) hnc (periodicModOne_satisfies_binomial_congruence hp hper) · have hM : (m : ℝ) - 1 ≤ mahlerMeasureZ f := le_trans (by exact_mod_cast h0_big) (mahlerMeasureZ_ge_constCoeff_abs hf_ne) have hM2 : ((m : ℝ) ^ 2 + 3) / 4 ≤ (mahlerMeasureZ f) ^ 2 := by have hmR : (0 : ℝ) ≤ (m : ℝ) - 1 := by have : (3 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm linarith exact le_trans hsq_le (pow_le_pow_left₀ hmR hM 2) have hpow := pow_bound_of_ge_base hbase_ge1 hM2 (Nat.mul_le_mul_right p (Nat.le_succ q)) rwa [← pow_mul] at hpow · have hM : (m : ℝ) - 1 ≤ mahlerMeasureZ f := le_trans (by exact_mod_cast hlc_big) (mahlerMeasureZ_ge_leadingCoeff_abs f) have hM2 : ((m : ℝ) ^ 2 + 3) / 4 ≤ (mahlerMeasureZ f) ^ 2 := by have hmR : (0 : ℝ) ≤ (m : ℝ) - 1 := by have : (3 : ℝ) ≤ (m : ℝ) := by exact_mod_cast hm linarith exact le_trans hsq_le (pow_le_pow_left₀ hmR hM 2) have hpow := pow_bound_of_ge_base hbase_ge1 hM2 (Nat.mul_le_mul_right p (Nat.le_succ q)) rwa [← pow_mul] at hpow /-- **`p`-Periodic Congruence Bound (`m = 3`, `10^{1/4}`)**: `M(f)^{4(q+1)p} ≥ 10^{q p}`. -/ theorem periodic_congruence_mod_three_pow {p q : ℕ} {f : ℤ[X]} (hp : 0 < p) (hq : 0 < q) (hnc : HasNoCyclotomicFactor f) (hper : IsPeriodicModOneClass 3 p q f) : (10 : ℝ) ^ (q * p) ≤ (mahlerMeasureZ f) ^ (4 * ((q + 1) * p)) := by have hdeg : f.natDegree = q * p := hper.1 have hdeg_pos : 1 ≤ f.natDegree := by rw [hdeg]; exact Nat.mul_pos hq hp have hf_ne : f ≠ 0 := by intro h0; rw [h0, Polynomial.natDegree_zero] at hdeg_pos; omega have hlc_mod : (3 : ℤ) ∣ (f.leadingCoeff - 1) := by have h := hper.2 f.natDegree le_rfl have hdvd : p ∣ f.natDegree := by rw [hdeg]; exact dvd_mul_left p q rw [Polynomial.leadingCoeff] simpa [hdvd] using h have h0_mod : (3 : ℤ) ∣ (f.coeff 0 - 1) := by have h := hper.2 0 (Nat.zero_le _) simpa using h rcases eq_one_or_abs_ge_sub_one_of_mod_one (by decide) hlc_mod with hlc1 | hlc_big · rcases eq_one_or_abs_ge_sub_one_of_mod_one (by decide) h0_mod with h01 | h0_big · rw [← hdeg] exact master_mod_three_mahler_pow_bound (Nat.mul_pos (Nat.succ_pos q) hp) (Polynomial.Monic.def.mpr hlc1) (Or.inl h01) hnc (periodicModOne_satisfies_binomial_congruence hp hper) · have hM : (2 : ℝ) ≤ mahlerMeasureZ f := le_trans (by exact_mod_cast h0_big) (mahlerMeasureZ_ge_constCoeff_abs hf_ne) have hM4 : (10 : ℝ) ≤ (mahlerMeasureZ f) ^ 4 := by have : (2 : ℝ) ^ 4 ≤ (mahlerMeasureZ f) ^ 4 := pow_le_pow_left₀ (by norm_num) hM 4 linarith [show (10 : ℝ) ≤ (2 : ℝ) ^ 4 by norm_num] have hpow := pow_bound_of_ge_base (by norm_num) hM4 (Nat.mul_le_mul_right p (Nat.le_succ q)) rwa [← pow_mul] at hpow · have hM : (2 : ℝ) ≤ mahlerMeasureZ f := le_trans (by exact_mod_cast hlc_big) (mahlerMeasureZ_ge_leadingCoeff_abs f) have hM4 : (10 : ℝ) ≤ (mahlerMeasureZ f) ^ 4 := by have : (2 : ℝ) ^ 4 ≤ (mahlerMeasureZ f) ^ 4 := pow_le_pow_left₀ (by norm_num) hM 4 linarith [show (10 : ℝ) ≤ (2 : ℝ) ^ 4 by norm_num] have hpow := pow_bound_of_ge_base (by norm_num) hM4 (Nat.mul_le_mul_right p (Nat.le_succ q)) rwa [← pow_mul] at hpow /-! ## Section 9: Concrete Reciprocal Witness Polynomials -/ /-- The monic reciprocal quadratic `Q_m(X) = X² - (m - 1) X + 1 ∈ D_m` (`m ≥ 4`). -/ noncomputable def reciprocalQuadraticD (m : ℕ) : ℤ[X] := X ^ 2 - C ((m : ℤ) - 1) * X + 1 lemma reciprocalQuadraticD_modOne (m : ℕ) : IsModOneClass m (reciprocalQuadraticD m) := by intro i hi have hdeg : (reciprocalQuadraticD m).natDegree ≤ 2 := by unfold reciprocalQuadraticD; compute_degree! have hi2 : i ≤ 2 := le_trans hi hdeg interval_cases i · unfold reciprocalQuadraticD; simp [Polynomial.coeff_one] · unfold reciprocalQuadraticD; simp [Polynomial.coeff_one] · unfold reciprocalQuadraticD; simp [Polynomial.coeff_one] lemma reciprocalQuadraticD_reverse (m : ℕ) : (reciprocalQuadraticD m).reverse = reciprocalQuadraticD m := by have hdeg : (reciprocalQuadraticD m).natDegree = 2 := by unfold reciprocalQuadraticD; compute_degree! ext i rw [Polynomial.coeff_reverse, hdeg] by_cases hi : i ≤ 2 · interval_cases i <;> unfold reciprocalQuadraticD <;> simp [Polynomial.coeff_one] · rw [Polynomial.revAt_eq_self_of_lt (by omega)] /-- The monic reciprocal interior-divisible quadratic `R_m(X) = X² - m X + 1` (`m ≥ 3`), which has `M(R_m) = (m + √(m² - 4)) / 2 < m`. -/ noncomputable def interiorQuadratic (m : ℕ) : ℤ[X] := X ^ 2 - C (m : ℤ) * X + 1 lemma interiorQuadratic_isInteriorDivisible (m : ℕ) : IsInteriorDivisible m (interiorQuadratic m) := by have hdeg : (interiorQuadratic m).natDegree = 2 := by unfold interiorQuadratic; compute_degree! refine ⟨Or.inl ?_, Or.inl ?_, ?_⟩ · rw [Polynomial.leadingCoeff, hdeg]; unfold interiorQuadratic; simp [Polynomial.coeff_one] · unfold interiorQuadratic; simp [Polynomial.coeff_one] · intro i hi0 hid rw [hdeg] at hid have hi1 : i = 1 := by omega subst hi1 unfold interiorQuadratic simp [Polynomial.coeff_one] /-! ## Section 10: Axiom Audit -/ #print axioms master_linear_pair_mahler_pow_bound #print axioms master_even_mahler_pow_bound #print axioms master_odd_mahler_pow_bound #print axioms master_mod_three_mahler_pow_bound #print axioms master_mod_two_mahler_pow_bound #print axioms bdm_improved_even_log #print axioms bdm_improved_odd_log #print axioms bdm_improved_mod_three_log #print axioms bdm_mod_two_log #print axioms strictly_beats_bdm2007_all #print axioms mod_three_hierarchy #print axioms interior_divisible_even #print axioms interior_divisible_odd #print axioms interior_divisible_mod_three #print axioms interior_divisible_mod_two #print axioms periodic_congruence_even_pow #print axioms periodic_congruence_odd_pow #print axioms periodic_congruence_mod_three_pow end CyclotomicCongruenceMahlerMeasure