  We apply the graph container method to prove a number of counting results for
the Boolean lattice $\mathcal P(n)$. In particular, we: (i) Give a partial
answer to a question of Sapozhenko estimating the number of $t$ error
correcting codes in $\mathcal P(n)$, and we also give an upper bound on the
number of transportation codes; (ii) Provide an alternative proof of Kleitman's
theorem on the number of antichains in $\mathcal P(n)$ and give a two-coloured
analogue; (iii) Give an asymptotic formula for the number of $(p,q)$-tilted
Sperner families in $\mathcal P(n)$; (iv) Prove a random version of Katona's
$t$-intersection theorem.
  In each case, to apply the container method, we first prove corresponding
supersaturation results. We also give a construction which disproves two
conjectures of Ilinca and Kahn on maximal independent sets and antichains in
the Boolean lattice. A number of open questions are also given.
