src/HOL/Relation_Power.thy
author paulson
Sun, 15 Feb 2004 10:46:37 +0100
changeset 14387 e96d5c42c4b0
parent 12338 de0f4a63baa5
child 15112 6f0772a94299
permissions -rw-r--r--
Polymorphic treatment of binary arithmetic using axclasses
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/Relation_Power.thy
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     2
    ID:         $Id$
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     3
    Author:     Tobias Nipkow
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     4
    Copyright   1996  TU Muenchen
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     5
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
     6
R^n = R O ... O R, the n-fold composition of R
11306
6f4ed75b2dca added comments
nipkow
parents: 11305
diff changeset
     7
f^n = f o ... o f, the n-fold composition of f
6f4ed75b2dca added comments
nipkow
parents: 11305
diff changeset
     8
6f4ed75b2dca added comments
nipkow
parents: 11305
diff changeset
     9
WARNING: due to the limits of Isabelle's type classes, ^ on functions and
6f4ed75b2dca added comments
nipkow
parents: 11305
diff changeset
    10
relations has too general a domain, namely ('a * 'b)set and 'a => 'b.
6f4ed75b2dca added comments
nipkow
parents: 11305
diff changeset
    11
This means that it may be necessary to attach explicit type constraints.
6f4ed75b2dca added comments
nipkow
parents: 11305
diff changeset
    12
Examples: range(f^n) = A and Range(R^n) = B need constraints.
10213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    13
*)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    14
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    15
Relation_Power = Nat +
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    16
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    17
instance
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11306
diff changeset
    18
  set :: (type) power   (* only ('a * 'a) set should be in power! *)
10213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    19
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    20
primrec (relpow)
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    21
  "R^0 = Id"
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    22
  "R^(Suc n) = R O (R^n)"
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    23
11305
2ce86fccc95b added ^ on functions.
nipkow
parents: 10213
diff changeset
    24
11306
6f4ed75b2dca added comments
nipkow
parents: 11305
diff changeset
    25
instance
12338
de0f4a63baa5 renamed class "term" to "type" (actually "HOL.type");
wenzelm
parents: 11306
diff changeset
    26
  fun :: (type, type) power   (* only 'a => 'a should be in power! *)
11305
2ce86fccc95b added ^ on functions.
nipkow
parents: 10213
diff changeset
    27
2ce86fccc95b added ^ on functions.
nipkow
parents: 10213
diff changeset
    28
primrec (funpow)
2ce86fccc95b added ^ on functions.
nipkow
parents: 10213
diff changeset
    29
  "f^0 = id"
2ce86fccc95b added ^ on functions.
nipkow
parents: 10213
diff changeset
    30
  "f^(Suc n) = f o (f^n)"
2ce86fccc95b added ^ on functions.
nipkow
parents: 10213
diff changeset
    31
10213
01c2744a3786 *** empty log message ***
nipkow
parents:
diff changeset
    32
end