11649
|
1 |
(* Title: HOL/Induct/Ordinals.thy
|
11641
|
2 |
ID: $Id$
|
|
3 |
Author: Stefan Berghofer and Markus Wenzel, TU Muenchen
|
|
4 |
License: GPL (GNU GENERAL PUBLIC LICENSE)
|
|
5 |
*)
|
|
6 |
|
|
7 |
header {* Ordinals *}
|
|
8 |
|
|
9 |
theory Ordinals = Main:
|
|
10 |
|
|
11 |
text {*
|
|
12 |
Some basic definitions of ordinal numbers. Draws an Agda
|
11649
|
13 |
development (in Martin-L\"of type theory) by Peter Hancock (see
|
11641
|
14 |
\url{http://www.dcs.ed.ac.uk/home/pgh/chat.html}).
|
|
15 |
*}
|
|
16 |
|
|
17 |
datatype ordinal =
|
|
18 |
Zero
|
|
19 |
| Succ ordinal
|
|
20 |
| Limit "nat => ordinal"
|
|
21 |
|
|
22 |
consts
|
|
23 |
pred :: "ordinal => nat => ordinal option"
|
|
24 |
primrec
|
|
25 |
"pred Zero n = None"
|
|
26 |
"pred (Succ a) n = Some a"
|
|
27 |
"pred (Limit f) n = Some (f n)"
|
|
28 |
|
|
29 |
consts
|
|
30 |
iter :: "('a => 'a) => nat => ('a => 'a)"
|
|
31 |
primrec
|
|
32 |
"iter f 0 = id"
|
|
33 |
"iter f (Suc n) = f \<circ> (iter f n)"
|
|
34 |
|
|
35 |
constdefs
|
|
36 |
OpLim :: "(nat => (ordinal => ordinal)) => (ordinal => ordinal)"
|
|
37 |
"OpLim F a == Limit (\<lambda>n. F n a)"
|
|
38 |
OpItw :: "(ordinal => ordinal) => (ordinal => ordinal)" ("\<Squnion>")
|
|
39 |
"\<Squnion>f == OpLim (iter f)"
|
|
40 |
|
|
41 |
consts
|
|
42 |
cantor :: "ordinal => ordinal => ordinal"
|
|
43 |
primrec
|
|
44 |
"cantor a Zero = Succ a"
|
|
45 |
"cantor a (Succ b) = \<Squnion>(\<lambda>x. cantor x b) a"
|
|
46 |
"cantor a (Limit f) = Limit (\<lambda>n. cantor a (f n))"
|
|
47 |
|
|
48 |
consts
|
|
49 |
Nabla :: "(ordinal => ordinal) => (ordinal => ordinal)" ("\<nabla>")
|
|
50 |
primrec
|
|
51 |
"\<nabla>f Zero = f Zero"
|
|
52 |
"\<nabla>f (Succ a) = f (Succ (\<nabla>f a))"
|
|
53 |
"\<nabla>f (Limit h) = Limit (\<lambda>n. \<nabla>f (h n))"
|
|
54 |
|
|
55 |
constdefs
|
|
56 |
deriv :: "(ordinal => ordinal) => (ordinal => ordinal)"
|
|
57 |
"deriv f == \<nabla>(\<Squnion>f)"
|
|
58 |
|
|
59 |
consts
|
|
60 |
veblen :: "ordinal => ordinal => ordinal"
|
|
61 |
primrec
|
|
62 |
"veblen Zero = \<nabla>(OpLim (iter (cantor Zero)))"
|
|
63 |
"veblen (Succ a) = \<nabla>(OpLim (iter (veblen a)))"
|
|
64 |
"veblen (Limit f) = \<nabla>(OpLim (\<lambda>n. veblen (f n)))"
|
|
65 |
|
|
66 |
constdefs
|
|
67 |
veb :: "ordinal => ordinal"
|
|
68 |
"veb a == veblen a Zero"
|
|
69 |
|
|
70 |
constdefs
|
11649
|
71 |
epsilon0 :: ordinal ("\<epsilon>\<^sub>0")
|
|
72 |
"\<epsilon>\<^sub>0 == veb Zero"
|
11641
|
73 |
Gamma0 :: ordinal ("\<Gamma>\<^sub>0")
|
|
74 |
"\<Gamma>\<^sub>0 == Limit (\<lambda>n. iter veb n Zero)"
|
|
75 |
|
|
76 |
end
|