Solution (source code)

= Solution

Let $\lambda\geq\kappa$ be a <cardinal number> of $M$. If forcing collapsed $\lambda$, some condition would force a <surjective function> $\dot f:\mu\to\lambda$ for an ordinal $\mu<\lambda$. Replacing $\mu$ by its ground-model cardinality lets us assume that $\mu$ is a cardinal.

For each $\xi<\mu$, choose in $M$ a maximal <antichain in a forcing order> deciding $\dot f(\xi)$. The <chain condition for forcing> makes its size less than $\kappa$, so the set $B_\xi$ of possible values of $\dot f(\xi)$ has size below $\kappa$. This is the <possible-values lemma for chain-condition forcing>. Every interpreted range is contained in $B=\bigcup_{\xi<\mu}B_\xi$. If $\mu<\kappa$, the fact that $\kappa$ is a <regular cardinal> gives $|B|<\kappa\leq\lambda$; if $\kappa\leq\mu<\lambda$, <infinite cardinal arithmetic> gives $|B|\leq\mu<\lambda$. Either way $B$ cannot contain the range of a surjection onto $\lambda$, a contradiction. By <cardinal preservation by chain-condition forcing>, \b[$\mathbb P$ preserves every cardinal at least $\kappa$.]