Could anyone check my working please?
$F:\mathscr C \to \mathscr D$ is a contravariant functor (as opposed to a covariant functor) if it assigns to $f:a \to b$ an arrow $F(f): F(b)\to F(a)$, such that
- $F(1_a)=1_{F(a)}$
- $F(g\circ f)=F(f)\circ F(g)$
A contravariant powerset functor $ \bar{\mathscr P}:Set \to Set$ takes each set $A$ to its powerset $\mathscr P(A)$, and each $f:A \to B$ to the function $\bar{\mathscr P}(f):\mathscr P(B) \to \mathscr P(A)$ that assigns to $X\subseteq B$ its inverse image $f^{-1}(X)\subseteq A$.
We begin with 1, and assume that $\bar{\mathscr P}(1_A)$. $\bar{\mathscr P}(1_A)=\bar{\mathscr P}(A)=1_{\bar{\mathscr P}(A)}$. The proof for an arbitrary function $f$ is very similar.
For 2, assume $\bar{\mathscr P}(g\circ f)$. Let $f:A \to B$ and $g:B\to C$. Then $g\circ f:A\to C$. By def $\bar{\mathscr P}(g\circ f):\mathscr P(C)\to \mathscr P(A)$ assigns to each $X\subseteq C$ its inverse image $(g\circ f)^{-1}(X)\subseteq A$.
On the other hand, starting with $\bar{\mathscr P}(f)\circ \bar{\mathscr P}(g)$ on the RHS, $\bar{\mathscr P}(g):\mathscr P(C)\to \mathscr P(B)$ assigns to each $X\subseteq C$ its inverse image $g^{-1}(X)\subseteq B$. Likewise, $\bar{\mathscr P}(f):\mathscr P(B)\to \mathscr P(A)$ assigns to each $X\subseteq B$ its inverse image $f^{-1}(X)\subseteq A$.
Beginning with $\bar{\mathscr P}(g)(X)$, we get $g^{-1}(X)\subseteq B$, but by applying $\bar{\mathscr P}(f)$ we get $f^{-1}\circ g^{-1}(X)\subseteq A$. But we know the inverse of a composition is the same as the composition of the inverses, ie. $f^{-1}\circ g^{-1}=(g\circ f)^{-1}$, thus $\bar{\mathscr P}(f)\circ \bar{\mathscr P}(g)=\bar{\mathscr P}(g\circ f)$.