Documentation

CslibFrontier.Computability.Circuit.Boolean.Decoding

Total decoders for De Morgan circuit codes #

The gates of a De Morgan circuit and its output wire are written as the word gatesOutputWord C, with operations written by encOp. decOp and decGatesOutput are total polynomial-time decoders for these encodings: they read every word, and they invert the encodings on their images.

Main definitions #

Main results #

Total polynomial-time decoder for Boolean.encOp.

The gates and the output wire of a single-output circuit, encoded: the word that decGatesOutput reads.

@[simp]

decGatesOutput reads the gates and the output wire back from gatesOutputWord.

theorem Cslib.Circuits.Boolean.length_gatesOutputWord_le {n : ℕ} (C : Circuit signature n 1) :
(gatesOutputWord C).length ≤ 2 * (C.size * (23 + 8 * (Nat.log 2 (n + C.size + 1) + 1))) + 1 + (Nat.log 2 (n + C.size + 1) + 1)

Length of a circuit word: with L = log₂ (n + C.size + 1) + 1 bits per wire number, each gate takes at most 23 + 8 L bits and the output wire L bits.

theorem Cslib.Circuits.Boolean.length_gatesOutputWord_le_of_le {m R M : ℕ} (hm : m ≤ M) (C : Circuit signature m 1) (hC : C.size ≤ R) :
(gatesOutputWord C).length ≤ 62 * (R + 1) * (M + R + 2)

The word of a circuit with at most M inputs and at most R gates has at most 62 (R + 1) (M + R + 2) bits.