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 : rsr ∩ s is the set that contains the elements that are contained in relation rr as well as in ss, or rs = {(x,y)  (x,y)r(x,y)s}r ∩ s\ =\ \{ (x,y)\ |\ (x,y) ∈ r ∧ (x,y) ∈ s \}

  • union : rsr ∪ s is the set that contains all elements that are contained either in relation rr or in ss, or rs = {(x,y)  (x,y)r(x,y)s}r ∪ s\ =\ \{ (x,y)\ |\ (x,y) ∈ r ∨ (x,y) ∈ s \}

  • difference : rsr - s is the set that contains the elements of relation rr that are not contained in ss, or rs = {(x,y)  (x,y)r(x,y)s}r - s\ =\ \{ (x,y)\ |\ (x,y) ∈ r ∧ (x,y) ∉ s \}

The complement (or negation) of a relation r[AxB]r_{[A x B]} is defined by means of the difference operator:

  • complement : If rr is defined as rA×Br_{A\times B}, then r\overline{r} is the set of all tuples in A×BA\times B (the Cartesian product) that are not contained in rr. So r=V[A×B]r\overline{r} = V_{[A\times B]} - r

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

How to type boolean operators in your script

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

Other explanation

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

Last updated