This question, in general, has been already asked here.
My question is whether following approach can be applied too.
For any $A$ and $\mathcal P(A)$ we know that $A \in \mathcal P(A)$
If we know that some given set is a power set, seems we are able to choose the "main" element from the power set.
In other words we can define a function $f(\mathcal P(A))=A$
So if $f(\mathcal P(A))= f(\mathcal P(B))$, then $A=B$
Is it a valid approach?
Update
I will try to explain my question better.
Of course it's not a problem to fetch $A$ from $\mathcal P(A)$ by $\cup \mathcal P(A)$. And it's not a problem to prove the statement in many other ways.
But my question is intended to achieve a better understanding of functions. And the specific question about P(A)=P(B) - is no more just an example. So...
Usually when we define some function we describe the algorithm of this function (or assume it's obvious).
But what about defining function without known algorithm?
Instead of telling the function "Return me, please, a union of all elements of $\mathcal P$" I want to tell the function "I know that $\mathcal P$ is a power set and it contains the 'main' element [the set that this $\mathcal P$ was created from]. So, please, dear function, go and fetch this element for me".
I don't see here any contradiction to logic or to common sense. But I wonder is there any contradiction to axioms of sets theory.
Hope, my question is clear now.
Update 2
I think I understood what is my mistake. I still haven't figured out if there is any meaning in my question in principle. But I realized that the example I gave is really bad.
If we have some function that is not one to one it's clear that there is no way do define some sort of inverse function [e.g. if we have $f:\mathbb R\to \mathbb R, f(x)=x^2$ it's not legitimate to define function $g$ (upgraded $f^{-1}$) that will in some way reveal secrets - whether appropriate 4 was product of $f(2)$ or of $f(-2)$]
In our question we know that $P(A)=P(B)$ but we don't know that it's kind of one to one (e.g. may be $A\ne B$), so it's impossible do define an inverse function that will fetch the 'main' element.
Sorry for all the chatter.