SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Figure 4: Illustration of intersecting hypercubes and hyperplanes in  $\mathbb{R}^2$ .
Clearly, the number of intersecting hypercubes is upper bounded by the number of intersecting edges. The rest of the proof is devoted to showing that this number is strictly smaller than  $p^N$  if  $p \geq 3NH$ , as this will imply the existence of at least one non-intersecting hypercube.
586   
587   
588   
589   
590   
591   
592   
593   
594   
595
To estimate the maximum number of intersecting edges, we analyze the maximum number of edges that a given hyperplane can intersect. For a fixed index  $1 \leq i \leq N$ , we count the number of edges of the form  $(x, x + \frac{1}{p}\mathbf{e}_i)$  intersected by a single hyperplane. The key observation is: if we fix all the coordinates of  $x$  except the  $i$ th one, then the edges  $(x, x + \frac{1}{p}\mathbf{e}_i)$  form a line in the ambient space. Among those edges, there are at most two intersecting edges with respect to the given hyperplane. This happens only when the hyperplane intersects an edge at one of its endpoints (e.g., the hyperplane  $\ell_2$  and the second vertical line in Figure 4). In total, for each  $1 \leq i \leq N$  and each given hyperplane, there are at most  $2(p + 1)^{N - 1}$  intersecting edges of the form  $(x, x + \frac{1}{p}\mathbf{e}_i)$ . For a given hyperplane, there are thus at most  $2N(p + 1)^{N - 1}$  intersecting edges in total (since  $i \in [[N]]$ ). Since the number of hyperplanes is at most  $H$ , there are at most  $2NH(p + 1)^{N - 1}$  intersecting edges, and this quantity also bounds the number of intersecting cubes as we have seen. With the assumption  $p \geq 3NH$ , we conclude by proving that  $p^N > 2NH(p + 1)^{N - 1}$ . Indeed, we have:
$$
\begin{array}{l} \frac {2 N H (p + 1) ^ {N - 1}}{p ^ {N}} = \frac {2 N H}{p} \left(\frac {p + 1}{p}\right) ^ {N - 1} = \frac {2 N H}{p} \left(1 + \frac {1}{p}\right) ^ {N - 1} <   \frac {2 N H}{p} \left(1 + \frac {1}{p}\right) ^ {N H} \\ \leq \frac {2 N H}{3 N H} \left(1 + \frac {1}{3 N H}\right) ^ {N H} \leq \frac {2 e ^ {1 / 3}}{3} \approx 0. 9 3 <   1 \\ \end{array}
$$
where we used that  $(1 + 1 / n)^n\leq e\approx 2.71828$  , the Euler number.
B.3 Proof of Theorem 3.4
Proof. We denote  $\mathbf{X} = [x_1, \ldots, x_P] \in \mathbb{R}^{N_0 \times P}$ , the matrix representation of  $\Omega$ . Our proof has three main steps:
Step 1: We show that we can reduce the study of the closedness of  $\mathcal{F}_{\mathbf{I}}(\Omega)$  to that of the closedness of a union of subsets of  $\mathbb{R}^P$ , associated to the vectors  $\mathbf{W}_2$ . To do this, we prove that for any element  $f \in \mathcal{F}_{\mathbf{I}}(\Omega)$ , there exists a set of parameters  $\theta \in \mathcal{N}_{\mathbf{I}}$  such that the matrix of the second layer  $\mathbf{W}_2$  belongs to  $\{-1,0,1\}^{1 \times N_1}$  (since we assume  $N_2 = 1$ ). This idea is reused from the proof of [1, Theorem 4.1].
For  $\theta \coloneqq \{(\mathbf{W}_i,\mathbf{b}_i)_{i = 1}^2\} \in \mathcal{N}_{\mathbf{I}}$  , the function  $\mathcal{R}(\theta)$  has the form:
$$
\mathcal {R} _ {\theta} (x) = \mathbf {W} _ {2} \sigma (\mathbf {W} _ {1} x + \mathbf {b} _ {1}) + \mathbf {b} _ {2} = \sum_ {i = 1} ^ {N _ {1}} \mathbf {w} _ {2, i} \sigma (\mathbf {w} _ {1, i} x + \mathbf {b} _ {1, i}) + \mathbf {b} _ {2}
$$
where  $\mathbf{w}_{1,i} = \mathbf{W}_1[i,:] \in \mathbb{R}^{1 \times N_0}$ ,  $\mathbf{w}_{2,i} = \mathbf{W}_2[i] \in \mathbb{R}$ ,  $\mathbf{b}_{1,i} = \mathbf{b}[i] \in \mathbb{R}$ . Moreover, if  $w_{2,i}$  is different from zero, we have:
$$
\mathbf {w} _ {2, i} \sigma (\mathbf {w} _ {1, i} x + \mathbf {b} _ {1}) = \frac {\mathbf {w} _ {2 , i}}{| \mathbf {w} _ {2 , i} |} \sigma (| \mathbf {w} _ {2, i} | \mathbf {w} _ {1, i} x + | \mathbf {w} _ {2, i} | \mathbf {b} _ {1, i}).
$$
In that case, one can assume that  $\mathbf{w}_{2,i}$  can be equal to either  $-1$  or  $1$ . Thus, we can assume  $\mathbf{w}_{2,i} \in \{\pm 1,0\}$ . For a vector  $\mathbf{v} \in \{-1,0,1\}^{1 \times N_1}$ , we define:
$$
F _ {\mathbf {v}} = \left\{\left[ \mathcal {R} _ {\theta} \left(x _ {1}\right), \dots , \mathcal {R} _ {\theta} \left(x _ {P}\right) \right] \mid \theta \in \mathcal {N} _ {\mathbf {I}, \mathbf {v}} \right\} \tag {14}
$$
where  $\mathcal{N}_{\mathbf{I},\mathbf{v}}\subseteq \mathcal{N}_{\mathbf{I}}$  is the set of  $\theta = \{(\mathbf{W}_i,\mathbf{b}_i)_{i = 1}^2\}$  with  $\mathbf{W}_2 = \mathbf{v}\in \{0,1\}^{1\times N_1}$ , i.e., in words,  $F_{\mathbf{v}}$  is the image of  $\Omega$  through the function  $\mathcal{R}_{\theta}$ ,  $\theta \in \mathcal{N}_{\mathbf{I},\mathbf{v}}$ .
Define  $\mathbb{V} := \{\mathbf{v} \mid \operatorname{supp}(\mathbf{v}) \subseteq I_2\} \cap \{0, \pm 1\}^{1 \times N_1}$ . Clearly, for  $\mathbf{v} \in \mathbb{V}$ ,  $F_{\mathbf{v}} \subseteq \mathcal{F}_{\mathbf{I}}(\Omega)$ . Therefore,
$$
\bigcup_ {\mathbf {v} \in \mathbb {V}} F _ {\mathbf {v}} \subseteq \mathcal {F} _ {\mathbf {I}} (\Omega).
$$
Moreover, by our previous argument, we also have:
$$
\mathcal {F} _ {\mathbf {I}} (\Omega) \subseteq \bigcup_ {\mathbf {v} \in \mathbb {V}} F _ {\mathbf {v}}.
$$
$$
\mathcal {F} _ {\mathbf {I}} (\Omega) = \bigcup_ {\mathbf {v} \in \mathbb {V}} F _ {\mathbf {v}}.
$$
602   
603   
604   
605   
606   
607   
608   
609   
610
Step 2: Using the first step, to prove that  $\mathcal{F}_{\mathbf{I}}(\Omega)$  is closed, it is sufficient to prove that  $F_{\mathbf{v}}$  is closed,  $\forall \mathbf{v} \in \mathbb{V}$ . This can be accomplished by further decomposing  $F_{\mathbf{v}}$  into smaller closed sets. We denote  $\theta'$  the set of parameters  $\mathbf{W}_1$ ,  $\mathbf{b}_1$  and  $\mathbf{b}_2$ . In the following, only the parameters of  $\theta'$  are varied since  $\mathbf{W}_2$  is now fixed to  $\mathbf{v}$ .
Due to the activation function  $\sigma$ , for a given data point  $x_{j} \in \Omega$ , we have:
$$
\sigma \left(\mathbf {W} x _ {j} + \mathbf {b} _ {1}\right) = \mathbf {D} _ {j} \left(\mathbf {W} x _ {j} + \mathbf {b} _ {1}\right) \tag {15}
$$
where  $\mathbf{D}_j\in \mathcal{D}$ , the set of binary diagonal matrices, and its diagonal coefficients  $\mathbf{D}_j[i,i]$  are determined by:
$$
\mathbf {D} _ {j} [ i, i ] = \left\{ \begin{array}{l l} 0 & \text {i f} \mathbf {W} [ i,: ] x _ {j} + \mathbf {b} _ {1} [ i ] \leq 0 \\ 1 & \text {i f} \mathbf {W} [ i,: ] x _ {j} + \mathbf {b} _ {1} [ i ] \geq 0 \end{array} . \right. \tag {16}
$$
Note that  $\mathbf{D}_j[i,i]$  can take both values 0 or 1 if  $\mathbf{W}[i,:]x_{j} + \mathbf{b}_{1}[i] = 0$ . We call the matrix  $\mathbf{D}_j$  the activation matrix of  $x_{j}$ . Therefore, for (15) to hold, the  $N_{1}$  constraints of the form (16) must hold simultaneously. It is important to notice that all these constraints are linear w.r.t.  $\theta^{\prime}$ . We denote  $\mathbf{z}$  a vectorized version of  $\theta^{\prime}$  (i.e., we concatenate all coefficients whose indices are in  $I_{1}$  of  $\mathbf{W}$  and  $\mathbf{b}_1,\mathbf{b}_2$  into a long vector), and we write all the constraints in (15) in a compact form:
$$
\mathcal {A} (\mathbf {D} _ {j}, x _ {j}) \mathbf {z} \leq \mathbf {0} _ {N _ {1}}
$$
where  $\mathcal{A}(\mathbf{D}_j,x_j)$  is a constant matrix that depend on  $\mathbf{D}_j$  and  $x_{j}$
Set  $\theta = (\mathbf{v},\mathbf{z})$  .Given that (15) holds, we deduce that:
$$
\mathcal {R} _ {\theta} \left(x _ {j}\right) = \mathbf {v} \sigma \left(\mathbf {W} x _ {j} + \mathbf {b} _ {1}\right) + \mathbf {b} _ {2} = \mathbf {v} \mathbf {D} _ {j} \left(\mathbf {W} x _ {j} + \mathbf {b} _ {1}\right) + \mathbf {b} _ {2} = \mathcal {V} \left(\mathbf {D} _ {j}, x _ {j}, \mathbf {v}\right) \mathbf {z}
$$
where  $\mathcal{V}(\mathbf{D}_j,x_j,\mathbf{v})$  is a constant matrix that depends on  $\mathbf{D}_j,\mathbf{v},x_j$ . In particular,  $\mathcal{R}_{\theta}(x_j)$  is also a linear function w.r.t the parameters  $\mathbf{z}$ . Assume that the activation matrices of  $(x_{1},\ldots ,x_{P})$  are  $(\mathbf{D}_1,\dots ,\mathbf{D}_P)$ , then we have:
$$
\mathcal {R} _ {\theta} (\Omega) = \left(\mathcal {V} \left(\mathbf {D} _ {1}, x _ {1}, \mathbf {v}\right) \mathbf {z}, \dots , \mathcal {V} \left(\mathbf {D} _ {P}, x _ {P}, \mathbf {v}\right) \mathbf {z}\right) \in \mathbb {R} ^ {1 \times P}.
$$
To emphasize that  $\mathcal{R}_{\theta}(\Omega)$  depends linearly on  $\mathbf{z}$ , for the rest of the proof, we will write  $\mathcal{R}_{\theta}(\Omega)$  as a vector of size  $P$  (instead of a row matrix  $1\times P$ ) as follows:
$$
\mathcal {R} _ {\theta} (\Omega) = \mathcal {V} (\mathbf {D} _ {1}, \ldots , \mathbf {D} _ {P}) \mathbf {z} \quad \text {w h e r e} \quad \mathcal {V} (\mathbf {D} _ {1}, \ldots , \mathbf {D} _ {P}) = \left( \begin{array}{c} \mathcal {V} (\mathbf {D} _ {1}, x _ {1}, \mathbf {v}) \\ \vdots \\ \mathcal {V} (\mathbf {D} _ {P}, x _ {P}, \mathbf {v}) \end{array} \right).
$$
Moreover, to have  $(\mathbf{D}_1,\dots ,\mathbf{D}_P)$  activation matrices, the parameters  $\mathbf{z}$  need to satisfy:
$$
\mathcal {A} (\mathbf {D} _ {1}, \dots , \mathbf {D} _ {P}) \mathbf {z} \leq \mathbf {0} _ {Q}
$$
where  $Q = PN_{1}$  and
$$
\mathcal {A} (\mathbf {D} _ {1}, \ldots , \mathbf {D} _ {P}) = \left( \begin{array}{c} \mathcal {A} (\mathbf {D} _ {1}, x _ {1}) \\ \vdots \\ \mathcal {A} (\mathbf {D} _ {P}, x _ {P}) \end{array} \right).
$$
Thus, the set of  $\mathcal{R}_{\theta}(\Omega)$  given the activation matrices  $(\mathbf{D}_1,\dots ,\mathbf{D}_P)$  has the following compact form:
$$
F _ {\mathbf {v}} ^ {(\mathbf {D} _ {1}, \dots , \mathbf {D} _ {P})} := \{\mathcal {V} (\mathbf {D} _ {1}, \dots , \mathbf {D} _ {P}) \mathbf {z} \mid \mathcal {A} (\mathbf {D} _ {1}, \dots , \mathbf {D} _ {P}) \mathbf {z} \leq \mathbf {0} \}.
$$
Clearly,  $F_{\mathbf{v}}^{(\mathbf{D}_1,\dots,\mathbf{D}_P)} \subseteq F_{\mathbf{v}}$  since each element is equal to  $\mathcal{R}_{\theta}(\Omega)$  with  $\theta = (\mathbf{v},\mathbf{z})$  for some  $\mathbf{z}$ . On the other hand, each element of  $F_{\mathbf{v}}$  is an element of  $F_{\mathbf{v}}^{(\mathbf{D}_1,\dots,\mathbf{D}_P)}$  for some  $(\mathbf{D}_1,\ldots ,\mathbf{D}_P) \in \mathcal{D}^P$  since the set of activation matrices corresponding to any  $\theta$  is in  $\mathcal{D}^P$ . Therefore,
$$
F_{\mathbf{v}} = \bigcup_{(\mathbf{D}_{1},\ldots ,\mathbf{D}_{P})\in \mathcal{D}^{P}}F_{\mathbf{v}}^{(\mathbf{D}_{1},\ldots ,\mathbf{D}_{P})}.
$$
615   
616   
617   
618   
619   
620   
621
Step 3: Using the previous step, it is sufficient to prove that  $F_{\mathbf{v}}^{(\mathbf{D}_1,\dots,\mathbf{D}_P)}$  is closed, for any  $\mathbf{v}, (\mathbf{D}_1,\ldots,\mathbf{D}_P) \in \mathcal{D}^P$ . To do so, we write  $F_{\mathbf{v}}^{(\mathbf{D}_1,\dots,\mathbf{D}_P)}$  in a more general form:
$$
\left\{\mathbf {A} \mathbf {z} \mid \mathbf {C} \mathbf {z} \leq \mathbf {y} \right\}. \tag {17}
$$
Therefore, it is sufficient to prove that a set as in Equation (17) is closed. These sets are linear transformations of an intersection of a finite number of half-spaces. Since the intersection of a finite number of halfspaces is stable under linear transformations (cf. Lemma B.5 below), and the intersection of a finite number of half-spaces is a closed set itself, the proof can be concluded.  $\square$
Lemma B.5 (Closure of intersection of half-spaces under linear transformations). For any  $\mathbf{A} \in \mathbb{R}^{m \times n}$ ,  $\mathbf{C} \in \mathbb{R}^{\ell \times n}$ ,  $\mathbf{y} \in \mathbb{R}^{\ell}$ , there exists  $\mathbf{C}' \in \mathbf{R}^{k \times m}$ ,  $\mathbf{b}' \in \mathbf{R}^k$  such that:
$$
\left\{\mathbf {A} \mathbf {x} \mid \mathbf {C} \mathbf {x} \leq \mathbf {y} \right\} = \left\{\mathbf {C} ^ {\prime} \mathbf {z} \leq \mathbf {b} ^ {\prime} \right\}.
$$
Proof. The proof uses Fourier-Motzkin elimination  $^{4}$ . This method is a quantifier elimination algorithm for linear functions  $^{5}$ . In fact, the LHS can be written as:  $\{\mathbf{t} \mid \mathbf{t} = \mathbf{A}\mathbf{x}, \mathbf{C}\mathbf{x} \leq \mathbf{y}\}$ , or more generally,
$$
\left\{\mathbf {t} \mid \exists \mathbf {x} \in \mathbb {R} ^ {n} \text {s . t .} \mathbf {B} \left( \begin{array}{c} \mathbf {x} \\ \mathbf {t} \end{array} \right) \leq \mathbf {v} \right\} \subseteq \mathbb {R} ^ {m}
$$
where  $\left( \begin{array}{l} \mathbf{x} \\ \mathbf{t} \end{array} \right)$  is the concatenation of two vectors  $(\mathbf{x}, \mathbf{t})$  and the linear constraints imposed by  $\mathbf{B}\left( \begin{array}{l} \mathbf{x} \\ \mathbf{t} \end{array} \right) \leq \mathbf{v}$  replace the two linear constraints  $\mathbf{C}\mathbf{x} \leq \mathbf{y}$  and  $\mathbf{t} = \mathbf{A}\mathbf{x}$ . The idea is to show that:
$$
\left\{\mathbf {t} \mid \exists \mathbf {x} \in \mathbb {R} ^ {n} \text {s . t .} \mathbf {B} \binom {\mathbf {x}} {\mathbf {t}} \leq \mathbf {v} \right\} = \left\{\mathbf {t} \mid \exists \mathbf {x} ^ {\prime} \in \mathbb {R} ^ {n - 1} \text {s . t .} \mathbf {B} ^ {\prime} \binom {\mathbf {x} ^ {\prime}} {\mathbf {t}} \leq \mathbf {v} ^ {\prime} \right\} \tag {18}
$$
for some matrix  $\mathbf{B}'$  and vector  $\mathbf{v}'$ . By doing so, we reduce the dimension of the quantified parameter  $\mathbf{x}$  by one. By repeating this procedure until there is no more quantifier, we prove the lemma. The rest of this proof is thus devoted to show that  $\mathbf{B}', \mathbf{v}'$  as in (18) do exist.
We will show how to eliminate the first coordinate of  $\mathbf{x}[1]$ . First, we partition the set of linear constraints of LHS of (18) into three groups:
1.  $S_0 \coloneqq \{j \mid \mathbf{B}[j, 1] = 0\}$ : In this case,  $\mathbf{x}[1]$  does not appear in this constraint, there is nothing to do.
2.  $S_{+} \coloneqq \{j \mid \mathbf{B}[j,1] > 0\}$ , for  $j \in S_{+}$ , we can rewrite the constraints  $\mathbf{B}[j,:]\left(\begin{array}{c}\mathbf{x}\\ \mathbf{t}\end{array}\right) \leq \mathbf{v}[j]$  as:
$$
\mathbf {x} [ 1 ] \leq \gamma [ j ] + \sum_ {i = 2} ^ {n} \alpha [ i ] \mathbf {x} [ i ] + \sum_ {i = 1} ^ {m} \beta [ i ] \mathbf {t} [ i ] := B _ {j} ^ {+} (\mathbf {x} ^ {\prime}, \mathbf {t})
$$
for some suitable  $\gamma[j], \alpha[i], \beta[i]$  where  $\mathbf{x}'$  is the last  $(n-1)$  coordinate of the vector  $\mathbf{x}$ .
3.  $S_{-}:= \{j\mid \mathbf{B}[j,1] < 0\}$  : for  $j\in S_{-}$  , we can rewrite the constraints  $\mathbf{B}[j,:]\bigl {(} \begin{array}{c}\mathbf{x}\\ \mathbf{t} \end{array} \bigr)\leq \mathbf{v}_j$  as:
$$
\mathbf {x} [ 1 ] \geq \gamma [ j ] + \sum_ {i = 2} ^ {n} \alpha [ i ] \mathbf {x} [ i ] + \sum_ {i = 1} ^ {m} \beta [ i ] \mathbf {t} [ i ] := B _ {j} ^ {-} \left(\mathbf {x} ^ {\prime}, \mathbf {t}\right).
$$
For the existence of such  $\mathbf{x}[1]$ , it is necessary and sufficient that:
$$
B _ {k} ^ {+} \left(\mathbf {x} ^ {\prime}, \mathbf {t}\right) \geq B _ {j} ^ {-} \left(\mathbf {x} ^ {\prime}, \mathbf {t}\right), \quad \forall k \in S _ {+}, j \in S _ {-}. \tag {19}
$$
Thus, we form the matrix  $\mathbf{B}'$  and the vector  $\mathbf{v}'$  such that the linear constraints written in the following form:
$$
\mathbf {B} ^ {\prime} \left( \begin{array}{c} \mathbf {x} ^ {\prime} \\ \mathbf {t} \end{array} \right) \leq \mathbf {v} ^ {\prime}
$$
represent all the linear constraints in the set  $S_0$  and those in the form of (19). Using this procedure recursively, one can eliminate all quantifiers and prove the lemma.
625   
626   
627   
628   
629   
630   
631   
632   
633   
634   
635   
636   
637   
638   
639   
640   
641
4More detail about this method can be found in this link
In fact, the algorithm determining the closedness of  $\mathcal{L}_{\mathbf{I}}$  is also a quantifier elimination one, but it can be used in a more general setting: polynomials
B.4 Proofs for Lemma 3.3
Since we use tools of real algebraic geometry, this section provides basic notions of real algebraic geometry for readers who are not familiar with this domain. It is organized and presented as in the textbook [2] (with slight modifications to better suit our needs). For a more complete presentation, we refer readers to [2, Chapter 2].
Definition B.1 (Semi-algebraic sets). A semi-algebraic set of  $\mathbb{R}^n$  has the form:
$$
\bigcup_ {i = 1} ^ {k} \{x \in \mathbb {R} ^ {n} \mid P _ {i} (x) = 0 \wedge \bigwedge_ {j = 1} ^ {\ell_ {i}} Q _ {i, j} (x) > 0 \}
$$
where  $P_{i},Q_{i,j}:\mathbb{R}^{n}\mapsto \mathbb{R}$  are polynomials and  $\wedge$  is the "and" logic.
The following theorem is known as the projection theorem of semi-algebraic sets. In words, the theorem states that: The projection of a semi-algebraic set to a lower dimension is still a semi-algebraic set (of lower dimension).
Theorem B.6 (Projection theorem of semi-algebraic sets [2, Theorem 2.92]). Let  $A$  be a semi-algebraic set of  $\mathbb{R}^n$  and define:
$$
B = \left\{\left(x _ {1}, \dots , x _ {n - 1}\right) \mid \exists x _ {n}, \left(x _ {1}, \dots , x _ {n - 1}, x _ {n}\right) \in A \right\}
$$
then  $B$  is a semi-algebraic set of  $\mathbb{R}^{n - 1}$
Theorem B.6 is a powerful result. Its proof [2, Section 2.4] (which is constructive) shows a way to express  $B$  (in Theorem B.6) by using only the first  $n - 1$  variables  $(x_{1},\ldots ,x_{n - 1})$ .
Next, we introduce the language of an ordered field and sentence. Readers which are not familiar to the notion of ordered field can simply think of it as  $\mathbb{R}$  and its subring as  $\mathbb{Q}$ . Example for fields that is not ordered is  $\mathbb{C}$  (we cannot compare two arbitrary complex numbers). Therefore, the notion of semi-algebraic set in Definition B.1 (which contains  $Q_{i,j}(x) > 0$ ) does not make sense when the underlying field is not ordered.
The central definition of the language of  $\mathbb{R}$  is formula, an abstraction of semi-algebraic sets. In particular, the definition of formula is recursive: formula is built from atoms - equalities and inequalities of polynomials whose coefficients are in a subring  $\mathbb{Q}$  of  $\mathbb{R}$ . It can be also formed by combining with logical connectives "and", "or", and "negation"  $(\land, \lor, \neg)$  and existential/universal quantifiers  $(\exists, \forall)$ . Formula has variables, which are those of atoms in the formula itself. Free variables of a formula are those which are not preceded by a quantifier  $(\exists, \forall)$ . The definitions of a formula and its free variables are given recursively as follow:
Definition B.2 (Language of the ordered field with coefficients in a ring). Consider  $\mathbf{R}$  an ordered field and  $\mathbf{Q} \subseteq \mathbf{R}$  a subring, a formula  $\Phi$  and its set of free variables  $\operatorname{Free}(X)$  are defined recursively as:
1. An atom: if  $P \in \mathbf{Q}[X]$  (where  $\mathbf{Q}[X]$  is the set of polynomials with coefficients in  $\mathbf{Q}$ ) then  $\Phi := (P = 0)$  (resp.  $\Phi := (P > 0)$ ) is a formula and its set of free variables is  $\mathrm{Free}(\Phi) := \{X_1, \ldots, X_n\}$  where  $n$  is the number of variables.
2. If  $\Phi_1$  and  $\Phi_2$  are formulas, then so are  $\Phi_1 \vee \Phi_2$ ,  $\Phi_1 \wedge \Phi_2$  and  $\neg \Phi_1$ . The set of free variables is defined as:
(a)  $\mathrm{Free}(\Phi_1\vee \Phi_2)\coloneqq \mathrm{Free}(\Phi_1)\cup \mathrm{Free}(\Phi_2).$
(b)  $\mathrm{Free}(\Phi_1\wedge \Phi_2)\coloneqq \mathrm{Free}(\Phi_1)\cup \mathrm{Free}(\Phi_2).$
(c)  $\mathrm{Free}(\neg \Phi_1) = \mathrm{Free}(\Phi_1)$ .
3. If  $\Phi$  is a formula and  $X \in \mathrm{Free}(\Phi)$ , then  $\Phi' = (\exists X) \Phi$  and  $\Phi'' = (\forall X) \Phi$  are also formulas and  $\mathrm{Free}(\Phi') := \mathrm{Free}(\Phi) \setminus \{X\}$ , and  $\mathrm{Free}(\Phi'') := \mathrm{Free}(\Phi) \setminus \{X\}$ .
Definition B.3 (Sentence). A sentence is a formula of an ordered field with no free variable.
Example B.1. Consider two formulas:
$$
\begin{array}{l} \Phi_ {1} = \left\{\exists X _ {1}, X _ {1} ^ {2} + X _ {2} ^ {2} = 0 \right\} \\ \Phi_ {2} = \left\{\exists X _ {1}, \exists X _ {2}, X _ {1} ^ {2} + X _ {2} ^ {2} = 0 \right\} \\ \end{array}
$$
642   
643   
644   
645   
646   
647   
648   
649   
650   
651   
652   
653   
654   
655   
656   
657   
658   
659   
660   
661   
662   
663   
664   
665   
666   
667   
668   
669   
670   
671   
672   
673   
674   
675   
676   
677   
678   
679
While  $\Phi_1$  is a normal formula,  $\Phi_2$  is a sentence and given an underlying field  $(\mathbb{R},\text{for instance})$ ,  $\Phi_2$  is either correct or not. Here,  $\Phi_2$  is correct (since  $X_1^2 + X_2^2 = 0$  has a root  $(0,0)$ ). Nevertheless, if one consider  $\Phi_2' = \{\exists X_1, \exists X_2, X_1^2 + X_2^2 = -1\}$ , then  $\Phi_2'$  is not correct.
An algorithm deciding whether a sentence is correct or not is very tempting since formula and sentence can be used to express many theorems in the language of an ordered field. The proof or disproof will be then given by an algorithm. Such an algorithm does exist, as follow:
Theorem B.7 (Decision problem [2, Algorithm 11.36]). There exists an algorithm to decide whether a given sentence is correct is not with complexity  $O(sd)^{O(1)^{k-1}}$  where  $s$  is the bound on the number of polynomials in  $\Phi$ ,  $d$  is the bound on the degrees of the polynomials in  $\Phi$  and  $k$  is the number of variables.
A full description of [2, Algorithm 11.36] (quantifier elimination algorithm) is totally out of the scope of this paper. Nevertheless, we will try to explain it in a concise way. The key observation is Theorem B.6, the central result of real algebraic geometry. As discussed right after Theorem B.6, its proof implies that one can replace a sentence by another whose number of quantifiers is reduced by one such that both sentences agree (both are true or false). Applying this procedure iteratively will result into a sentence without any variable (and the remain are only coefficients in the subring). We check the correctness of this final sentence by trivially verifying all the equalities/inequalities and obtain the answer for the original one.
Proof of Lemma 3.3. To decide whether  $\mathcal{L}_{\mathbf{I}}$  is closed or not, it is equivalent to decide if the following sentence (see Definition B.3) is true or false:
$$
\begin{array}{l} \exists \mathbf {A}, (\forall \mathbf {X} _ {L}, \dots , \mathbf {X} _ {1}, P (\mathbf {A}, \mathbf {X} _ {L}, \dots , \mathbf {X} _ {1}) > 0) \wedge \\ (\forall \epsilon > 0, \exists \mathbf {X} _ {L} ^ {\prime}, \dots , \mathbf {X} _ {1} ^ {\prime}, P (\mathbf {A}, \mathbf {X} _ {L} ^ {\prime}, \dots , \mathbf {X} _ {1} ^ {\prime}) - \epsilon <   0) \\ \end{array}
$$
where  $P(\mathbf{A},\mathbf{X}_1,\ldots ,\mathbf{X}_L)\coloneqq \sum_{(i,j)}(\mathbf{A}[i,j] - P_{i,j}^{\mathbf{I}}(\mathbf{X}_L,\ldots ,\mathbf{X}_1))^2$
This sentence basically asks whether there exists a matrix  $\mathbf{A} \in \overline{\mathcal{F}}_{\mathbf{I}} \setminus \mathcal{F}_{\mathbf{I}}$  or not. It can be proved that this sentence can be decided to be true or false using real algebraic geometry tools (see Theorem B.7), with a complexity  $O\left((sd)^{C^{k-1}}\right)$  where  $C$  is a universal constant and  $s, d, k$  are the number of polynomials, the maximum degree of the polynomials and the number of variables in the sentence, respectively. Applying this to our case, we have  $s = 2, d = 2L, k = N_L N_0 + 1 + 2 \sum_{\ell=1}^{L} |I_\ell|$  (remind that  $|I_\ell|$  is the total number of unmasked coefficients of  $\mathbf{X}_\ell$ ).
B.5 Polynomial algorithm to detect support constraints  $\mathbf{I} = (I,J)$  with non-closed  $\mathcal{L}_{\mathbf{I}}$
The following sufficient condition for non-closedness is based on the existence in the support constraint of  $2 \times 2$  blocks sharing the essential properties of a  $2 \times 2$  LU support constraint.
Lemma B.8. Consider a pair  $\mathbf{I} = (I,J)\in \{0,1\}^{m\times r}\times \{0,1\}^{r\times n}$  of support constraints for the weight matrices of one-hidden-layer neural network. If there exists four indices  $1\leq i_{1},i_{2}\leq m,1\leq j_{1},j_{2}\leq n$  and two indices  $k\neq l,1\leq k,l\leq r$  such that:
1. For each pair  $(i,j) \in \{(i_1,j_1),(i_1,j_2),(i_2,j_1)\}$  we have: