# Securing Relay Networks with Artificial Noise: An Error Performance-Based Approach +
## Appendix A Proof of Theorem 1  
In the following, we base our proof on the concept of linear programming and the Karush-Kuhn-Tucker (KKT) optimality conditions ([52], p. 243). Before proceeding, note that for a discrete realization \(x_{1}\) with probability \(p\), one can express \(f(x)\) at \(x_{1}\) as,  
\[f(x)=p\delta\left(x-x_{1}\right). \tag{10}\]  
If a PDF \(f(x)\), which solves the problem in Equation (20), has the form of \(f(x)=\delta\left(x-x_{0}\right)\), we can easily obtain \(x_{0}=\overline{P}\), as \(\widetilde{\text{SER}}\left(x\right)\) in Equation (19) is a monotonically increasing function. This case is trivially contained in Theorem 1. In the following, we will assume that \(f(x)>0\) for at least two different values of \(x\). In this case, at the optimum, the constraint in Equation (20b) must be met with equality as otherwise we can further increase the objective function in Equation (20a) by increasing \(f(x_{1})\) and decreasing \(f(x_{2})\) for some \(x_{1}>x_{2}\) without violating any constraint, which contradicts to the optimality assumption. If the optimal distribution \(f(x)\) corresponds to that of a discrete random variable with \(n\) realizations, \(f(x)\) can be expressed as,  
\[f(x)=\sum_{i=1}^{n}p_{i}\delta\left(x-x_{i}\right) \tag{11}\]  
where \(\sum_{i=1}^{n}p_{i}=1\) and \(p_{i}>0\). Inserting Equation (11) into Equations (20a)-(20c), we can obtain the following system of linear equations:  
\[\alpha_{1}p_{1}+\alpha_{2}p_{2}+\cdots+\alpha_{n}p_{n} =b \tag{12a}\] \[\beta_{1}p_{1}+\beta_{2}p_{2}+\cdots+\beta_{n}p_{n} =\overline{P}\] (12b) \[p_{1}+p_{2}+\cdots+p_{n} =1 \tag{12c}\]  
where \(\alpha_{i}=\widetilde{\text{SER}}\left(\sqrt{x_{i}}\right)\), \(\beta_{i}=x_{i}\), and \(0\leq p_{i}\leq 1\) with \(i=1,\ldots,n\). The achieved maximum value of the objective function in Equation (20a) is denoted as \(b\). If the optimal PDF \(f(x)\) contains at least one interval \([x_{a},x_{b}]\) with \(f(x)>0\) for any \(x\in[x_{a},x_{b}]\), we can divide \([x_{a},x_{b}]\) into \(m\) non-overlapping sub-intervals \((\hat{x}_{m-1},\hat{x}_{m})\) with \(x_{a}=\hat{x}_{0}<\hat{x}_{1}<\cdots<\hat{x}_{m}=x_{b}\). Then, following the first mean value theorem ([53], Theorem 12.111), we can find some \(\tilde{x}_{i}\) and \(\overline{x}_{i}\) with \(\hat{x}_{i-1}\leq\tilde{x}_{i}\leq\hat{x}_{i}\) and, \(\hat{x}_{i-1}\leq\overline{x}_{i}\leq\hat{x}_{i}\) such that,  
\[p_{i}=\int_{\hat{x}_{i-1}}^{\hat{x}_{i}}f(x)\;\mathrm{d}x \tag{13}\]  
\[\int_{x_{a}}^{x_{b}}\widetilde{\text{SER}}\left(\sqrt{x}\right)f\left(x\right) \;\mathrm{d}x=\sum_{i=1}^{m}\widetilde{\text{SER}}\left(\sqrt{\tilde{x}_{i}} \right)p_{i} \tag{14}\]  
and,  
\[\int_{x_{a}}^{x_{b}}xf(x)\;\mathrm{d}x=\sum_{i=1}^{m}\overline{x}_{i}p_{i}. \tag{15}\]Denoting \(\widetilde{\text{SER}}\left(\sqrt{\tilde{x}_{i}}\right)\) and \(\overline{x}_{i}\) as \(\alpha_{i}\) and \(\beta_{i}\) in this case and repeating the approach for all intervals on which \(f(x)>0\), we can again obtain a system of linear equations in the form of Equation (A3). Note that \(\hat{x}_{i}\to\hat{x}_{i-1}\) as the number of sub-intervals \(m\) increases. In this case we have \(\overline{x}_{i}\simeq\tilde{x}_{i}\simeq\hat{x}_{i-1}\simeq\hat{x}_{i-1}\). Further, as \(\widetilde{\text{SER}}\left(x\right)\) is a monotonically increasing function, we can order the coefficients such that \(\alpha_{1}\leq\alpha_{2}\leq\cdots\leq\alpha_{n}\) and \(\beta_{1}\leq\beta_{2}\leq\cdots\leq\beta_{n}\). Then, as \(0\leq p_{i}\leq 1\) for all \(i=1,\cdots,n\), Equations (A3b) and (A3c) indicate that \(\beta_{n}\geq\overline{P}\).