The identity laws: A ∪ ∅ = A and A ∩ U = A¶
Level: 101 · one law of the algebra of sets, on its own page
One line: Adding nothing changes nothing, and keeping everything keeps A: ∅ is the identity for ∪ and U for ∩, the way 0 is for + and 1 for ×.
The law¶
| Sets | Logic | Python |
|---|---|---|
| A ∪ ∅ = A, A ∩ U = A | p ∨ false = p, p ∧ true = p | a | set() == a and a & U == a |
Why it is true¶
For any x, "x ∈ A or x ∈ ∅" is just "x ∈ A", since x ∈ ∅ is always false; and "x ∈ A and x ∈ U" is just "x ∈ A", since x ∈ U is always true inside the universe. In logic, or false and and true both leave p alone. A law of sets is decided one member at a time, so checking it on every subset of a four-element universe, every pattern of membership there is, proves it; the program does that and prints the matching truth table.
Where it is used, and the trap¶
The identity elements are what make the subsets of U a monoid under ∪ and again under ∩, and in code a | set() and a & U are the no-ops. The trap is the second: A ∩ U = A only because U was fixed first; with a bigger U the complement changes, though this law does not.
What the program prints¶
Verified output of law_identity.py — regenerated by tools/run_examples.py, never hand-typed.
1. THE LAW: A ∪ ∅ = A, A ∩ U = A
checked on all 16 choices of 1 subset(s) of U = {1, 2, 3, 4}: True
2. ONE INSTANCE, WORKED
A = {1, 2}, B = {2, 3}, C = {3, 4}, A' = {3, 4}, B' = {1, 4}
A ∪ ∅ = {1, 2} = A
A ∩ U = {1, 2} = A
3. THE SAME LAW IN LOGIC: p ∨ false = p, p ∧ true = p
every row of the truth table agrees, which is why the member-by-member check is a proof:
p left right
T T T
F T T
Po polsku, w skrócie¶
Prawa identyczności: suma ze zbiorem pustym i przekrój z uniwersum nie zmieniają A, tak jak dodanie 0 i pomnożenie przez 1 nie zmieniają liczby. W logice to „lub fałsz" i „i prawda".
Auf Deutsch: Stichwörter¶
Neutrale Elemente: A ∪ ∅ = A und A ∩ U = A.
Stichwörter: neutrales Element (identity), leere Menge, Grundmenge.
See also¶
- The algebra of sets — all the laws in one table, and the ones that look true and are not
- The laws, one page each — the other nine
- Truth tables and the laws of logic — the same list for ∨, ∧, ¬
- The laws of an operation — what every such list has in common