Documentation

Cslib.Computability.Circuit.Finite

Finite circuit syntax #

A finite signature gives computable enumerations of lines and programs of each fixed size. Their cardinalities count syntax and are independent of any interpretation or carrier. Line.card_le bounds the number of lines when all operation arities are bounded.

@[instance_reducible]
instance Cslib.Circuits.Line.instFintype {σ : Signature} [Fintype σ.Op] (n g : ℕ) :
Fintype (Line σ n g)
Equations
theorem Cslib.Circuits.Line.card {σ : Signature} [Fintype σ.Op] (n g : ℕ) :
Fintype.card (Line σ n g) = ∑ op : σ.Op, (n + g) ^ σ.Arity op

For each operation, choose one wire for each of its arguments.

theorem Cslib.Circuits.Line.card_le {σ : Signature} [Fintype σ.Op] (n g r : ℕ) (arity_le : ∀ (op : σ.Op), σ.Arity op ≤ r) :
Fintype.card (Line σ n g) ≤ Fintype.card σ.Op * (n + g + 1) ^ r

A uniform arity bound gives a uniform bound on the number of lines, including when there are no available wires.

@[simp]

There is one empty program, regardless of the signature or number of inputs.

Choose a prefix program and then its last line.

theorem Cslib.Circuits.Program.card {σ : Signature} [Fintype σ.Op] (n g : ℕ) :
Fintype.card (Program σ n g) = ∏ j ∈ Finset.range g, ∑ op : σ.Op, (n + j) ^ σ.Arity op

The line at each position may refer to the inputs and all preceding gates.