Documentation

Complexitylib.Metacomplexity.MCSP

The Minimum Circuit Size Problem #

This module exposes a canonical, total MCSP syntax and its exact relationship to the library's Boolean circuit complexity measure.

Main definitions #

The zero-arity case is explicit: its one truth-table bit is stored directly and has size zero, matching CircuitFamily. Positive arities use Basis.andOr2 and agree exactly with Circuit.sizeComplexity.

@[simp]

Every instance carries exactly 2^arity truth-table bits.

@[simp]
theorem Complexity.MCSP.Instance.inputIndex_inputOfIndex {arity : } (index : Fin (2 ^ arity)) :
inputIndex (inputOfIndex index) = index

Converting a truth-table index to an input and back recovers the index.

@[simp]

Converting a fixed-length input to its truth-table index and back recovers the input.

@[simp]
theorem Complexity.MCSP.Instance.function_inputOfIndex (inst : Instance) (index : Fin (2 ^ inst.arity)) :
inst.function (inputOfIndex index) = inst.table index

Evaluating the represented function on index k returns truth-table entry k under the canonical little-endian enumeration.

@[simp]
theorem Complexity.MCSP.Instance.arity_ofFunction (arity threshold : ) (f : BitString arityBool) :
(ofFunction arity threshold f).arity = arity
@[simp]
theorem Complexity.MCSP.Instance.threshold_ofFunction (arity threshold : ) (f : BitString arityBool) :
(ofFunction arity threshold f).threshold = threshold
@[simp]
theorem Complexity.MCSP.Instance.function_ofFunction (arity threshold : ) (f : BitString arityBool) :
(ofFunction arity threshold f).function = f

Reading the canonical truth table of a packaged Boolean function recovers that function exactly.

@[simp]
theorem Complexity.MCSP.Instance.function_withThreshold (inst : Instance) (threshold : ) :
(inst.withThreshold threshold).function = inst.function

Changing the threshold does not change the represented function.

@[simp]

Canonical MCSP encodings decode to their original instances.

theorem Complexity.MCSP.Instance.decode?_eq_some_iff (bits : List Bool) (inst : Instance) :
decode? bits = some inst bits = inst.encode

Exact decoding accepts precisely canonical encodings.

theorem Complexity.MCSP.Instance.decode?_eq_none_iff (bits : List Bool) :
decode? bits = none ¬∃ (inst : Instance), bits = inst.encode

Decoding rejects exactly those strings that are not canonical encodings of any well-formed MCSP instance.

Canonical MCSP instance encoding is injective.

@[simp]

Exact encoded length, exposing truth-table length 2^n separately from the logarithmic-width arity and threshold fields.

The truth-table payload is no longer than the complete instance code.

Zero-input Boolean functions use the explicit size-zero family convention.

At every positive arity, MCSP uses exactly the existing fan-in-two circuit complexity measure.

Every zero-arity instance is a yes-instance at every natural threshold.

At positive arity, the direct circuit-witness semantics agrees with the minimum circuit-size inequality.

The total witness semantics agrees with the total minimum-size convention, including arity zero.

theorem Complexity.MCSP.Instance.HasCircuitAtMost.mono (inst : Instance) {first second : } (hthreshold : first second) (hsmall : (inst.withThreshold first).HasCircuitAtMost) :

Increasing the threshold preserves MCSP yes-instances.

@[simp]

A canonical instance code belongs to MCSP exactly when the decoded instance has a circuit at most its threshold.

Membership of a canonical code is exactly its total minimum-size inequality, including the explicit zero-arity convention.

At positive arity, canonical encoded MCSP membership agrees exactly with the library's existing fan-in-two size complexity.

theorem Complexity.MCSP.mem_encode_of_arity_eq_zero (inst : Instance) (harity : inst.arity = 0) :

The canonical code of every zero-arity instance is in MCSP.

theorem Complexity.MCSP.not_mem_of_decode?_eq_none {bits : List Bool} (hdecode : Instance.decode? bits = none) :
bitsMCSP

Every malformed instance code is rejected by the total MCSP language.

Decoded language membership has an explicit unique-instance witness.