git @ Cat's Eye Technologies Eqthy / df4be3a
Use Boolean algebra as basis for set difference, interior algebra. Chris Pressey 1 year, 1 month ago
3 changed file(s) with 48 addition(s) and 45 deletion(s). Raw diff Collapse all Expand all
55 For more information, please refer to <https://unlicense.org/>
66 SPDX-License-Identifier: Unlicense
77 -->
8
9 TODO: turn this into "Boolean algebra alternate axioms" where we prove some of the statements
10 that we took as axioms, as theorems, using statements that we proved as theorems, as axioms.
811
912 Is the [Algebra of sets (Wikipedia)](https://en.wikipedia.org/wiki/Algebra_of_sets) really
1013 any different from [Boolean algebra (Wikipedia)](https://en.wikipedia.org/wiki/Boolean_algebra)?
2626 too, to similar effect: they also define the fundamental topological closure operation.)
2727
2828 Requires [Set Difference](set-difference.eqthy.md)
29 (which will also bring in [Algebra of Sets](algebra-of-sets.eqthy.md)).
30 (TODO: just change to using Boolean algebra as the basis.)
29 (which itself is based on [Boolean algebra](boolean-algebra.md)).
3130
32 axiom (#comp-universe) comp(u) = e
33 axiom (#comp-empty) comp(e) = u
31 // TODO: these should be from boolean algebra
32 axiom (#comp-universe) not(1) = 0
33 axiom (#comp-empty) not(0) = 1
3434
35 axiom (#interior-closed) diff(interior(X), X) = e
35 axiom (#interior-closed) diff(interior(X), X) = 0
3636 axiom (#interior-idem) interior(interior(X)) = interior(X)
37 axiom (#interior-distrib) interior(inter(X, Y)) = inter(interior(X), interior(Y))
38 axiom (#interior-total) interior(u) = u
37 axiom (#interior-distrib) interior(and(X, Y)) = and(interior(X), interior(Y))
38 axiom (#interior-total) interior(1) = 1
3939
4040 We can define the closure operator in terms of the interior operator.
4141
42 axiom (#clos) clos(X) = comp(interior(comp(X)))
42 axiom (#clos) clos(X) = not(interior(not(X)))
4343
4444 This is the dual of the interior. Duals of the above axioms all hold.
4545 We can prove them as theorems.
4848 the interior operator.
4949
5050 theorem
51 interior(inter(X, inter(Y, Z))) = inter(interior(X), inter(interior(Y), interior(Z)))
51 interior(and(X, and(Y, Z))) = and(interior(X), and(interior(Y), interior(Z)))
5252 proof
53 interior(inter(X, inter(Y, Z))) = interior(inter(X, inter(Y, Z)))
54 interior(inter(X, inter(Y, Z))) = inter(interior(X), interior(inter(Y, Z)))
55 interior(inter(X, inter(Y, Z))) = inter(interior(X), inter(interior(Y), interior(Z)))
53 interior(and(X, and(Y, Z))) = interior(and(X, and(Y, Z)))
54 interior(and(X, and(Y, Z))) = and(interior(X), interior(and(Y, Z)))
55 interior(and(X, and(Y, Z))) = and(interior(X), and(interior(Y), interior(Z)))
5656 qed
5757
5858 Right, so, onto the closure operator.
5959
6060 theorem (#closure-total)
61 clos(e) = e
61 clos(0) = 0
6262 proof
6363 clos(X) = clos(X)
64 clos(X) = comp(interior(comp(X)))
65 clos(e) = comp(interior(comp(e))) [by substitution of e into X]
66 clos(e) = comp(interior(u))
67 clos(e) = comp(u)
68 clos(e) = e
64 clos(X) = not(interior(not(X)))
65 clos(0) = not(interior(not(0))) [by substitution of 0 into X]
66 clos(0) = not(interior(1))
67 clos(0) = not(1)
68 clos(0) = 0
6969 qed
88
99 Some theorems about set difference.
1010
11 Using the [Algebra of sets (Wikipedia)](https://en.wikipedia.org/wiki/Algebra_of_sets)
12 as a basis. (TODO: just change to using Boolean algebra as the basis.)
11 These theorems, as usually stated, are based on an [Algebra of sets (Wikipedia)](https://en.wikipedia.org/wiki/Algebra_of_sets).
12 However, we will use Boolean algebra as their basis here. (I'm given to
13 understand that these two theories are subtlely different, but I've concluded
14 that the difference, if there is one, is too subtle to matter for our purposes;
15 all the axioms and properties we care about are shared by the two,
16 and it is only a matter of adjusting the nomenclature.)
1317
14 Requires [Algebra of Sets](algebra-of-sets.eqthy.md).
15
16 axiom (#union-de-morg) comp(inter(A, B)) = union(comp(A), comp(B))
17 axiom (#inter-de-morg) comp(union(A, B)) = inter(comp(A), comp(B))
18 Requires [Boolean algebra](boolean-algebra.eqthy.md).
1819
1920 Definition of set difference.
2021
21 axiom (#diff) diff(A, B) = inter(A, comp(B))
22 axiom (#diff) diff(A, B) = and(A, not(B))
2223
2324 A theorem about set difference: difference distributes over union.
2425
2526 theorem (#diff-union-distrib)
26 union(diff(A, C), diff(B, C)) = diff(union(A, B), C)
27 or(diff(A, C), diff(B, C)) = diff(or(A, B), C)
2728 proof
28 union(diff(A, C), diff(B, C)) = union(diff(A, C), diff(B, C))
29 union(diff(A, C), diff(B, C)) = union(diff(A, C), inter(B, comp(C)))
30 union(diff(A, C), diff(B, C)) = union(inter(A, comp(C)), inter(B, comp(C)))
31 union(diff(A, C), diff(B, C)) = union(inter(A, comp(C)), inter(comp(C), B))
32 union(diff(A, C), diff(B, C)) = union(inter(comp(C), A), inter(comp(C), B))
33 union(diff(A, C), diff(B, C)) = inter(comp(C), union(A, B))
34 union(diff(A, C), diff(B, C)) = inter(union(A, B), comp(C))
35 union(diff(A, C), diff(B, C)) = diff(union(A, B), C)
29 or(diff(A, C), diff(B, C)) = or(diff(A, C), diff(B, C))
30 or(diff(A, C), diff(B, C)) = or(diff(A, C), and(B, not(C)))
31 or(diff(A, C), diff(B, C)) = or(and(A, not(C)), and(B, not(C)))
32 or(diff(A, C), diff(B, C)) = or(and(A, not(C)), and(not(C), B))
33 or(diff(A, C), diff(B, C)) = or(and(not(C), A), and(not(C), B))
34 or(diff(A, C), diff(B, C)) = and(not(C), or(A, B))
35 or(diff(A, C), diff(B, C)) = and(or(A, B), not(C))
36 or(diff(A, C), diff(B, C)) = diff(or(A, B), C)
3637 qed
3738
38 Another theorem about set difference. This one uses De Morgan's law, which
39 has been added as an axiom above. For a working-out of it, see the
40 Boolean algebra document.
39 Another theorem about set difference: the difference of A and B is the
40 same as the difference of A and the intersection of A and B.
4141
4242 theorem (#diff-of-inter-is-diff)
43 diff(A, B) = diff(A, inter(A, B))
43 diff(A, B) = diff(A, and(A, B))
4444 proof
4545 diff(A, B) = diff(A, B)
46 diff(A, B) = inter(A, comp(B))
47 diff(A, B) = union(inter(A, comp(B)), e)
48 diff(A, B) = union(e, inter(A, comp(B)))
49 diff(A, B) = union(inter(A, comp(A)), inter(A, comp(B)))
50 diff(A, B) = inter(A, union(comp(A), comp(B)))
51 diff(A, B) = inter(A, comp(inter(A, B)))
52 diff(A, B) = diff(A, inter(A, B))
46 diff(A, B) = and(A, not(B))
47 diff(A, B) = or(and(A, not(B)), 0)
48 diff(A, B) = or(0, and(A, not(B)))
49 diff(A, B) = or(and(A, not(A)), and(A, not(B)))
50 diff(A, B) = and(A, or(not(A), not(B)))
51 diff(A, B) = and(A, not(and(A, B)))
52 diff(A, B) = diff(A, and(A, B))
5353 qed
5454
5555 Both of these theorems were adapted from