Minimum Circuit Size Problem (MCSP) definitions #
This module defines the Minimum Circuit Size Problem (MCSP) as a family of Boolean
functions on truth tables of length 2 ^ n.
inputEquiv n: canonical recursive bijection(Fin n → Bool) ≃ Fin (2 ^ n)splitting on the first coordinate0 : Fin (n + 1).truthTableEquiv nandtruthTableTargetEquiv n: equivalences between truth tablesFin (2 ^ n) → Bool, scalar Boolean functionsScalarFunction Bool n, and single-output targetsTarget Bool n 1.pairTruthTable tt₀ tt₁: concatenates two2 ^ n-bit truth tables into a2 ^ (n + 1)-bit truth table corresponding to the subcube multiplexermuxTarget.mcspScalar/mcspTarget: gate-complexity MCSP predicate for an arbitrary basis.mcspCostScalar/mcspCostTarget: operation-cost MCSP predicate (used in particular withDeMorgan.binaryCostwhere NOT gates are free).yesSet,costYesSet, andexactCostSet: finite sets of truth tables with complexity≤ sor= s. For gate complexity,|yesSet|is bounded above by the ordered and sharp Shannon-style circuit-counting budgets (card_yesSet_le_orderedBudget,card_yesSet_le_sharpBudget); no counting bounds are given forcostYesSetorexactCostSet.
Relation to Complexity.MCSP #
Complexity.MCSP (Complexitylib/Metacomplexity/MCSP/Defs.lean) is the language-level problem:
encoded instances carrying an arity, a truth table, and a threshold, decided with respect to
Basis.andOr2 circuit size. The definitions here are the algebraic-circuit-model variant: for
fixed n and s, MCSP is a Boolean function on 2 ^ n truth-table bits, parametrized by an
arbitrary basis interpretation and operation cost. The truth-table indexing also differs:
inputEquiv is big-endian (x 0 is the most significant bit, selecting the lower or upper half),
whereas Complexity.MCSP.Instance.inputIndex is little-endian (variable j is bit j of the
index).
Canonical recursive bijection between n-bit inputs and truth-table indices Fin (2 ^ n).
For n + 1, inputs with x 0 = false map to the lower half 0 .. 2 ^ n - 1 and inputs with
x 0 = true map to the upper half 2 ^ n .. 2 ^ (n + 1) - 1.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Inputs with leading bit false index the lower half of the truth table.
Inputs with leading bit true index the upper half of the truth table.
Equivalence between 2 ^ n-bit truth tables and n-variable scalar Boolean functions.
Equations
Instances For
The truth table of a function lists its value at each decoded index.
Equivalence between scalar Boolean functions and single-output Targets.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Concatenate two 2 ^ n-bit truth tables into a 2 ^ (n + 1)-bit truth table.
Equations
Instances For
The lower half of pairTruthTable tt₀ tt₁ is tt₀.
The upper half of pairTruthTable tt₀ tt₁ is tt₁.
pairTruthTable is injective in its first (lower-half) argument.
pairTruthTable is injective in its second (upper-half) argument.
Pairing two truth tables corresponds under truthTableTargetEquiv to muxTarget.
Gate-complexity MCSP as a scalar Boolean function on 2 ^ n-bit truth tables.
Equations
- Algebraic.MCSP.mcspScalar interpretation n s tt = decide (Cslib.Circuits.Circuit.gateComplexity interpretation ((Algebraic.MCSP.truthTableTargetEquiv n) tt) ≤ ↑s)
Instances For
Gate-complexity MCSP as a single-output Target.
Equations
- Algebraic.MCSP.mcspTarget interpretation n s tt x✝ = Algebraic.MCSP.mcspScalar interpretation n s tt
Instances For
mcspScalar accepts exactly the truth tables of gate complexity at most s.
mcspScalar rejects exactly the truth tables of gate complexity above s.
Operation-cost MCSP as a scalar Boolean function on 2 ^ n-bit truth tables.
Equations
- Algebraic.MCSP.mcspCostScalar interpretation cost n s tt = decide (Cslib.Circuits.Circuit.costComplexity interpretation cost ((Algebraic.MCSP.truthTableTargetEquiv n) tt) ≤ ↑s)
Instances For
Operation-cost MCSP as a single-output Target.
Equations
- Algebraic.MCSP.mcspCostTarget interpretation cost n s tt x✝ = Algebraic.MCSP.mcspCostScalar interpretation cost n s tt
Instances For
mcspCostScalar accepts exactly the truth tables of cost complexity at most s.
mcspCostScalar rejects exactly the truth tables of cost complexity above s.
With unit operation cost, mcspCostScalar is gate-complexity mcspScalar.
The finite set of 2 ^ n-bit truth tables with gate complexity at most s.
Equations
- Algebraic.MCSP.yesSet interpretation n s = {tt : Fin (2 ^ n) → Bool | Algebraic.MCSP.mcspScalar interpretation n s tt = true}
Instances For
Membership in yesSet is gate complexity at most s.
The finite set of 2 ^ n-bit truth tables with operation-cost complexity at most s.
Equations
- Algebraic.MCSP.costYesSet interpretation cost n s = {tt : Fin (2 ^ n) → Bool | Algebraic.MCSP.mcspCostScalar interpretation cost n s tt = true}
Instances For
Membership in costYesSet is cost complexity at most s.
The finite set of 2 ^ n-bit truth tables with operation-cost complexity exactly s.
Equations
- Algebraic.MCSP.exactCostSet interpretation cost n s = {tt : Fin (2 ^ n) → Bool | Cslib.Circuits.Circuit.costComplexity interpretation cost ((Algebraic.MCSP.truthTableTargetEquiv n) tt) = ↑s}
Instances For
Membership in exactCostSet is cost complexity exactly s.
Truth tables of cost complexity exactly s are yes instances at threshold s.
yesSet has the same cardinality as Circuit.functionsAtMost.
Ordered-syntax Shannon upper bound on the number of yes truth tables of MCSP.
Sharp (g!-reduced) Shannon upper bound on the number of yes truth tables of MCSP.