Documentation

CslibFrontier.Algorithms.PlantedClique.CommonNeighborProgram

A uniform common-neighbor wrapper for clique recovery #

For a fixed seed size, the wrapper enumerates distinct vertex lists of that length, restricts the input to their common neighbors, calls a supplied recovery function with the reduced target size, lifts its output identifiers, and checks the resulting clique. It returns the first verified candidate, or the empty list when no candidate is accepted.

This implements the enumeration and verification mechanism of Algorithm B in Section 2.3 of Alon, Krivelevich, Sudakov. Lists enumerate each seed set in several orders, which does not change the common neighborhood. The fallback is the empty list, rather than an arbitrary target-sized set. The native certificate is uniform in the dense input; the seed size is fixed before the machine is chosen. No polynomial-time claim treats a varying seed size as part of the input.

The deterministic success lemma is a step toward the probabilistic theorem: it uses a successful planted seed and uniqueness of the target-sized clique. Those are mathematical obligations of the random-graph analysis, not premises of the runtime certificate.

Declared vertices outside the seed list that are adjacent to every seed entry, in increasing identifier order. Repeated seed entries impose the same adjacency condition.

The dense subgraph on a list of identifiers, relabeled in list order, with a supplied target size. The symmetric decoder remains total on arbitrary identifier lists.

Check that a list consists of exactly the requested number of distinct declared vertices and that each pair of distinct identifiers is adjacent.

Common-neighbor restriction computes only declared vertex identifiers.

A common-neighbor list contains no repeated identifier.

The increasing inclusion of the stored common-neighbor vertices into the original graph.

Every stored common-neighbor identifier occurs exactly once in the increasing inclusion.

The runtime list denotes the finite common neighborhood of its seed set.

theorem Cslib.Algorithms.PlantedClique.RecoveryInput.graph_inducedInput (x : RecoveryInput) (vertices : List ℕ) (k : ℕ) (e : Fin vertices.length ↪ Fin x.vertexCount) (he : ∀ (i : Fin vertices.length), ↑(e i) = vertices.get i) :
(x.inducedInput vertices k).graph = SimpleGraph.comap (⇑e) x.graph

Reading the dense induced input agrees with graph pullback along the identifier list. The embedding premise records that the listed identifiers are distinct declared vertices.

The verifier accepts exactly lists of distinct declared identifiers representing a clique with the requested cardinality.

Common-neighbor restriction is native polynomial-time for arbitrary encoded seed lists.

Building every row of the induced dense input is native polynomial-time, including the stored adjacency word and its new unary dimensions.

The full size, distinctness, range and pairwise-adjacency verifier is polynomial-time.

Try one seed: recover in its common-neighbor graph, lift valid local identifiers, and return the canonical increasing list of the union with the seed.

Enumerate all distinct seeds of a fixed size, try the supplied recovery function on their common-neighbor graphs, and return the first verified target-sized clique, or the empty list.

Every single-seed output is a list of distinct declared identifiers.

Lifting and canonicalizing a single-seed output never creates an undeclared vertex.

A single-seed candidate denotes precisely the seed set together with the lifted bounded identifiers produced by the reduced solver. Invalid local identifiers do not name vertices.

theorem Cslib.Algorithms.PlantedClique.commonNeighborCandidate_eq_of_recovery (solve : RecoveryInput → List ℕ) (x : RecoveryInput) (seed : List ℕ) (S : Finset (Fin x.vertexCount)) (hbound : ∀ i ∈ seed, i < x.vertexCount) (hseed : vertexSet x.vertexCount seed ⊆ S) (hclique : x.graph.IsClique ↑S) (hrec : vertexSet (x.commonVertices seed).length (solve (x.inducedInput (x.commonVertices seed) (x.cliqueSize - seed.length))) = {i : Fin (x.commonVertices seed).length | (x.commonVertexEmbedding seed) i ∈ S}) :

Recovering exactly the retained planted vertices makes a single planted-seed attempt return the whole planted set. This deterministic step imposes no assumption on other seeds.

theorem Cslib.Algorithms.PlantedClique.commonNeighborCandidate_recoverInput_eq_of_recover (x : RecoveryInput) (seed : List ℕ) (S : Finset (Fin x.vertexCount)) (hcard : S.card = x.cliqueSize) (hnodup : seed.Nodup) (hbound : ∀ i ∈ seed, i < x.vertexCount) (hseed : vertexSet x.vertexCount seed ⊆ S) (hclique : x.graph.IsClique ↑S) (hrec : have U := x.graph.commonNeighborhood (vertexSet x.vertexCount seed); have e := U.orderEmbOfFin ⋯; recover (SimpleGraph.comap (⇑e) x.graph) (S.card - (vertexSet x.vertexCount seed).card) = {i : Fin U.card | e i ∈ S}) :

The canonical common-neighborhood recovery event used in probability estimates implies success of the actual list program. Increasing enumeration identifies the canonical finite graph with the runtime induced input, including its reduced target size.

theorem Cslib.Algorithms.PlantedClique.commonNeighborRecover_eq_of_successful_seed (solve : RecoveryInput → List ℕ) (s : ℕ) (x : RecoveryInput) (S : Finset (Fin x.vertexCount)) (hcard : S.card = x.cliqueSize) (hclique : x.graph.IsClique ↑S) (hunique : ∀ (Q : Finset (Fin x.vertexCount)), x.graph.IsClique ↑Q → Q.card = S.card → Q = S) (seed : List ℕ) (hlen : seed.length = s) (hnodup : seed.Nodup) (hbound : ∀ v ∈ seed, v < x.vertexCount) (hsuccess : vertexSet x.vertexCount (commonNeighborCandidate solve x seed) = S) :

A deterministic step of the common-neighbor argument: a successful enumerated seed yields the planted set when it is the unique target-sized clique. Probability estimates must discharge the successful-seed and uniqueness premises separately.

theorem Cslib.Algorithms.PlantedClique.commonNeighborRecover_ofGraph_eq_of_recover {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (S T : Finset (Fin n)) (hT : T ⊆ S) (hclique : G.IsClique ↑S) (hunique : ∀ (Q : Finset (Fin n)), G.IsClique ↑Q → Q.card = S.card → Q = S) (hrec : have U := G.commonNeighborhood T; have e := U.orderEmbOfFin ⋯; recover (SimpleGraph.comap (⇑e) G) (S.card - T.card) = {i : Fin U.card | e i ∈ S}) :

The represented wrapper recovers a unique planted clique when the canonical reduced algorithm succeeds for one planted seed. This is the deterministic implication used by the common-neighbor probability bound; all seed enumeration and representation obligations are discharged here.

For each fixed seed size, one native polynomial-time machine performs the entire common- neighbor search whenever the supplied base function has a uniform native certificate.