Documentation

CslibFrontier.Computability.Complexity.Problems.Clique

Cliques #

Clique is the set of graphs with a clique of a given number of their vertices Arora and Barak, Section 2.4. A set of vertices is independent in a graph exactly when it is a clique in the complement of the graph on its vertices (Graph.compl), so complementing the graph reduces IndependentSet to Clique [Kar72]. The verifier is Cslib.Complexity.Graph.verifySubset for adjacency, an instance of the subset-witness verifier Cslib.Complexity.subsetVerifier.

The same problem as a class of finite structures, closed under isomorphism and without an encoding, with the target size given by a unary relation, is Cslib.Logic.FO.sizedGraph.Clique. There loops are ignored, edges need not be symmetric, and the reductions between independent set, clique and vertex cover are quantifier-free first-order interpretations.

Main definitions #

Main results #

References #

An instance (graph, m) of Clique.

  • graph : Graph

    The graph in which to find a clique.

  • m : ℕ

    The target number of declared vertices.

Instances For
    theorem Cslib.Complexity.CliqueInstance.ext {x y : CliqueInstance} (graph : x.graph = y.graph) (m : x.m = y.m) :
    x = y
    theorem Cslib.Complexity.encCliqueInstance_graph_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → CliqueInstance} :
    Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ encCliqueInstance S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (a : γ✝) => (g✝ a).graph) encIn✝ encGraph S✝
    @[reducible, inline]

    The tuple of the fields of encCliqueInstance.

    Instances For
      theorem Cslib.Complexity.encCliqueInstance_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → Graph} {x1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encGraph budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encNat budget) :
      Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { graph := x0 x, m := x1 x }) encIn encCliqueInstance budget
      theorem Cslib.Complexity.encCliqueInstance_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Graph} {T0 S0 x1 T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encGraph T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encNat T1 S1) :
      Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { graph := x0 x, m := x1 x }) encIn encCliqueInstance (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
      theorem Cslib.Complexity.encCliqueInstance_m_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → CliqueInstance} :

      Framed encGraph followed by binary target encNat, encoding CliqueInstance.

      Instances For

        The graphs with a clique of m of their vertices.

        Instances For

          Membership in Clique as a finite set of m declared vertices that is a clique in x.graph.toSimpleGraph.

          @[simp]
          theorem Cslib.Complexity.mem_Clique_iff_mk {G : Graph} {m : ℕ} :
          { graph := G, m := m } ∈ Clique ↔ ∃ (S : Finset ℕ), (∀ v ∈ S, v ∈ G.vertices) ∧ G.toSimpleGraph.IsNClique m S

          The complement of a graph on its vertices: an edge between any two distinct vertices that are not adjacent.

          Instances For

            On the vertices of a graph, adjacency in the complement is non-adjacency in the graph.

            @[simp]

            The induced graph of the complement is the complement of the induced graph.

            theorem Cslib.Complexity.Graph.compl_mem_Clique_iff (G : Graph) (m : ℕ) :
            { graph := G.compl, m := m } ∈ Clique ↔ { graph := G, m := m } ∈ IndependentSet

            Independent sets are cliques of the complement.

            theorem Cslib.Complexity.Graph.compl_mem_IndependentSet_iff (G : Graph) (m : ℕ) :
            { graph := G.compl, m := m } ∈ IndependentSet ↔ { graph := G, m := m } ∈ Clique

            Cliques are independent sets of the complement.

            Complementing a graph on its declared vertices is polynomial-time with the graph encoding.

            The verifier for Clique: select distinct declared vertices from the certificate mask, check that their count equals m, and check that every two distinct selected vertices are adjacent.

            Instances For

              Complementing the graph reduces IndependentSet to Clique.

              Instances For

                Complementing the graph reduces Clique to IndependentSet.

                Instances For

                  IndependentSet reduces to Clique in polynomial time by complementing the graph on its declared vertices.

                  Clique reduces to IndependentSet in polynomial time by complementing the graph on its declared vertices.

                  The clique number #

                  noncomputable def Cslib.Complexity.Graph.cliqueNum (G : Graph) :

                  The clique number of a graph: the largest number of declared vertices that are pairwise adjacent.

                  Instances For
                    theorem Cslib.Complexity.Graph.mem_Clique_of_le {G : Graph} {k k' : ℕ} (h : { graph := G, m := k } ∈ Clique) (hk : k' ≤ k) :
                    { graph := G, m := k' } ∈ Clique

                    Fewer vertices of a clique form a clique.

                    theorem Cslib.Complexity.Graph.le_cliqueNum_iff {G : Graph} {k : ℕ} :
                    k ≤ G.cliqueNum ↔ { graph := G, m := k } ∈ Clique

                    The clique number is the largest target of Clique.

                    theorem Cslib.Complexity.Graph.le_card_of_mem_Clique {G : Graph} {k : ℕ} (h : { graph := G, m := k } ∈ Clique) :

                    A clique has at most as many vertices as the distinct declared vertices.

                    Cliques of the complement are independent sets: the clique number of the complement on the declared vertices is the independence number.