Background
Two common ways of defining what an Evolutionary Stable Strategy (ESS) are:
First definition: Consider a population composed of populations playing two strategies, $\mathbf{p}$ and $\mathbf{q}$. Let us denote $W(\mathbf{p})$ the average fitness of the strategy $\mathbf{p}$. A population consisting of individuals playing $\mathbf{p}$ will be an ESS if, whenever a small amount of deviant individuals playing $\mathbf{q}$, the old type $\mathbf{p}$ fares batter than the newcomers $\mathbf{q}$. This means that for all $\mathbf{p}\neq \mathbf{q}$, \begin{equation} W(\mathbf{p}) > W (\mathbf{q}) \end{equation}
Second definition: $E(\mathbf{p},\mathbf{q})$ is the payoff for $\mathbf{p}$-strategist against a $\mathbf{q}$-strategist. The strategy $\mathbf{p}$ is an ESS if and only if the following conditions are satisfied:
$E(\mathbf{p},\mathbf{p})\geq E(\mathbf{q},\mathbf{p}) \quad \forall \mathbf{q}$
If $\mathbf{q}\neq \mathbf{p}$ and $E(\mathbf{p},\mathbf{p}) = E(\mathbf{q},\mathbf{p})$, then $E(\mathbf{p},\mathbf{q})> E(\mathbf{q},\mathbf{q})$
Question (shorter version)
The above two ways of defining what an ESS should be equivalent. How can I prove such an equivalence? Alternatively, do you know of a book (or a paper) that has this proof?
Question (longer version)
I understand that the first definition implies the second. According to the first definition: \begin{align*} W(\mathbf{p}) - W (\mathbf{q}) &>0\\ (1-\epsilon) [E(\mathbf{p},\mathbf{p}) - E(\mathbf{q},\mathbf{p})] + \epsilon [E(\mathbf{p},\mathbf{q}) - E(\mathbf{q},\mathbf{q})] &>0 \end{align*} where $\epsilon$ is frequency of individuals playing $\mathbf{q}$. Since $0<\epsilon<1$, if the above inequality is true, the conditions 1 and 2 in the second definition must be true. The part that I find less clear is how the second definition implies the first definition. More specifically, that if $\mathbf{p}$ is a strict Nash equilibrium (i.e., $E(\mathbf{p},\mathbf{p})> E(\mathbf{q},\mathbf{p})$), then $W(\mathbf{p}) > W (\mathbf{q})$.