$A'$ (respectively, $B'$) by updating the colour of the vertex $v$ in $A$ (respectively, $B$) according to the distributions $\phi_A := \phi_A^v$ (respectively, $\phi_B := \phi_B^v$). The joint distribution on $(\phi_A, \phi_B)$ is chosen so as to maximise the probability that $A'(v) = B'(v)$. Call this maximised probability $p=p(v,A,B)$. It is not hard to see that $$1-p = \frac{1}{2}\sum_{c \in [q]} |\phi_A(c) - \phi_B(c)| = \|\phi_A - \phi_B \|_{TV}.$$ Observe that $p(v,A,B) = 1$ if $v=u$ or if $v$ is not a neighbour of $u$ (because in both cases, $A$ and $B$ assign the same colours to the neighbours of $v$ and so $\phi_A$ and $\phi_B$ are the same distribution).

Now assume that $v$ is a neighbour of $u$, so that $\phi_A$ and $\phi_B$ are different distributions. Without loss of generality, we may assume that $A(u)=1$ and $B(u)=2$. Let $a_i:=n(A,v,i)$, that is, $a_i$ is the number of neighbours of $v$ coloured $i$ by $A$. Similarly, let $b_i := n(B,v,i)$. Note that $b_1 = a_1 - 1$, $b_2 = a_2+1$ and $b_i = a_i$ for $i = 3, \ldots, q$. Define $$Z_A = \sum_{i=1}^q \lambda^{a_i} \:\:\:\:\: \text{and} \:\:\:\:\:
Z_B = \sum_{i=1}^q \lambda^{b_i} \,=\, Z_A + (1- \lambda^{-1})(\lambda^{a_2+1} - \lambda^{a_1}),$$ and assume 