src/ZF/ex/NatSum.thy
author wenzelm
Tue, 06 Nov 2001 19:25:24 +0100
changeset 12067 b2f5fbb39f14
parent 9647 e9623f47275b
child 12867 5c900a821a7c
permissions -rw-r--r--
export pretty_thm_aux;

(*  Title:      HOL/ex/Natsum.thy
    ID:         $Id$
    Author:     Tobias Nipkow & Lawrence C Paulson

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

Note: n is a natural number but the sum is an integer,
                            and f maps integers to integers
*)

NatSum = Main +

consts sum     :: [i=>i, i] => i
primrec 
  "sum (f,0) = #0"
  "sum (f, succ(n)) = f($#n) $+ sum(f,n)"

end