# Power set of N vs. Union of sets of all cardinality

For convenience, let $\mathbb{N} = \{0,1\ldots\}$. Consider the set

$$S=\bigcup_{k\in\mathbb{N}}A_k,$$ where $A_k=\{X\subset\mathbb{N}:|X|=k\},$ i.e. the collection of subsets of cardinality $k$. For instance, $A_0=\{\emptyset\}, A_1=\{\{0\},\{1\}\ldots\},A_2=\{\{0,1\},\{0,2\}\ldots\{1,2\},\{1,3\}\ldots\}.$

Since both the index set and the set where all the subsets are contained in are $\mathbb{N}$, $S$ is a union of countably many countable sets and thus it is countable. However, it seems to me that this set is identical to $\mathcal{P}({\mathbb{N}}),$ the power set of $\mathbb{N}$. Furthermore, I can define $f: S \rightarrow \mathcal{P}({\mathbb{N}})$ as $f(a)=a$ and $f$ is bijective.

Clearly something is wrong as $S$ is countable but $\mathcal{P}(\mathbb{N})$ isn't. I suspect the two sets are not identical but cannot pinpoint where exactly the flaw is. Could someone please help me?

There is indeed an error: $f$ is not bijective, since no infinite set is in the range of $f$. $S$ is just a countable subset of $\mathcal{P}(\mathbb{N})$.