Main derivation
S01 · definition
Before
\text{a universe and two sets}After
U=\{1,2,3,4,5,6,7,8\},\ A=\{2,4,6,8\},\ B=\{3,4,5,6\}Conditions: none
Rule: def_intro · Uses: G1, G2
Leaf basis: def_intro + finite_set_listing
State the universe U first, then A and B. By the MKO, a complement must be relative to an explicit universe, so the universe is fixed before any complement is computed. The sets are given by lists, so by finite_set_listing, x∈A means exactly that x is one of 2, 4, 6, 8.
S02 · implies
Before
A=\{2,4,6,8\},\ B=\{3,4,5,6\},\ U=\{1,2,3,4,5,6,7,8\}After
A\subseteq U,\ B\subseteq U
Conditions: none
Rule: subset_def · Uses: S01
Leaf basis: subset_def + finite_set_listing + forall_intro
The elements of A are exactly 2, 4, 6, 8, and each appears in the list of U; the elements 3, 4, 5, 6 of B are also in U. Since A and B are finite lists, checking all their listed elements is a complete check of 'every element', so by the subset definition A⊆U and B⊆U, as assumption a1 requires: A and B lie in one universe.
S03 · implies
Before
A\subseteq U,\ B\subseteq U
After
A\cup B,\ A\cap B,\ A\setminus B,\ B\setminus A\subseteq U
Conditions: A\subseteq U; B\subseteq U
Rule: L_ops_in_U · Uses: S02
Leaf basis: set_operations_def + subset_def + case_analysis
By Lemma L_ops_in_U (proved in S03.1 and S03.2), all four resulting sets are subsets of U. So no object outside U belongs to them, and to list them it suffices to test the eight elements of U one by one.
S04 · implies
Before
x\in U
After
1{:}(F,F),\ 2{:}(T,F),\ 3{:}(F,T),\ 4{:}(T,T),\ 5{:}(F,T),\ 6{:}(T,T),\ 7{:}(F,F),\ 8{:}(T,F)Conditions: none
Rule: finite_set_listing · Uses: S01, S03
Leaf basis: finite_set_listing + numeric_evaluation
For each element of U record a pair of truth values (x∈A, x∈B): for example 2 is in the list of A and not in that of B, recorded as (T,F); 4 is in both, (T,T); 1 is in neither, (F,F). The eight rows cover all of U, and by S03 every operation below only needs this table.
S05 · equivalent
Before
A\cup B
After
\{2,3,4,5,6,8\}Conditions: none
Rule: set_operations_def · Uses: S03, S04
Leaf basis: set_operations_def + set_extensionality + finite_set_listing
x∈A∪B ⇔ x∈A or x∈B. The rows with at least one T are 2, 3, 4, 5, 6, 8, so A∪B={2,3,4,5,6,8}. 4 and 6 belong to both sets but each counts as one element of the union.
S06 · equivalent
Before
A\cap B
After
\{4,6\}Conditions: none
Rule: set_operations_def · Uses: S03, S04
Leaf basis: set_operations_def + set_extensionality + finite_set_listing
x∈A∩B ⇔ x∈A and x∈B. The only rows with T in both places are 4 and 6, so A∩B={4,6}. Compare with S05: 2 is in A∪B but not in A∩B, so 'or' and 'and' give different sets.
S07 · equivalent
Before
A\setminus B
After
\{2,8\}Conditions: none
Rule: set_operations_def · Uses: S03, S04
Leaf basis: set_operations_def + set_extensionality + finite_set_listing
x∈A∖B ⇔ x∈A and x∉B, that is the rows (T,F): 2 and 8. So A∖B={2,8}.
S08 · equivalent
Before
B\setminus A
After
\{3,5\}Conditions: none
Rule: set_operations_def · Uses: S03, S04
Leaf basis: set_operations_def + set_extensionality + finite_set_listing
x∈B∖A ⇔ x∈B and x∉A, that is the rows (F,T): 3 and 5. So B∖A={3,5}. The rows read here have F first and T second, the opposite direction to S07.
S09 · implies
Before
A\setminus B=\{2,8\},\ B\setminus A=\{3,5\}After
A\setminus B\neq B\setminus A
Conditions: none
Rule: set_extensionality · Uses: S07, S08
Leaf basis: set_extensionality + finite_set_listing
2∈A∖B but 2∉B∖A, so the sets have different elements and by the criterion for equality A∖B≠B∖A. In this example they have no common element at all. Set difference has a direction.
S10 · equivalent
Before
U\setminus A,\ U\setminus B
After
U\setminus A=\{1,3,5,7\},\ U\setminus B=\{1,2,7,8\}Conditions: U\ \text{explicit}
Rule: mko_set_ops · Uses: S01, S04
Leaf basis: set_operations_def + set_extensionality + finite_set_listing + finite_counting_basics
By the MKO, the complement of A is U∖A, relative to the explicit universe U. x∈U∖A ⇔ x∈U and x∉A: the rows with F in the first place are 1, 3, 5, 7. Likewise U∖B consists of the rows with F in the second place, 1, 2, 7, 8. Count check: U is the disjoint union of A and U∖A, so |U∖A|=8−4=4.
S11 · implies
Before
U'\setminus A
After
U'\setminus A=\{1,3,5,7,9,10\}\neq U\setminus AConditions: A\subseteq U'
Rule: set_extensionality · Uses: G3, S01, S10
Leaf basis: set_operations_def + set_extensionality + finite_set_listing
Switch to the universe U′: A⊆U′ still holds, and x∈U′∖A ⇔ x∈U′ and x∉A, giving U′∖A={1,3,5,7,9,10}, with 10−4=6 elements. 9 belongs to U′∖A but not to U∖A (9∉U), so the two 'complements' differ. The list of A did not change, only the universe did; writing 'the complement of A' without a universe has no determinate answer.
S12 · equivalent
Before
U\setminus(A\cup B)
After
(U\setminus A)\cap(U\setminus B)
Conditions: none
Rule: L_de_morgan_set · Uses: set_operations_def
Leaf basis: set_operations_def + de_morgan_logic + and_intro_elim + set_extensionality
By Lemma L_de_morgan_set (proved for arbitrary sets in S12.1 to S12.3), the two are the same set. This is a general argument and does not depend on the numbers of this example.
S13 · implies
Before
U\setminus\{2,3,4,5,6,8\},\quad \{1,3,5,7\}\cap\{1,2,7,8\}After
\{1,7\}=\{1,7\}Conditions: none
Rule: set_operations_def · Uses: S05, S10, S12
Leaf basis: set_operations_def + finite_set_listing + numeric_evaluation
Check the lemma on this example: by S05, U∖(A∪B) consists of the elements of U not in {2,3,4,5,6,8}, namely {1,7}; by S10, (U∖A)∩(U∖B) consists of the common elements of {1,3,5,7} and {1,2,7,8}, also {1,7}. The two agree, consistent with S12.
S14 · equivalent
Before
A\cup B
After
A\cup(B\setminus A)\ \text{with}\ A\cap(B\setminus A)=\varnothingConditions: none
Rule: L_union_split · Uses: S05, S08
Leaf basis: set_operations_def + case_analysis + set_extensionality + contradiction
By Lemma L_union_split (proved in S14.1 and S14.2), A∪B splits into the two disjoint parts A and B∖A. In this example {2,4,6,8}∪{3,5}={2,3,4,5,6,8}, in agreement with S05.
S15 · implies
Before
|A\cup B|=|A\cup(B\setminus A)|
After
|A\cup B|=|A|+|B\setminus A|=4+2=6
Conditions: A\cap(B\setminus A)=\varnothing
Rule: finite_counting_basics · Uses: S08, S14
Leaf basis: finite_counting_basics + numeric_evaluation
A and B∖A are disjoint (S14), so finite counting gives |A∪(B∖A)|=|A|+|B∖A|=4+2=6. Taking |A|+|B|=8 as the size of the union would count 4 and 6 twice; the difference 8−6=2 is exactly |A∩B|.
S16 · implies
Before
\text{membership table of }UAfter
A\cup B=\{2,3,4,5,6,8\},\ A\cap B=\{4,6\},\ A\setminus B=\{2,8\},\ B\setminus A=\{3,5\},\ U\setminus A=\{1,3,5,7\},\ U\setminus B=\{1,2,7,8\}Conditions: none
Rule: and_intro_elim · Uses: S05, S06, S07, S08, S09, S10, S11, S13, S15
Leaf basis: and_intro_elim
Collect the results of S05 to S15: the six results are as shown; A∖B≠B∖A; U′∖A≠U∖A; De Morgan's law holds in this example; |A∪B|=6.
Substeps and lemmas
S03.1 · implies
Before
x\in A\cup B
After
x\in U
Conditions: A\subseteq U; B\subseteq U
Rule: case_analysis · Uses: set_operations_def, subset_def
Leaf basis: set_operations_def + case_analysis + subset_def + forall_elim
Let x∈A∪B; by the definition of union, x∈A or x∈B. Case 1, x∈A: A⊆U gives x∈U. Case 2, x∈B: B⊆U gives x∈U. Both cases give x∈U, so A∪B⊆U.
S03.2 · implies
Before
x\in A\cap B\ \lor\ x\in A\setminus B\ \lor\ x\in B\setminus A
After
x\in U
Conditions: A\subseteq U; B\subseteq U
Rule: and_intro_elim · Uses: set_operations_def, subset_def
Leaf basis: set_operations_def + and_intro_elim + subset_def + forall_elim
Both x∈A∩B and x∈A∖B contain the conjunct x∈A; extracting it and using A⊆U gives x∈U. x∈B∖A contains x∈B, and B⊆U gives x∈U. S03.1 and S03.2 together prove Lemma L_ops_in_U.
S12.1 · equivalent
Before
x\in U\setminus(A\cup B)
After
x\in U\land\neg(x\in A\lor x\in B)
Conditions: none
Rule: set_operations_def · Uses: set_operations_def
Leaf basis: set_operations_def + def_unfold
By the definition of difference, x∈U∖(A∪B) ⇔ x∈U and x∉A∪B; by the definition of union, x∉A∪B is ¬(x∈A or x∈B).
S12.2 · equivalent
Before
x\in U\land\neg(x\in A\lor x\in B)
After
x\in U\land x\notin A\land x\notin B
Conditions: none
Rule: de_morgan_logic · Uses: S12.1, de_morgan_logic
Leaf basis: de_morgan_logic
By De Morgan's law for logic, ¬(P∨Q) ⇔ ¬P∧¬Q, with P the statement x∈A and Q the statement x∈B. Negation turns 'or' into 'and'.
S12.3 · equivalent
Before
x\in U\land x\notin A\land x\notin B
After
x\in(U\setminus A)\cap(U\setminus B)
Conditions: none
Rule: and_intro_elim · Uses: S12.2, set_operations_def
Leaf basis: and_intro_elim + set_operations_def + forall_intro + set_extensionality
Duplicate x∈U (P ⇔ P∧P) and regroup the conjunction: (x∈U and x∉A) and (x∈U and x∉B), that is x∈U∖A and x∈U∖B, which is x∈(U∖A)∩(U∖B). Since x was arbitrary, set equality applies, and S12.1 to S12.3 together prove Lemma L_de_morgan_set.
S14.1 · equivalent
Before
x\in A\lor(x\in B\land x\notin A)
After
x\in A\lor x\in B
Conditions: none
Rule: case_analysis · Uses: set_operations_def
Leaf basis: case_analysis + set_operations_def + set_extensionality
The left side unfolds x∈A∪(B∖A). Split on x∈A: if x∈A, both sides hold; if x∉A, the left side reduces to x∈B∧x∉A, that is x∈B, and the right side also reduces to x∈B. In both cases the two sides agree, so A∪(B∖A)=A∪B.
S14.2 · implies
Before
x\in A\cap(B\setminus A)
After
A\cap(B\setminus A)=\varnothing
Conditions: none
Rule: contradiction · Uses: set_operations_def
Leaf basis: set_operations_def + contradiction + quantifier_negation
If x∈A∩(B∖A), then x∈A and x∈B and x∉A, a contradiction. So there is no such x, and A∩(B∖A)=∅. S14.1 and S14.2 together prove Lemma L_union_split.