Mathbook Project

Subsets and Power Sets

We will often want to compare sets. One kind of comparison is: everything in one set is in the other (set) too. This situation is sufficiently important for us to introduce some new notation.

Definition Subset

If every element of a set AA is also an element of BB, then we say that AA is a subset of BB, and we write ABA \subseteq B. If ABA \subseteq B but ABA \neq B, we write ABA \subset B, and say that AA is a proper subset of BB.

The notation \subset is used because they are similar to equality operators \leq and <<. You may also see \subsetneq in other literature. The corresponding latex symbols are \subset, \subseteq, and \subsetneq.

Example Basics

Every set is a subset of itself, and \emptyset is a subset of every set. The set of even numbers is a subset of the set of natural numbers. Also {a,b}{a,b,c}\{a, b\} \subseteq \{a, b, c\}. But {a,b,e}\{a, b, e\} is not a subset of {a,b,c}\{a, b, c\}.

Applying subsets is useful for checking validity of something e.g. ensuring that a customer have chosen appropriate combination of items. The chefs check that they have chosen ingredients from available sets before planning the servings. The managers compare software features against the requirements.

Example Pizza toppings

Let all pizza toppings be a A={ham,kebab,cheese,tomato}A = \{ ham, kebab, cheese, tomato \}. Choosing any subset of toppings would result in a pizza that have name e.g. ham or cheese pizza. A kebab pizza would be a proper subset B={kebab,cheese}B = \{ kebab, cheese \} so BAB \subset A.

In Python the example would be written as

pizza_toppings: set[str] = { "ham", "kebab", "mozzarella", "tomato" }
kebab_pizza: set[str] = { "kebab", "mozzarella" }

print(kebab_pizza.issubset(pizza_toppings))
# True
Proposition

A=BA = B iff both ABA \subseteq B and BAB \subseteq A.

Definition Power Set

The set consisting of all subsets of a set AA is called power set of AA, written (A)\wp(A):

(A)={BBA}. \wp(A) = \{ B \mid B \subseteq A \}.

The symbol can be written \wp in TeX (perhaps short for Weierstrass p-function). You may also encounter different power set notations that uses different styles of "p" such as P(A)P(A).

Example Different soups

Soups can have any combination of ingredients and still taste good. The chef wants a list of all soups he can make from a set of ingredients S={salmon,potato}S = \{ salmon, potato \}. That power set that describes all combinations is

(S)={,{salmon},{potato},{potato,carrot}}. \wp(S) = \{ \emptyset, \{ salmon \}, \{ potato \}, \{ potato, carrot \} \}.
Problem

List all subsets of {a,b,c,d}\{ a, b, c, d\}.

Problem

Show that if AA has nn elements, then (A)\wp(A) has 2n2^n elements.