# Mean-Field Stackelberg Game-Based Security Defense and Resource Optimization in Edge Computing
## 4 Mean-Field Games Equilibrium and Optimal Strategies
### Optimality for the \(N\) Defenders: \(\varepsilon\)-Nash Equilibrium  
In edge computing with large nodes, each defender node has the same system and it influences the choice of the strategy of another defender through the mean-field term. We can discuss the mean-field equilibrium in this case. We apply the optimal strategy (5) and the associated optimal state trajectory (6) to the \(N\) defenders. Let \(z(t)=\lim\limits_{N\to\infty}x^{N}(t)\), and  
\[p(t)=\lim\limits_{N\to\infty}p^{N}(t)\text{; hence, we have the following differential equations:  
\[dz(t)=\Big{[}a_{i}z(t)+b_{i}\Big{(}\beta_{i}^{-1}p(t)b_{i}-\beta_{i}^{-1} \lambda_{i}u_{0}(t)\Big{)}+c_{i}\|\overline{z}(t)-Az(t)\|^{2}+cu_{0}(t)\Big{]}dt \tag{16}\]  
\[dp(t)=[a_{i}p(t)+a_{i}(\overline{z}(t)-Az(t))]dt \tag{17}\]where \(\Xi(t)=\lim\limits_{N\rightarrow\infty}\x_{i}^{*N}(t)\), \(p(T)=0\), and \(E[x_{0}(0)]=x_{0}\). With the equations given in (13) and (14), the above equivalent representation can be re-written as  
\[dz(t)=\Big{[}\Big{(}a_{i}-\beta_{i}^{-1}b_{i}^{2}V_{i}(t)\Big{)}z(t)+\beta_{i}^{ -1}b_{i}^{2}\varphi(t)+c_{i}\|z(t)-Az(t)\|^{2}+\Big{(}c-\beta_{i}^{-1}\lambda_ {i}\Big{)}V_{i}(t)\Big{]}dt \tag{18}\]  
\[d\varphi(t)=\Big{[}\Big{(}a_{i}-\beta_{i}^{-1}b_{i}^{2}V_{i}(t)\Big{)}\varphi( t)-\phi_{i}Az(t)-V_{i}(t)\Big{(}\beta_{i}^{-1}\lambda-c\Big{)}u_{0}(t) \Big{]}dt \tag{19}\]  
where \(\varphi(t)=\lim\limits_{N\rightarrow\infty}\frac{1}{N}\sum\limits_{i=1}^{N} \varphi_{i}(t)\) and \(\varphi(T)=0\). While the pair \(\big{(}x_{i}^{*},u_{i}^{*}\big{)}\) is the optimal solution of the game, \((z,p)\) has a unique solution. Moreover, if the number of defenders \(N\) is large enough, we will obtain the mean-field approximate equilibrium solution, which is dependent on the strategy of the attacker.  
**Definition 1**.: _For any strategy \(u_{0}(t)\), the strategy set \(U=\{u_{1}(t),u_{2}(t),\cdots,u_{N}(t)\}\) is called to satisfy an \(\varepsilon\)-Nash equilibrium with respect to the cost \(J_{i}\) for any \(i\), if there exists\({}_{1}\geq 0\) such that for each defender \(i\), we have_  
\[J_{i}\big{(}u_{i}^{*},u_{-i}^{*},u_{0}\big{)}\leq\inf\
olimits_{u_{i}\in U_{i }(u_{0})}J_{i}\big{(}u_{i},u_{-i}^{*},u_{0}\big{)}+\varepsilon_{1} \tag{20}\]  
**Theorem 1**.: _For any strategy of the attacker, we have_  
\[\sup\limits_{0\leq t\leq T}E|x^{*}(t)-z(t)|^{2}=O\bigg{(}\frac{1}{N}\bigg{)} \tag{21}\]  
\[\big{|}J_{i}\big{(}u_{i}^{*},u_{-i}^{*},u_{0}\big{)}-J_{i}\big{(}u_{i},u_{-i} ^{*},u_{0}\big{)}\big{|}=O\bigg{(}\frac{1}{\sqrt{N}}+\frac{1}{N}\bigg{)} \tag{22}\]  
_Moreover, we have_  
\[E\!\int_{0}^{T}\|x^{*}(t)-z(t)\|^{2}=O\bigg{(}\frac{1}{N}\bigg{)} \tag{23}\]  
Proof.: We prove the first statement (22) because the second representation (23) can be proved similarly. By the state trajectory (16) and [PERSON]'s inequality, we have  
\[E|x^{*}(t)-z(t)|^{2}\,\sim E\bigg{|}\!\int_{0}^{T}(a_{i}-\alpha_{i})(x^{*}(t)- z(t))dt\bigg{|}=O\bigg{(}\frac{1}{N}\bigg{)} \tag{24}\]  
Thus, (21) is obtained.  
Applying Cauchy-Schwarz inequality, we have  
\[\begin{array}{l}\big{|}J_{i}\big{(}u_{i}^{*},u_{-i}^{*},u_{0}\big{)}-J_{i} \big{(}u_{i},u_{-i}^{*},u_{0}\big{)}\big{|}\\ =\Big{|}E\!\int_{0}^{T}\!\Big{[}\big{\|}Ax^{N}(t)-Az(t)\big{\|}^{2}+\big{(}x_{ i}^{*}(t)-z(t)\big{)}\alpha_{i}\big{(}Ax^{N}(t)-Az(t)\big{)}\Big{]}dt\Big{|}\\ \leq\alpha_{i}\|A\|\Big{(}E\!\int_{0}^{T}\|x_{i}^{*}(t)-z(t)\|^{2}dt\Big{)}^{ \frac{1}{2}}+O\Big{(}\frac{1}{N}\Big{)}\\ =O\Big{(}\frac{1}{\sqrt{N}}+\frac{1}{N}\Big{)}\end{array} \tag{25}\]  
Hence, we obtained the \(\varepsilon\)-Nash equilibrium for any defender \(i\), \(1\leq i\leq N\), that is,  
\[J_{i}\big{(}u_{i}^{*}(t),u_{-i}^{*}(t),u_{0}(t)\big{)}\leq\inf\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!