src/ZF/Main.thy
author haftmann
Fri, 07 Dec 2007 15:07:59 +0100
changeset 25571 c9e39eafc7a0
parent 24893 b8ef7afe3a6b
child 26056 6a0801279f4c
permissions -rw-r--r--
instantiation target rather than legacy instance
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13203
diff changeset
     1
(*$Id$*)
12426
9032bdbc2125 new-style theory;
wenzelm
parents: 9578
diff changeset
     2
13356
c9cfe1638bf2 improved presentation markup
paulson
parents: 13203
diff changeset
     3
header{*Theory Main: Everything Except AC*}
12426
9032bdbc2125 new-style theory;
wenzelm
parents: 9578
diff changeset
     4
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 14565
diff changeset
     5
theory Main imports List IntDiv CardinalArith begin
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
     6
13203
fac77a839aa2 Tidying up. Mainly moving proofs from Main.thy to other (Isar) theory files.
paulson
parents: 13162
diff changeset
     7
(*The theory of "iterates" logically belongs to Nat, but can't go there because
22814
4cd25f1706bb removed lagacy ML files;
wenzelm
parents: 17884
diff changeset
     8
  primrec isn't available into after Datatype.*)
4cd25f1706bb removed lagacy ML files;
wenzelm
parents: 17884
diff changeset
     9
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    10
subsection{* Iteration of the function @{term F} *}
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    11
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff 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: 12820
diff changeset
    13
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    14
primrec
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    15
    "F^0 (x) = x"
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    16
    "F^(succ(n)) (x) = F(F^n (x))"
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    17
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22814
diff changeset
    18
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22814
diff changeset
    19
  iterates_omega :: "[i=>i,i] => i"  where
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff 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: 12820
diff changeset
    21
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22814
diff changeset
    22
notation (xsymbols)
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22814
diff changeset
    23
  iterates_omega  ("(_^\<omega> '(_'))" [60,1000] 60)
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22814
diff changeset
    24
notation (HTML output)
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22814
diff changeset
    25
  iterates_omega  ("(_^\<omega> '(_'))" [60,1000] 60)
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    26
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    27
lemma iterates_triv:
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff 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: 12820
diff changeset
    29
by (induct n rule: nat_induct, simp_all)
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    30
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    31
lemma iterates_type [TC]:
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff 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: 12820
diff changeset
    33
      ==> F^n (a) : A"  
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    34
by (induct n rule: nat_induct, simp_all)
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    35
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    36
lemma iterates_omega_triv:
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    37
    "F(x) = x ==> F^\<omega> (x) = x" 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    38
by (simp add: iterates_omega_def iterates_triv) 
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    39
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    40
lemma Ord_iterates [simp]:
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff 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: 12820
diff changeset
    42
      ==> Ord(F^n (x))"  
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    43
by (induct n rule: nat_induct, simp_all)
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    44
13396
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
    45
lemma iterates_commute: "n \<in> nat ==> F(F^n (x)) = F^n (F(x))"
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
    46
by (induct_tac n, simp_all)
11219ca224ab A couple of new theorems for Constructible
paulson
parents: 13356
diff changeset
    47
13162
660a71e712af New theorems from Constructible, and moving some Isar material from Main
paulson
parents: 12820
diff changeset
    48
13694
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    49
subsection{* Transfinite Recursion *}
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    50
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    51
text{*Transfinite recursion for definitions based on the 
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    52
    three cases of ordinals*}
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    53
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22814
diff changeset
    54
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 22814
diff changeset
    55
  transrec3 :: "[i, i, [i,i]=>i, [i,i]=>i] =>i" where
13694
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    56
    "transrec3(k, a, b, c) ==                     
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    57
       transrec(k, \<lambda>x r.
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    58
         if x=0 then a
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    59
         else if Limit(x) then c(x, \<lambda>y\<in>x. r`y)
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    60
         else b(Arith.pred(x), r ` Arith.pred(x)))"
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    61
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    62
lemma transrec3_0 [simp]: "transrec3(0,a,b,c) = a"
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    63
by (rule transrec3_def [THEN def_transrec, THEN trans], simp)
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    64
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    65
lemma transrec3_succ [simp]:
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    66
     "transrec3(succ(i),a,b,c) = b(i, transrec3(i,a,b,c))"
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    67
by (rule transrec3_def [THEN def_transrec, THEN trans], simp)
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    68
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    69
lemma transrec3_Limit:
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    70
     "Limit(i) ==> 
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    71
      transrec3(i,a,b,c) = c(i, \<lambda>j\<in>i. transrec3(j,a,b,c))"
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    72
by (rule transrec3_def [THEN def_transrec, THEN trans], force)
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    73
be3e2fa01b0f new operator transrec3
paulson
parents: 13396
diff changeset
    74
17884
805eca99d398 moved pos/negDivAlg_induct declarations to Integ/IntDiv.thy;
wenzelm
parents: 16417
diff changeset
    75
ML_setup {*
805eca99d398 moved pos/negDivAlg_induct declarations to Integ/IntDiv.thy;
wenzelm
parents: 16417
diff changeset
    76
  change_simpset (fn ss => ss setmksimps (map mk_eq o Ord_atomize o gen_all));
805eca99d398 moved pos/negDivAlg_induct declarations to Integ/IntDiv.thy;
wenzelm
parents: 16417
diff changeset
    77
*}
12620
4e6626725e21 Some new theorems for ordinals
paulson
parents: 12552
diff changeset
    78
12426
9032bdbc2125 new-style theory;
wenzelm
parents: 9578
diff changeset
    79
end