arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Boolean operators in set theory

A relation is by definition a subset of the Cartesian Product of the source and target sets. So, if two different relations r and s are defined on the same source A and target B, then the ordinary set operators can be applied to produce a new relation.

  • intersection : r∩sr ∩ sr∩s is the set that contains the elements that are contained in relation rrr as well as in sss, or r∩s = {(x,y) ∣ (x,y)∈r∧(x,y)∈s}r ∩ s\ =\ \{ (x,y)\ |\ (x,y) ∈ r ∧ (x,y) ∈ s \}r∩s = {(x,y) ∣ (x,y)∈r∧(x,y)∈s}

  • union : r∪sr ∪ sr∪s is the set that contains all elements that are contained either in relation or in , or

  • difference : is the set that contains the elements of relation that are not contained in , or

The complement (or negation) of a relation is defined by means of the difference operator:

  • complement : If is defined as , then is the set of all tuples in (the Cartesian product) that are not contained in . So

Note that the complement is defined in terms of and . So, two relations with the identical population yet a different type may have different complements.

hashtag
How to type boolean operators in your script

shows how you can write these things in your Ampersand script.

hashtag
Other explanation

Would you like a different explanation of the boolean operators? explains the boolean operators in logic.

rrr
sss
r∪s = {(x,y) ∣ (x,y)∈r∨(x,y)∈s}r ∪ s\ =\ \{ (x,y)\ |\ (x,y) ∈ r ∨ (x,y) ∈ s \}r∪s = {(x,y) ∣ (x,y)∈r∨(x,y)∈s}
r−sr - sr−s
rrr
sss
r−s = {(x,y) ∣ (x,y)∈r∧(x,y)∉s}r - s\ =\ \{ (x,y)\ |\ (x,y) ∈ r ∧ (x,y) ∉ s \}r−s = {(x,y) ∣ (x,y)∈r∧(x,y)∈/s}
r[AxB]r_{[A x B]}r[AxB]​
rrr
rA×Br_{A\times B}rA×B​
r‾\overline{r}r
A×BA\times BA×B
rrr
r‾=V[A×B]−r\overline{r} = V_{[A\times B]} - rr=V[A×B]​−r
AAA
BBB
This page
This page