Window templates #
The reduction of Ilango, Loff and Oliveira [IlangoLoffOliveira2020, §4.2, pp. 22:20–22:21] gives
a circuit minimizer a random truth table T on p input bits together with, for each set A_i
of a set system, a circuit whose gates depend only on the entries of T inside A_i; its last
gate computes T restricted to A_i. Covering the inputs with c of the sets, T is the OR of
c such windows, which costs c - 1 further gates (completeness, [p. 22:22, Lemma 15]).
This file builds such a family in the constant-free De Morgan basis, as one program template A T
on p inputs, and proves the facts the reduction uses about it. The source writes each window as a
canonical DNF [pp. 22:19–22:20]; here all windows share the p negations, a constant-zero gate and
the p · 2^p gates of prefix conjunctions, and window i is an OR chain: its gate window i y is
the OR of the accepted inputs of A i up to y, in the order of BitString.equivFin. This is a
construction choice internal to the proof: like the source's, its gates depend on T only through
the entries inside the window they belong to.
- Layout (
Gate,gateCount,Gate.set,Gate.op): the gates, their number and their operations depend only onpand the numbertof sets. - Locality (
value_congr): the function computed by a gate of windowidepends only onTrestricted toA i; the other gates compute fixed functions. With the layout, these are the two facts the counting argument uses; the program itself depends onT, andexists_programrealizes it with the layout's operations. - Exact cost (
ecomplexity_template): computing all the gate functions costs exactly their number of distinct non-input functions, over any De Morgan basis. - Completeness (
ecomplexity_append_le): with a coverCof the inputs by sets, the template followed byTcosts at most that number plus#C - 1.
Main definitions #
Cslib.MultiMCSP.Window.Gate,Cslib.MultiMCSP.Window.gateCount,Cslib.MultiMCSP.Window.Gate.equivFin: the gates of a template and their numbering.Cslib.MultiMCSP.Window.Gate.set,Cslib.MultiMCSP.Window.Gate.op: the window a gate belongs to and its operation.Cslib.MultiMCSP.Window.value: the function each gate computes, in closed form.Cslib.MultiMCSP.Window.template: all gate functions, as a multi-output function.Cslib.MultiMCSP.Window.tableFun: the function whose truth table isT.
Main results #
Cslib.MultiMCSP.Window.exists_program: a program computing the template, with the layout's operations.Cslib.MultiMCSP.Window.value_congr: locality of the gate functions.Cslib.MultiMCSP.Window.value_window_last: the last gate of windowicomputesTonA i.Cslib.MultiMCSP.Window.ecomplexity_template: the template costs its number of distinct non-input gate functions.Cslib.MultiMCSP.Window.ecomplexityGiven_tableFun_le,Cslib.MultiMCSP.Window.ecomplexity_append_le: completeness.
References #
The gates of a window template on p inputs with t windows: a negation of each input, a
constant-zero gate, a prefix conjunction grid y k of the first k + 1 literals of each input y,
and a gate window i y of window i for each input y.
- neg {p t : ℕ} (i : Fin p) : Gate p t
The negation of input
i. - zero {p t : ℕ} : Gate p t
The constant zero.
- grid {p t : ℕ} (y : Fin (2 ^ p)) (k : Fin p) : Gate p t
Whether the first
k + 1input bits agree with those ofy. - window {p t : ℕ} (i : Fin t) (y : Fin (2 ^ p)) : Gate p t
Whether the input is at most
y, lies in windowiand is accepted by the table.
The number of gates of a window template: p negations, one zero, 2^p · p prefix
conjunctions and t · 2^p window gates.
The operation of each gate: NOT for the negations, AND for zero and the prefix conjunctions, OR for the window gates.
Locality #
Locality. A gate of window i computes a function that depends on T only through its
entries in A i; the other gates compute the same function for every T.
The last input 2^p - 1, whose window gates compute the windows of T.
The window identity. The last gate of window i computes T restricted to A i.
The program #
The template as a program. For p ≥ 1, a program over the constant-free De Morgan basis
with one gate for each gate of the layout computes the window template, and its gate
Gate.equivFin p t κ performs the operation κ.op.
Cost #
Exact cost of the template. For p ≥ 1, over any De Morgan basis, computing all gate
functions of a window template costs exactly the number of distinct ones that are not input
projections. This is the analogue for this template of [IlangoLoffOliveira2020, Proposition 14,
pp. 22:21–22:22].
The table given the template. If the windows C cover every input, then T costs at
most #C - 1 gates given the template: it is the OR of the last gates of those windows. This is
the analogue for this template of [IlangoLoffOliveira2020, Lemma 15, p. 22:22], with the sharper
bound #C - 1.
Completeness. For p ≥ 1, if the windows C cover every input, the template followed by
T costs at most the number of distinct non-input gate functions plus #C - 1. This is the
analogue for this template of [IlangoLoffOliveira2020, Lemma 15, p. 22:22].