<p><strong>A simple conversion process for $\boldsymbol\cup\,$, $\boldsymbol\cap\,$, constants, and complements</strong></p>

<p>Note that any integer-set circuit representing a set $S \subseteq \{0,1,\ldots,N-1\}$ can be represented by a boolean circuit which tests $x \mathbin{\in?} S$ for $0 \leqslant x &lt; N$. If $N = 2^n$, this is a boolean circuit with $n$ inputs. We may construct such a circuit $C_n$ as follows.
$\def\GE#1{\mathrm{GE#1}}\def\PRIME={\mathrm{PRIME}}$</p>

<ol>
<li><p>Using AND, OR, and NOT gates, we can very easily simulate equality of the input with a binary representation of any integer $0 \leqslant x &lt; 2^n$ with a circuit of size $n$ and depth $\log (n)$. </p></li>
<li><p>Next, we may represent your input sets as also being constructed by $\cup$ circuits, constructed from singletons $\{x\}$ for $1 \leqslant x &lt; N$. If $S_j$ has size $m_j \leqslant M$, this requires a circuit with a boolean tree structure, with $m-1$ union gates, having depth at most $\log(m)$.  </p></li>
<li><p>Finally, we may represent unions and intersections of your sets $S_j$ by logical ANDs and ORs of membership in the input sets. This part of the circuit has the same size $s$ and depth $d$ as the depth of your integer-set-circuit.</p></li>
</ol>

<p>We may then obtain a boolean circuit $C_n$ of depth at most $d + \log m + \log n$ and size at most $s + m + mn$. The complexity of building this circuit is essentially $O(s + m(\log m + n \log n))$, arising from doing the necessary construction of the binary trees for the gates representing each $S_j$ and $\{x\}$ for $x \in S_j$.</p>

<p>Note that the complexity does not increase at all if you allow logical complementation, which would represent in principle an infinitely large set including numbers larger than the input size; though to represent numbers which are $N$ or larger, we must use uniform circuit <em>families</em> $\{C_n\}$ rather than a single circuit $C_n$. The construction above will build these efficiently, however.</p>

<p><strong>Remarks on the power of integer-set circuits with arithmetic</strong></p>

<p>In the (extremely powerful!) model of arithmetic circuits including $+$ and $\times$ gates, this construction fails because the outputs to those gates implicitly involve existential quantifiers over satisfying inputs to subcircuits <em>of arbitrary size</em>. As your linked article notes, the Goldbach conjecture can be tested by evaluating $G(0)$, where $G$ is a (<em>finite depth!</em>) circuit,
$$ G :=\overline{\{0\} \times \Bigl(\bigl[ \{2\} \times \GE2 \bigr] \cap \bigl[\; \overline{\PRIME + \PRIME}\;\bigr]\Bigr)} \;, $$
where $\GE2 := \overline{\{0\} \cup \{1\}}$ tests whether an input is $\geqslant 2$, and $\PRIME := \GE2 \cap \bigl[\,\overline{\GE2 \times \GE2}\,\bigr]$ tests whether an input is prime. The enormous power of these circuits seem to me to come from combining negation (which allows you to obtain infinite sets from finite ones) with the $+$ and $\times$ gates (which allow existential quantification over all inputs to sub-circuits, as to whether there are accepted inputs whose sum or product is equal to the input integer). If you do not have additions or multiplications, those quantifications are absent, and the problem becomes much simpler &mdash; indeed, very close in flavour to a run-of-the-mill boolean circuit.</p>

CC BY-SA 3.0
2013-03-31T01:06:34.327Z
I am afraid I am missing a point here. Are you assuming that the circuit $S$ contains $\{i\}$-type gates in order to construct each input set before doing set operations on them? If I assume that all involved sets are of size $m$ and $p$ such sets are used then $|S| \in O(mp)$. Also when converting to a boolean circuit, shouldn't each $\{i\}$-type gate be represented by at least $k$ boolean gates?
Jonathan Naysmith
CC BY-SA 3.0
2013-04-01T15:57:04.040Z
@JonathanNaysmith:I have attempted to clarify my construction, and have fixed some minor errors.
Niel de Beaudrap
CC BY-SA 3.0
2013-03-30T15:56:04.657Z
2013-04-01T15:56:39.993Z
2013-04-01T15:56:39.993Z
Niel de Beaudrap
<p>Let the size of each input set $|S| \leq m = f(\lambda)$ and let $k$ be the number of inputs. </p>

<p>With corresponding input set $S$ let $L = S_1, ..., S_{|S|}, \emptyset_{|S|+1}, ..., \emptyset_m$ and let $\mathbf{L}$ be the concatenation of all $L$. </p>

<p>Let $\mathbf{s}$ be a binary array of length $mk$ where $\mathbf{s}_i$ is $1$ if $S$ contains an element that first occurs in $\mathbf{L}$ at position $i$.</p>

