Depths along program lines, and depths with costs #
Every wire read by a gate is shallower than the gate (Program.wireDepths_lines_lt), which is what
makes induction on depth go through for programs.
The depth with costs (Circuit.depthWith cost) charges cost op for a gate of operation op
instead of one, so it is the largest total cost of the gates on a path to an output. Unit costs
give Circuit.depth (Circuit.depthWith_one). With free negations it is the largest number of
AND and OR gates on a path in a circuit over the unbounded fan-in basis, the depth of AC⁰ circuits
with negations at the inputs.
Main definitions #
Cslib.Circuits.Line.depthWith,Cslib.Circuits.Program.depthsWith,Cslib.Circuits.Program.wireDepthsWith,Cslib.Circuits.Circuit.depthWith: depths with costs.
Main results #
Fin.foldl_max_eq_max_sup: foldingmaxis taking the supremum, so depths are suprema (Cslib.Circuits.Line.depthWith_eq_sup,Cslib.Circuits.Circuit.depthWith_eq_sup).Cslib.Circuits.Program.depths_eq_depth_lines: the depth of a gate is the depth of its line.Cslib.Circuits.Program.wireDepths_lines_lt: the wires a gate reads are shallower than it.Cslib.Circuits.Program.depths_pos: gates have positive depth.Cslib.Circuits.Program.wireDepthsWith_lines_add_le: with costs, the wires a gate reads are shallower than it by at least its cost.Cslib.Circuits.Circuit.depthWith_one: unit costs give the depth.Cslib.Circuits.Circuit.depthWith_le_iff,Cslib.Circuits.Circuit.depthWith_mono: bounds, and monotonicity in the costs.Cslib.Circuits.Circuit.depthWith_le_depth: costs of at most one never increase the depth.Cslib.Circuits.Circuit.depthWith_le_mul_depth: if every gate costs at mostb, the depth with costs is at mostbtimes the depth.
Folding max over the values of f, from init, gives the larger of init and their
supremum.
Depth with costs #
The depth of a wire when each operation op costs cost op instead of one: the largest total
cost of the gates on a path to the wire. With negations costing nothing, it is the largest number
of AND and OR gates on a path, the depth of AC⁰ circuits with negations at the inputs.
The depth interpretation takes the largest argument depth and adds the operation's cost. In particular, a nullary gate contributes its own cost.
Instances For
Raising the depths of the wires by at most D raises the depth of a line by at most D.
Line.depthWith is monotone in the costs and in the depths of the wires.
With unit costs, Program.depthsWith is Program.depths.
With unit costs, Program.wireDepthsWith is Program.wireDepths.
Program.depthsWith is monotone in the costs.
Program.wireDepthsWith is monotone in the costs.
The depth of a circuit with costs is the largest depth of its outputs.
With unit costs, Circuit.depthWith is Circuit.depth.
If every gate of a program costs at most b, every wire is at most b times as deep with
costs as without.