Documentation

CslibFrontier.Computability.Complexity.Parameterized

Fixed-parameter tractability #

A parameterized problem is a problem A : Set α with an encoding enc : α ↪ List Bool of its instances and a parameter κ : α → ℕ [DF99] [FG06] [CFK+15]. The parameter is any function of the instance: the number of variables of a formula, the size of a solution sought, a width. Running times are measured in the parameter k = κ a and in the length L of the encoded instance, on the multi-tape machines of Cslib.Complexity.DecidableInTimeO.

The function f is arbitrary, as in the uniform fixed-parameter tractability of Downey and Fellows [DowneyFellows1999, Chapter 2]. Flum and Grohe [FlumGrohe2006, Chapter 1] and Cygan et al. [CyganEtAl2015, Chapter 1] require f to be computable (Downey and Fellows' strongly uniform tractability); that variant is not formalized here. The function f may be taken monotone (Cslib.Complexity.mem_FPT_iff_exists_monotone).

Cslib.Complexity.FPTReducible encA encB κA κB A B: A reduces to B by an fpt-reduction [FlumGrohe2006, Definition 2.1] [CyganEtAl2015, Definition 13.1]: a map f computable by some machine within time F (κA a) * (L + 1) ^ c (Cslib.Complexity.ComputableInFPTTime) with a ∈ A ↔ f a ∈ B and κB (f a) ≤ h (κA a) for a function h. Fpt-time computability is closed under case distinction and under composition along a function that bounds the parameter (Cslib.Complexity.ComputableInFPTTime.ite, Cslib.Complexity.ComputableInFPTTime.comp), and polynomial time is fpt time for every parameter (Turing.MultiTapeTM.ComputableInPolyTime.computableInFPTTime). Polynomial-time reductions with a parameter bound are fpt-reductions (Cslib.Complexity.FPTReducible.of_computableInPolyTime). FPT and XP are closed under fpt-reductions. As for FPT, the functions F and h are arbitrary, where the cited definitions require them to be computable.

Main definitions #

Main results #

References #

Monotone majorants #

The classes #

def Cslib.Complexity.FPT {α : Type u_1} (enc : α ↪ List Bool) (κ : α → ℕ) :
Set (Set α)

Fixed-parameter tractability. A ∈ FPT enc κ when A is decidable within time f (κ a) * (|enc a| + 1) ^ c up to a constant factor, for some function f : ℕ → ℕ and some constant c, by a machine with a binary alphabet reading enc a (Cslib.Complexity.DecidableInTimeO). The function f is arbitrary, as in the uniform fixed-parameter tractability of [DF99]; [FG06] also requires it to be computable.

def Cslib.Complexity.XP {α : Type u_1} (enc : α ↪ List Bool) (κ : α → ℕ) :
Set (Set α)

Slicewise polynomial time. A ∈ XP enc κ when a single machine decides A within time f (κ a) * (|enc a| + 1) ^ g (κ a) up to a constant factor, for some functions f and g [DF99] [FG06]: in particular each slice {a | κ a = k} is decidable in polynomial time, with a degree depending on k. The functions f and g are arbitrary, where [FG06] and [CFK+15] require them to be computable.

theorem Cslib.Complexity.mem_FPT {α : Type u_1} {enc : α ↪ List Bool} {κ : α → ℕ} {A : Set α} :
A ∈ FPT enc κ ↔ ∃ (f : ℕ → ℕ) (c : ℕ), DecidableInTimeO A enc fun (a : α) => ↑(f (κ a)) * (↑(enc a).length + 1) ^ c

Membership in FPT: decidability within time f (κ a) * (|enc a| + 1) ^ c up to a constant factor, for some function f and constant c.

theorem Cslib.Complexity.mem_XP {α : Type u_1} {enc : α ↪ List Bool} {κ : α → ℕ} {A : Set α} :
A ∈ XP enc κ ↔ ∃ (f : ℕ → ℕ) (g : ℕ → ℕ), DecidableInTimeO A enc fun (a : α) => ↑(f (κ a)) * (↑(enc a).length + 1) ^ g (κ a)

Membership in XP: decidability within time f (κ a) * (|enc a| + 1) ^ g (κ a) up to a constant factor, for some functions f and g.

theorem Cslib.Complexity.FPT_subset_XP {α : Type u_1} {enc : α ↪ List Bool} {κ : α → ℕ} :
FPT enc κ ⊆ XP enc κ

FPT ⊆ XP.

theorem Cslib.Complexity.P_subset_FPT {α : Type u_1} {enc : α ↪ List Bool} {κ : α → ℕ} :
P enc ⊆ FPT enc κ

P ⊆ FPT, for every parameter: a polynomial-time decider is an fpt-time decider with f = 1.

theorem Cslib.Complexity.P_subset_XP {α : Type u_1} {enc : α ↪ List Bool} {κ : α → ℕ} :
P enc ⊆ XP enc κ

P ⊆ XP, for every parameter.

theorem Cslib.Complexity.FPT_subset_FPT_of_le_comp {α : Type u_1} {enc : α ↪ List Bool} {κ κ' : α → ℕ} {h : ℕ → ℕ} (hκ : ∀ (a : α), κ a ≤ h (κ' a)) :
FPT enc κ ⊆ FPT enc κ'

