src/HOL/ex/NatSum.thy
author wenzelm
Tue, 27 Apr 1999 15:10:36 +0200
changeset 6526 6b64d1454ee3
parent 5184 9b8547a9496a
child 8356 14d89313c66c
permissions -rw-r--r--
added Isar_examples/NatSum.thy;

(*  Title:      HOL/ex/natsum.thy
    ID:         $Id$
    Author:     Tobias Nipkow
    Copyright   1994 TU Muenchen

A summation operator. sum(f,n+1) is the sum of all f(i), i=0...n.
*)

NatSum = Arith +
consts sum     :: [nat=>nat, nat] => nat
primrec 
  "sum f 0 = 0"
  "sum f (Suc n) = f(n) + sum f n"

end