The absorption laws: A ∪ (A ∩ B) = A and A ∩ (A ∪ B) = A¶
Level: 101 · one law of the algebra of sets, on its own page
One line: A ∩ B already lies inside A, so joining it adds nothing; A ∪ B already contains A, so meeting with it removes nothing: B is absorbed and disappears.
The law¶
| Sets | Logic | Python |
|---|---|---|
| A ∪ (A ∩ B) = A, A ∩ (A ∪ B) = A | p ∨ (p ∧ q) = p, p ∧ (p ∨ q) = p | a | (a & b) == a |
Why it is true¶
If x ∈ A then x is in both sides of each law; if x ∉ A then x ∉ A ∩ B, so x is in neither side of the first, and x ∉ A ∩ (A ∪ B), so in neither side of the second. B never gets a say. In logic, "p or (p and q)" is true exactly when p is. 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¶
Absorption is the rule a simplifier uses to delete redundant conditions: a or (a and b) is a, and a query that filters by A and then by "A or B" filtered by A. It is also the law that defines a lattice, the structure ∪ and ∩ share with max and min, gcd and lcm.
What the program prints¶
Verified output of law_absorption.py — regenerated by tools/run_examples.py, never hand-typed.
1. THE LAW: A ∪ (A ∩ B) = A, A ∩ (A ∪ B) = A
checked on all 256 choices of 2 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 ∪ (A ∩ B) = A ∪ {2} = {1, 2} = A
A ∩ (A ∪ B) = A ∩ {1, 2, 3} = {1, 2} = A
3. THE SAME LAW IN LOGIC: p ∨ (p ∧ q) = p, p ∧ (p ∨ q) = p
every row of the truth table agrees, which is why the member-by-member check is a proof:
p q left right
T T T T
T F T T
F T F F
F F F F
Po polsku, w skrócie¶
Prawa absorpcji: A ∩ B leży wewnątrz A, więc suma nic nie dodaje; A ∪ B zawiera A, więc przekrój nic nie zabiera; B znika. Tak upraszcza się warunki: a or (a and b) to a.
Auf Deutsch: Stichwörter¶
Absorptionsgesetze: A ∪ (A ∩ B) = A und A ∩ (A ∪ B) = A.
Stichwörter: Absorptionsgesetz, Vereinigung, Schnitt, Verband (lattice).
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