Documentation

CslibFrontier.Foundations.RingTheory.CyclicIntRing.Coefficients

Executable coefficient operations for the existing cyclic integer quotient #

The existing CyclicIntRing remains the ring model. Its multiplication coefficients are finite cyclic convolutions, with an explicit natural partner index suitable for native array access. Partial-sum magnitude bounds account for the actual intermediate accumulators.

The quotient expansion and multiplication proof adapt Spec/Sec3/Theorem17/Cyclic.lean, lines 52–141, at anthropics/formal-math@16a5ce41304fcdaea4e0be7c132e1c361dc26da5. The function representation and partial-sum bound below serve the native coefficient kernel. No additional ring type or execution model is introduced.

The unique partner below p whose sum with i has residue r, when r and i are below p.

theorem Cslib.CyclicIntRing.subIndex_lt {p r i : ℕ} (hr : r < p) (hi : i < p) :
subIndex p r i < p

Cyclic coefficient indexing remains within the coefficient array.

def Cslib.CyclicIntRing.partialConvolution (p : ℕ) (u v : ℕ → ℤ) (r k : ℕ) :

Partial convolution of two coefficient arrays, without assumptions about their lengths.

def Cslib.CyclicIntRing.convolution (p : ℕ) (u v : ℕ → ℤ) (r : ℕ) :

The executable cyclic convolution of two arrays of p coefficients.

@[simp]
theorem Cslib.CyclicIntRing.partialConvolution_zero (p : ℕ) (u v : ℕ → ℤ) (r : ℕ) :
partialConvolution p u v r 0 = 0

The initial accumulator is zero.

theorem Cslib.CyclicIntRing.partialConvolution_succ (p : ℕ) (u v : ℕ → ℤ) (r k : ℕ) :
partialConvolution p u v r (k + 1) = partialConvolution p u v r k + u k * v (subIndex p r k)

The next actual multiply/accumulate term.

theorem Cslib.CyclicIntRing.partialConvolution_natAbs_le {p r k A B : ℕ} {u v : ℕ → ℤ} (hr : r < p) (hk : k ≤ p) (hu : ∀ i < p, (u i).natAbs ≤ A) (hv : ∀ i < p, (v i).natAbs ≤ B) :
(partialConvolution p u v r k).natAbs ≤ k * (A * B)

Every partial accumulator is bounded by the number of terms times the input envelopes.

theorem Cslib.CyclicIntRing.convolution_congr {p r : ℕ} (hr : r < p) {u v u' v' : ℕ → ℤ} (hu : ∀ i < p, u i = u' i) (hv : ∀ i < p, v i = v' i) :
convolution p u v r = convolution p u' v' r

A cyclic coefficient depends only on the two original coefficient blocks.

theorem Cslib.CyclicIntRing.coeff_eq_zero_of_le {p : ℕ} (hp : p ≠ 0) (z : CyclicIntRing p) {r : ℕ} (hr : p ≤ r) :
(coeff hp r) z = 0

Quotient representatives have no coefficients at degrees at least p.

theorem Cslib.CyclicIntRing.eq_sum_coeff {p : ℕ} (hp : p ≠ 0) (z : CyclicIntRing p) :
z = ∑ i ∈ Finset.range p, (coeff hp i) z • x p ^ i

Expand an existing quotient element in its p coefficient powers.

theorem Cslib.CyclicIntRing.coeff_mul_eq_convolution {p : ℕ} (hp : p ≠ 0) (z w : CyclicIntRing p) {r : ℕ} (hr : r < p) :
(coeff hp r) (z * w) = convolution p (fun (i : ℕ) => (coeff hp i) z) (fun (i : ℕ) => (coeff hp i) w) r

Coefficient multiplication in the existing quotient is exactly executable convolution.