Given a Set , the power set is the set of all subsets of . It is ordered by inclusion, which makes it a poset (and from now on this is the order meant when speaking of “the power set as an ordered set”).
Sources: 7 Sketches Example 1.50, 1.87, Exercise 1.51; Kittenlab Lecture 14; CTfS Definition 2.7.4.1, Exercise 2.7.4.2, Proposition 2.7.4.10, Exercise 5.3.2.3
For , the Hasse Diagram of is a cube; in general looks like an -dimensional cube:
Why “power” set (CTfS Exercise 2.7.4.2): , , , and in general because subsets are the same as characteristic functions (Subobject Classifier). Downward-closed families of subsets containing all singletons are simplicial complexes.
Properties
- In the Meet of is and the Join is (Example 1.87); the top element is and the bottom is .
- , the set of maps ; equivalently is the preorder of upper sets of the Discrete Preorder on (Exercise 1.55).
- The elements of have a Monotone Map , cardinality (Example 1.62).
- A function induces three adjoint monotone maps between and ; see Direct Image, Preimage, and Dual Image.
- with singletons and unions is a Monad on whose Kleisli arrows are relations (Power Set Monad).
- is a contravariant Functor via preimage, and a covariant one via direct image (Kittenlab Lecture 14).
Docs: FinSets · C-set morphisms — Kittenlab Lecture 14
using Catlab
X = FinSet(3)
# subobjects of a finite set form a lattice (Catlab.CategoricalAlgebra.Subobjects)
U = Subobject(X, [1,2]); V = Subobject(X, [2,3])
meet(U, V) # {2}
join(U, V) # {1,2,3}
top(X); bottom(X)-- Mathlib: `Set α` is a complete Boolean algebra under ⊆
example (α : Type) : CompleteBooleanAlgebra (Set α) := inferInstance
example (α : Type) (A B : Set α) : A ⊓ B = A ∩ B := rfl
example (α : Type) (A B : Set α) : A ⊔ B = A ∪ B := rfl
#check (Set.powerset : Set α → Set (Set α))import Data.List (subsequences)
powerset :: [a] -> [[a]]
powerset = subsequences
-- powerset [0,1,2] == [[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]]