<p>We can construct $\mathbf{s}$ from $S$ and $\mathbf{L}$ using $O(m^2k)$ integer comparators or $O(m^2k^2)$ comparators for all $S$. Representing elements of $S$ in base 2, comparators can be constructed using $O(\lambda)$ boolean gates.</p>

<p>Now $C_s$ can be transformed as you describe with each gate in $C_s$ being implemented by $mk$ gates in $C_b$.</p>

<p>An output $S_{out}$ can be constructed from a boolean array $\mathbf{s}_{out}$ by comparison with $\mathbf{L}$ using $O(mk)$ integer gates. To match output and input formats you can build an odd-even mergesort comparator network with $O(mk~log^2(mk))$ integer comparators per output.</p>

CC BY-SA 3.0
2013-03-30T11:55:28.613Z
2013-03-30T14:56:12.570Z
2013-03-30T14:56:12.570Z
bhitov
<p>I am interested in reducing a <em>circuit over sets of naturals</em> (see <a href="http://www-ti.informatik.uni-tuebingen.de/~borchert/ArithmeticalCircuits/PreFinalCC-7-229.pdf" rel="nofollow">here</a> for some basic notions about this type of circuits) to a boolean circuit computing the same output. A very basic circuit of this type is a circuit $C_s$ defined over a beginning subset of $\mathbb{N}$ (i.e., $\{0,...,n\}$) containing only $\{\cap,\cup\}$ gates. My question is how efficiently can a boolean circuit $C_b$ be constructed that computes the same output as $C_s$ and whether there exists a lower bound on the size of such a $C_b$. </p>

<p>The simplest way I can think of, in order to achieve the above, would be to represent a set $S$ by a binary array $\mathbf{s} = s_1,...,s_n$ of size $n$ where a 1 in position $i$ would signify that element $i \in S$. With this representation in mind, a union operation between sets $S,P$ can be implemented by $n$ OR gates by performing a point-wise OR for arrays $\mathbf{s}$ and $\mathbf{p}$. Likewise, intersection would be captured by point-wise AND. This approach would imply that $|C_b| \in O(n)$ and likewise for the reduction time (with a multiplicative factor of $|C_s|$).</p>

