author | huffman |
Tue, 29 May 2007 17:36:35 +0200 | |
changeset 23118 | ce3cf072ae14 |
parent 19249 | 86c73395c99b |
child 27015 | f8537d69f514 |
permissions | -rw-r--r-- |
13305 | 1 |
(*<*) |
16417 | 2 |
theory Plus imports Main begin |
13305 | 3 |
(*>*) |
4 |
||
5 |
text{*\noindent Define the following addition function *} |
|
6 |
||
19249 | 7 |
consts add :: "nat \<Rightarrow> nat \<Rightarrow> nat" |
13305 | 8 |
primrec |
19249 | 9 |
"add m 0 = m" |
10 |
"add m (Suc n) = add (Suc m) n" |
|
13305 | 11 |
|
12 |
text{*\noindent and prove*} |
|
13 |
(*<*) |
|
19249 | 14 |
lemma [simp]: "!m. add m n = m+n" |
13305 | 15 |
apply(induct_tac n) |
16 |
by(auto) |
|
17 |
(*>*) |
|
19249 | 18 |
lemma "add m n = m+n" |
13305 | 19 |
(*<*) |
20 |
by(simp) |
|
21 |
||
22 |
end |
|
23 |
(*>*) |