Positive and read-once Boolean formulas from tight binary-cost circuits #
A one-output De Morgan circuit c : Circuit Boolean.signature n 1 on n ≥ 1 variables that
depends on all n inputs must use at least n - 1 binary (AND/OR) gates
(Circuit.card_inputSupport_le_cost_binaryCost).
When n ≥ 1 and this bound is tight (c.program.cost binaryCost ≤ n - 1, i.e.
c.program.cost binaryCost + 1 ≤ n), no gate in the backward cone of the
output can share wires or use a Boolean constant, so the circuit unfolds without duplication into a
constant-free negation-normal-form formula (LitFormula) of leaf size n in which each of the n
variables appears at a single leaf (Circuit.exists_litFormula_of_cost_binaryCost_le).
If moreover every coordinate i : Fin n is positively essential—meaning some pair of inputs
differing only at i flips the output from false to true when coordinate i is flipped from
false to true—then every leaf must have positive polarity, yielding a positive (monotone)
read-once formula F : PosFormula n of leaf size n and gate size n - 1 computing the same
function (Circuit.exists_posFormula_of_cost_binaryCost_le) [Ilango2020FOCS, Section III.B;
ECCC TR20-183, Section 3, Claim 13, p. 24].
Main definitions #
Cslib.Circuits.Boolean.LitFormula: constant-free negation-normal-form Boolean formulas built from literalslit i polusing binaryandandor.Cslib.Circuits.Boolean.PosFormula: constant-free positive (monotone) Boolean formulas built from variablesvar iusing binaryandandor.Cslib.Circuits.Boolean.PosFormula.IsReadOnce: no variable appears at more than one leaf.Cslib.Circuits.Boolean.PosFormula.IsSubformula: the structural subformula relation.Cslib.Circuits.Boolean.PosFormula.flipSensitive: input coordinates inleafSupportwhose flip fromw₀totruechanges the formula value fromfalsetotrue.Cslib.Circuits.Boolean.PosFormula.orFin: right-nested disjunction ofm > 0positive formulas.
Main results #
Cslib.Circuits.Program.exists_litFormula_of_card_biUnion_wireSupport_ge: a frontier of wires achieving the binary-cost support bound unfolds into constant-free NNF formulas whose leaf sizes sum tofrontier.card + p.cost binaryCost.Cslib.Circuits.Circuit.exists_litFormula_of_cost_binaryCost_le: a one-output De Morgan circuit with full support andc.program.cost binaryCost + 1 ≤ nunfolds into aLitFormulaof leaf sizen.Cslib.Circuits.Circuit.exists_posFormula_of_cost_binaryCost_le: when every coordinate is positively essential andc.program.cost binaryCost + 1 ≤ n, the circuit is computed by a read-oncePosFormulaof leaf sizenand sizen - 1.Cslib.Circuits.Boolean.PosFormula.card_flipSensitive_le_numOr_add_one: a read-once positive formula has at mostnumOr + 1flip-sensitive coordinates at any baseline input.Cslib.Circuits.Boolean.PosFormula.eval_eq_of_isSubformula_of_eval_eq: in a read-once positive formula, two inputs that agree outside a subformula's support and give the subformula the same value give the whole formula the same value.
References #
Constant-free positive (monotone) Boolean formulas #
A constant-free positive Boolean formula on n variables, built from input variables var i
using binary conjunction (and) and disjunction (or).
- var {n : ℕ} (i : Fin n) : PosFormula n
Input variable
i. - and {n : ℕ} (L R : PosFormula n) : PosFormula n
Binary conjunction.
- or {n : ℕ} (L R : PosFormula n) : PosFormula n
Binary disjunction.
Instances For
Instances For
Evaluate a positive formula on an n-bit input.
Instances For
Number of variable leaves in a positive formula.
Instances For
Number of and gates in a positive formula.
Instances For
Number of or gates in a positive formula.
Instances For
The set of input variables appearing at the leaves of a positive formula.
Instances For
A positive formula is read-once when no input variable appears at more than one leaf.
Instances For
A positive formula is read-once if and only if its leaf support has cardinality equal to its leaf size.
Evaluation of a positive formula depends only on the variables in F.leafSupport.
Positive formulas compute monotone Boolean functions.
A positive formula with no and gates evaluates to the disjunction of the variables in its
leaf support.
Embedding into De Morgan and monotone formulas and circuits #
View a PosFormula as a De Morgan Formula.
Instances For
View a PosFormula as a Monotone.Formula.
Instances For
Compile a PosFormula to a one-output De Morgan circuit.
Instances For
Subformulas and context invariance in read-once formulas #
IsSubformula T F holds when T occurs as a syntactic subformula of F.
- refl {n : ℕ} (T : PosFormula n) : T.IsSubformula T
- and_left {n : ℕ} {T L R : PosFormula n} : T.IsSubformula L → T.IsSubformula (L.and R)
- and_right {n : ℕ} {T L R : PosFormula n} : T.IsSubformula R → T.IsSubformula (L.and R)
- or_left {n : ℕ} {T L R : PosFormula n} : T.IsSubformula L → T.IsSubformula (L.or R)
- or_right {n : ℕ} {T L R : PosFormula n} : T.IsSubformula R → T.IsSubformula (L.or R)
Instances For
In a read-once positive formula F, if T is a subformula of F and two inputs w₁, w₂
agree on all coordinates outside T.leafSupport and give T the same Boolean value, then F
evaluates to the same value on w₁ and w₂.
The coordinates in F.leafSupport whose flip from w₀ to true changes F.eval from
false to true.
Instances For
Gate-elimination bound on OR gates [Ilango2020FOCS, Section III.B; ECCC TR20-183, Section 3,
Claim 14, p. 25]: in any read-once positive formula F, for any baseline input w₀, at most
F.numOr + 1 coordinates in F.leafSupport flip F.eval from false to true.
Indexed disjunction of positive formulas #
Right-nested disjunction of m positive formulas (m > 0).
Instances For
Constant-free negation-normal-form Boolean formulas #
A constant-free negation-normal-form Boolean formula on n variables, built from literals
lit i pol (x i when pol = true, !x i when pol = false) using binary and and or.
- lit {n : ℕ} (i : Fin n) (pol : Bool) : LitFormula n
Literal on input variable
iwith polaritypol. - and {n : ℕ} (L R : LitFormula n) : LitFormula n
Binary conjunction.
- or {n : ℕ} (L R : LitFormula n) : LitFormula n
Binary disjunction.
Instances For
Instances For
Evaluate a literal formula on an n-bit input.
Instances For
Number of literal leaves in a literal formula.
Instances For
Number of positive literal leaves (lit i true) in a literal formula.
Instances For
The set of input variables occurring positively (lit i true) at a leaf.
Instances For
Project a literal formula to a positive formula by dropping literal polarities. When all
leaves have positive polarity (posLeafCount = leafSize), this preserves evaluation.
Instances For
If variable i does not occur positively in F, flipping i from false to true can only
decrease F.eval.
Unfolding tight binary-cost De Morgan programs into formulas #
When a frontier of wires in a De Morgan program achieves the binary-cost support bound
frontier.card + p.cost binaryCost ≤ (frontier.biUnion p.wireSupport).card, every wire in the
frontier unfolds into a constant-free NNF formula (LitFormula) such that the leaf sizes across the
frontier sum to frontier.card + p.cost binaryCost.
A one-output De Morgan circuit with 1 ≤ n, full input support n ≤ c.inputSupport.card, and
c.program.cost binaryCost + 1 ≤ n unfolds into a constant-free NNF formula F : LitFormula n of
leaf size n computing c.
Unfolding a tight binary-cost circuit into a positive read-once formula
[Ilango2020FOCS, Section III.B; ECCC TR20-183, Section 3, Claim 13, p. 24]: if c is a one-output
De Morgan circuit on n ≥ 1 inputs with c.program.cost binaryCost + 1 ≤ n such that every input
coordinate i : Fin n is positively essential for fun x => c.eval interpretation x 0, then there
exists a read-once positive formula F : PosFormula n with F.leafSize = n, F.size = n - 1,
and F.leafSupport = Finset.univ that computes c.