<p>Can someone point out whether this approach is optimal or whether there is a better way to achieve the above? More importantly, is there a known lower bound for transformation of circuits over sets of naturals to boolean circuits? My research is security-motivated and the problem is governed by a security parameter $\lambda$ such that $n \in O(2^{\lambda})$ hence my approach is infeasible as it yields exponential size $C_b$. (EDIT: Assume each set $S$ is of size only $O(poly(\lambda)$)   </p>

<cc.complexity-theory><circuit-complexity><arithmetic-circuits>
How efficiently can circuits over sets of naturals be transformed to boolean circuits?
Jonathan Naysmith
# How efficiently can circuits over sets of naturals be transformed to boolean circuits?

(Asked by: username_0 on 2013-03-27)

I am interested in reducing a *circuit over sets of naturals* (see [here](http://www-ti.informatik.uni-tuebingen.de/~borchert/ArithmeticalCircuits/PreFinalCC-7-229.pdf) for some basic notions about this type of circuits) to a boolean circuit computing the same output. A very basic circuit of this type is a circuit $C\_s$ defined over a beginning subset of $\mathbb{N}$ (i.e., $\{0,...,n\}$) containing only $\{\cap,\cup\}$ gates. My question is how efficiently can a boolean circuit $C\_b$ be constructed that computes the same output as $C\_s$ and whether there exists a lower bound on the size of such a $C\_b$.

The simplest way I can think of, in order to achieve the above, would be to represent a set $S$ by a binary array $\mathbf{s} = s\_1,...,s\_n$ of size $n$ where a 1 in position $i$ would signify that element $i \in S$. With this representation in mind, a union operation between sets $S,P$ can be implemented by $n$ OR gates by performing a point-wise OR for arrays $\mathbf{s}$ and $\mathbf{p}$. Likewise, intersection would be captured by point-wise AND. This approach would imply that $|C\_b| \in O(n)$ and likewise for the reduction time (with a multiplicative factor of $|C\_s|$).

Can someone point out whether this approach is optimal or whether there is a better way to achieve the above? More importantly, is there a known lower bound for transformation of circuits over sets of naturals to boolean circuits? My research is security-motivated and the problem is governed by a security parameter $\lambda$ such that $n \in O(2^{\lambda})$ hence my approach is infeasible as it yields exponential size $C\_b$. (EDIT: Assume each set $S$ is of size only $O(poly(\lambda)$)

**Tags:** cc.complexity-theory, circuit-complexity, arithmetic-circuits


---

## 2 answers

### Answer by username_1 on 2013-03-30. Score: 2

**A simple conversion process for $\boldsymbol\cup\,$, $\boldsymbol\cap\,$, constants, and complements**

Note that any integer-set circuit representing a set $S \subseteq \{0,1,\ldots,N-1\}$ can be represented by a boolean circuit which tests $x \mathbin{\in?} S$ for $0 \leqslant x < N$. If $N = 2^n$, this is a boolean circuit with $n$ inputs. We may construct such a circuit $C\_n$ as follows.
$\def\GE#1{\mathrm{GE#1}}\def\PRIME={\mathrm{PRIME}}$

1. Using AND, OR, and NOT gates, we can very easily simulate equality of the input with a binary representation of any integer $0 \leqslant x < 2^n$ with a circuit of size $n$ and depth $\log (n)$.
2. Next, we may represent your input sets as also being constructed by $\cup$ circuits, constructed from singletons $\{x\}$ for $1 \leqslant x < N$. If $S\_j$ has size $m\_j \leqslant M$, this requires a circuit with a boolean tree structure, with $m-1$ union gates, having depth at most $\log(m)$.
3. Finally, we may represent unions and intersections of your sets $S\_j$ by logical ANDs and ORs of membership in the input sets. This part of the circuit has the same size $s$ and depth $d$ as the depth of your integer-set-circuit.

We may then obtain a boolean circuit $C\_n$ of depth at most $d + \log m + \log n$ and size at most $s + m + mn$. The complexity of building this circuit is essentially $O(s + m(\log m + n \log n))$, arising from doing the necessary construction of the binary trees for the gates representing each $S\_j$ and $\{x\}$ for $x \in S\_j$.

Note that the complexity does not increase at all if you allow logical complementation, which would represent in principle an infinitely large set including numbers larger than the input size; though to represent numbers which are $N$ or larger, we must use uniform circuit *families* $\{C\_n\}$ rather than a single circuit $C\_n$. The construction above will build these efficiently, however.

**Remarks on the power of integer-set circuits with arithmetic**

In the (extremely powerful!) model of arithmetic circuits including $+$ and $\times$ gates, this construction fails because the outputs to those gates implicitly involve existential quantifiers over satisfying inputs to subcircuits *of arbitrary size*. As your linked article notes, the Goldbach conjecture can be tested by evaluating $G(0)$, where $G$ is a (*finite depth!*) circuit,
$$ G :=\overline{\{0\} \times \Bigl(\bigl[ \{2\} \times \GE2 \bigr] \cap \bigl[\; \overline{\PRIME + \PRIME}\;\bigr]\Bigr)} \;, $$
where $\GE2 := \overline{\{0\} \cup \{1\}}$ tests whether an input is $\geqslant 2$, and $\PRIME := \GE2 \cap \bigl[\,\overline{\GE2 \times \GE2}\,\bigr]$ tests whether an input is prime. The enormous power of these circuits seem to me to come from combining negation (which allows you to obtain infinite sets from finite ones) with the $+$ and $\times$ gates (which allow existential quantification over all inputs to sub-circuits, as to whether there are accepted inputs whose sum or product is equal to the input integer). If you do not have additions or multiplications, those quantifications are absent, and the problem becomes much simpler — indeed, very close in flavour to a run-of-the-mill boolean circuit.

> **Comments:**
> **username_0**: I am afraid I am missing a point here. Are you assuming that the circuit $S$ contains $\{i\}$-type gates in order to construct each input set before doing set operations on them? If I assume that all involved sets are of size $m$ and $p$ such sets are used then $|S| \in O(mp)$. Also when converting to a boolean circuit, shouldn't each $\{i\}$-type gate be represented by at least $k$ boolean gates?  
> **username_1**: @JonathanNaysmith:I have attempted to clarify my construction, and have fixed some minor errors.  

---

### Answer by username_2 on 2013-03-30. Score: 0

Let the size of each input set $|S| \leq m = f(\lambda)$ and let $k$ be the number of inputs.

With corresponding input set $S$ let $L = S\_1, ..., S\_{|S|}, \emptyset\_{|S|+1}, ..., \emptyset\_m$ and let $\mathbf{L}$ be the concatenation of all $L$.

Let $\mathbf{s}$ be a binary array of length $mk$ where $\mathbf{s}\_i$ is $1$ if $S$ contains an element that first occurs in $\mathbf{L}$ at position $i$.

We can construct $\mathbf{s}$ from $S$ and $\mathbf{L}$ using $O(m^2k)$ integer comparators or $O(m^2k^2)$ comparators for all $S$. Representing elements of $S$ in base 2, comparators can be constructed using $O(\lambda)$ boolean gates.

Now $C\_s$ can be transformed as you describe with each gate in $C\_s$ being implemented by $mk$ gates in $C\_b$.

An output $S\_{out}$ can be constructed from a boolean array $\mathbf{s}\_{out}$ by comparison with $\mathbf{L}$ using $O(mk)$ integer gates. To match output and input formats you can build an odd-even mergesort comparator network with $O(mk~log^2(mk))$ integer comparators per output.


---

