Complexity of circuit combinators #
Size bounds for building a De Morgan circuit from circuits for its parts, stated with complexity
in the style of complexity_and_le: a multiplexer, a finite conjunction or disjunction, and
reading one block of a tuple of BitString blocks with the other blocks fixed to constants. The
bounds are on size only.
Main definitions #
blockInputs: the substitution that feeds one block from the input and fixes the others.
Main results #
complexity_ite_le: a multiplexer costs four gates beyond its arguments.complexity_decide_forall_mem_le,complexity_decide_exists_mem_le: a conjunction or a disjunction of#stests of costccosts#s (c + 1) + 1.complexity_single_block_le: reading one block, with the others fixed, costs at most two gates more than reading the whole flat tuple.
Multiplexer: choosing between two outputs by a third costs four gates beyond the three outputs.
Finite conjunction: the conjunction of the tests F i over i ∈ s, each costing at most
c gates, costs at most #s (c + 1) + 1 gates. The lemma takes the Decidable instance of the
caller's statement, such as Nat.decidableForallFin when ι = Fin k, so it applies directly.
Finite disjunction: the disjunction of the tests F i over i ∈ s, each costing at most
c gates, costs at most #s (c + 1) + 1 gates. As in complexity_decide_forall_mem_le, the
lemma takes the Decidable instance of the caller's statement.
Substituting blockInputs z j and cutting into blocks puts x at block j of z.
Reading one block: fixing every block but block j to the bits of z costs at most two
more gates than reading all of them.