[step:Compute the bounded-differences constant for replacing a single $X$-coordinate]Fix $k \in \{1, \dots, m\}$ and let $Z' = (X_1, \dots, X_{k-1}, X_k', X_{k+1}, \dots, X_m, Y_1, \dots, Y_m)$ differ from $Z$ only in the $k$-th $X$-coordinate. We bound
\begin{align*}
|F(Z) - F(Z')| \le c_k.
\end{align*}
Replacing $X_k$ affects only those terms in $F$ that involve $X_k$ — namely the terms $k_\phi(X_k, X_j)$ and $k_\phi(X_j, X_k)$ in the first sum, and $k_\phi(X_k, Y_j)$ in the cross sum.
**First sum (within-$X$ off-diagonal):** The pairs containing index $k$ are $\{(k, j) : j \neq k\} \cup \{(j, k) : j \neq k\}$, totalling $2(m-1)$ ordered pairs. Each $k_\phi$ value lies in $[-M, M]$, so the change in any single term is at most $2M$. Hence
\begin{align*}
\left| \frac{1}{m(m-1)} \sum_{i \neq j} k_\phi(X_i, X_j) - \frac{1}{m(m-1)} \sum_{i \neq j} k_\phi(X_i', X_j') \right| \le \frac{2(m-1) \cdot 2M}{m(m-1)} = \frac{4M}{m},
\end{align*}
where we use the convention $X_i' = X_i$ for $i \neq k$.
**Cross sum:** The terms containing $X_k$ are $\{(k, j) : 1 \le j \le m\}$, totalling $m$ pairs, each shifted by at most $2M$. The cross term carries a coefficient of $-2/m^2$, so
\begin{align*}
\left| -\frac{2}{m^2} \sum_{i, j} k_\phi(X_i, Y_j) + \frac{2}{m^2} \sum_{i, j} k_\phi(X_i', Y_j) \right| \le \frac{2 \cdot m \cdot 2M}{m^2} = \frac{4M}{m}.
\end{align*}
**Within-$Y$ sum:** Unchanged.
By the triangle inequality,
\begin{align*}
|F(Z) - F(Z')| \le \frac{4M}{m} + \frac{4M}{m} = \frac{8M}{m}.
\end{align*}
Thus $c_k = 8M/m$ for $k \in \{1, \dots, m\}$ (the $X$-coordinates).[/step]