Definitions for programs with shared gates over the full binary basis #
This file holds the definitions behind the bounded-sharing Nechiporuk bounds, so that both the
proof internals (Complexitylib.Algebraic.LowerBound.Nechiporuk.Sharing.Internal) and the surface
statements (Complexitylib.Algebraic.LowerBound.Nechiporuk.Sharing) can refer to them:
- leaf and gate counts of full-binary-basis formulas (
Binary.Formula.gates,occ,inputLeaves,sharedLeaves,inputLeavesIn); - programs with shared gates (
Nechiporuk.SharedProgram), their semantics and size measures, and the per-block measuresSharedProgram.activeSharedandSharedProgram.activeSharedLeaves, which advance a block through each shared gate withSharedProgram.stepBlock; - the circuit-side sharing measures
sharedFanOut,activeSharedGateCount,activeSharedFanOut,gateBlockSpan, andhighSpanSharedFanOut, where a gate is active on a blockYwhen its syntactic input cone contains a coordinate ofY(gateActive).
The number of binary gates in a formula.
Equations
- (Algebraic.Binary.Formula.var index).gates = 0
- (Algebraic.Binary.Formula.const value).gates = 0
- (Algebraic.Binary.Formula.gate op left right).gates = left.gates + right.gates + 1
Instances For
The number of variable leaves with index v.
Equations
- Algebraic.Binary.Formula.occ v (Algebraic.Binary.Formula.var index) = if ↑index = v then 1 else 0
- Algebraic.Binary.Formula.occ v (Algebraic.Binary.Formula.const value) = 0
- Algebraic.Binary.Formula.occ v (Algebraic.Binary.Formula.gate op left right) = Algebraic.Binary.Formula.occ v left + Algebraic.Binary.Formula.occ v right
Instances For
The number of variable leaves on the primary input variables 0, …, m - 1.
Equations
- (Algebraic.Binary.Formula.var i).inputLeaves x✝ = if ↑i < x✝ then 1 else 0
- (Algebraic.Binary.Formula.const value).inputLeaves x✝ = 0
- (Algebraic.Binary.Formula.gate op l r).inputLeaves x✝ = l.inputLeaves x✝ + r.inputLeaves x✝
Instances For
The number of variable leaves on variables below n that belong to Y.
Equations
- Algebraic.Binary.Formula.inputLeavesIn Y (Algebraic.Binary.Formula.var index) = if h : ↑index < n then if ⟨↑index, h⟩ ∈ Y then 1 else 0 else 0
- Algebraic.Binary.Formula.inputLeavesIn Y (Algebraic.Binary.Formula.const value) = 0
- Algebraic.Binary.Formula.inputLeavesIn Y (Algebraic.Binary.Formula.gate op left right) = Algebraic.Binary.Formula.inputLeavesIn Y left + Algebraic.Binary.Formula.inputLeavesIn Y right
Instances For
Sharing measures of binary circuits #
Whether gate g of p has at least one input from Y in its syntactic cone.
Equations
- One or more equations did not get rendered due to their size.
- Algebraic.Nechiporuk.gateActive Y Cslib.Circuits.Program.empty = Fin.elim0
Instances For
def
Algebraic.Nechiporuk.gateBlockSpan
{σ : Signature}
{n t B : ℕ}
(Y : Fin B → Finset (Fin n))
(p : Program σ n t)
(g : Fin t)
:
The number of blocks in Y : Fin B → Finset (Fin n) on which gate g of p is active.
Equations
- Algebraic.Nechiporuk.gateBlockSpan Y p g = {i : Fin B | Algebraic.Nechiporuk.gateActive (Y i) p g = true}.card