Changing the parameter. If κ a ≤ h (κ' a) for a function h, then a problem that is fixed-parameter tractable in κ is fixed-parameter tractable in κ'.

theorem Cslib.Complexity.XP_subset_XP_of_le_comp {α : Type u_1} {enc : α ↪ List Bool} {κ κ' : α → ℕ} {h : ℕ → ℕ} (hκ : ∀ (a : α), κ a ≤ h (κ' a)) :
XP enc κ ⊆ XP enc κ'

Changing the parameter. If κ a ≤ h (κ' a) for a function h, then a problem that is slicewise polynomial in κ is slicewise polynomial in κ'.

theorem Cslib.Complexity.mem_FPT_iff_exists_monotone {α : Type u_1} {enc : α ↪ List Bool} {κ : α → ℕ} {A : Set α} :
A ∈ FPT enc κ ↔ ∃ (f : ℕ → ℕ), Monotone f ∧ ∃ (c : ℕ), DecidableInTimeO A enc fun (a : α) => ↑(f (κ a)) * (↑(enc a).length + 1) ^ c

The function of an fpt bound may be taken monotone: replace f by its partial sums.

theorem Cslib.Complexity.DecidableInExpTime.mem_FPT {α : Type u_1} {enc : α ↪ List Bool} {κ : α → ℕ} {A : Set α} {δ : ℝ} (h : DecidableInExpTime A enc κ δ) :
A ∈ FPT enc κ

Exponential time in the parameter is fpt time. A decider within time 2 ^ (δ κ a) times a polynomial in the length of the encoded instance, for any real δ, is an fpt-time decider with f k = ⌈2 ^ δ⌉ ^ k.

SAT is fixed-parameter tractable in the number of variables, by exhaustive search.

k-SAT is fixed-parameter tractable in the number of variables, by exhaustive search.

Fpt-time computability #

def Cslib.Complexity.ComputableInFPTTime {α : Type u_1} {β : Type u_2} (f : α → β) (encA : α ↪ List Bool) (encB : β ↪ List Bool) (κ : α → ℕ) :

f is computable in fpt time with respect to the parameter κ: some machine computes f within time and space F (κ a) * (|encA a| + 1) ^ c, for a function F : ℕ → ℕ and a constant c. Bounding the space by the same expression is no restriction, since a machine within time t visits at most k t + k work-tape cells (Turing.MultiTapeTM.ComputableInTimeAndSpace.computableInFPTTime).

theorem Turing.MultiTapeTM.ComputableInO.computableInFPTTime {α : Type u_1} {β : Type u_2} {f : α → β} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {κ : α → ℕ} {F : ℕ → ℕ} {c : ℕ} (h : ComputableInO f encA encB (fun (a : α) => F (κ a) * ((encA a).length + 1) ^ c) fun (a : α) => F (κ a) * ((encA a).length + 1) ^ c) :

A computation within an fpt bound, up to a constant factor, is a computation in fpt time.

theorem Turing.MultiTapeTM.ComputableInTimeAndSpace.computableInFPTTime {α : Type u_1} {β : Type u_2} {f : α → β} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {κ : α → ℕ} {F : ℕ → ℕ} {c : ℕ} {s : α → ℕ} (h : ComputableInTimeAndSpace f encA encB (fun (a : α) => F (κ a) * ((encA a).length + 1) ^ c) s) :

A time bound alone suffices. A function computable by some machine within time F (κ a) * (|encA a| + 1) ^ c, with any space bound, is computable in fpt time: a machine with k work tapes within time t visits at most k t + k work-tape cells.

theorem Turing.MultiTapeTM.ComputableInPolyTime.computableInFPTTime {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {f : α → β} (hf : ComputableInPolyTime f encA encB) (κ : α → ℕ) :

A function computable in polynomial time is computable in fpt time, for every parameter.

theorem Cslib.Complexity.ComputableInFPTTime.ite {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {κ : α → ℕ} {p : α → Bool} {f g : α → β} (hp : ComputableInFPTTime p encA Turing.MultiTapeTM.encBool κ) (hf : ComputableInFPTTime f encA encB κ) (hg : ComputableInFPTTime g encA encB κ) :
ComputableInFPTTime (fun (a : α) => if p a = true then f a else g a) encA encB κ

Case distinction in fpt time.

theorem Cslib.Complexity.ComputableInFPTTime.comp {α β γ : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {encC : γ ↪ List Bool} {κA : α → ℕ} {κB : β → ℕ} {f : α → β} {g : β → γ} (hg : ComputableInFPTTime g encB encC κB) (hf : ComputableInFPTTime f encA encB κA) {h : ℕ → ℕ} (hκ : ∀ (a : α), κB (f a) ≤ h (κA a)) :
ComputableInFPTTime (g ∘ f) encA encC κA

Composition in fpt time, along a function that bounds the parameter.

theorem Cslib.Complexity.mem_FPT_iff_computableInFPTTime {α : Type} {encA : α ↪ List Bool} {κ : α → ℕ} {A : Set α} :
A ∈ FPT encA κ ↔ ∃ (g : α → Bool), ComputableInFPTTime g encA Turing.MultiTapeTM.encBool κ ∧ ∀ (a : α), a ∈ A ↔ g a = true

FPT in terms of fpt-time computability: a problem is fixed-parameter tractable exactly when a Boolean function deciding it is computable in fpt time.

theorem Cslib.Complexity.mem_XP_iff_exists_computableInO {α : Type} {encA : α ↪ List Bool} {κ : α → ℕ} {A : Set α} :
A ∈ XP encA κ ↔ ∃ (g : α → Bool) (f : ℕ → ℕ) (e : ℕ → ℕ), (Turing.MultiTapeTM.ComputableInO g encA Turing.MultiTapeTM.encBool (fun (a : α) => f (κ a) * ((encA a).length + 1) ^ e (κ a)) fun (a : α) => f (κ a) * ((encA a).length + 1) ^ e (κ a)) ∧ ∀ (a : α), a ∈ A ↔ g a = true

XP in terms of computability within explicit bounds.

theorem Cslib.Complexity.FPT_eq_P_of_le {α : Type} {encA : α ↪ List Bool} {κ : α → ℕ} {K : ℕ} (hκ : ∀ (a : α), κ a ≤ K) :
FPT encA κ = P encA

Bounded parameters. For a parameter bounded by a constant, FPT is P.

theorem Cslib.Complexity.XP_eq_P_of_le {α : Type} {encA : α ↪ List Bool} {κ : α → ℕ} {K : ℕ} (hκ : ∀ (a : α), κ a ≤ K) :
XP encA κ = P encA

Bounded parameters. For a parameter bounded by a constant, XP is P.

Boolean closure #

theorem Cslib.Complexity.compl_mem_FPT {α : Type} {encA : α ↪ List Bool} {κ : α → ℕ} {A : Set α} (hA : A ∈ FPT encA κ) :
Aᶜ ∈ FPT encA κ

FPT is closed under complement.

theorem Cslib.Complexity.inter_mem_FPT {α : Type} {encA : α ↪ List Bool} {κ : α → ℕ} {A B : Set α} (hA : A ∈ FPT encA κ) (hB : B ∈ FPT encA κ) :
A ∩ B ∈ FPT encA κ

FPT is closed under intersection.

theorem Cslib.Complexity.union_mem_FPT {α : Type} {encA : α ↪ List Bool} {κ : α → ℕ} {A B : Set α} (hA : A ∈ FPT encA κ) (hB : B ∈ FPT encA κ) :
A ∪ B ∈ FPT encA κ

FPT is closed under union.

theorem Cslib.Complexity.compl_mem_XP {α : Type} {encA : α ↪ List Bool} {κ : α → ℕ} {A : Set α} (hA : A ∈ XP encA κ) :
Aᶜ ∈ XP encA κ

XP is closed under complement.

Fpt-reductions #

def Cslib.Complexity.ComputableInFPTWithParam {α : Type u_1} {β : Type u_2} (encA : α ↪ List Bool) (encB : β ↪ List Bool) (κA : α → ℕ) (κB : β → ℕ) (f : α → β) :

f is computable in fpt time with respect to κA and bounds κB (f a) by a function of κA a.

def Cslib.Complexity.FPTReducible {α : Type u_1} {β : Type u_2} (encA : α ↪ List Bool) (encB : β ↪ List Bool) (κA : α → ℕ) (κB : β → ℕ) (A : Set α) (B : Set β) :

Fpt-reductions [FlumGrohe2006, Definition 2.1] [CyganEtAl2015, Definition 13.1]: A reduces to B by a map f, computable in fpt time with respect to κA, with a ∈ A ↔ f a ∈ B, whose parameter κB (f a) is bounded by a function h of κA a. This is ManyOneReducibleBy for ComputableInFPTWithParam (fptReducible_iff_manyOneReducibleBy). The function h and the function of the time bound are arbitrary; the cited definitions require them to be computable.

theorem Cslib.Complexity.fptReducible_iff_manyOneReducibleBy {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {κA : α → ℕ} {κB : β → ℕ} {A : Set α} {B : Set β} :
FPTReducible encA encB κA κB A B ↔ ManyOneReducibleBy (ComputableInFPTWithParam encA encB κA κB) A B

Fpt-reducibility is many-one reducibility by maps computable in fpt time with a parameter bound.

theorem Cslib.Complexity.FPTReducible.of_computableInPolyTime {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {κA : α → ℕ} {κB : β → ℕ} {A : Set α} {B : Set β} {f : α → β} (hf : Turing.MultiTapeTM.ComputableInPolyTime f encA encB) {h : ℕ → ℕ} (hκ : ∀ (a : α), κB (f a) ≤ h (κA a)) (hfA : ∀ (a : α), a ∈ A ↔ f a ∈ B) :
FPTReducible encA encB κA κB A B

Polynomial-time reductions bounding the parameter are fpt-reductions.

theorem Cslib.Complexity.FPTReducible.refl {α : Type} (encA : α ↪ List Bool) (κA : α → ℕ) (A : Set α) :
FPTReducible encA encA κA κA A A

Every parameterized problem reduces to itself by the identity.

theorem Cslib.Complexity.FPTReducible.trans {α β γ : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {encC : γ ↪ List Bool} {κA : α → ℕ} {κB : β → ℕ} {κC : γ → ℕ} {A : Set α} {B : Set β} {C : Set γ} (hAB : FPTReducible encA encB κA κB A B) (hBC : FPTReducible encB encC κB κC B C) :
FPTReducible encA encC κA κC A C

Fpt-reductions compose.

theorem Cslib.Complexity.FPTReducible.compl {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {κA : α → ℕ} {κB : β → ℕ} {A : Set α} {B : Set β} (h : FPTReducible encA encB κA κB A B) :
FPTReducible encA encB κA κB Aᶜ Bᶜ

An fpt-reduction from A to B is one from Aᶜ to Bᶜ.

theorem Cslib.Complexity.FPTReducible.mem_FPT {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {κA : α → ℕ} {κB : β → ℕ} {A : Set α} {B : Set β} (hAB : FPTReducible encA encB κA κB A B) (hB : B ∈ FPT encB κB) :
A ∈ FPT encA κA

FPT is closed under fpt-reductions.

theorem Cslib.Complexity.FPTReducible.mem_XP {α β : Type} {encA : α ↪ List Bool} {encB : β ↪ List Bool} {κA : α → ℕ} {κB : β → ℕ} {A : Set α} {B : Set β} (hAB : FPTReducible encA encB κA κB A B) (hB : B ∈ XP encB κB) :
A ∈ XP encA κA

XP is closed under fpt-reductions.