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.

Example 64 On sets of persons, the “mother-of” relation is an non-symmetric, non-reflexive<br />

relation.<br />

Example 65 On sets of persons, the “ancestor-of” relation is a partial order that is not<br />

linear.<br />

Functions (as special relations)<br />

c○: Michael Kohlhase 51<br />

Definition 66 f ⊆ X × Y , is called a partial function, iff for all x ∈ X there is at most<br />

one y ∈ Y with 〈x, y〉 ∈ f.<br />

Notation 67 f : X ⇀ Y ; x ↦→ y if 〈x, y〉 ∈ f (arrow notation)<br />

call X the domain (write dom(f)), and Y the codomain (codom(f)) (come with f)<br />

Notation 68 f(x) = y instead of 〈x, y〉 ∈ f (function application)<br />

Definition 69 We call a partial function f : X ⇀ Y undefined at x ∈ X, iff 〈x, y〉 ∈ f for<br />

all y ∈ Y . (write f(x) = ⊥)<br />

Definition 70 If f : X ⇀ Y is a total relation, we call f a total function and write f : X →<br />

Y . (∀x ∈ X.∃ 1 y ∈ Y .〈x, y〉 ∈ f)<br />

Notation 71 f : x ↦→ y if 〈x, y〉 ∈ f (arrow notation)<br />

: this probably does not conform to your intuition about functions. Do not<br />

worry, just think of them as two different things they will come together over time.<br />

(In this course we will use “function” as defined here!)<br />

Function Spaces<br />

c○: Michael Kohlhase 52<br />

Definition 72 Given sets A and B We will call the set A → B (A ⇀ B) of all (partial)<br />

functions from A to B the (partial) function space from A to B.<br />

Example 73 Let B := {0, 1} be a two-element set, then<br />

B → B = {{〈0, 0〉, 〈1, 0〉}, {〈0, 1〉, 〈1, 1〉}, {〈0, 1〉, 〈1, 0〉}, {〈0, 0〉, 〈1, 1〉}}<br />

B ⇀ B = B → B ∪ {∅, {〈0, 0〉}, {〈0, 1〉}, {〈1, 0〉}, {〈1, 1〉}}<br />

as we can see, all of these functions are finite (as relations)<br />

Lambda-Notation for Functions<br />

c○: Michael Kohlhase 53<br />

Problem: It is common mathematical practice to write things like fa(x) = ax 2 +<br />

3x + 5, meaning e.g. that we have a collection {fa | a ∈ A} of functions.<br />

(is a an argument or jut a “parameter”?)<br />

Definition 74 To make the role of arguments extremely clear, we write functions in λnotation.<br />

For f = {〈x, E〉 | x ∈ X}, where E is an expression, we write λx ∈ X.E.<br />

30

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

Saved successfully!

Ooh no, something went wrong!