src/HOL/Relation_Power.thy
author nipkow
Fri May 18 12:09:13 2001 +0200 (2001-05-18)
changeset 11306 6f4ed75b2dca
parent 11305 2ce86fccc95b
child 12338 de0f4a63baa5
permissions -rw-r--r--
added comments
nipkow@10213
     1
(*  Title:      HOL/Relation_Power.thy
nipkow@10213
     2
    ID:         $Id$
nipkow@10213
     3
    Author:     Tobias Nipkow
nipkow@10213
     4
    Copyright   1996  TU Muenchen
nipkow@10213
     5
nipkow@10213
     6
R^n = R O ... O R, the n-fold composition of R
nipkow@11306
     7
f^n = f o ... o f, the n-fold composition of f
nipkow@11306
     8
nipkow@11306
     9
WARNING: due to the limits of Isabelle's type classes, ^ on functions and
nipkow@11306
    10
relations has too general a domain, namely ('a * 'b)set and 'a => 'b.
nipkow@11306
    11
This means that it may be necessary to attach explicit type constraints.
nipkow@11306
    12
Examples: range(f^n) = A and Range(R^n) = B need constraints.
nipkow@10213
    13
*)
nipkow@10213
    14
nipkow@10213
    15
Relation_Power = Nat +
nipkow@10213
    16
nipkow@10213
    17
instance
nipkow@10213
    18
  set :: (term) {power}   (* only ('a * 'a) set should be in power! *)
nipkow@10213
    19
nipkow@10213
    20
primrec (relpow)
nipkow@10213
    21
  "R^0 = Id"
nipkow@10213
    22
  "R^(Suc n) = R O (R^n)"
nipkow@10213
    23
nipkow@11305
    24
nipkow@11306
    25
instance
nipkow@11306
    26
  fun :: (term,term)power   (* only 'a => 'a should be in power! *)
nipkow@11305
    27
nipkow@11305
    28
primrec (funpow)
nipkow@11305
    29
  "f^0 = id"
nipkow@11305
    30
  "f^(Suc n) = f o (f^n)"
nipkow@11305
    31
nipkow@10213
    32
end