doc-src/TutorialI/Misc/natsum.thy
author wenzelm
Tue, 12 Sep 2000 22:13:23 +0200
changeset 9941 fe05af7ec816
parent 9834 109b11c4e77e
child 10171 59d6633835fa
permissions -rw-r--r--
renamed atts: rulify to rule_format, elimify to elim_format;

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