doc-src/TutorialI/Misc/Plus.thy
author haftmann
Wed, 24 Feb 2010 14:19:53 +0100
changeset 35369 e4a7947e02b8
parent 27015 f8537d69f514
permissions -rw-r--r--
more general case and induct rules; normalize and quotient_of; abstract code generation

(*<*)
theory Plus imports Main begin
(*>*)

text{*\noindent Define the following addition function *}

primrec add :: "nat \<Rightarrow> nat \<Rightarrow> nat" where
"add m 0 = m" |
"add m (Suc n) = add (Suc m) n"

text{*\noindent and prove*}
(*<*)
lemma [simp]: "!m. add m n = m+n"
apply(induct_tac n)
by(auto)
(*>*)
lemma "add m n = m+n"
(*<*)
by(simp)

end
(*>*)