equal
deleted
inserted
replaced
10 relations has too general a domain, namely ('a * 'b)set and 'a => 'b. |
10 relations has too general a domain, namely ('a * 'b)set and 'a => 'b. |
11 This means that it may be necessary to attach explicit type constraints. |
11 This means that it may be necessary to attach explicit type constraints. |
12 Examples: range(f^n) = A and Range(R^n) = B need constraints. |
12 Examples: range(f^n) = A and Range(R^n) = B need constraints. |
13 *) |
13 *) |
14 |
14 |
15 Relation_Power = Nat + |
15 theory Relation_Power = Nat: |
16 |
16 |
17 instance |
17 instance |
18 set :: (type) power (* only ('a * 'a) set should be in power! *) |
18 set :: (type) power .. (* only ('a * 'a) set should be in power! *) |
19 |
19 |
20 primrec (relpow) |
20 primrec (relpow) |
21 "R^0 = Id" |
21 "R^0 = Id" |
22 "R^(Suc n) = R O (R^n)" |
22 "R^(Suc n) = R O (R^n)" |
23 |
23 |
24 |
24 |
25 instance |
25 instance |
26 fun :: (type, type) power (* only 'a => 'a should be in power! *) |
26 fun :: (type, type) power .. (* only 'a => 'a should be in power! *) |
27 |
27 |
28 primrec (funpow) |
28 primrec (funpow) |
29 "f^0 = id" |
29 "f^0 = id" |
30 "f^(Suc n) = f o (f^n)" |
30 "f^(Suc n) = f o (f^n)" |
31 |
31 |
|
32 lemma funpow_add: "f ^ (m+n) = f^m o f^n" |
|
33 by(induct m) simp_all |
|
34 |
32 end |
35 end |