Let $G=([n], E)$ be a finite graph with degree sequence $d=(d_v)_{v\in [n]}$. Assume $d_v\ge 1\;\forall v\in [n]$. Let $X_n$ be the degree of a vertex drawn uniformly at random from $[n]$, and $Y_n$ be the degree of a uniformly drawn neighbour of this vertex. Then
$$\mathbb E[Y_n]\ge \mathbb E[X_n],$$ the inequality being strict unless all degrees are equal.
I was trying to understand the proof from This book where the proof goes like this:
The joint law of $(X_n, Y_n)$ is $$\mathbb P [X_n= k, Y_n=l]=\frac{1}{n}\sum_{(u,v)\in E'} \mathbb 1_{\{d_u=k, d_v=l\}}\frac{1}{d_u}$$, Where the sum is over all directed edges $E'$; i.e., we now consider $(u,v)$ to be a different edge than $(v,u)$, and we notice that, given that $u$ is chosen as the uniform vertex, the probability that its neighbour is chosen is $\frac{1}{d_u}$.
Could anyone explain the indicator function used on the right side of the equality? Also, I did not understand how to find the quantity $\mathbb E[X_n]$ and $\mathbb E[Y_n]$; thanks for any help in understanding more intuitively.
A standard casework / conditioning exercise.
Let $X$ be the first chosen vertex and let $Y$ be the neighbour of $X$ that's chosen. Then the key observation is that $X$ and $Y$ must be adjacent and hence must be the two end points of some edge, thus by enumerating over all cases where one has a degree $k$ vertex and a degree $\ell$ vertex adjacent one obtains
$\mathbf{P} \{ \text{deg} (X) = k , \text{deg} (Y) = \ell \} = \sum_{(x,y) \in E'} \mathbf{P} \{ X = x \wedge Y = y\} \mathbf{1}_{\{\text{deg}(x) = k ; \text{deg}(y) = \ell\}}$
$=\sum_{(x,y) \in E'} \mathbf{P} \{ Y = y | X = x \} \mathbf{P} \{ X = x \} \mathbf{1}_{\{\text{deg}(x) = k ; \text{deg}(y) = \ell\}}$
$= \sum_{(x,y) \in E'} \underbrace{\mathbf{1}_{\{\text{deg}(x) = k ; \text{deg}(y) = \ell\}}}_{\text{since } x \text{ deg}(x)= k; \text{ deg}( y) \text{=} \ell} ~~~ \underbrace{\frac{1}{n}}_{\text{as } X \text{ is chosen uniformly}} ~~~\underbrace{\frac{1}{\text{deg(x)}}}_{\text{as } Y \text{ is chosen uniformly from among the neighbours of } x}$