author | wenzelm |
Sun, 01 Apr 2012 23:07:15 +0200 | |
changeset 47263 | 434d9dd99523 |
parent 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 |
||
27015 | 7 |
primrec add :: "nat \<Rightarrow> nat \<Rightarrow> nat" where |
8 |
"add m 0 = m" | |
|
19249 | 9 |
"add m (Suc n) = add (Suc m) n" |
13305 | 10 |
|
11 |
text{*\noindent and prove*} |
|
12 |
(*<*) |
|
19249 | 13 |
lemma [simp]: "!m. add m n = m+n" |
13305 | 14 |
apply(induct_tac n) |
15 |
by(auto) |
|
16 |
(*>*) |
|
19249 | 17 |
lemma "add m n = m+n" |
13305 | 18 |
(*<*) |
19 |
by(simp) |
|
20 |
||
21 |
end |
|
22 |
(*>*) |