Solution (source code)

= Solution
{c}

Choose a <Uniformly random maximal chain in a Boolean lattice> by taking a uniformly random <permutation> of $X$ and successively adjoining its elements. A fixed $r$-element set occurs on this <maximal chain in a Boolean lattice> with probability $r!(n-r)!/n!=\binom nr^{-1}$. Because an <antichain> meets every such <chain in a partially ordered set> at most once, <linearity of expectation> gives the <LYM inequality>:
$$
L(\mathcal A):=\sum_{A\in\mathcal A}\binom n{|A|}^{-1}=\mathbb E|\mathcal A\cap\mathcal C|\leq1.
$$
Here $L(\mathcal A)$ is the <Lubell mass>.

For <equality in the LYM inequality>, the integer $|\mathcal A\cap\mathcal C|\leq1$ must equal one for every <maximal chain in a Boolean lattice>, since every chain has positive probability. Choose $A\in\mathcal A$ of rank $r$. If $0<r<n$, take $x\in A$ and $y\notin A$, and choose a <permutation> with its first $r$ elements equal to $A$, its $r$th element $x$, and its next element $y$. Interchanging those two adjacent elements changes precisely the rank-$r$ member of the corresponding <maximal chain in a Boolean lattice>, replacing $A$ by $A'=A\setminus\{x\}\cup\{y\}$. All other members are unchanged and none belongs to the <antichain>. The new chain must still meet $\mathcal A$, so $A'\in\mathcal A$.

Successive exchanges connect all $r$-element subsets: exchange an element outside a desired target for an element missing from it, decreasing the number of differences each time. Thus $\mathcal A$ contains the whole rank-$r$ level. Every set of another rank is comparable with some set in that level, so the <antichain> contains nothing else. If $r=0$ or $r=n$, its sole possible member is already the whole corresponding level. Conversely, every full level meets every <maximal chain in a Boolean lattice> exactly once. Hence
$$
\boxed{L(\mathcal A)\leq1,\qquad L(\mathcal A)=1\iff\mathcal A=X^{(r)}\text{ for some }0\leq r\leq n.}
$$