We follow an argument similar to the proof of Mantel’s Theorem. Let \(t\) be the number of triangles in \(G\) and, for each edge \(uv\in E(G)\text{,}\) let \(t_{uv}\) be the number of triangles which contain \(uv\text{.}\) Of course, \(t_{uv}\) is precisely \(|N(u)\cap N(v)|\text{.}\) So, for any \(uv\in E(G)\text{,}\)
\begin{equation*}
d(u)+d(v)=|N(u)\setminus N(v)|+|N(v)\setminus N(u)|+ 2|N(u)\cap N(v)|
\end{equation*}
\begin{equation*}
\leq |V(G)| + t_{uv}\text{.}
\end{equation*}
\begin{equation*}
\sum_{v\in V(G)}d(v)^2 = \sum_{uv\in E(G)}(d(u)+d(v))\leq |E(G)||V(G)| + \sum_{uv\in E(G)}t_{uv}
\end{equation*}
\begin{equation*}
=|E(G)||V(G)|+3t
\end{equation*}
(since the sum
\(\sum_{uv\in E(G)}t_{uv}\) counts every triangle thrice). Combining this with the handshaking lemma and
Corollary C.0.6,
\begin{equation*}
4|E(G)|^2 = \left(\sum_{v\in V(G)}d(v)\right)^2 \leq |V(G)|\sum_{v\in V(G)}d(v)^2
\end{equation*}
\begin{equation*}
\leq |V(G)|^2|E(G)| + 3|V(G)|t\text{.}
\end{equation*}
Thus, by definition of \(p\text{,}\) we have
\begin{equation*}
t\geq \frac{4|E(G)|^2}{3|V(G)|} - \frac{|V(G)||E(G)|}{3} = \frac{p^2|V(G)|^3}{3} - \frac{p|V(G)|^3}{6}\text{.}
\end{equation*}
This completes the proof.