Induced subgraph isomorphism
AbbreviationInduced-subgraph-isomorphism instance#✓fully proved
An instance of INDUCED SUBGRAPH ISOMORPHISM is a quadruple \((n, E, k, F)\) consisting of a natural number \(n\) (the number of host vertices), a list \(E\) of pairs of natural numbers (the host edges), a natural number \(k\) (the number of pattern vertices) and a list \(F\) of pairs of natural numbers (the pattern edges).
DefinitionHost graph of an induced-subgraph-isomorphism instance#✓fully proved
For an instance \((n, E, k, F)\), the host graph is the graph of the edge list \(E\) on \(n\) vertices: the simple graph on \(\{0, \dots, n - 1\}\) in which distinct vertices \(i\) and \(j\) are adjacent when \((i, j)\) or \((j, i)\) belongs to \(E\).
def GraphHost (i : InducedSubgraphIsomorphismInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
abbrev InducedSubgraphIsomorphismInstance := ℕ × List (ℕ × ℕ) × ℕ × List (ℕ × ℕ)
WantedExt/Complexity/NPComplete/InducedSubgraphIsomorphismWanted.lean:48
def edgeGraph (n : ℕ) (es : List (ℕ × ℕ)) : SimpleGraph (Fin n) :=
SimpleGraph.fromRel fun i j => ((i : ℕ), (j : ℕ)) ∈ es
CSLibExt/Computability/Complexity/Karp/Color.lean:51
Uses 2 · Used by 1
DefinitionPattern graph of an induced-subgraph-isomorphism instance#✓fully proved
For an instance \((n, E, k, F)\), the pattern graph is the graph of the edge list \(F\) on \(k\) vertices: the simple graph on \(\{0, \dots, k - 1\}\) in which distinct vertices \(i\) and \(j\) are adjacent when \((i, j)\) or \((j, i)\) belongs to \(F\).
def GraphPattern (i : InducedSubgraphIsomorphismInstance) :
SimpleGraph (Fin i.2.2.1) :=
Cslib.Complexity.Karp.edgeGraph i.2.2.1 i.2.2.2
abbrev InducedSubgraphIsomorphismInstance := ℕ × List (ℕ × ℕ) × ℕ × List (ℕ × ℕ)
WantedExt/Complexity/NPComplete/InducedSubgraphIsomorphismWanted.lean:48
def edgeGraph (n : ℕ) (es : List (ℕ × ℕ)) : SimpleGraph (Fin n) :=
SimpleGraph.fromRel fun i j => ((i : ℕ), (j : ℕ)) ∈ es
CSLibExt/Computability/Complexity/Karp/Color.lean:51
Uses 2 · Used by 1
DefinitionWell-formed induced-subgraph-isomorphism instance#✓fully proved
An instance \((n, E, k, F)\) is well-formed when the list \(E\) has no repeated entries and every pair \((u, v)\) in \(E\) satisfies \(u < n\), \(v < n\), \(u \ne v\) and \((v, u) \notin E\), and likewise the list \(F\) has no repeated entries and every pair \((u, v)\) in \(F\) satisfies \(u < k\), \(v < k\), \(u \ne v\) and \((v, u) \notin F\).
def WellFormed (i : InducedSubgraphIsomorphismInstance) : Prop :=
i.2.1.Nodup ∧ (∀ e ∈ i.2.1, e.1 < i.1 ∧ e.2 < i.1 ∧ e.1 ≠ e.2 ∧ (e.2, e.1) ∉ i.2.1) ∧
i.2.2.2.Nodup ∧ ∀ e ∈ i.2.2.2, e.1 < i.2.2.1 ∧ e.2 < i.2.2.1 ∧ e.1 ≠ e.2 ∧ (e.2, e.1) ∉ i.2.2.2
abbrev InducedSubgraphIsomorphismInstance := ℕ × List (ℕ × ℕ) × ℕ × List (ℕ × ℕ)
WantedExt/Complexity/NPComplete/InducedSubgraphIsomorphismWanted.lean:48
Uses 1 · Used by 1
DefinitionInduced embedding of the pattern into the host#✓fully proved
An instance \((n, E, k, F)\) is feasible when there is an injective map \(f\) from \(\{0, \dots, k - 1\}\) to \(\{0, \dots, n - 1\}\) such that, for all \(a, b \in \{0, \dots, k - 1\}\), the vertices \(a\) and \(b\) are adjacent in the pattern graph if and only if \(f(a)\) and \(f(b)\) are adjacent in the host graph.
def InducedSubgraphIsomorphismFeasible
(i : InducedSubgraphIsomorphismInstance) : Prop :=
∃ f : Fin i.2.2.1 → Fin i.1, Function.Injective f ∧
∀ a b : Fin i.2.2.1,
(GraphPattern i).Adj a b ↔ (GraphHost i).Adj (f a) (f b)
abbrev InducedSubgraphIsomorphismInstance := ℕ × List (ℕ × ℕ) × ℕ × List (ℕ × ℕ)
WantedExt/Complexity/NPComplete/InducedSubgraphIsomorphismWanted.lean:48
def GraphPattern (i : InducedSubgraphIsomorphismInstance) :
SimpleGraph (Fin i.2.2.1) :=
Cslib.Complexity.Karp.edgeGraph i.2.2.1 i.2.2.2
WantedExt/Complexity/NPComplete/InducedSubgraphIsomorphismWanted.lean:56
def GraphHost (i : InducedSubgraphIsomorphismInstance) : SimpleGraph (Fin i.1) :=
Cslib.Complexity.Karp.edgeGraph i.1 i.2.1
WantedExt/Complexity/NPComplete/InducedSubgraphIsomorphismWanted.lean:52
DefinitionINDUCED SUBGRAPH ISOMORPHISM as a decision problem#✓fully proved
The decision problem INDUCED SUBGRAPH ISOMORPHISM accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding, to an instance \((n, E, k, F)\) (host vertex count, host edge list, pattern vertex count, pattern edge list) that is well-formed and for which there is an injective map \(f\) from \(\{0, \dots, k - 1\}\) to \(\{0, \dots, n - 1\}\) such that, for all \(a\) and \(b\), the vertices \(a\) and \(b\) are adjacent in the pattern graph if and only if \(f(a)\) and \(f(b)\) are adjacent in the host graph. Bitstrings that do not decode to an instance are rejected.
noncomputable def inducedSubgraphIsomorphismDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := InducedSubgraphIsomorphismInstance) x with
| some i => decide (WellFormed i ∧ InducedSubgraphIsomorphismFeasible i)
| none => false
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
abbrev InducedSubgraphIsomorphismInstance := ℕ × List (ℕ × ℕ) × ℕ × List (ℕ × ℕ)
WantedExt/Complexity/NPComplete/InducedSubgraphIsomorphismWanted.lean:48
def WellFormed (i : InducedSubgraphIsomorphismInstance) : Prop :=
i.2.1.Nodup ∧ (∀ e ∈ i.2.1, e.1 < i.1 ∧ e.2 < i.1 ∧ e.1 ≠ e.2 ∧ (e.2, e.1) ∉ i.2.1) ∧
i.2.2.2.Nodup ∧ ∀ e ∈ i.2.2.2, e.1 < i.2.2.1 ∧ e.2 < i.2.2.1 ∧ e.1 ≠ e.2 ∧ (e.2, e.1) ∉ i.2.2.2
WantedExt/Complexity/NPComplete/InducedSubgraphIsomorphismWanted.lean:62
def InducedSubgraphIsomorphismFeasible
(i : InducedSubgraphIsomorphismInstance) : Prop :=
∃ f : Fin i.2.2.1 → Fin i.1, Function.Injective f ∧
∀ a b : Fin i.2.2.1,
(GraphPattern i).Adj a b ↔ (GraphHost i).Adj (f a) (f b)
WantedExt/Complexity/NPComplete/InducedSubgraphIsomorphismWanted.lean:67
Uses 12 · Used by 1
TheoremINDUCED SUBGRAPH ISOMORPHISM is NP-complete#●ready to prove
The decision problem INDUCED SUBGRAPH ISOMORPHISM is in NP, and every decision problem in NP reduces to it by a polynomial-time many-one reduction.
public theorem_wanted inducedSubgraphIsomorphism_npComplete :
inducedSubgraphIsomorphismDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L inducedSubgraphIsomorphismDec
noncomputable def inducedSubgraphIsomorphismDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := InducedSubgraphIsomorphismInstance) x with
| some i => decide (WellFormed i ∧ InducedSubgraphIsomorphismFeasible i)
| none => false
WantedExt/Complexity/NPComplete/InducedSubgraphIsomorphismWanted.lean:75
def NP : DecisionComplexityClass :=
{ L | ∃ (p : Polynomial ℕ), ∃ R : (List Bool × List Bool) → Bool,
IsPolyTime R ∧
∀ x, L x ↔ ∃ w : List Bool, w.length ≤ p.eval x.length ∧ R (x, w) }
MathlibExt/Computability/Complexity.lean:200
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def PolyManyOneRed (L₁ L₂ : MetaMathlibExt.ComplexityTheory.DecisionProblem) : Prop :=
∃ reduce : List Bool → List Bool,
MetaMathlibExt.ComplexityTheory.IsPolyTime reduce ∧ ∀ x, L₁ x = L₂ (reduce x)
CSLibExt/Computability/CookLevin.lean:396
Sources
- M. R. Garey and D. S. Johnson, Computers and Intractability (1979), INDUCED SUBGRAPH ISOMORPHISM.
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.