%! TEX root = Combi.tex
% vim: tw=50
% 19/11/2024 09AM

  Let $r = \min \{|x| : x \notin B\}$ and $s =
  \max \{|x| : x \notin B\}$. May assume $r \le
  s$, since $r = s + 1$ implies $B = \{x : |x| \le
  r - 1\}$ would imply $B = C$.
  \begin{center}
    \includegraphics[width=0.3\linewidth]{images/80315eaef8d1429a.png}
  \end{center}
  If $r = s$: then $\{x : |x| \le r - 1\} \subset
  B \subset \{x : |x| \le r\}$. So clearly
  $|\neigh(B)| \ge |\neigh(C)|$.
  \begin{center}
    \includegraphics[width=0.3\linewidth]{images/5eb2b654b21e430f.png}
  \end{center}
  If $r < s$: cannot have $\{x : |x| = s\} \subset
  B$, because then also $\{x : |x| = r\} \subset
  B$ (as $B$ is a down-set).
  \begin{center}
    \includegraphics[width=0.3\linewidth]{images/7824622ec62d4bb0.png}
  \end{center}
  So there exists $y, y'$ with $|y| = |y'| = s$,
  $y \in B$, $y' \notin B$ and $y' = y \pm (e_1 -
  e_2)$ ($e_1 = (1, 0)$, $e_2 = (0, 1)$).

  Similarly, cannot have $\{x : |x| = r\} \cap B =
  \emptyset$, because then $\{x : |x| = s\} \cap B
  = \emptyset$ (as $B$ is a down-set). So there
  exists $x, x'$ with $|x| = |x'| = r$, $x \notin
  B$, $x' \in B$ and $x' = x \pm (e_1 - e_n)$. Now
  let $B' = B \cup \{x\} - \{y\}$. From $B$ we
  lost $\ge 1$ point in the neighbourhood (namely
  $z$ in the picture), and gained $\le 1$ point
  (the only point that we can possibly gain is $w$),
  so $|\neigh(B')| \le |\neigh(B)|$. This
  contradicts minimality of $B$. This finishes the
  two dimensional case.

  \textbf{Case 2:} $n \ge 3$. For any $1 \le i \le
  n - 1$ and any $x \in B$ with $x_n > 1$, $x_i <
  k$. Have $x - r_n + e_i \in B$ (as $B$ is
  \glsref[gridiced]{$j$-compressed} for any $j$,
  so apply with some $j \neq i, n$). So,
  considering the \sects n of $B$, we have
  $\neigh(B_{\isec t}) \subset B_{\isec{t - 1}}$ for all
  $t = 2, \ldots, k$.
  \begin{center}
    \includegraphics[width=0.6\linewidth]{images/dc7732ccf1b14158.png}
  \end{center}
  Recall that $\neigh(B)_{\isec t} =
  \neigh(B_{\isec t})
  \cup B_{\isec{t + 1}} \cup B_{\isec{t - 1}}$. So in
  fact $\neigh(B)_{\isec t} = B_{\isec{t - 1}}$ for all
  $t \ge 2$. Thus
  \[
    |\neigh(B)|
    = \ub{|B_{\isec{k - 1}}|}_{\text{level $k$}}
    + \ub{|B_{\isec{k - 2}}|}_{\text{level $k - 1$}}
    + \cdots
    + \ub{|B_{\isec 1}|}_{\text{level 2}}
    + \ub{|\neigh(B_{\isec 1})|}_{\text{level 1}}
    = |B| - |B_{\isec k}| + |\neigh(B_{\isec 1})|
  .\]
  Similarly,
  \[
    |\neigh(C)| = |C| - |C_{\isec k}| + |\neigh(C_{\isec 1})|
  .\]
  So to show $|\neigh(C)| \le |\neigh(B)|$, enough
  to show that $|B_{\isec k}| \le |C_{\isec k}|$ and
  $|B_{\isec 1}| \ge |C_{\isec 1}|$.

  $|B_{\isec k}| \le |C_{\isec k}|$: define a set
  $D \subset [k]^n$ as follows: put $D_{\isec k} =
  B_{\isec k}$, and for $t = k - 1, k - 2, \ldots,
  1$ set $D_{\isec t} = \neigh(D_{\isec t - 1})$.
  Then $D \subset B$, so $|D| \le |B|$. Also, $D$
  is an initial segment of \gls{simpordk}. So in
  fact $D \subset C$, whence $|B_{\isec k}| =
  |D_{\isec k}| \le |C_{\isec k}|$.

  $|B_{\isec 1}| \ge |C_{\isec 1}|$: define a set
  $E \subset [k]^n$ as follows: put $E_{\isec 1} =
  B_{\isec 1}$ and for $t = 2, 3, \ldots, k$ set
  $E_{\isec t} = \{x \in [k]^{n - 1} :
  \neigh(\{x\}) \subset E_{\isec{t - 1}}\}$
  ($E_{\isec t}$ is the biggest it could be given
  $\neigh(E_{\isec t}) \subset E_{\isec t}$). Then
  $E \supset B$, so $|E| \ge |B|$. Also, $E$ is an
  initial segment of \gls{simpordk}. So $E \supset
  C$, whence $|B_{\isec 1}| = |E_{\isec 1}| \ge
  |C_{\isec 1}|$.
\end{proof}

\begin{fccoro}[]
  \label{coro_2_12}
  % Corollary 2 12
  Assuming:
  - $A \subset [k]^n$ with $|A| \ge |\{x : |x| \le
  n\}|$
  Then:
  $|A_{\ineigh{t}}| \ge |\{x : |x| \le r + t\}|$
  for all $t$.
\end{fccoro}

\begin{remark*}
  Can check from \cref{coro_2_12} that, for $k$
  fixed, the sequence $([k]^n)_{n = 1}^\infty$ is
  a \gls{lf}.
\end{remark*}

\subsection{The edge-isoperimetric inequality in
the grid}

Which set $A \subset [k]^n$ (of given size) should
we take to minimise $|\bounde A|$?

\begin{example*}
  In $[k]^n$:
  \begin{center}
    \includegraphics[width=0.6\linewidth]{images/0bd421e26ca34b62.png}
  \end{center}
  Suggests squares are best.
\end{example*}

However...
\begin{center}
  \includegraphics[width=0.6\linewidth]{images/e8eaaa3a7bee4751.png}
\end{center}
So we have ``phase transitions'' at $|A| =
\frac{k^2}{4}$ and $\frac{3k^2}{4}$ -- extremal
sets are \emph{not} nested. This seems to rule out
all our compression methods.

And in $[k]^3$?
\begin{align*}
  [a]^3 (\text{cube})
  &\leadsto [a]^2 \times [k]
  (\text{square column}) \\
  &\leadsto [a] \times [k]^2
  (\text{half space}) \\
  &\leadsto \text{complement of square column}
  \\
  &\leadsto \text{complement of cube}
\end{align*}
So in $[k]^n$, up to $|A| = \frac{k^n}{2}$, we get
$n - 1$ of these phase transitions!
