Documentation

CslibFrontier.Algorithms.PlantedClique.Eigenvector

The raw-adjacency second-eigenvector algorithm #

Algorithm A of [AKS98], Section 2.1 (p. 3), chooses a unit eigenvector for the second largest eigenvalue of the ordinary adjacency matrix, selects the k largest absolute coordinates, and applies degree cleanup. This file specifies that algorithm using Mathlib's ordered spectral theorem. In particular, index 1 belongs to the decreasingly ordered linear-map eigenbasis, not to the arbitrarily reindexed matrix eigenbasis.

The correctness proof follows the residual argument in Section 2.2 (pp. 4--7). The rank-two signal is (J + 1_S 1_Sᵀ) / 2; the exact expectation also subtracts (I + diag(1_S)) / 2 to remove loops. Removing the all-ones component of the planted indicator gives an approximate eigenvector at eigenvalue k / 2. The first and third ordered eigenvalues are separated from that value, so a small residual implies proximity to the second eigenline. The existing coordinate-rounding and degree-cleanup theorems finish the argument.

The explicit constants here are conservative: 4096 k ≤ n, 8192 √n ≤ k, and the existing noise event of norm at most 36 √n. Matching the paper's constant 10 and supplying a finite-precision implementation with a native running-time certificate are tracked in #6238. Mathlib's exact eigenvector choice is noncomputable. This file proves mathematical correctness; the theorem recoverFromApproximateSecondEigenvector_eq gives an explicit 1 / 64 Euclidean accuracy tolerance for the numerical implementation.

A unit second eigenvector of the ordinary adjacency matrix, ordered by decreasing algebraic eigenvalue. The output is zero only when the graph has fewer than two vertices.

The k largest absolute coordinates of the second adjacency eigenvector.

Algorithm A: second adjacency eigenvector, largest absolute coordinates, then the 3 k / 4 degree threshold. This is an exact mathematical specification.

The selected vector has unit norm whenever a second eigenvalue exists.

The chosen vector satisfies the adjacency eigen-equation for index 1 of Mathlib's nonincreasingly ordered spectrum.

Coordinate selection has the requested size if it does not exceed the vertex count.

A small perturbation of the rank-two raw-adjacency signal makes the second adjacency eigenvector approximate the planted indicator, up to sign.

Under the rank-two perturbation bound, the selected coordinates miss at most one sixteenth of the planted vertices.

theorem Cslib.Algorithms.PlantedClique.recoverEigenvector_eq_of_opNorm_le {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (S : Finset (Fin n)) (hk : 6 ≤ S.card) (hsparse : 4096 * S.card ≤ n) (hclique : G.IsClique ↑S) (hnoise : ‖Matrix.toEuclideanCLM (SimpleGraph.adjMatrix ℝ G - (1 / 2) • (cliqueSignal Finset.univ + cliqueSignal S))‖ ≤ ↑S.card / 256) (hdegree : ∀ v ∉ S, 8 * (Finset.filter (G.Adj v) S).card ≤ 5 * S.card) :

Complete deterministic correctness of the raw-adjacency eigenvector specification.

theorem Cslib.Algorithms.PlantedClique.recoverFromApproximateSecondEigenvector_eq {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (S : Finset (Fin n)) (hk : 6 ≤ S.card) (hsparse : 4096 * S.card ≤ n) (hclique : G.IsClique ↑S) (hnoise : ‖Matrix.toEuclideanCLM (SimpleGraph.adjMatrix ℝ G - (1 / 2) • (cliqueSignal Finset.univ + cliqueSignal S))‖ ≤ ↑S.card / 256) (hdegree : ∀ v ∉ S, 8 * (Finset.filter (G.Adj v) S).card ≤ 5 * S.card) (v : EuclideanSpace ℝ (Fin n)) (happrox : ∃ (ε : ℝ), (ε = 1 ∨ ε = -1) ∧ ‖v - ε • secondEigenvector G‖ ≤ 1 / 64) :

The exact spectral bound leaves an explicit numerical tolerance: a vector within 1 / 64 of either orientation of the chosen unit second eigenvector supports exact rounding and degree cleanup. The finite-precision eigensolver is tracked in #6238.

The existing centered-noise event also gives the rank-two perturbation bound for the ordinary adjacency matrix, including both diagonal corrections.

theorem Cslib.Algorithms.PlantedClique.recoverEigenvector_sample_eq {n : ℕ} (S : Finset (Fin n)) (ω : Probability.PlantedClique.Coins n) (hn : 1 ≤ n) (hk : 6 ≤ S.card) (hsparse : 4096 * S.card ≤ n) (hsize : 8192 * √↑n ≤ ↑S.card) (hnoise : ‖Matrix.toEuclideanCLM (Probability.PlantedClique.noise S ω)‖ ≤ 36 * √↑n) (hdegree : ∀ v ∉ S, 8 * (Finset.filter ((Probability.PlantedClique.sample S ω).Adj v) S).card ≤ 5 * S.card) :

On the good noise and outside-degree events, Algorithm A recovers every planted set in the explicit conservative size regime. All spectral assumptions are discharged here.