src/HOL/PreList.thy
author wenzelm
Wed Nov 28 00:37:40 2001 +0100 (2001-11-28)
changeset 12304 8df202daf55d
parent 12020 a24373086908
child 12397 6766aa05e4eb
permissions -rw-r--r--
tuned declarations;
nipkow@10519
     1
(*  Title:      HOL/PreList.thy
nipkow@8563
     2
    ID:         $Id$
wenzelm@10733
     3
    Author:     Tobias Nipkow and Markus Wenzel
nipkow@8563
     4
    Copyright   2000 TU Muenchen
nipkow@8563
     5
nipkow@8563
     6
A basis for building theory List on. Is defined separately to serve as a
nipkow@8563
     7
basis for theory ToyList in the documentation.
nipkow@8563
     8
*)
wenzelm@8490
     9
wenzelm@8490
    10
theory PreList =
nipkow@10212
    11
  Option + Wellfounded_Relations + NatSimprocs + Recdef + Record +
wenzelm@12020
    12
  Relation_Power + SVC_Oracle:
wenzelm@12020
    13
wenzelm@12020
    14
(*belongs to theory Divides*)
wenzelm@12304
    15
declare dvdI [intro?]  dvdE [elim?]  dvd_trans [trans]
wenzelm@8490
    16
wenzelm@10261
    17
(*belongs to theory Wellfounded_Recursion*)
wenzelm@10261
    18
declare wf_induct [induct set: wf]
wenzelm@9066
    19
wenzelm@10671
    20
wenzelm@10680
    21
(* generic summation indexed over nat *)
wenzelm@10680
    22
wenzelm@10671
    23
consts
wenzelm@11803
    24
  Summation :: "(nat => 'a::{zero, plus}) => nat => 'a"
wenzelm@10671
    25
primrec
wenzelm@10671
    26
  "Summation f 0 = 0"
wenzelm@10671
    27
  "Summation f (Suc n) = Summation f n + f n"
wenzelm@10671
    28
wenzelm@10671
    29
syntax
wenzelm@10671
    30
  "_Summation" :: "idt => nat => 'a => nat"    ("\<Sum>_<_. _" [0, 51, 10] 10)
wenzelm@10671
    31
translations
wenzelm@10671
    32
  "\<Sum>i < n. b" == "Summation (\<lambda>i. b) n"
wenzelm@10671
    33
wenzelm@10671
    34
theorem Summation_step:
wenzelm@10671
    35
    "0 < n ==> (\<Sum>i < n. f i) = (\<Sum>i < n - 1. f i) + f (n - 1)"
wenzelm@10671
    36
  by (induct n) simp_all
wenzelm@10671
    37
wenzelm@8490
    38
end