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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Definition 82 We say that a set A is countably infinite, iff there is a bijective function<br />

f : A → N.<br />

Theorem 83 We have the following identities for finite sets A and B<br />

#({a, b, c}) = 3 (e.g. choose f = {〈a, 0〉, 〈b, 1〉, 〈c, 2〉})<br />

#(A ∪ B) ≤ #(A) + #(B)<br />

#(A ∩ B) ≤ min(#(A), #(B))<br />

#(A × B) = #(A) · #(B)<br />

With the definition above, we can prove them (last three Homework)<br />

c○: Michael Kohlhase 56<br />

Next we turn to a higher-order function in the wild. The composition function takes two functions<br />

as arguments and yields a function as a result.<br />

Operations on Functions<br />

Definition 84 If f ∈ A → B and g ∈ B → C are functions, then we call<br />

g ◦ f : A → C; x ↦→ g(f(x))<br />

the composition of g and f (read g “after” f).<br />

Definition 85 Let f ∈ A → B and C ⊆ A, then we call the relation {〈c, b〉 |<br />

c ∈ C ∧ 〈c, b〉 ∈ f} the restriction of f to C.<br />

Definition 86 Let f : A → B be a function, A ′ ⊆ A and B ′ ⊆ B, then we<br />

call f(A ′ ) := {b ∈ B | ∃a ∈ A ′ .〈a, b〉 ∈ f} the image of A ′ under f and f −1 (B ′ ) :=<br />

{a ∈ A | ∃b ∈ B ′ .〈a, b〉 ∈ f} the pre-image of B ′ under f.<br />

c○: Michael Kohlhase 57<br />

32

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

Saved successfully!

Ooh no, something went wrong!