Documentation

CslibFrontier.Algorithms.PlantedClique.IntegerPower

Materialized integer matrix-power columns #

powerColumnVector M s i computes M ^ s applied to the i-th standard basis vector. Each multiplication first computes the previous column and then fills a new array-backed Vector. Thus later coordinate reads access stored entries of that column.

The getter theorem identifies this computation with the mathematical matrix power. If every matrix entry has absolute value at most one, an entry after s multiplications has absolute value at most n ^ s, hence at most s * n.size + 1 magnitude bits. These are correctness and integer-size guarantees. The uniform native machine realization is supplied by Cslib.IntTable.powerColumn in CslibFrontier.Computability.PolyTime.Int.MatrixPower; the complete recovery program and its agreement with this implementation are in Program.

Main definitions #

Main results #

Compute a power column by storing the entire column after each matrix multiplication.

@[simp]
theorem Cslib.Algorithms.PlantedClique.getElem_powerColumnVector {n : ℕ} (M : Matrix (Fin n) (Fin n) ℤ) (s : ℕ) (i j : Fin n) :
(powerColumnVector M s i)[↑j] = (M ^ s) j i

Reading a stored power-column entry agrees with the corresponding matrix-power entry.

theorem Cslib.Algorithms.PlantedClique.natAbs_powerColumnVector_le {n : ℕ} (M : Matrix (Fin n) (Fin n) ℤ) (hM : ∀ (j l : Fin n), (M j l).natAbs ≤ 1) (s : ℕ) (i j : Fin n) :

If all matrix entries have magnitude at most one, each multiplication grows the largest entry magnitude by at most a factor of the dimension.

theorem Cslib.Algorithms.PlantedClique.size_powerColumnVector_le {n : ℕ} (M : Matrix (Fin n) (Fin n) ℤ) (hM : ∀ (j l : Fin n), (M j l).natAbs ≤ 1) (s : ℕ) (i j : Fin n) :

The magnitude of each stored power-column entry uses at most s * n.size + 1 binary digits. An additional sign bit suffices to encode the corresponding integer.