CS Wiki | Cedric Schwyter

Sets, Relations, and Functions

Sets, Relations, and Functions

Sets and Operations on Sets

πŸ’‘ The number of elements of a finite set is called its cardinality and is denoted .

πŸ’‘

πŸ“Œ For any and , .

πŸ’‘ The set is a subset of the set , denoted , if every element of is also an element of , i.e.,

πŸ’‘ .

πŸ’‘ . (transitivity of )

πŸ’‘ A set is called empty if it contains no elements and is ofent denoted as or . In other words, .

πŸ“Œ There is only one empty set.

πŸ“Œ The emtpy set is a subset of every set, i.e., .

πŸ’‘ The power set of a set , denoted , is the set of all subsets of :

πŸ’‘ The union of two sets and is defined as

and their intersection is defined as

πŸ’‘ For a given universe , the complement of a set , denoted , is

or simply .

πŸ’‘ The difference of sets and , denoted is the set of elements of without those that are elements of :

πŸ“– For any sets , and , the following laws hold:

Idempotence: and

Commutativity: and

Associativity: and

Distributivity: and

Consistency:

πŸ’‘ The Cartesian product of two sets and is the set of all ordered pairs with the first component from and the second component from :

Relations

πŸ’‘ A (binary) relation from a set to a set (also called an -relation) is a subset of . If , then is called a relation on .

πŸ’‘ Instead of one usually writes

and sometimes we write if .

πŸ’‘ For any set , the identity relation on , denoted (or ), is the relation .

πŸ’‘ The inverse of a relation from to is the relation from to defined by

πŸ’‘ Let be a relation from to and let be a relation from to . Then the composition of and , denoted (or also ), is the relation from to defined by

The -fold composition of a relation on a set with itself is denoted .

πŸ“Œ The composition of relations is associative, i.e., we have .

πŸ“Œ Let be a relation from to and let be a relation from to . Then the inverse of is the relation .

πŸ’‘ A relation on a set is called reflexive if

is true for all , i.e., if

πŸ’‘ A relation on a set is called irreflexive if for all , i.e., if .

πŸ’‘ A relation on a set is called symmetric if

is true for all , i.e., if

πŸ’‘ A relation on a set is called antisymmetric if

is true for all , i.e., if

πŸ’‘ A relation on a set is called transitive if

is true for all .

πŸ“Œ A relation is transitive if and only if .

πŸ’‘ The transitive closure of a relation on a set , denoted , is

Equivalence Relations

πŸ’‘ An equivalence relation is a relation on a set that is reflexive, symmetric and transitive.

πŸ’‘ For an equivalence relation on a set and for , the set of elements of that are equivalent to is called the equivalence class of and is denoted as :

πŸ“Œ The intersection of two equivalence relations is an equivalence relation.

πŸ’‘ A partition of a set is a set of mutually disjoint subsets of that cover , i.e., a set of sets (for some index set ) satisfying

πŸ’‘ The set of equivalence classes of an equivalence relation , denoted by

is called the quotient set of by , or simply modulo , or .

πŸ“– The set of equivalence classes of an equivalence relation on is a partition of .

Partial Order Relations

πŸ’‘ A partial order (or simply an order relation) on a set is a relation that is reflexive, antisymmetric, and transitive. A set together with a partial order on is called a partially ordered set (or simply poset) and is denoted as .

πŸ’‘ For a poset , two elements and are called comparable if or ; otherwise they are called incomparable.

πŸ’‘ If any two elements of a poset are comparable, then is called totally ordered (or linearly ordered) by .

πŸ’‘ In a poset an element is said to cover an element if and there exists no with and (i.e., between and ).

πŸ’‘ The Hasse diagram of a (finite) poset is the directed graph whose vertices are labeled with the elements of and where there is an edge from to if and only if covers .

πŸ’‘ For given posets and , their direct product, denoted , is the set with the relation (on ) defined by

πŸ“– is a partial order relation.*

πŸ“– For given posets and , the relation defined on by

is a partial order relation.

πŸ’‘ The relation is the so-called lexicographic order of pairs, usually considered when both posets are identical. The lexicographic order is useful because if both and are totally ordered (eq. the alphabetical order of the letters), then so is the lexicographic order on .

πŸ’‘ Let be a poset, and let be some subset of A. Then

  1. is a minimal (maximal) element of if there exists no with ().
  2. is the least (greatest) element of if () for all .
  3. is a lower (upper) bound of if () for all .
  4. is the greatest lower bound (least upper bound) of if is the greatest (least) element of the set of all lower (upper) bounds of .

πŸ’‘ A poset is well-ordered if it is totally ordered and if every non-empty subset of has a least element.

πŸ’‘ Let be a poset. If and (i.e., the set ) have a greatest lower bound, then it is called the meet of and , often denoted as . If and have a least upper bound, then it is called the join of and , often denoted .

πŸ’‘ A poset in which every pair of elements has a meet and a join is called a lattice.

Functions

πŸ’‘ A function from a domain to a codomain is a relation from to with the special properties (using the relation notation ):

  1. ( is totally defined)
  2. ( is well-defined).

πŸ’‘ The set of all functions is denoted as .

πŸ’‘ A partial function is a relation from to such that condition 2. above holds.

πŸ’‘ For a function and a subset of , the image of under , denoted , is the set

πŸ’‘ The subset of is called the image (or range) of and is also denoted .

πŸ’‘ For a subset of , the preimage of , denoted , is the set of values in that map into :

πŸ’‘ A function is called

  1. injective (or one-to-one or an injection) if for we have , i.e., no two distinct values are mapped to the same function value (there are no β€œcollisions”).
  2. surjective (or onto) if , i.e., if for every for some (every value in the codomain is taken on for some argument).
  3. bijective (or a bijection) if it is both injective or surjective.

πŸ’‘ For a bijective function , the inverse relation is called the inverse function of , usually denoted as .

πŸ’‘ A function between two finite sets of equal cardinality is injective if and only if it is surjective.

πŸ’‘ The composition of a function and a function , denoted by or simply , is defined by .

πŸ“Œ Function composition is associative, i.e., .

πŸ’‘ A function is idempotent if for all

Countable and Uncountable Sets

πŸ’‘ Countability of Sets:

  1. Two sets amd are equinumerous, denoted , if there exists a bijection .
  2. The set dominates the set , denoted , if for some subset or, equivalently, if there exists an injective function .
  3. A set is called countable if , and uncountable otherwise.

πŸ“Œ Transitivity:

  1. The relation is transitive: .
  2. .

πŸ“– Bernstein-SchrΓΆder Theorem:

πŸ“– A set is countable if and only if it is finite or if .

πŸ“– The set of finite binary sequences is countable.

πŸ“– The set () of ordered pairs of natural numbers is countable.

πŸ“Ž The Cartesian product of two countable sets and is countable, i.e., .

πŸ“Ž The rational numbers are countable.

πŸ“– Let and for be countable sets.

  1. For any , the set of -tuples over is countable.
  2. The union of a countable list of countable sets is countable.
  3. The set of finite sequences of elements from is countable.

πŸ’‘ Let denote the set of semi-infinite binary sequences.

πŸ“– The set is uncountable.

πŸ’‘ A function is called computable if there is a program that, for every , when given as input, outputs .

πŸ“Ž There are uncomputable functions .

This project is maintained by D3PSI