The implication $|A| = |B|$ is already proven is this post.
How about the other way? It looks similar to $A = B$ iff $\mathcal{P}(A) = \mathcal{P}(B)$, but what about their cardinalities in general? That is, I want to prove that if $|\mathcal{P}(A)| = |\mathcal{P}(B)|$, then $|A| = |B|$.
I tried the following: Let $\hat{f}: \mathcal{P}(A) \to \mathcal{P}(B)$ be any bijection and $f: A \to B$ defined as $f(a) = b$ iff $\hat{f}(\{a\}) = \{b\}$.
Is this ok?