15.08.2013 Views

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

General Computer Science 320201 GenCS I & II Lecture ... - Kwarc

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.2.4 Relations and Functions<br />

Now we will take a closer look at two very fundamental notions in mathematics: functions and<br />

relations. Intuitively, functions are mathematical objects that take arguments (as input) and<br />

return a result (as output), whereas relations are objects that take arguments and state whether<br />

they are related.<br />

We have alread encountered functions and relations as set operations — e.g. the elementhood<br />

relation ∈ which relates a set to its elements or the powerset function that takes a set and produces<br />

another (its powerset).<br />

Relations<br />

Definition 56 R ⊆ A × B is a (binary) relation between A and B.<br />

Definition 57 If A = B then R is called a relation on A.<br />

Definition 58 R ⊆ A × B is called total iff ∀x ∈ A.∃y ∈ B.〈x, y〉 ∈ R.<br />

Definition 59 R −1 := {〈y, x〉 | 〈x, y〉 ∈ R} is the converse relation of R.<br />

Note: R −1 ⊆ B × A.<br />

The composition of R ⊆ A × B and S ⊆ B × C is defined as S ◦ R :=<br />

{〈a, c〉 ∈ (A × C) | ∃b ∈ B.〈a, b〉 ∈ R ∧ 〈b, c〉 ∈ S}<br />

Example 60 relation ⊆, =, has color<br />

Note: we do not really need ternary, quaternary, . . . relations<br />

Idea: Consider A × B × C as A × (B × C) and 〈a, b, c〉 as 〈a, 〈b, c〉〉<br />

we can (and often will) see 〈a, b, c〉 as 〈a, 〈b, c〉〉 different representations of the same<br />

object.<br />

c○: Michael Kohlhase 50<br />

We will need certain classes of relations in following, so we introduce the necessary abstract<br />

properties of relations.<br />

Properties of binary Relations<br />

Definition 61 A relation R ⊆ A × A is called<br />

reflexive on A, iff ∀a ∈ A.〈a, a〉 ∈ R<br />

symmetric on A, iff ∀a, b ∈ A.〈a, b〉 ∈ R ⇒ 〈b, a〉 ∈ R<br />

antisymmetric on A, iff ∀a, b ∈ A.(〈a, b〉 ∈ R ∧ 〈b, a〉 ∈ R) ⇒ a = b<br />

transitive on A, iff ∀a, b, c ∈ A.(〈a, b〉 ∈ R ∧ 〈b, c〉 ∈ R) ⇒ 〈a, c〉 ∈ R<br />

equivalence relation on A, iff R is reflexive, symmetric, and transitive<br />

partial order on A, iff R is reflexive, antisymmetric, and transitive on A.<br />

a linear order on A, iff R is transitive and for all x, y ∈ A with x = y either 〈x, y〉 ∈ R or<br />

〈y, x〉 ∈ R<br />

Example 62 The equality relation is an equivalence relation on any set.<br />

Example 63 The ≤ relation is a linear order on N (all elements are comparable)<br />

29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!