doc-src/TutorialI/Misc/natsum.thy
author wenzelm
Tue, 10 Oct 2000 23:44:44 +0200
changeset 10184 4a7a1091cf65
parent 10171 59d6633835fa
child 10538 d1bf9ca9008d
permissions -rw-r--r--
fully enclose "\isadigit{...}"; \<^foo> produces "\isactrlfoo ";

(*<*)
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);
apply(auto);
done

(*<*)
end
(*>*)