Combining De Morgan circuit codes on shared inputs and in sequence #
Specializes the signature-polymorphic raw circuit-code combinators of
CslibFrontier.Computability.Circuit.Encoding.Combinators to Cslib.Circuits.Boolean.Op and
Cslib.Circuits.Boolean.encCode.
Main definitions #
Cslib.Circuits.Boolean.appendCode,Cslib.Circuits.Boolean.appendCodes,Cslib.Circuits.Boolean.bundleCode: combine De Morgan raw codes on shared inputs.Cslib.Circuits.Boolean.compCode: compose De Morgan raw circuit codes sequentially.
Main results #
Cslib.Circuits.Boolean.appendCode_code,Cslib.Circuits.Boolean.appendCodes_code,Cslib.Circuits.Boolean.bundleCode_code,Cslib.Circuits.Boolean.compCode_code: agreement with typed circuit combinators.Cslib.Circuits.Boolean.computableInPolyTime_appendCode,Cslib.Circuits.Boolean.computableInPolyTime_appendCodes,Cslib.Circuits.Boolean.computableInPolyTime_bundleCode,Cslib.Circuits.Boolean.computableInPolyTime_compCode: polynomial-time constructors.
References #
theorem Cslib.Circuits.Boolean.evalOutput_appendCode_code {n m p : ℕ} (c : Circuit signature n m) (d : Circuit signature n p) (x : Fin n → Bool) :
List.map (evalOutput (List.ofFn x) (appendCode n c.code d.code).1) (appendCode n c.code d.code).2 = List.ofFn (c.eval interpretation x) ++ List.ofFn (d.eval interpretation x)
The outputs of combined codes are the two output lists in order, on every input.
theorem Cslib.Circuits.Boolean.computableInPolyTime_appendCode {α : Type} {enc : α ↪ List Bool} {n : α → ℕ} {c d : α → List (Op × List ℕ) × List ℕ} (hn : Turing.MultiTapeTM.ComputableInPolyTime n enc Turing.MultiTapeTM.encNat) (hc : Turing.MultiTapeTM.ComputableInPolyTime c enc encCode) (hd : Turing.MultiTapeTM.ComputableInPolyTime d enc encCode) :
Combining circuit codes is polynomial-time, including binary input and wire counts.
theorem Cslib.Circuits.Boolean.computableInPolyTime_appendCodes {α : Type} {enc : α ↪ List Bool} {n : α → ℕ} {codes : α → List (List (Op × List ℕ) × List ℕ)} (hn : Turing.MultiTapeTM.ComputableInPolyTime n enc Turing.MultiTapeTM.encNat) (hcodes : Turing.MultiTapeTM.ComputableInPolyTime codes enc (Turing.MultiTapeTM.encList encCode)) :
Combining arbitrary raw blocks is polynomial-time in their complete encodings.
Combining single-output circuit codes agrees with Circuit.pi.
theorem Cslib.Circuits.Boolean.computableInPolyTime_bundleCode {α : Type} {enc : α ↪ List Bool} {n blockSize : α → ℕ} {codes : α → List (List (Op × List ℕ) × List ℕ)} (hn : Turing.MultiTapeTM.ComputableInPolyTime n enc Turing.MultiTapeTM.encNat) (hblock : Turing.MultiTapeTM.ComputableInPolyTime blockSize enc Turing.MultiTapeTM.encNat) (hcodes : Turing.MultiTapeTM.ComputableInPolyTime codes enc (Turing.MultiTapeTM.encList encCode)) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (a : α) => bundleCode (n a) (blockSize a) (codes a)) enc encCode
Bundling raw blocks is polynomial-time in their encodings and binary layout parameters.
theorem Cslib.Circuits.Boolean.computableInPolyTime_compCode {α : Type} {enc : α ↪ List Bool} {n : α → ℕ} {d c : α → List (Op × List ℕ) × List ℕ} (hn : Turing.MultiTapeTM.ComputableInPolyTime n enc Turing.MultiTapeTM.encNat) (hd : Turing.MultiTapeTM.ComputableInPolyTime d enc encCode) (hc : Turing.MultiTapeTM.ComputableInPolyTime c enc encCode) :
Construct sequential circuit codes in polynomial time.