Documentation

CslibFrontier.Computability.Circuit.Complexity.Composition

Composition with retained inputs #

A form of the composition rule complexity_comp_le for circuits that keep their inputs: computing f and then a function g of both the inputs and the values of f costs at most the sum of their complexities (Cslib.Circuits.complexity_comp_append_le). The inputs reach g by wiring, which costs nothing, alongside a circuit for f.

Main results #

theorem Cslib.Circuits.complexity_comp_append_le {σ : Signature} {U : Type u_1} {I : Interpretation σ U} [I.IsComplete] {n m p : ℕ} (f : (Fin n → U) → Fin m → U) (g : (Fin (n + m) → U) → Fin p → U) :
(complexity I fun (x : Fin n → U) => g (Fin.append x (f x))) ≤ complexity I f + complexity I g

Computing f and then a function g of the inputs and of the values of f costs at most the sum of their complexities: the inputs reach g by wiring.