src/Doc/Tutorial/Misc/Plus.thy
author wenzelm
Tue, 31 Mar 2020 14:09:36 +0200
changeset 71637 45c2b8cf1b26
parent 67613 ce654b0e6d69
permissions -rw-r--r--
more robust message_context and shutdown, e.g. after errors in protocol loop (see also 3f02bc5a5a03);

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

text\<open>\noindent Define the following addition function\<close>

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

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

end
(*>*)