author | Walther Neuper <neuper@ist.tugraz.at> |
Thu, 12 Aug 2010 15:03:34 +0200 | |
branch | isac-from-Isabelle2009-2 |
changeset 37913 | 20e3616b2d9c |
parent 27015 | f8537d69f514 |
permissions | -rw-r--r-- |
nipkow@13305 | 1 |
(*<*) |
haftmann@16417 | 2 |
theory Plus imports Main begin |
nipkow@13305 | 3 |
(*>*) |
nipkow@13305 | 4 |
|
nipkow@13305 | 5 |
text{*\noindent Define the following addition function *} |
nipkow@13305 | 6 |
|
nipkow@27015 | 7 |
primrec add :: "nat \<Rightarrow> nat \<Rightarrow> nat" where |
nipkow@27015 | 8 |
"add m 0 = m" | |
wenzelm@19249 | 9 |
"add m (Suc n) = add (Suc m) n" |
nipkow@13305 | 10 |
|
nipkow@13305 | 11 |
text{*\noindent and prove*} |
nipkow@13305 | 12 |
(*<*) |
wenzelm@19249 | 13 |
lemma [simp]: "!m. add m n = m+n" |
nipkow@13305 | 14 |
apply(induct_tac n) |
nipkow@13305 | 15 |
by(auto) |
nipkow@13305 | 16 |
(*>*) |
wenzelm@19249 | 17 |
lemma "add m n = m+n" |
nipkow@13305 | 18 |
(*<*) |
nipkow@13305 | 19 |
by(simp) |
nipkow@13305 | 20 |
|
nipkow@13305 | 21 |
end |
nipkow@13305 | 22 |
(*>*) |