Internals of programs with shared gates over the full binary basis #
Proof internals for Complexitylib.Algebraic.LowerBound.Nechiporuk.Sharing:
- leaf and occurrence bookkeeping for
Binary.Formula, including reindexing (mapIndex) and substitution of a formula for a variable (subst,substVarMap); - the block-advancing combinatorics of
SharedProgram.castBlock,snocBlock, andstepBlock, and the gluing identities used to restrict asharestep to a block (SharedProgram.glue_castBlock,SharedProgram.glue_snocBlock), which yield the one-step subfunction boundsSharedProgram.card_subfunctions_share_le_of_leavesIn_eq_zeroandSharedProgram.card_subfunctions_share_le_mul; - substitution of a formula for a shared variable (
SharedProgram.substVar) and its effect on gates, occurrences, and active measures; - the translation of a full-binary-basis program into a
SharedProgram, processing gates from the last one down (exists_sharedProgram_of_program): a gate read at least twice becomes a shared gate, and any other gate is substituted into the program; - the characterization of
gateActiveby the syntactic input support (Internal.gateActive_eq_true_iff), the resulting block-span bound over disjoint blocks (Internal.gateBlockSpan_le_card_wireSupport), and the counting of gate-argument uses behindInternal.sharedFanOut_le_two_mul_size_add_one.
Reindex the variables of a formula.
Equations
- Algebraic.Binary.Formula.mapIndex φ (Algebraic.Binary.Formula.var i) = Algebraic.Binary.Formula.var (φ i)
- Algebraic.Binary.Formula.mapIndex φ (Algebraic.Binary.Formula.const b) = Algebraic.Binary.Formula.const b
- Algebraic.Binary.Formula.mapIndex φ (Algebraic.Binary.Formula.gate op l r) = Algebraic.Binary.Formula.gate op (Algebraic.Binary.Formula.mapIndex φ l) (Algebraic.Binary.Formula.mapIndex φ r)
Instances For
Substitute a formula for each variable.
Equations
- Algebraic.Binary.Formula.subst σ (Algebraic.Binary.Formula.var i) = σ i
- Algebraic.Binary.Formula.subst σ (Algebraic.Binary.Formula.const b) = Algebraic.Binary.Formula.const b
- Algebraic.Binary.Formula.subst σ (Algebraic.Binary.Formula.gate op l r) = Algebraic.Binary.Formula.gate op (Algebraic.Binary.Formula.subst σ l) (Algebraic.Binary.Formula.subst σ r)
Instances For
Embedding the variables with Fin.castLE preserves occurrence counts.
The input leaves are among all variable leaves.
The input leaves of a binary formula number at most its binary gates plus one.
Decompose F.leavesIn Y into input leaves in Y₀ and occurrences of shared variables in Y
when Y agrees with Y₀ below n.
Evaluating a substituted formula evaluates the original with φ's value inserted at N.
Subfunctions of a program with shared gates #
Substitution of a variable in a SharedProgram #
Shared fan-out and translation from binary circuits to SharedProgram #
The active wires of the empty program are the block itself.
The formula of one full-binary-basis gate over the earlier wires, numbered by Wire.index.
Equations
- Algebraic.Nechiporuk.lineFormula line = Algebraic.Binary.Formula.gate line.op (Algebraic.Binary.Formula.var (line.wires 0).index) (Algebraic.Binary.Formula.var (line.wires 1).index)
Instances For
The formula of the last gate has no leaves among the active wires iff the gate is inactive.
Advancing the active wires through the formula of a new gate gives the active wires of the extended program.
The values of the inputs and gates of a binary program, numbered by Wire.index.
Equations
Instances For
The formula of a gate evaluates as the gate.
The formula of a gate has exactly one binary gate.
The formula of a gate reads gate g at most as often as the gate's arguments do.
Evaluating a program with an appended gate appends the gate's value.
The wire values of an extended program append the value of the new gate's formula.
The wire values of the empty program are the inputs.
Over pairwise disjoint blocks Y, the number of blocks on which gate g is active is at most
the cardinality of its syntactic input support.