Layered semi-unbounded Boolean circuits and proof trees #
A layered semi-unbounded Boolean circuit has leaves carrying fixed Boolean values (such as
evaluated input literals), AND gates of fan-in one or two, and unbounded fan-in OR gates, with
every child strictly one layer below its parent. A circuit is in alternating normal form with an
AND first layer (LayeredSemiUnboundedCircuit.InNormalForm) when layer 0 consists of leaves,
odd layers consist of AND gates, and positive even layers consist of OR gates.
A proof tree (LayeredSemiUnboundedCircuit.ProofTree) lives in the circuit's tree unfolding:
leaves must evaluate to true, AND gates keep all children, and OR gates select one child.
This file develops the structural combinatorics of proof trees (part of work package 1 of
cslib-frontier #7920; original formalization adapting the layered-digraph isolation framework of
Cslib.LayeredDigraph):
eval_iff_nonempty_proofTree: a gate evaluates totrueiff it admits a proof tree.ProofTree.andNodes_level_profile: in normal form, a proof tree rooted at AND-levelmcontains at most2 ^ (m - k)copies of AND gates at each AND-levelk ≤ m.isMinIsolating_of_separated: if at every OR gate, distinct children have distinct minimum proof-tree weights, then bottom-up induction gives every true gate a unique minimum-weight proof tree.
Main definitions #
Cslib.Circuits.Boolean.AndInputs: unary or ordered binary inputs of an AND gate.Cslib.Circuits.Boolean.GateKind: leaf, AND gate, or unbounded OR gate.Cslib.Circuits.Boolean.LayeredSemiUnboundedCircuit: layered semi-unbounded circuits.Cslib.Circuits.Boolean.LayeredSemiUnboundedCircuit.InNormalForm: alternating AND-first-layer normal form.Cslib.Circuits.Boolean.LayeredSemiUnboundedCircuit.Eval: Boolean gate evaluation.Cslib.Circuits.Boolean.LayeredSemiUnboundedCircuit.ProofTree: inductive proof trees over the tree unfolding, withProofTree.weightandProofTree.andNodes.Cslib.Circuits.Boolean.LayeredSemiUnboundedCircuit.IsMinIsolating: uniqueness of minimum-weight proof trees at every gate evaluating totrue.
Main results #
Cslib.Circuits.Boolean.LayeredSemiUnboundedCircuit.eval_iff_nonempty_proofTree: evaluation equals existence of a proof tree.Cslib.Circuits.Boolean.LayeredSemiUnboundedCircuit.ProofTree.andNodes_and_profile: the2 ^ (m - k)AND-level multiplicity bound below a root AND gate.Cslib.Circuits.Boolean.LayeredSemiUnboundedCircuit.isMinIsolating_of_separated: separation at every OR gate implies min-isolation for every true gate.
The inputs of an AND gate of fan-in one or two.
The role of a gate in a layered semi-unbounded circuit.
- leaf {G : Type u_1} (val : Bool) : GateKind G
A leaf carrying a fixed Boolean truth value (for example an evaluated literal).
- and {G : Type u_1} (inputs : AndInputs G) : GateKind G
An AND gate of fan-in one or two.
- or {G : Type u_1} : GateKind G
An unbounded fan-in OR gate, whose children are given by
orChild.
A layered semi-unbounded Boolean circuit: leaves carry Boolean values, AND gates have fan-in one or two, OR gates have unbounded fan-in (as a child relation with no duplicate edges), and every child lies strictly one layer below its parent.
- layer : G → ℕ
The layer of each gate.
- kind : G → GateKind G
The gate kind and, for leaves and AND gates, its truth value or inputs.
- orChild : G → G → Prop
The child relation for OR gates:
orChild g cmeanscis an input to OR gateg. - layer_andUnary {g c : G} : self.kind g = GateKind.and (AndInputs.unary c) → self.layer c + 1 = self.layer g
Every child of a fan-in-one AND gate lies one layer below it.
- layer_andBinary {g l r : G} : self.kind g = GateKind.and (AndInputs.binary l r) → self.layer l + 1 = self.layer g ∧ self.layer r + 1 = self.layer g
Both children of a fan-in-two AND gate lie one layer below it.
- layer_orChild {g c : G} : self.kind g = GateKind.or → self.orChild g c → self.layer c + 1 = self.layer g
Every child of an OR gate lies one layer below it.
Alternating normal form with an AND first layer above the leaves: layer 0 consists of
leaves, odd layers consist of AND gates, and positive even layers consist of OR gates.
Layer zero consists of leaves.
Odd layers consist of AND gates.
Positive even layers consist of OR gates.
In normal form, every AND gate sits at an odd layer.
In normal form, every OR gate sits at a positive even layer.
In normal form, every leaf sits at layer zero.
In normal form, every child of an OR gate is an AND gate at an odd layer.
The zero-based AND-level of a gate: for an AND gate at layer 2 * k + 1, this is k.
Boolean evaluation of a gate in a layered semi-unbounded circuit, defined by recursion on its layer.
A leaf evaluates to its truth value.
A fan-in-one AND gate evaluates to the value of its child.
A fan-in-two AND gate evaluates to the conjunction of its two children.
An OR gate evaluates to true iff at least one of its children evaluates to true.
A proof tree witnessing that gate g evaluates to true in the tree unfolding of C:
leaves are true, AND gates keep all children, and OR gates choose a single child.
- leaf {G : Type u_1} {C : LayeredSemiUnboundedCircuit G} {g : G} (hkind : C.kind g = GateKind.leaf true) : C.ProofTree g
Witness at a true leaf.
- andUnary {G : Type u_1} {C : LayeredSemiUnboundedCircuit G} {g c : G} (hkind : C.kind g = GateKind.and (AndInputs.unary c)) (sub : C.ProofTree c) : C.ProofTree g
Witness at a fan-in-one AND gate.
- andBinary {G : Type u_1} {C : LayeredSemiUnboundedCircuit G} {g l r : G} (hkind : C.kind g = GateKind.and (AndInputs.binary l r)) (left : C.ProofTree l) (right : C.ProofTree r) : C.ProofTree g
Witness at a fan-in-two AND gate.
- orChoice {G : Type u_1} {C : LayeredSemiUnboundedCircuit G} {g c : G} (hkind : C.kind g = GateKind.or) (hchild : C.orChild g c) (sub : C.ProofTree c) : C.ProofTree g
Witness at an OR gate, keeping one satisfied child.
Instances For
A gate evaluates to true iff it has a proof tree.
The weight of a proof tree under a gate weighting w, summing over all gate occurrences
with multiplicity from the tree unfolding.
The list of AND-gate occurrences in a proof tree, with multiplicity from the tree unfolding.
In normal form, a proof tree rooted at gate g contains at most
2 ^ ((C.layer g - 1) / 2 - k) copies of AND gates at each AND-level k with
2 * k < C.layer g.
In normal form, the AND-gate occurrences of a proof tree rooted at an AND gate u split as
u :: rest, where every node in rest sits strictly below C.andLevel u and at most
2 ^ (C.andLevel u - k) nodes sit at each AND-level k < C.andLevel u.
A gate weighting is min-isolating if every gate evaluating to true has a unique
minimum-weight proof tree.
Minimizing a proof tree of a fan-in-one AND gate is equivalent to minimizing its child's proof tree.
Minimizing a proof tree of a fan-in-two AND gate is equivalent to minimizing both children's proof trees independently.
A leaf gate has at most one proof tree.
A unary AND gate is min-isolated whenever its child has a unique minimum tree.
A binary AND gate is min-isolated whenever both children have unique minimum trees.
An OR proof tree is minimum precisely when its chosen child tree is no heavier than any proof tree of any child. The root weight contributes equally to all the candidates.
The chosen child subtree of a minimum-weight proof tree at an OR gate is itself a minimum-weight proof tree of that child.
Given a cheapest child tree and uniqueness at that child, the OR gate is isolated exactly when every tree from another child is strictly heavier.
If at every OR gate, distinct satisfied children have distinct minimum proof-tree weights,
then the weighting is min-isolating for every gate evaluating to true.