author | wenzelm |
Tue, 13 Sep 2005 22:19:23 +0200 | |
changeset 17339 | ab97ccef124a |
parent 17274 | 746bb4c56800 |
child 19819 | 14de4d05d275 |
permissions | -rw-r--r-- |
1246 | 1 |
(* Title: FOL/ex/NatClass.thy |
2 |
ID: $Id$ |
|
3 |
Author: Markus Wenzel, TU Muenchen |
|
4 |
*) |
|
5 |
||
17245 | 6 |
theory NatClass |
7 |
imports FOL |
|
8 |
begin |
|
9 |
||
10 |
text {* |
|
11 |
This is an abstract version of theory @{text "Nat"}. Instead of |
|
12 |
axiomatizing a single type @{text nat} we define the class of all |
|
13 |
these types (up to isomorphism). |
|
14 |
||
15 |
Note: The @{text rec} operator had to be made \emph{monomorphic}, |
|
16 |
because class axioms may not contain more than one type variable. |
|
17 |
*} |
|
1246 | 18 |
|
19 |
consts |
|
17245 | 20 |
0 :: 'a ("0") |
21 |
Suc :: "'a => 'a" |
|
22 |
rec :: "['a, 'a, ['a, 'a] => 'a] => 'a" |
|
1246 | 23 |
|
24 |
axclass |
|
17245 | 25 |
nat < "term" |
26 |
induct: "[| P(0); !!x. P(x) ==> P(Suc(x)) |] ==> P(n)" |
|
27 |
Suc_inject: "Suc(m) = Suc(n) ==> m = n" |
|
28 |
Suc_neq_0: "Suc(m) = 0 ==> R" |
|
29 |
rec_0: "rec(0, a, f) = a" |
|
30 |
rec_Suc: "rec(Suc(m), a, f) = f(m, rec(m, a, f))" |
|
1246 | 31 |
|
17245 | 32 |
constdefs |
33 |
add :: "['a::nat, 'a] => 'a" (infixl "+" 60) |
|
34 |
"m + n == rec(m, n, %x y. Suc(y))" |
|
1246 | 35 |
|
17245 | 36 |
ML {* use_legacy_bindings (the_context ()) *} |
17274
746bb4c56800
axclass: name space prefix is now "c_class" instead of just "c";
wenzelm
parents:
17245
diff
changeset
|
37 |
ML {* open nat_class *} |
1246 | 38 |
|
39 |
end |