%! TEX root = PC.tex
% vim: tw=80 ft=tex
% 03/12/2025 09AM

\begin{fcthm}[]
  \label{thm:folkmannum}
  If $p \gg \frac{1}{\sqrt{n}}$ and $G \sim G(n, p)$ then $G \rto K_3$ with high
  probability.
\end{fcthm}

\begin{remark*}
  If $p < \frac{\gamma}{\sqrt{n}}$ then $G \not\to K_3$ with high probability
  for $\gamma$ small.

  Sketch proof: pick an edge from each triangle and colour it blue.
  Since the number of triangles is small compared to the number of edges, we
  don't colour too many blue.
  Colour the rest red.
  Now as long as we didn't create any blue triangles, this works.
\end{remark*}

\begin{fclemma}[``Supersaturation'' Lemma]
  \label{lemma:trianglesupersat}
  Let $\eps > 0$ be sufficiently small.
  Let $K_n$ be coloured with red / blue / grey with the property that $\le \eps
  n^2$ are grey.

  Then there are $cn^3$ monochromatic triangles in red or blue.
\end{fclemma}

\begin{proof}
  There are at most $\eps n^6$ $K_6$'s that contain a grey edge.
  So there are $\ge {n \choose 6} - \eps n^6 = (*)$ $K_6$'s that are only
  red / blue coloured.
  Each one of these contains a monochromatic triangle.
  So we have $\ge (*)$ many pairs ($K_6$, monochromatic $K_3$).
  So there exist $\ge \frac{(*)}{n^3} \ge cn^3$ monochromatic $K_3$'s in red or
  blue.
\end{proof}

