src/HOL/ex/NatSum.thy
author paulson
Mon, 26 May 1997 12:33:03 +0200
changeset 3335 b0139b83a5ee
parent 3269 eca2a3634acd
child 5184 9b8547a9496a
permissions -rw-r--r--
New example ported from ZF

(*  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" nat 
  "sum f 0 = 0"
  "sum f (Suc n) = f(n) + sum f n"

end