Solution (source code)

= Solution

Choose a uniformly random <permutation> of $[n]$ and take its initial segments. This produces a <Uniformly random maximal chain in a Boolean lattice>. A fixed $r$-set belongs to this chain with <probability> $r!(n-r)!/n!=\binom nr^{-1}$. An <antichain> meets the chain at most once, so taking the <expected value> of the number of meetings proves the <LYM inequality>:
$$
\boxed{\sum_{r=0}^n\frac{|\mathcal A\cap[n]^{(r)}|}{\binom nr}\le1.}
$$
In particular the <Sperner theorem> bound follows by multiplying each summand by at most the largest <binomial coefficient>.

For the <vector> request, an ordering by ordinary <subset> need not work: distinct <vectors> may cancel. Instead, write $s_A=\sum_{i\in A}x_i$ and construct a <separated block decomposition for vector subset sums>. A block is separated if distinct labeled members have <subset> sums at distance at least one. We prove that the labeled <subsets> of $[n]$ can be partitioned into separated blocks, with
$$
b_{n,r}=\binom nr-\binom n{r-1}
$$
blocks of size $n-2r+1$, for $0\le r\le\lfloor n/2\rfloor$, with $\binom n{-1}=0$.

For $n=0$ the one <subset> forms one block. Suppose a block of sums $z_1,\ldots,z_\ell$ has already been constructed for $n-1$ <vectors>, and let $x=x_n$. Choose $z_*$ minimizing $z_j\cdot x$ in the block. Replace the two copies of the block, with and without the new coordinate, by the following two blocks:
$$
\{z_1+x,\ldots,z_\ell+x,z_*\},\qquad
\{z_j:j\ne *\}.
$$
The old labels are retained, so these partition the two copies even if equal sums occur in different blocks. Translation preserves separation in the first translated portion, and the second block is a <subset> of the old separated block. For the new cross pairs, <Cauchy-Schwarz inequality> gives
$$
\|z_j+x-z_*\|\ge\frac{(z_j-z_*+x)\cdot x}{\|x\|}
\ge\|x\|\ge1.
$$
Thus both new blocks are separated. Their sizes are $\ell+1$ and $\ell-1$, omitting an empty block. The resulting size-profile recurrence is $b_{n,r}=b_{n-1,r}+b_{n-1,r-1}$, and Pascal's identity verifies the displayed binomial-difference formula, including the even middle boundary. The total number of blocks telescopes to $\binom n{\lfloor n/2\rfloor}$.

A signed sum associated with $A=\{i:\epsilon_i=1\}$ is $2s_A-\sum_i x_i$. If two signed sums lie in the <open ball> of radius one, their difference has <norm> less than two, so their <subset> sums have distance less than one. At most one can therefore lie in any separated block. Hence the <Littlewood-Offord inequality> is
$$
\boxed{\#\left\{\epsilon\in\{-1,1\}^n:\left\|\sum_i\epsilon_ix_i-a\right\|<1\right\}
\le\binom n{\lfloor n/2\rfloor}.}
$$
The counting is by sign choices, not by distinct numerical values of the sums. The open-ball condition handles the equality-distance boundary correctly.

For the last request take real coefficients. Absorb their signs into the choices $\epsilon_i$, so all coefficients are positive and at least one. A signed-sum <real interval> of length four corresponds to a subset-sum <real interval> of length two. A strict three-member inclusion chain $A\subsetneq B\subsetneq C$ would have $s_C-s_A\ge2$, which cannot occur in that open <real interval>. Thus its <set family> is a <k-Sperner family> with $k=2$. Every <maximal chain in a Boolean lattice> meets it at most twice, yielding $\sum_r |\mathcal F_r|/\binom nr\le2$. Write $f_r=|\mathcal F_r|/\binom nr$, so $0\le f_r\le1$ and $\sum_r f_r\le2$. If $B_1\ge B_2$ are the two largest <binomial coefficients> and $f_*$ is the fraction at a largest level, then $|\mathcal F|\le B_1f_*+B_2(2-f_*)\le B_1+B_2$. This proves the <two-level Littlewood-Offord bound>:
$$
\boxed{\binom n{\lfloor n/2\rfloor}+\binom n{\lfloor(n-1)/2\rfloor}\quad(n\ge1).}
$$
It is the greatest possible number uniformly over choices of coefficients and center. For even $n=2m$, take every coefficient equal to one and center $a=-1$: the <real interval> $(-3,1)$ contains the sum levels $-2,0$, of multiplicities $\binom n{m-1},\binom nm$. For odd $n=2m+1$, take center zero, giving levels $-1,1$, each of multiplicity $\binom nm$. These attain the bound. For $n=0$ the only sign choice gives the separate maximum one. Attainment here is at the exhibited centers; it need not hold at every prescribed center.