src/HOL/PreList.thy
author wenzelm
Sat Oct 27 00:00:38 2001 +0200 (2001-10-27)
changeset 11955 5818c5abb415
parent 11803 30f2104953a1
child 12020 a24373086908
permissions -rw-r--r--
moved product cases/induct to theory Datatype;
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@10261
    12
  Relation_Power + Calculation + SVC_Oracle:
wenzelm@8490
    13
wenzelm@10261
    14
(*belongs to theory Wellfounded_Recursion*)
wenzelm@10261
    15
declare wf_induct [induct set: wf]
wenzelm@9066
    16
wenzelm@10671
    17
wenzelm@10680
    18
(* generic summation indexed over nat *)
wenzelm@10680
    19
wenzelm@10671
    20
consts
wenzelm@11803
    21
  Summation :: "(nat => 'a::{zero, plus}) => nat => 'a"
wenzelm@10671
    22
primrec
wenzelm@10671
    23
  "Summation f 0 = 0"
wenzelm@10671
    24
  "Summation f (Suc n) = Summation f n + f n"
wenzelm@10671
    25
wenzelm@10671
    26
syntax
wenzelm@10671
    27
  "_Summation" :: "idt => nat => 'a => nat"    ("\<Sum>_<_. _" [0, 51, 10] 10)
wenzelm@10671
    28
translations
wenzelm@10671
    29
  "\<Sum>i < n. b" == "Summation (\<lambda>i. b) n"
wenzelm@10671
    30
wenzelm@10671
    31
theorem Summation_step:
wenzelm@10671
    32
    "0 < n ==> (\<Sum>i < n. f i) = (\<Sum>i < n - 1. f i) + f (n - 1)"
wenzelm@10671
    33
  by (induct n) simp_all
wenzelm@10671
    34
wenzelm@8490
    35
end