## 4 Convex Minimization Problem  
In this section we state the monitoring problem as a convex minimization problem. For an appropriate analysis background we refer the interested reader to the classical monograph [14]. For the relevant convex analysis material see [15]. Consider the following optimization problem:  
**Problem 4.1**: _For a function \(K\ :\ \mathbf{R}^{d+nd}\rightarrow\mathbf{R}\) concave with respect to the first \(d\) variables \(\lambda_{1},\ldots,\lambda_{d}\) and convex with respect to the last \(nd\) variables \(x_{1},\ldots,x_{nd}\), solve_  
\[\inf_{\mathbf{x}}\sup_{\boldsymbol{\lambda}}K(\boldsymbol{\lambda},\mathbf{x}) \tag{11}\]  
A solution for Problem 4.1 with appropriately selected \(K(\boldsymbol{\lambda},\mathbf{x})\) concludes the section. The connection between Problem 4.1, and the monitoring problem is explained next. Let \(B\) be a \(d\times nd\) matrix made of \(n\) blocks, where each block is the \(d\times d\) identity matrix multiplied by \(\dfrac{1}{n}\), so that for a set of \(n\) vectors \(\{\mathbf{v}_{1},\ldots,\mathbf{v}_{n}\}\) in \(\mathbf{R}^{d}\) one has  
\[B\mathbf{w}=\dfrac{\mathbf{v}_{1}+\ldots+\mathbf{v}_{n}}{n}\text{ where }\mathbf{w}^{T}=\left(\mathbf{v}_{1}^{T},\ldots,\mathbf{v}_{n}^{T}\right) \tag{12}\]  
Assume that inequality Equation \((1)\) holds for the vector \(\mathbf{w}\), _i.e._, \(f\left(B\mathbf{w}\right)>0\). We are looking for a vector \(\mathbf{x}\) \"nearest\" to \(\mathbf{w}\) so that \(f\left(B\mathbf{x}\right)=0\), _i.e._, \(B\mathbf{x}=\mathbf{z}\) for some \(\mathbf{z}\in Z_{f}\) (where \(Z_{f}\) is the zero set of \(f\), _i.e._, \(Z_{f}=\{\mathbf{z}\ :\ f(\mathbf{z})=0\}\)). We now fix \(\mathbf{z}\in Z_{f}\) and denote the distance from \(\mathbf{w}\) to the set \(\{\mathbf{x}\ :\ \ B\mathbf{x}=\mathbf{z}\}\) by \(r(\mathbf{z})\). Note that for each \(\mathbf{y}\) inside the ball of radius \(r(\mathbf{z})\) centered at \(\mathbf{w}\), one has \(B\mathbf{y}\
eq\mathbf{z}\). If \(\mathbf{y}\) belongs to a ball of radius \(r=\inf_{\mathbf{z}\in Z_{f}}r(\mathbf{z})\) centered at \(\mathbf{w}\), then the inequality \(f\left(B\mathbf{y}\right)>0\) holds true. Let \(F(\mathbf{x})\) be a \"norm\" on \(\mathbf{R}^{nd}\) (specific functions \(F\) we run the numerical experiments with will be described later). The nearest \"bad\" vector problem described above is the following. **Problem 4.2**: _For \(\mathbf{z}\in Z_{f}\) identify_  
\[r(\mathbf{z})=\inf_{\mathbf{x}}F(\mathbf{x}-\mathbf{w})\text{ subject to }B\mathbf{x}=\mathbf{z} \tag{13}\]We note that Equation (13) is equivalent to \(\inf_{\mathbf{x}}\left[\sup_{\boldsymbol{\lambda}}\left\{F\left(\mathbf{x}- \mathbf{w}\right)-\boldsymbol{\lambda}^{T}\left(B\mathbf{x}-\mathbf{z}\right) \right\}\right].\) The function  
\[K(\boldsymbol{\lambda},\mathbf{x})=F\left(\mathbf{x}-\mathbf{w}\right)- \boldsymbol{\lambda}^{T}\left(B\mathbf{x}-\mathbf{z}\right)\]  
is concave (actually linear) in \(\boldsymbol{\lambda}\), and convex in \(\mathbf{x}\). Hence (see e.g., [15])  
\[\inf_{\mathbf{x}}\left[\sup_{\boldsymbol{\lambda}}\left\{F\left(\mathbf{x}- \mathbf{w}\right)-\boldsymbol{\lambda}^{T}\left(B\mathbf{x}-\mathbf{z}\right) \right\}\right]=\sup_{\boldsymbol{\lambda}}\left[\inf_{\mathbf{x}}\left\{F \left(\mathbf{x}-\mathbf{w}\right)-\boldsymbol{\lambda}^{T}\left(B\mathbf{x}- \mathbf{z}\right)\right\}\right]\]  
The right hand side of the above equality can be conveniently written as follows  
\[\sup_{\boldsymbol{\lambda}}\left[\inf_{\mathbf{x}}\left\{F\left(\mathbf{x}- \mathbf{w}\right)-\boldsymbol{\lambda}^{T}\left(B\mathbf{x}-\mathbf{z}\right) \right\}\right]=\]  
The conjugate \(g^{*}(\mathbf{y})\) of a function \(g(\mathbf{x})\) is defined by \(g^{*}(\mathbf{y})=\sup_{\mathbf{x}}\left\{\mathbf{y}^{T}\mathbf{x}-g( \mathbf{x})\right\}\) (see e.g., [15]).