# Showing that $\mathscr P(A)\cong H_2(A)$ naturally in $A$

From here:

I'm trying to verify that the isomorphism $$\mathscr P(A)\cong H_2(A)$$ is natural in $$A$$.

Let $$f^{op}:A\to B$$ be an arrow in $$\mathbf{Set}^{op}$$ (so $$f:B\to A$$ is an arrow in $$\mathbf{Set}$$). We need to verify that the diagram

$$\require{AMScd} \begin{CD} \mathscr P(A) @>{\mathscr P(f^{op})}>> \mathscr P(B);\\ @VVV @VVV \\ H_2(A) @>{H_2(f^{op})}>> H_2(B); \end{CD}$$

commutes.

If we first go right and then down, then $$U$$ first gets sent to $$f^{-1}(U)$$ and then to the characteristic function $$\chi_{f^{-1}(U)\subset B}$$ of the subset $$f^{-1}(U)\subset B$$.

If we first go down and then right, then $$U$$ first gets sent to the characteristic function $$\chi_{U\subset A}$$ of $$U\subset A$$ and then to $$\chi_{U\subset A}\circ f$$.

One thing that got me confused is this: we have an arrow $$A\to B$$ (i.e., a function of sets), how is the arrow (function) $$B\to A$$ chosen? For example, if $$A=\{\star,\ast\},B=\{\cdot\}$$ and the functon $$A\to B$$ sends $$\ast,\star\mapsto \cdot$$, then we cannot construct a function $$B\to A$$ by sending $$\cdot$$ to both $$\star,\ast$$, so one has to make a choice.

And secondly, I don't quite see why the two compositions described above are the same.

• The arrow $A\to B$ coming from the opposite category is not a function of sets from $A\to B$, it is an arrow $B \to A$ in Sets, ie a function $B\to A$ already. – Ben Jul 1 '19 at 1:10
• If you don’t see why the two compositions are the same you can try evaluating them at various elements in $B$ (Ones which map to $U$, or which dont). – Ben Jul 1 '19 at 1:20
• @Ben Then if we have an arrow (a function) $h: B\to A$, then what exactly is the arrow (function) $h^{op}:A\to B$? – user634426 Jul 1 '19 at 1:20
• Arrows $X\to Y$ are not always functions $X \to Y$ (even if $X,Y$ are sets). They are in the category of Sets, but not in Sets^op. In Sets^op, arrows $X\to Y$ are functions $Y \to X$. Given an arrow (function) $h: B \to A$, the arrow (not function) $h^{op}: A \to B$ is the function $h: B \to A$ (again). – Ben Jul 1 '19 at 2:31

1. The arrows in $$\mathbf{Set}$$ are functions. The arrows in $$\mathbf{Set}^{op}$$ are also functions, except we flip our labels for domain and codomain. So for example, there is a constant function $$\{*,\star\}\to\{\bullet\}$$ in $$\mathbf{Set}$$. This same function counts as an arrow $$\{\bullet\}\to\{*,\star\}$$ in $$\mathbf{Set}^{op}$$. In moving to the opposite category, we simply flip the labels for domain and codomain; the behavior is the same.

2. Pick a function $$f:B\to A$$ in $$\mathbf{Set}$$. We can view it as an arrow $$f^{op}:A\to B$$ in $$\mathbf{Set}^{op}$$.

3. Then $$\mathscr{P}(f^{op}:A\to B)$$ is a function from $$\mathscr{P}(A)$$ to $$\mathscr{P}(B)$$. It sends subsets of $$A$$ to their inverse image in $$B$$ under $$f$$. Note that because $$f$$ is a function from $$B\to A$$, this checks out.

4. And $$H_2(f^{op}:A\to B)$$ is a function from $$2^A$$ to $$2^B$$. Given a function $$A\to 2$$, you can pre-compose with $$f$$ to get a function $$B\to A \to 2$$.

5. The isomorphism $$\mathscr{P}(A)\to H_2(A)$$ sends each subset $$U$$ to its characteristic function $$\chi(u) = \begin{cases}1, u\in U\\ 0, u\notin U\end{cases}$$.

6. It is natural because one way – right then down – we get the map that sends each subset $$U$$ of $$A$$ to the characteristic function of $$f^{-1}(U)$$. In other words, each subset $$U\subseteq A$$ gets sent to the map $$\small(B\to 2)$$ which assigns $$1$$ to every point $$x\in B$$ with $$f(x)\in U$$ and $$0$$ to every other point.

The other way – down then right – $$U$$ gets sent to the characteristic function of $$U$$ pre-composed with $$f$$. In other words, this composition sends each point $$x\in B$$ to $$f(x)$$, then returns $$1$$ if $$f(x)\in U$$ and returns $$0$$ otherwise. This is the same function as before, so the isomorphism is natural.

• 1. But isn't an arrow $x\to y$ in $\mathbf {Set}^{op}$ a function with domain $x$ and codomain $y$ as well? If it is, then our arrow $\{\bullet\}\to\{\ast,\star\}$ must send $\bullet$ somewhere. – user634426 Jul 1 '19 at 2:19
• @user634426 It isn't, actually. An arrow $A\rightarrow B$ in $\mathrm{Set}^{op}$ is exactly the same as a function from $B\rightarrow A$. That is, an arrow in $\mathrm{Set}^{op}$ with domain $A$ and codomain $B$ is the same as a function with domain $B$ and codomain $A$. In moving to the opposite category, nothing changes except what you label as domain and codomain. – user326210 Jul 1 '19 at 2:36
• As an extreme example, in $\mathrm{Set}$, the empty set $\varnothing$ is the initial object. There is one, and only one, function from $\varnothing$ into each set. There are no functions into it except id. In $\mathrm{Set}^{op}$, the arrows are reversed so the dual is true: $\varnothing$ is terminal; there is exactly one arrow in $\mathrm{Set}^{op}$ with domain $A$ and codomain $\varnothing$. That arrow is the unique function $\varnothing \rightarrow A$ in $\mathrm{Set}$. – user326210 Jul 1 '19 at 2:40
• If you like, in opposite categories, the definition of a particular function $f:A\rightarrow B$ remains the same; we just choose to write the arrows the other way: $f:A\leftarrow B$. – user326210 Jul 1 '19 at 2:45