src/HOL/PreList.thy
author wenzelm
Thu Dec 14 19:36:48 2000 +0100 (2000-12-14)
changeset 10671 ac6b3b671198
parent 10519 ade64af4c57c
child 10680 26e4aecf3207
permissions -rw-r--r--
added Summation;
     1 (*  Title:      HOL/PreList.thy
     2     ID:         $Id$
     3     Author:     Tobias Nipkow
     4     Copyright   2000 TU Muenchen
     5 
     6 A basis for building theory List on. Is defined separately to serve as a
     7 basis for theory ToyList in the documentation.
     8 *)
     9 
    10 theory PreList =
    11   Option + Wellfounded_Relations + NatSimprocs + Recdef + Record +
    12   Relation_Power + Calculation + SVC_Oracle:
    13 
    14 (*belongs to theory HOL*)
    15 declare case_split [cases type: bool]
    16 
    17 (*belongs to theory Wellfounded_Recursion*)
    18 declare wf_induct [induct set: wf]
    19 
    20 (*belongs to theory Datatype_Universe; hides popular names *)
    21 hide const Node Atom Leaf Numb Lim Funs Split Case
    22 
    23 
    24 (*belongs to theory Nat, but requires Datatype*)
    25 consts
    26   Summation :: "(nat => 'a::{zero,plus}) => nat => 'a"
    27 primrec
    28   "Summation f 0 = 0"
    29   "Summation f (Suc n) = Summation f n + f n"
    30 
    31 syntax
    32   "_Summation" :: "idt => nat => 'a => nat"    ("\<Sum>_<_. _" [0, 51, 10] 10)
    33 translations
    34   "\<Sum>i < n. b" == "Summation (\<lambda>i. b) n"
    35 
    36 theorem Summation_step:
    37     "0 < n ==> (\<Sum>i < n. f i) = (\<Sum>i < n - 1. f i) + f (n - 1)"
    38   by (induct n) simp_all
    39 
    40 end