Example 5 Let $X$ be a set containing $n(n>2)$ elements, and $A, B$ be two disjoint subsets of $X$, containing $m, k (m, k \geqslant 1, m+k \leqslant n)$ elements respectively. Then the number of subsets of $X$ that do not contain $A$ or $B$ is ( ).
(A) $2^{n-m}+2^{n-k}-2^{n-m-k}$
(B) $2^{n-m-k}$
(C) $2^{n}-2^{n-m}-2^{n-k}+2^{n-m-k}$
(D) $2^{n+1}-2^{n-m}-2^{n-k}+2^{n-m-k}$
(2009, Fudan University Independent Admission Examination)
Let the set of subsets of $X$ containing $A$ be $P(A)$, and the set of subsets of $X$ containing $B$ be $P(B)$. Then
$$
\begin{array}{l}
|P(A) \cup P(B)|=2^{n}-|P(A) \cup P(B)| \\
=2^{n}-(|P(A)|+|P(B)|-|P(A) \cap P(B)|) \\
=2^{n}-2^{n-m}-2^{n-k}+2^{n-k-m} .
\end{array}
$$