Documentation

CslibFrontier.Foundations.NumberTheory.AKS.Coefficients

Coefficient arithmetic modulo X^r - 1 and n #

An element of (ℤ / n)[X] / (X^r - 1) is represented by the r coefficients of its reduced polynomial, as natural numbers below n. This file gives the coefficient formulas that a program evaluates and identifies them with the ring operations: Cslib.AKS.toQuot n r c is the class of ∑_{i < r} c i X^i, products of classes have the coefficients Cslib.AKS.mulCoeff (Cslib.AKS.toQuot_mulCoeff), the classes of X^e + a have the coefficients Cslib.AKS.powAddCoeff (Cslib.AKS.toQuot_powAddCoeff), and reduced coefficient vectors determine their classes (Cslib.AKS.toQuot_eq_toQuot_iff). In particular the AKS congruence holds exactly when the n-th power of the class of X + a has the coefficients of X^n + a (Cslib.AKS.congruence_iff_toQuot).

Main definitions #

Main results #

References #

noncomputable def Cslib.AKS.coeffPoly (n r : ℕ) (c : ℕ → ℕ) :

The polynomial ∑_{i < r} c i X^i over ℤ / n.

noncomputable def Cslib.AKS.toQuot (n r : ℕ) (c : ℕ → ℕ) :

The class of ∑_{i < r} c i X^i in (ℤ / n)[X] / (X^r - 1).

def Cslib.AKS.mulCoeff (n r : ℕ) (p q : ℕ → ℕ) (k : ℕ) :

The coefficients of the product of the classes of p and q, reduced modulo n: ∑_{(i + j) mod r = k} p i q j mod n.

def Cslib.AKS.powAddCoeff (n r e a k : ℕ) :

The coefficients of X^e + a, reduced modulo X^r - 1 and n.

The root of X^r - 1 is an r-th root of unity.

Powers of the root depend only on the exponent modulo r.

theorem Cslib.AKS.natCast_mod (n r m : ℕ) :
↑(m % n) = ↑m

Natural numbers in (ℤ / n)[X] / (X^r - 1) depend only on their residue modulo n.

theorem Cslib.AKS.toQuot_eq_sum (n r : ℕ) (c : ℕ → ℕ) :
toQuot n r c = ∑ i ∈ Finset.range r, ↑(c i) * AdjoinRoot.root (Polynomial.X ^ r - 1) ^ i

The class of ∑_{i < r} c i X^i as a sum of powers of the root.

theorem Cslib.AKS.toQuot_congr {n r : ℕ} {c d : ℕ → ℕ} (h : ∀ i < r, c i = d i) :
toQuot n r c = toQuot n r d

The class of ∑_{i < r} c i X^i depends only on the coefficients below r.

theorem Cslib.AKS.toQuot_mulCoeff (n r : ℕ) (p q : ℕ → ℕ) :
toQuot n r (mulCoeff n r p q) = toQuot n r p * toQuot n r q

Coefficients of products.

theorem Cslib.AKS.toQuot_powAddCoeff {n r : ℕ} (hr : 0 < r) (e a : ℕ) :

Coefficients of X^e + a.

theorem Cslib.AKS.coeff_coeffPoly {n r : ℕ} (c : ℕ → ℕ) (k : ℕ) :
(coeffPoly n r c).coeff k = if k < r then ↑(c k) else 0

The coefficients of ∑_{i < r} c i X^i.

theorem Cslib.AKS.toQuot_eq_toQuot_iff {n r : ℕ} (hn : 0 < n) (hr : 0 < r) {c d : ℕ → ℕ} (hc : ∀ i < r, c i < n) (hd : ∀ i < r, d i < n) :
toQuot n r c = toQuot n r d ↔ ∀ i < r, c i = d i

Reduced coefficients determine their class: for n ≥ 1 and r ≥ 1, coefficient vectors with entries below n have equal classes exactly when they agree below r.

theorem Cslib.AKS.congruence_iff_toQuot {n r : ℕ} (hr : 0 < r) (a : ℕ) :
Congruence n r a ↔ toQuot n r (powAddCoeff n r 1 a) ^ n = toQuot n r (powAddCoeff n r n a)

The AKS congruence in coefficients: (X + a)^n ≡ X^n + a (mod X^r - 1, n) exactly when the n-th power of the class with the coefficients of X + a is the class with the coefficients of X^n + a.

theorem Cslib.AKS.powAddCoeff_lt {n r : ℕ} (hn : 0 < n) (e a k : ℕ) :
powAddCoeff n r e a k < n

Coefficients of X^e + a are reduced modulo n.

theorem Cslib.AKS.mulCoeff_lt {n r : ℕ} (hn : 0 < n) (p q : ℕ → ℕ) (k : ℕ) :
mulCoeff n r p q k < n

Coefficients of products are reduced modulo n.