src/HOL/PreList.thy
author wenzelm
Fri Nov 02 22:01:58 2001 +0100 (2001-11-02)
changeset 12020 a24373086908
parent 11955 5818c5abb415
child 12304 8df202daf55d
permissions -rw-r--r--
theory Calculation move to Set;
     1 (*  Title:      HOL/PreList.thy
     2     ID:         $Id$
     3     Author:     Tobias Nipkow and Markus Wenzel
     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 + SVC_Oracle:
    13 
    14 (*belongs to theory Divides*)
    15 declare dvd_trans [trans]
    16 
    17 (*belongs to theory Wellfounded_Recursion*)
    18 declare wf_induct [induct set: wf]
    19 
    20 
    21 (* generic summation indexed over nat *)
    22 
    23 consts
    24   Summation :: "(nat => 'a::{zero, plus}) => nat => 'a"
    25 primrec
    26   "Summation f 0 = 0"
    27   "Summation f (Suc n) = Summation f n + f n"
    28 
    29 syntax
    30   "_Summation" :: "idt => nat => 'a => nat"    ("\<Sum>_<_. _" [0, 51, 10] 10)
    31 translations
    32   "\<Sum>i < n. b" == "Summation (\<lambda>i. b) n"
    33 
    34 theorem Summation_step:
    35     "0 < n ==> (\<Sum>i < n. f i) = (\<Sum>i < n - 1. f i) + f (n - 1)"
    36   by (induct n) simp_all
    37 
    38 end