Documentation

CslibFrontier.Computability.MCSP.Multi

Multi-output MCSP #

The Multi-output Minimum Circuit Size Problem [IlangoLoffOliveira2020, Definition 1, p. 22:3] asks, given positive integers n, m and s in unary and a function f : {0,1}^n → {0,1}^m as a string of length m · 2^n, whether some Boolean circuit of size at most s computes f. A circuit computes a multi-output function "if for each component f_i of f, there is a gate or input wire in C that computes f_i" [p. 22:3]. Such a circuit is a cslib Program together with a wire for each component, which is a Circuit with m designated outputs; outputs cost nothing and every gate counts, used or not, in the source and here alike (MultiMCSP.mem_iff_exists_program_wires).

MultiMCSP I is defined for any interpretation I, through the complexity ecomplexity I in ℕ∞, so a basis need not be complete. Only MultiMCSP Boolean.DeMorgan.interpretation, over the source's basis of fan-in-two AND and OR and NOT without constants, is Definition 1 exactly. MultiMCSP Boolean.interpretation, over cslib's basis with constants, is a library variant with a different size measure: a constant costs one gate there, but two (x ∧ ¬x) in the source's basis. Results proved for both use the class Boolean.DeMorganBasis.

Presentation choices #

Main definitions #

Main results #

References #

An instance of Multi-output MCSP [IlangoLoffOliveira2020, Definition 1, p. 22:3]: the number n of inputs, the number m of outputs, a size threshold s, and the truth table of each of the m components. The source asks for positive n, m and s; this type also allows 0.

  • arity : ℕ

    The number n of inputs.

  • outputs : ℕ

    The number m of outputs.

  • threshold : ℕ

    The number s of gates allowed.

  • table : Fin self.outputs → BitString (2 ^ self.arity)

    The truth table of each component, in the order of MCSP.truthTable.

The multi-output function whose component truth tables an instance gives.

Component i of the function has truth table table i.

An instance of Definition 1 proper [IlangoLoffOliveira2020, p. 22:3]: n, m and s are positive.

Instances For

    The m · 2^n table bits of an instance, component-major: bit j of component i is at position i · 2^n + j (tableBits_eq_flatten).

    The table bits are the truth tables of the components, one after the other.

    theorem Cslib.MultiMCSP.Instance.tableBits_injective {n m s s' : ℕ} {T T' : Fin m → BitString (2 ^ n)} (h : { arity := n, outputs := m, threshold := s, table := T }.tableBits = { arity := n, outputs := m, threshold := s', table := T' }.tableBits) :
    T = T'

    The table bits determine the tables, for fixed numbers of inputs and outputs.

    @[reducible, inline]

    The fields of a Multi-output MCSP instance: the numbers n, m and s in unary, each framed, then the table bits unframed.

    The encoding of Definition 1 [IlangoLoffOliveira2020, p. 22:3]: n, m and s in unary, each framed, then the m · 2^n table bits, component-major (Instance.tableBits).

    The encoding has length 2n + 2m + 2s + 3 + m · 2^n: three framed unary numbers and the table bits.

    Multi-output MCSP [IlangoLoffOliveira2020, Definition 1, p. 22:3] over the basis I: the instances whose multi-output function has a circuit over I with at most threshold gates. The complexity is taken in ℕ∞, so I need not be complete. Definition 1 is the case I = Boolean.DeMorgan.interpretation; over other bases, such as cslib's Boolean.interpretation, whose constants cost one gate instead of two, this is a library variant.

    An instance is a yes-instance exactly when some circuit with m designated outputs and at most threshold gates computes its function.

    theorem Cslib.MultiMCSP.mem_iff_exists_program_wires {σ : Circuits.Signature} {I : Circuits.Interpretation σ Bool} {x : Instance} :
    x ∈ MultiMCSP I ↔ ∃ (g : ℕ) (p : Circuits.Program σ x.arity g), g ≤ x.threshold ∧ ∀ (i : Fin x.outputs), ∃ (w : Circuits.Wire x.arity g), p.wireFunction I w = fun (y : Fin x.arity → Bool) => x.function y i

    The source's circuits [IlangoLoffOliveira2020, p. 22:3]: an instance is a yes-instance exactly when some program with at most threshold gates has, for each component of the function, an input or gate wire computing it. Gates that no chosen wire uses still count.

    theorem Cslib.MultiMCSP.mem_of_threshold_le {σ : Circuits.Signature} {I : Circuits.Interpretation σ Bool} {n m s t : ℕ} {T : Fin m → BitString (2 ^ n)} (h : { arity := n, outputs := m, threshold := s, table := T } ∈ MultiMCSP I) (hst : s ≤ t) :
    { arity := n, outputs := m, threshold := t, table := T } ∈ MultiMCSP I

    Raising the threshold keeps a yes-instance a yes-instance.

    A meaning-keeping map of signatures turns yes-instances into yes-instances.

    Every yes-instance over the constant-free basis of the source is a yes-instance over cslib's basis with constants.

    A single-output MCSP instance as a Multi-output MCSP instance with one output.

    With one output, the multi-output function is the single function of the MCSP instance.

    With one output, Multi-MCSP is MCSP, both over cslib's De Morgan basis with constants.

    def Cslib.MultiMCSP.Instance.ofFunction (n m s : ℕ) (f : (Fin n → Bool) → Fin m → Bool) :

    The instance with arity n, m outputs and threshold s whose function is f.

    @[simp]
    theorem Cslib.MultiMCSP.Instance.function_ofFunction (n m s : ℕ) (f : (Fin n → Bool) → Fin m → Bool) :
    (ofFunction n m s f).function = f

    The instance with function f and threshold s is a yes-instance exactly when f costs at most s.