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.

+(〈n, o〉) = n (base) and +(〈m, s(n)〉) = s(+(〈m, n〉)) (step)<br />

Theorem 107 + ⊆ (N1 × N1) × N1 is a total function.<br />

We have to show that for all 〈n, m〉 ∈ (N1 × N1) there is exactly one l ∈ N1 with 〈〈n, m〉, l〉 ∈<br />

+.<br />

We will use functional notation for simplicity<br />

Addition is a total Function<br />

c○: Michael Kohlhase 75<br />

Lemma 108 For all 〈n, m〉 ∈ (N1 × N1) there is exactly one l ∈ N1 with +(〈n, m〉) = l.<br />

Proof: by induction on m. (what else)<br />

P.1 we have two cases<br />

P.1.1 base case (m = o):<br />

P.1.1.1 choose l := n, so we have +(〈n, o〉) = n = l.<br />

P.1.1.2 For any l ′ = +(〈n, o〉), we have l ′ = n = l.<br />

P.1.2 step case (m = s(k)):<br />

P.1.2.1 assume that there is a unique r = +(〈n, k〉), choose l := s(r), so we have<br />

+(〈n, s(k)〉) = s(+(〈n, k〉)) = s(r).<br />

P.1.2.2 Again, for any l ′ = +(〈n, s(k)〉) we have l ′ = l.<br />

Corollary 109 +: N1 × N1 → N1 is a total function.<br />

c○: Michael Kohlhase 76<br />

The main thing to note in the proof above is that we only needed the Peano Axioms to prove<br />

function-hood of addition. We used the induction axiom (P5) to be able to prove something about<br />

“all unary natural numbers”. This axiom also gave us the two cases to look at. We have used the<br />

distinctness axioms (P3 and P4) to see that only one of the defining equations applies, which in<br />

the end guaranteed uniqueness of function values.<br />

Reflection: How could we do this?<br />

we have two constructors for N1: the base element o ∈ N1 and the successor function<br />

s: N1 → N1<br />

Observation: Defining Equations for +: +(〈n, o〉) = n (base) and +(〈m, s(n)〉) =<br />

s(+(〈m, n〉)) (step)<br />

the equations cover all cases: n is arbitrary, m = o and m = s(k)<br />

(otherwise we could have not proven existence)<br />

but not more (no contradictions)<br />

using the induction axiom in the proof of unique existence.<br />

Example 110 Defining equations δ(o) = o and δ(s(n)) = s(s(δ(n)))<br />

Example 111 Defining equations µ(l, o) = o and µ(l, s(r)) = +(〈µ(l, r), l〉)<br />

42

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

Saved successfully!

Ooh no, something went wrong!