doc-src/TutorialI/Misc/natsum.thy
author wenzelm
Fri, 15 Sep 2000 20:18:08 +0200
changeset 9994 b06f6d2eef5f
parent 9834 109b11c4e77e
child 10171 59d6633835fa
permissions -rw-r--r--
XSYMBOL_INSTALLFONTS is back;

(*<*)
theory natsum = Main:;
(*>*)
text{*\noindent
In particular, there are @{text"case"}-expressions, for example
@{term[display]"case n of 0 => 0 | Suc m => m"}
primitive recursion, for example
*}

consts sum :: "nat \\<Rightarrow> nat";
primrec "sum 0 = 0"
        "sum (Suc n) = Suc n + sum n";

text{*\noindent
and induction, for example
*}

lemma "sum n + sum n = n*(Suc n)";
apply(induct_tac n);
by(auto);

(*<*)
end
(*>*)