src/Doc/Tutorial/Misc/Plus.thy
author wenzelm
Thu, 16 Jan 2020 15:34:55 +0100
changeset 71387 b3b992f6ad8f
parent 67613 ce654b0e6d69
permissions -rw-r--r--
updated to stack-2.1.3, stackage lts-13.19, ghc-8.6.4;

(*<*)
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
(*>*)