The powerset functor, often denoted as ( \mathcal{P} ), is a functor from the category of sets, ( \mathbf{Set} ), to itself. However, it is contravariant when considered in the context of its action on functions. Let's break down why this is the case.
Definition of the Powerset Functor
For a set ( X ), the powerset ( \mathcal{P}(X) ) is the set of all subsets of ( X ). For a function ( f: X \to Y ), the powerset functor ( \mathcal{P} ) maps ( f ) to a function ( \mathcal{P}(f): \mathcal{P}(Y) \to \mathcal{P}(X) ) defined by:
[
\mathcal{P}(f)(S) = { x \in X \mid f(x) \in S }
]
for any subset ( S \subseteq Y ).
Covariant vs. Contravariant Functors
- A covariant functor preserves the direction of morphisms. If ( F ) is a covariant functor and ( f: X \to Y ), then ( F(f): F(X) \to F(Y) ).
- A contravariant functor reverses the direction of morphisms. If ( F ) is a contravariant functor and ( f: X \to Y ), then ( F(f): F(Y) \to F(X) ).
Why the Powerset Functor is Contravariant
The powerset functor ( \mathcal{P} ) is contravariant because it maps a function ( f: X \to Y ) to a function ( \mathcal{P}(f): \mathcal{P}(Y) \to \mathcal{P}(X) ). Specifically:
- Given ( f: X \to Y ), the induced function ( \mathcal{P}(f) ) takes a subset ( S \subseteq Y ) and returns the subset of ( X ) consisting of all elements that map into ( S ) under ( f ).
This reversal of the direction of the morphism (from ( \mathcal{P}(Y) \to \mathcal{P}(X) ) instead of ( \mathcal{P}(X) \to \mathcal{P}(Y) )) is what makes the powerset functor contravariant.
Example
Consider sets ( X = {a, b} ) and ( Y = {1, 2} ), and a function ( f: X \to Y ) defined by ( f(a) = 1 ) and ( f(b) = 2 ).
- Let ( S = {1} \subseteq Y ). Then ( \mathcal{P}(f)(S) = {x \in X \mid f(x) \in S} = {a} ).
- Thus, ( \mathcal{P}(f): \mathcal{P}(Y) \to \mathcal{P}(X) ) maps ( {1} ) to ( {a} ).
This example illustrates how ( \mathcal{P}(f) ) reverses the direction of the original function ( f ).
Summary
The powerset functor ( \mathcal{P} ) is contravariant because it maps a function ( f: X \to Y ) to a function ( \mathcal{P}(f): \mathcal{P}(Y) \to \mathcal{P}(X) ), reversing the direction of the morphism. This is a fundamental property of how the powerset functor interacts with functions in the category of sets.