| author | nipkow | 
| Fri, 15 Apr 2005 18:43:35 +0200 | |
| changeset 15740 | d63e7a65b2d0 | 
| parent 14565 | c6dc17aab88a | 
| child 16417 | 9bc16273c2d4 | 
| permissions | -rw-r--r-- | 
| 13356 | 1 | (*$Id$*) | 
| 12426 | 2 | |
| 13356 | 3 | header{*Theory Main: Everything Except AC*}
 | 
| 12426 | 4 | |
| 13356 | 5 | theory Main = List + IntDiv + CardinalArith: | 
| 13162 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 6 | |
| 13203 
fac77a839aa2
Tidying up.  Mainly moving proofs from Main.thy to other (Isar) theory files.
 paulson parents: 
13162diff
changeset | 7 | (*The theory of "iterates" logically belongs to Nat, but can't go there because | 
| 
fac77a839aa2
Tidying up.  Mainly moving proofs from Main.thy to other (Isar) theory files.
 paulson parents: 
13162diff
changeset | 8 | primrec isn't available into after Datatype. The only theories defined | 
| 
fac77a839aa2
Tidying up.  Mainly moving proofs from Main.thy to other (Isar) theory files.
 paulson parents: 
13162diff
changeset | 9 | after Datatype are List and the Integ theories.*) | 
| 13162 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 10 | subsection{* Iteration of the function @{term F} *}
 | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 11 | |
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 12 | consts  iterates :: "[i=>i,i,i] => i"   ("(_^_ '(_'))" [60,1000,1000] 60)
 | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 13 | |
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 14 | primrec | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 15 | "F^0 (x) = x" | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 16 | "F^(succ(n)) (x) = F(F^n (x))" | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 17 | |
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 18 | constdefs | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 19 | iterates_omega :: "[i=>i,i] => i" | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 20 | "iterates_omega(F,x) == \<Union>n\<in>nat. F^n (x)" | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 21 | |
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 22 | syntax (xsymbols) | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 23 |   iterates_omega :: "[i=>i,i] => i"   ("(_^\<omega> '(_'))" [60,1000] 60)
 | 
| 14565 | 24 | syntax (HTML output) | 
| 25 |   iterates_omega :: "[i=>i,i] => i"   ("(_^\<omega> '(_'))" [60,1000] 60)
 | |
| 13162 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 26 | |
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 27 | lemma iterates_triv: | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 28 | "[| n\<in>nat; F(x) = x |] ==> F^n (x) = x" | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 29 | by (induct n rule: nat_induct, simp_all) | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 30 | |
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 31 | lemma iterates_type [TC]: | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 32 | "[| n:nat; a: A; !!x. x:A ==> F(x) : A |] | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 33 | ==> F^n (a) : A" | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 34 | by (induct n rule: nat_induct, simp_all) | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 35 | |
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 36 | lemma iterates_omega_triv: | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 37 | "F(x) = x ==> F^\<omega> (x) = x" | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 38 | by (simp add: iterates_omega_def iterates_triv) | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 39 | |
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 40 | lemma Ord_iterates [simp]: | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 41 | "[| n\<in>nat; !!i. Ord(i) ==> Ord(F(i)); Ord(x) |] | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 42 | ==> Ord(F^n (x))" | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 43 | by (induct n rule: nat_induct, simp_all) | 
| 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 44 | |
| 13396 | 45 | lemma iterates_commute: "n \<in> nat ==> F(F^n (x)) = F^n (F(x))" | 
| 46 | by (induct_tac n, simp_all) | |
| 47 | ||
| 13162 
660a71e712af
New theorems from Constructible, and moving some Isar material from Main
 paulson parents: 
12820diff
changeset | 48 | |
| 13694 | 49 | subsection{* Transfinite Recursion *}
 | 
| 50 | ||
| 51 | text{*Transfinite recursion for definitions based on the 
 | |
| 52 | three cases of ordinals*} | |
| 53 | ||
| 54 | constdefs | |
| 55 | transrec3 :: "[i, i, [i,i]=>i, [i,i]=>i] =>i" | |
| 56 | "transrec3(k, a, b, c) == | |
| 57 | transrec(k, \<lambda>x r. | |
| 58 | if x=0 then a | |
| 59 | else if Limit(x) then c(x, \<lambda>y\<in>x. r`y) | |
| 60 | else b(Arith.pred(x), r ` Arith.pred(x)))" | |
| 61 | ||
| 62 | lemma transrec3_0 [simp]: "transrec3(0,a,b,c) = a" | |
| 63 | by (rule transrec3_def [THEN def_transrec, THEN trans], simp) | |
| 64 | ||
| 65 | lemma transrec3_succ [simp]: | |
| 66 | "transrec3(succ(i),a,b,c) = b(i, transrec3(i,a,b,c))" | |
| 67 | by (rule transrec3_def [THEN def_transrec, THEN trans], simp) | |
| 68 | ||
| 69 | lemma transrec3_Limit: | |
| 70 | "Limit(i) ==> | |
| 71 | transrec3(i,a,b,c) = c(i, \<lambda>j\<in>i. transrec3(j,a,b,c))" | |
| 72 | by (rule transrec3_def [THEN def_transrec, THEN trans], force) | |
| 73 | ||
| 74 | ||
| 75 | subsection{* Remaining Declarations *}
 | |
| 76 | ||
| 12426 | 77 | (* belongs to theory IntDiv *) | 
| 78 | lemmas posDivAlg_induct = posDivAlg_induct [consumes 2] | |
| 79 | and negDivAlg_induct = negDivAlg_induct [consumes 2] | |
| 80 | ||
| 12620 | 81 | |
| 12426 | 82 | end |