Documentation

CslibFrontier.Algorithms.PlantedClique.Algorithm

An integer matrix-power algorithm for planted clique #

This file implements an exact-integer power-growth variant developed for this formalization of the spectral recovery method of Alon, Krivelevich, Sudakov. Its input is a finite simple graph and the target clique size; the hidden set is unavailable to the algorithm.

Relation to the source #

Algorithm A in [AKS98], Section 2.1, p. 3, uses the adjacency matrix's second eigenvector for k ≥ 10 √n, then selects the k largest absolute coordinates and keeps vertices with at least 3 k / 4 neighbors among them. Section 2.2, Propositions 2.1 and 2.3 and Lemma 2.4 (pp. 4--6), supplies its spectral analysis. Algorithm B in Section 2.3 (pp. 7--8) enumerates small vertex sets and restricts to their common neighbors to handle every fixed positive constant in k ≥ c √n. These locators refer to the author-hosted manuscript linked in the bibliography.

Our implementation retains the coordinate-selection and degree-cleanup architecture. It uses the centered signed matrix M = 2 A - J + I, with zero diagonal and off-diagonal entries 1 for an edge and -1 otherwise. It searches standard-basis orbits through the first n + 1 steps for a nonzero next iterate z = M y satisfying k² ‖y‖² ≤ 4 ‖z‖². The squared norms in this test are integer sums. IntegerPower stores every intermediate column in an array-backed vector and proves that its entries agree with the mathematical matrix power.

The correctness argument establishes the existence of a growing iterate through traces of positive operator powers. A rank-one residual bound then controls the normalized output's distance from the planted indicator. The probability argument uses scalar Rademacher tails and finite nets. Real normalization, spectral theory, and the hidden set occur only in these proofs; the recovery computation uses integer operations and comparisons.

Scope of the guarantee #

The companion development in Final proves recovery for k ≥ 1024 √n with failure probability at most 2 exp (-n) + n exp (-k / 32), under its explicit natural-number size hypotheses. CommonNeighborAsymptotics extends this integer algorithm by seed enumeration to every fixed c > 0, with one native polynomial-time program whose actual recovery failure tends to zero. Eigenvector and EigenvectorFinal separately specify Algorithm A's literal raw-adjacency second eigenvector and prove its probability guarantee in an explicit conservative regime. A native finite-precision implementation and sharper constants are tracked in #6238. IntegerPower proves bounds on entry magnitudes and their binary sizes. Program supplies a uniform native multitape polynomial-time realization on dense graph inputs and proves exact agreement with recover. PolyTime connects that one program to the distributional-search guarantee, with both size parameters supplied at runtime and signed integer arithmetic charged in binary.

Main definitions #

References #

The zero-diagonal signed adjacency matrix of a finite simple graph.

The seed and number of multiplications specifying a power column.

  • steps : ℕ

    The number of multiplications before testing growth.

  • seed : Fin n

    The standard-basis vector from which this orbit starts.

def Cslib.Algorithms.PlantedClique.powerVector {n : ℕ} (M : Matrix (Fin n) (Fin n) ℤ) (s : ℕ) (i : Fin n) :
Fin n → ℤ

A column of an integer matrix power.

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

The stored integer iteration computes the corresponding matrix-power column.

Test nonzero growth by comparing integer squared norms, without division.

Search every basis orbit through its first n + 1 multiplications.

The first growing column, in step order and then vertex order.

The selected nonzero next iterate, or the zero vector if the search fails.

The k largest absolute coordinates of the selected integer vector.

Recover a planted clique using integer matrix powers, rounding, and degree cleanup.

Recovery is unchanged when its adjacency decision procedure is normalized to classical decidability. This transports recovery events across graph representations without unfolding the integer computation to compare decision instances.

Every eligible seed and step occurs in the search.

The search examines at most a quadratic number of seed-step pairs.

theorem Cslib.Algorithms.PlantedClique.growingColumn?_isSome {n : ℕ} (M : Matrix (Fin n) (Fin n) ℤ) (k : ℕ) (h : ∃ (c : PowerColumn n), c.steps < n + 1 ∧ grows M k c = true) :

The finite search succeeds whenever a growing column occurs in its range.

theorem Cslib.Algorithms.PlantedClique.growingColumn?_spec {n : ℕ} (M : Matrix (Fin n) (Fin n) ℤ) (k : ℕ) {c : PowerColumn n} (h : growingColumn? M k = some c) :
c.steps < n + 1 ∧ grows M k c = true

A successful search returns a candidate in range satisfying the exact growth test.

theorem Cslib.Algorithms.PlantedClique.card_approximateSet {n : ℕ} (M : Matrix (Fin n) (Fin n) ℤ) {k : ℕ} (hk : k ≤ n) :

Rounding always returns exactly k vertices when k ≤ n.

Selected absolute coordinates dominate every omitted absolute coordinate.

Every signed adjacency entry has magnitude at most one.

theorem Cslib.Algorithms.PlantedClique.size_recoveredVector_le {n : ℕ} (M : Matrix (Fin n) (Fin n) ℤ) (hM : ∀ (i j : Fin n), (M i j).natAbs ≤ 1) (k : ℕ) (j : Fin n) :
(recoveredVector M k j).natAbs.size ≤ (n + 1) * n.size + 1

The vector returned by the bounded search uses only a polynomial number of magnitude bits per coordinate. This is an integer-size bound, separate from a machine-time certificate.