My question is similar to this one and almost identical with this. I am so confused due to indexing and could not make sure if I could apply the solution in here to this indexed version as shown below.
The Question:
Let binary variables $x_{ijk},y_{jik}\in\{0,1\}$, non-negative continuous variable $z_j\in\mathbb{R}^+$, the parameter $\lambda_k\in\mathbb{R}^+$, and $\mathcal{I}$, $\mathcal{J}$, and $\mathcal{K}$ be some polynomial size sets. Given these domains, how can I linearize the following set of equality constraints?
$$\displaystyle z_j=\sqrt{\sum_{\substack{i\in \mathcal{I},\\k\in \mathcal{K}}}\lambda_k\left(x_{ijk}+y_{jik}\right)}\qquad j\in\mathcal{J}$$
Solution Attempt:
As in here, can I say: for $n\in \{0,1,2\}$, introduce binary variables $w_{ijkn}$ to indicate whether $x_{ijk}+y_{jik}=n$, and introduce the following constraints?
\begin{align}\sum_{n=0}^2w_{ijkn}&=1 \qquad \forall i\in \mathcal{I},j\in \mathcal{J}, k\in \mathcal{K}\\\sum_{n=0}^2 n\cdot w_{ijkn}&= x_{ijk}+y_{jik}\qquad \forall i\in \mathcal{I},j\in \mathcal{J}, k\in \mathcal{K}\\z_j&= \sum_{\substack{i\in \mathcal{I},\\k\in \mathcal{K}}}\sqrt{\lambda_k}\sum_{n=0}^2 \sqrt{n}\cdot w_{ijkn} \qquad \forall j\in \mathcal{J}\end{align}