Preliminary definitions
Relations
generic 5 rightassoc (_ _) |
X
Y is the set of relations between X and Y,
that is, the set of all sets of ordered pairs whose first members
are members of X and whose second members are members of Y.
Total functions
generic 5 rightassoc (_ _) |
X Y == { f : X Y | x : X 1 y : Y (x , y) f } |
X
Y is the set of all total functions from X to Y,
that is, the set of all relations between X and Y
such that each x in X is related to exactly one y in Y.
Sets
Inequality relation
relation (_ _) |
|
|
[X] |
|
 |
|
 |
|
 |
|
 |
|
| _ _ : X X |
|
 |
 |
 |
|
| x , y : X x y x = y |
|
Inequality is the relation between those values of the same type
that are not equal to each other.
Non-membership
relation (_ _) |
|
|
[X] |
|
 |
|
 |
|
 |
|
 |
|
| _ _ : X X |
|
 |
 |
 |
|
| x : X ; a : X x a x a |
|
Non-membership is the relation between those values of a type, x,
and sets of values of that type, a,
for which x is not a member of a.
Empty set
[ X ] == { x : X | false } |
The empty set of any type is the set of that
type that has no members.
Subset relation
relation (_ _) |
|
|
[X] |
|
 |
|
 |
|
 |
|
 |
|
| _ _ : X X |
|
 |
 |
 |
|
| a , b : X a b  |
| ( x : a x b ) |
|
Subset is the relation between two sets of the same type, a and b,
such that every member of a is a member of b.
Proper subset relation
relation (_ _) |
|
|
[X] |
|
 |
|
 |
|
 |
|
 |
|
| _ _ : X X |
|
 |
 |
 |
|
| a , b : X a b  |
| a b a b |
|
Proper subset is the relation between two
sets of the same type, a and b,
such that a is a subset of b,
and a and b are not equal.
Non-empty subsets
If X is a set, then
1 X is the set of all non-empty subsets of X.
NOTE
The
symbol is established as a generic operator by the prelude.
Set union
function 30 leftassoc (_ _) |
|
|
[X] |
|
 |
|
 |
|
 |
|
 |
|
| _ _ : X X X |
|
 |
 |
 |
|
| a , b : X a b = { x : X | x a x b } |
|
The union of two sets of the same type is the set of values
that are members of either set.
Set intersection
function 40 leftassoc (_ _) |
|
|
[X] |
|
 |
|
 |
|
 |
|
 |
|
| _ _ : X X X |
|
 |
 |
 |
|
| a , b : X a b = { x : X | x a x b } |
|
The intersection of two sets of the same type is the set of
values that are members of both sets.
Set difference
function 30 leftassoc (_ \ _) |
|
|
[X] |
|
 |
|
 |
|
 |
|
 |
|
| _ \ _ : X X X |
|
 |
 |
 |
|
| a , b : X a \ b = { x : X | x a x b } |
|
The difference of two sets of the same type is the set of
values that are members of the first set but not members of the second set.
Set symmetric difference
function 25 leftassoc (_ _) |
|
|
[X] |
|
 |
|
 |
|
 |
|
 |
|
| _ _ : X X X |
|
 |
 |
 |
|
| a , b : X a b = { x : X | ( x a x b) } |
|
The symmetric set difference of two sets of the same type is
the set of values that are members of one set, or the other,
but not members of both.
Generalized union
|
|
[X] |
|
 |
|
 |
|
 |
|
 |
|
| : X X |
|
 |
 |
 |
|
| A : X A = { x : X | a : A x a } |
|
The generalized union of a set of sets of the same type is
the set of values of that type that are members of at least one of the sets.
Generalized intersection
|
|
[X] |
|
 |
|
 |
|
 |
|
 |
|
| : X X |
|
 |
 |
 |
|
| A : X A = { x : X | a : A x a } |
|
The generalized intersection of a set of sets of values of the same
type is the set of values of that type that are members of
every one of the sets.
Finite sets
Finite subsets
generic ( _) |
X == { A : X | |
A ( a : A ; x : X a { x } A ) } |
If X is a set,
then
X is the set of all finite subsets of X.
The set of finite subsets of X is the smallest set that contains the empty set
and is closed under the action of adding single elements of X.
Non-empty finite subsets
If X is a set,
then
1 X is the set of all non-empty finite subsets of X.
The set of non-empty finite subsets of X is the smallest set that contains
the singleton sets of X and is closed under the action of adding single
elements of X.
IT 22-Jan-2002