src/HOL/PreList.thy
author wenzelm
Thu Feb 21 20:09:19 2002 +0100 (2002-02-21)
changeset 12919 d6a0d168291e
parent 12869 f362c0323d92
child 13297 e4ae0732e2be
permissions -rw-r--r--
removed theory Option;
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 =
wenzelm@12919
    11
  Wellfounded_Relations + NatSimprocs + Recdef + Relation_Power:
wenzelm@12020
    12
wenzelm@12020
    13
(*belongs to theory Divides*)
wenzelm@12304
    14
declare dvdI [intro?]  dvdE [elim?]  dvd_trans [trans]
wenzelm@8490
    15
wenzelm@12397
    16
(*belongs to theory Nat*)
wenzelm@12397
    17
lemmas less_induct = nat_less_induct [rule_format, case_names less]
wenzelm@12397
    18
wenzelm@10261
    19
(*belongs to theory Wellfounded_Recursion*)
wenzelm@12397
    20
lemmas wf_induct_rule = wf_induct [rule_format, case_names less, induct set: wf]
wenzelm@9066
    21
wenzelm@10671
    22
wenzelm@10680
    23
(* generic summation indexed over nat *)
wenzelm@10680
    24
wenzelm@10671
    25
consts
wenzelm@11803
    26
  Summation :: "(nat => 'a::{zero, plus}) => nat => 'a"
wenzelm@10671
    27
primrec
wenzelm@10671
    28
  "Summation f 0 = 0"
wenzelm@10671
    29
  "Summation f (Suc n) = Summation f n + f n"
wenzelm@10671
    30
wenzelm@10671
    31
syntax
wenzelm@10671
    32
  "_Summation" :: "idt => nat => 'a => nat"    ("\<Sum>_<_. _" [0, 51, 10] 10)
wenzelm@10671
    33
translations
wenzelm@10671
    34
  "\<Sum>i < n. b" == "Summation (\<lambda>i. b) n"
wenzelm@10671
    35
wenzelm@10671
    36
theorem Summation_step:
wenzelm@10671
    37
    "0 < n ==> (\<Sum>i < n. f i) = (\<Sum>i < n - 1. f i) + f (n - 1)"
wenzelm@10671
    38
  by (induct n) simp_all
wenzelm@10671
    39
wenzelm@8490
    40
end