\begin{proof}[Proof of \cref{thm:folkmannum} for $p \ge \frac{C'\log
  n}{\sqrt{n}}$]
  Let $p \ge \frac{C'\log n}{\sqrt{n}}$, $G \sim G(n, p)$.
  Then
  \begin{align*}
    \Pbb(G \not\to K_3)
    &\le \Pbb(\exists H_1, H_2, \text{$K_3$-free with $G \supset H_1 \cup H_2$})
    \\
    &\le \Pbb(\exists K_1, K_2 \in \mathcal{C} \text{ with $G \supset K_1 \cup
    K_2$}) \\
    &\le \sum_{K_1, K_2 \in \mathcal{C}} \Pbb(G \subset K_1 \cup K_2) \\
    &\le \sum (1 - p)^{|V(G) \setminus K_1 \cup K_2|}
  \end{align*}
  By \cref{lemma:trianglesupersat}, $|V(G) \setminus K_1 \cup K_2| \ge \eps
  n^2$, the above is
  \[
    \le |\mathcal{C}| \cdot e^{-p \cdot \eps n^2}
    \le n^{C n^{3 / 2}} e^{-C(\log n)n^{3 / 2}}
  \]
  for some large $C'$, so $\to 0$ as $n \to \infty$.
\end{proof}

% TODO: verbal comment

\subsection{Proving the earlier container lemma}

We will sketch the proof of \cref{thm:trianglecontainers}.

Consider the $3$-uniform hypergraph $\mathcal{H}_n$ defined by
\[
  V(\mathcal{H}_n)
  = E(K_n)
  \qquad
  \mathcal{H}_n
  = \{\{e, f, g\} : \text{$e$, $f$, $g$ form a triangle}\}
.\]
\begin{center}
  \includegraphics[width=0.6\linewidth]{images/d16e11c2f0704dad.png}
\end{center}
\textbf{Key observation} is that $G \subset V(\mathcal{H}_n)$ is a graph on
$[n]$, and that $G$ is \emph{independent} in $\mathcal{H}_n$ if and only if $G$
is a triangle-free graph.

Here we say $G \subset V(\mathcal{H})$ is \emph{independent} if it induces no
edge of $\mathcal{H}$.

\begin{notation*}
  Given a hypergraph $\mathcal{H}$, define
  \[
    \Delta_l(\mathcal{H})
    = \max \{d_{\mathcal{H}}(A) : A \subset V(H), |A| = l\}
  ,\]
  where $d_{\mathcal{H}}(A) = |\{B \in E(\mathcal{H}) : A \subset B\}|$.

  We will write $\Delta(\mathcal{H})$ to mean $\Delta_1(\mathcal{H})$.
\end{notation*}

\begin{fcthm}[Hypergraph Container Theorem for $3$-uniform hypergraphs]
  \label{thm:hypcontainers}
  For $C > 0$, there exists $\delta > 0$ so that the following holds.
  Let $\mathcal{H}$ be a $3$-uniform hypergraph with average degree $d$ and
  \[
    \Delta(\mathcal{H})
    \le Cd
    \qquad
    \text{and}
    \qquad
    \Delta_2(\mathcal{H}) \le C\sqrt{d}
  .\]
  Then there exists a collection $\mathcal{C} \subset
  \mathcal{P}(V(\mathcal{H}))$ with the following properties:
  \begin{enumerate}[(1)]
    \item $|\mathcal{C}| \le {|V(\mathcal{H})| \choose
      \frac{|V(\mathcal{H})|}{\sqrt{d}}}$.
    \item $\forall C \in \mathcal{C}$, $|C| \le (1 - \delta) |V(\mathcal{H})|$.
    \item For every independent set $I$ in $\mathcal{H}$, there exists $C \in
      \mathcal{C}$ such that $I \subset C$.
  \end{enumerate}
\end{fcthm}

Due to Saxton, Thomason and Balogh, Morris, Samotij.

Sketch proof of container lemma for $K_3$-free graphs
(\cref{thm:trianglecontainers}) using \nameref{thm:hypcontainers}:

We note that all degrees are $n - 2$
\begin{center}
  \includegraphics[width=0.6\linewidth]{images/3f922c6071a04ed6.png}
\end{center}
So average degree is $n - 2$, and $\Delta(\mathcal{H}_n) = n - 2$.

We have $\Delta_2(\mathcal{H}_n) = 1$, since for a pair of edges $e$, $f$, we
have $d_{\mathcal{H}}(\{e, f\})$ is either $0$ or $1$.
\begin{center}
  \includegraphics[width=0.6\linewidth]{images/682270c1a8204cad.png}
\end{center}
So we can apply \nameref{thm:hypcontainers} to $\mathcal{H}_n$ with $d = n - 2$
and $C = 1$.
We obtain a collection $\mathcal{C}$ of graphs
\[
  |\mathcal{C}|
  \le {\frac{n^2}{2} \choose \frac{n^2}{2\sqrt{n}}}
  = n^{O(n^{3 / 2}}
.\]
Note that every triangle-free graph is contained in some $G \in \mathcal{C}$.
We also have $e(G) \le (1 - \delta) {n \choose 2}$.

We now repeat the following:

Suppose some $G \in \mathcal{C}$ (current set of containers) has $\ge \eps n^3$
triangles. Then consider $\mathcal{H}_n[G]$.
\begin{center}
  \includegraphics[width=0.6\linewidth]{images/4ea0e050c6f544ca.png}
\end{center}
The average degree is $\eps n$ and $\Delta(\mathcal{H}_n[G]) \le n$,
$\Delta_2(\mathcal{H}_n[G]) \le 1$.
So apply \cref{thm:hypcontainers} again to $\mathcal{H}_n[G]$ with $d = \eps n$
and $C = \frac{1}{\eps}$.
Now put all of these containers into my collection.

We can imagine this process as creating a rooted tree, whose vertices are
containers, and whose leaves are containers with $\le \eps n^3$ triangles.
\begin{center}
  \includegraphics[width=0.6\linewidth]{images/531c3f475ca44222.png}
\end{center}
Note we can only apply this at most $\le \frac{2}{\delta} \log \frac{1}{\eps}$
times to a container (because after this many steps we have so few edges of
$K_n$ left that we must have $\le \eps n^3$ triangles).
Thus the total number of containers at the end is
\begin{align*}
  &\le {\frac{n^2}{2} \choose \frac{n^2}{2\sqrt{n}}} {\frac{n^2}{2} \choose
  \frac{n^2}{2\sqrt{\eps n}}}^{\frac{2}{\eps}\log \frac{1}{\delta}} \\
  &\le n^{O_\eps(n^{3 / 2})}
\end{align*}
as desired.

By construction each of the containers has at most $\eps n^3$ triangles.
Note that every triangle-free graph $G$ on $n$ vertices is contained in some $C
\in \mathcal{C}$ for our initial application.
This property is preserved when we replace a $C \in \mathcal{C}$ with a
collection of containers for $\mathcal{H}[C]$.
