Inverse of power-set functor? In his answer to this Q: How to interpret $1 \to 0$ in $\mathbf {Set^{op}}$, and $\mathbf {Set^{op}}$ itself? Zhen Lin proposed that $\mathbf {Set^{op}}$ is naturally equivalent to the category of complete atomic boolean algebras via the contravariant power set functor.
As a step in understanding this equivalence, what's the inverse of the contravariant set functor? 
 A: The equivalence between $\mathbf{Set}^{op}$ and $\mathbf{CABA}$ is induced by an adjointness between $\mathbf{Set}^{op}$ and $\mathbf{CBA}$, where the latter is the category of complete Boolean algebras (i.e.  without any assumption about atoms).
First a recall the general principle:
Suppose $F: \mathcal{X} \to \mathcal{A}$ is left adjoint to $G: \mathcal{A} \to \mathcal{X}$ with unit $\eta: Id_{\mathcal{X}} \to GF$ and counit $\varepsilon: FG \to Id_{\mathcal{A}}$.
Then the two full subcategories
$\{ X \in \mathcal{X} \mid \eta_X \text{ is an isomorphism} \}$ and
$\{ A \in \mathcal{A} \mid \varepsilon_A \text{ is an isomorphism} \}$
are equivalent and the equivalences are given by the restrictions of F and G.  (this follows from the triangular equalities).
So now let's proceed to construct such adjoint functors. I will do this with $\mathcal{X}=\mathbf{Set}$ and $\mathcal{A}=\mathbf{CBA}^{op}$, but it is of course only a matter of taste where to put the $op$.  Anyway I will draw the maps in $\mathbf{Set}$ and $\mathbf{CBA}$. The crucial ingredient is the two element set $2 = \{ 0,1 \}$, which is of course a set, but also a complete Boolean algebra under the ordering with $0 < 1$.
Given a set $X$, set $P(X) = \mathbf{Set}(X,2)$.
Given a complete boolean algebra $B$, set  $Q(B) = \mathbf{CBA}(B,2)$.
On morphism $P$ and $Q$ act via precompositon, i.e. for $f: X \to Y$ the map $P(f): P(Y) \to P(X)$ takes $h \in P(Y)$ to $h\circ f \in P(X)$.  Similar for $Q$.
Then that gives two functors $P: \mathbf{Set} \to \mathbf{CBA}^{op}$ and $Q: \mathbf{CBA}^{op} \to \mathbf{Set}$.  This is clear for $Q$. For $P$ observe that the power set $P(X)$ is indeed a complete Boolean algebra, regardless of whether you view its elements as subsets of $X$ or as characteristic maps from $X$ to $2$.
For a set $X$ define $\eta_X : X \to Q(P(X)$ via
$\eta_X(x)\sigma := \sigma(x)$ for all $x\in X$, $\sigma\in P(X)$.
This gives the unit of the adjunction: given $f: X \to Q(B)$, the corresponding map $\hat{f}: B \to P(X)$ must satisfy
$$\matrix{
f(x)b = 1 &\iff& (\eta_X(x)\circ \hat{f})b = 1 \cr
          &\iff& \eta_X(x)(\hat{f}b) = 1 \cr
          &\iff& \hat{f}(b)x = 1 \cr
}
$$
and this can be taken to define $\hat{f}$ via $\hat{f}(b)x := f(x)b$.
In particular, for $X=Q(B)$ and $f=id_{Q(B)}$ the counit $\varepsilon_B: B \to P(Q(B))$ is given by $\varepsilon_B(b)h := h(b)$ for all $b \in B$, $h\in Q(X)$.
For a complete Boolean algebra $B$, write $at(B)$ for the set of its atoms and given $b\in B$ write $at(B/b)$ for the atoms below $b$.  No matter what precise definition of 'atom' is used, the only facts to recall are that the meet of two different atoms is the bottom element and that if $B$ is atomic then every $b\in B$ satisfies $b = \bigvee(at(B/b))$.  
Now the following steps pin down the full subcategories:
(1) If $B$ is atomic, then every $h\in Q(B)$ is completely determined by its restriction to $at(B)$. Moreover the preimage $h^{-1}(1)$ contains exactly one atom $a_h$ and for each $b \in B$ we have the equivalence 
$h(b)=1 \iff a_h\leq b$.
Conversely, given an $a\in at(B)$, this equivalence defines an element of $Q(B)$.  Therefore the assignment $h \mapsto a_h$ gives a bijection between $Q(B)$ and $at(B)$.
(2) $P(X)$ is always atomic and the atoms are the singleton subsets of $X$.  From (1) we have that for every $h \in Q(P(X))$ there is a unique $x\in X$ such that $h = \eta_X(x)$. In particular $\eta_X$ is always an isomorphism.
(3) If $\varepsilon_B: B\to P(Q(B))$ is an isomorphism then $B$ must be atomic because of (2). Conversely suppose $B$ is atomic. Given $\sigma \in P(Q(B))$, let $S = \sigma^{-1}(1) \subseteq Q(B)$ be the corresponding subset of morphisms from $B$ to $2$.  Set $b = \bigvee \{a_s\mid s \in S \}$. Then
$$\matrix{
\varepsilon_B(b)h = 1 &\iff& h(b) = 1 \cr
                      &\iff& \exists s\in S: h(a_s) = 1 \cr
                      &\iff& \exists s\in S: a_h \leq a_s \cr
                      &\iff& \exists s\in S: a_h = a_s \cr
                      &\iff& h \in S \cr
                      &\iff& \sigma(h) = 1 \cr
}
$$
and this $b$ is the unique $b\in B$ with $\varepsilon_B(b)=\sigma$.
Therefore $\varepsilon_B$ is an isomorphism iff $B$ is atomic.
