Documentation

CslibFrontier.Computability.Complexity.Problems.IndependentSet

Independent sets #

IndependentSet is the set of graphs, given by a list of vertices and a list of edges, together with a number m, such that the graph has an independent set of m declared vertices Arora and Barak, Section 2.4. Graphs are read on their declared vertices through Cslib.Complexity.Graph.induced, and independent sets through SimpleGraph.IsNIndepSet.

The reduction SAT.toIndependentSet from SAT is Karp's: one vertex for each occurrence of a literal, edges between occurrences in the same clause and between complementary occurrences, and m the number of clauses [Kar72]. An independent set with one vertex in each clause picks a literal in each clause without contradictions, which is exactly a satisfying assignment.

Vertices and target sizes use binary encoding (encNat). A certificate masks the declared vertex list at first occurrences so duplicate vertex entries cannot inflate the selected set, and checks the selected count in binary without unary expansion of m. The verifier is an instance of the subset-witness verifier Cslib.Complexity.subsetVerifier, which handles the certificate length.

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.IndependentSet. 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 Independent Set.

  • graph : Graph

    The graph in which to find an independent set.

  • m : ℕ

    The target number of declared vertices.

Instances For
    theorem Cslib.Complexity.encIndependentSetInstance_m_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → IndependentSetInstance} :
    @[reducible, inline]

    The tuple of the fields of encIndependentSetInstance.

    Instances For
      theorem Cslib.Complexity.encIndependentSetInstance_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 encIndependentSetInstance (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x
      theorem Cslib.Complexity.encIndependentSetInstance_graph_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → IndependentSetInstance} :

      Framed encGraph followed by binary target encNat, encoding IndependentSetInstance.

      Instances For
        theorem Cslib.Complexity.encIndependentSetInstance_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 encIndependentSetInstance budget

        The graphs with an independent set of m of their vertices Arora and Barak, Section 2.4.

        Instances For

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

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

          Karp's reduction #

          The vertex of an occurrence.

          Instances For

            Two occurrences conflict when they are in the same clause or are complementary.

            Instances For

              In the graph of Karp's reduction, two occurrences are adjacent exactly when they conflict.

              An independent set of Karp's graph gives an assignment satisfying as many clauses: the assignment making the chosen positive literals true satisfies the clause of every chosen occurrence, and distinct chosen occurrences lie in distinct clauses.

              Correctness of Karp's reduction. A formula is satisfiable exactly when its graph has an independent set with as many vertices as the formula has clauses.

              Polynomial-time reduction #

              Computing the binary vertex label of an occurrence from its unary indices is polynomial-time.

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

              Instances For

                The independence number #

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

                The independence number of a graph: the largest number of declared vertices that are pairwise non-adjacent.

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

                  Fewer vertices of an independent set are independent.

                  The independence number is the size of an independent set.

                  theorem Cslib.Complexity.Graph.le_indepNum_iff {G : Graph} {k : ℕ} :
                  k ≤ G.indepNum ↔ { graph := G, m := k } ∈ IndependentSet

                  The independence number is the largest target of IndependentSet.

                  The independence number is at most the number of distinct declared vertices.

                  An independent set has at most as many vertices as the distinct declared vertices.