Prove/Disprove that if two sets have the same power set then they are the same set

Suppose $A \neq B$. Without loss of generality, there exists an $x \in A$ such that $x \notin B$. Then $\{x\} \in \mathscr{P}(A)$ whereas $\{x\} \notin \mathscr{P}(B)$. Thus $\mathscr{P}(A) \neq \mathscr{P}(B)$.

Conversely, if $\mathscr{P}(A) = \mathscr{P}(B)$, then all their singletons are the same. Thus $A = B$.

$A = B$ if and only if $\mathscr{P}(A) = \mathscr{P}(B)$.


To add on William's answer with a positive proof, first one has to note the following observation:

$$A=\bigcup\{B\mid B\subseteq A\}$$

To prove this, the inclusion $A\subseteq\bigcup\{B\mid B\subseteq A\}$ is trivial since $A\subseteq A$, so we take $A$ into the union. In the other direction, since every $B$ in the union is a subset of $A$ the union is a subset of $A$.

Now we can proceed. The above identity can be written in terms of the power set as $A=\bigcup\mathcal P(A)$.

Assume $\mathcal P(A)=\mathcal P(B)$, therefore $\bigcup\mathcal P(A)=\bigcup\mathcal P(B)$, therefore $A=B$.


An alternative way to answer this old question: for all sets A and B,

$$ \begin{array}{ll} & \mathcal{P}(A) = \mathcal{P}(B) \\ \equiv & \;\;\;\text{"extensionality"} \\ & \langle \forall V :: V \in \mathcal{P}(A) \equiv V \in \mathcal{P}(B) \rangle \\ \equiv & \;\;\;\text{"definition of $\mathcal{P}$, twice"} \\ & \langle \forall V :: V \subseteq A \equiv V \subseteq B \rangle \\ \Rightarrow & \;\;\;\text{"choose $V:=A$, and choose $V:=B$"} \\ & (A \subseteq A \equiv A \subseteq B) \;\land\; (B \subseteq A \equiv B \subseteq B) \\ \equiv & \;\;\;\text{"$\subseteq$ is reflexive, so $A \subseteq A$ and $B \subseteq B$"} \\ & A \subseteq B \land B \subseteq A \\ \equiv & \;\;\;\text{"definition of set equality"} \\ & A = B \\ \end{array} $$

Update: As a comment rightly points out, the above proof is very similar to my answer to another question. In fact, we can directly prove the stronger version of this question's theorem from that one:

$$ \begin{array}{ll} & \mathcal{P}(A) = \mathcal{P}(B) \;\equiv\; A = B \\ \equiv & \;\;\;\text{"double inclusion, twice"} \\ & \mathcal{P}(A) \subseteq \mathcal{P}(B) \land \mathcal{P}(B) \subseteq \mathcal{P}(A) \;\equiv\; A \subseteq B \land B \subseteq A \\ \Leftarrow & \;\;\;\text{"logic"} \\ & (\mathcal{P}(A) \subseteq \mathcal{P}(B) \;\equiv\; A \subseteq B) \;\land\; (\mathcal{P}(B) \subseteq \mathcal{P}(A) \;\equiv\; B \subseteq A) \\ \equiv & \;\;\;\text{"the other theorem, twice"} \\ & \text{true} \\ \end{array} $$