src/ZF/AC/DC.thy
author hoelzl
Wed, 03 Jun 2009 11:33:16 +0200
changeset 31387 c4a3c3e9dc8e
parent 27678 85ea2be46c71
child 32960 69916a850301
permissions -rw-r--r--
Removed usage of reference in reification
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     1
(*  Title:      ZF/AC/DC.thy
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
     2
    ID:         $Id$
1478
2b8c2a7547ab expanded tabs
clasohm
parents: 1401
diff changeset
     3
    Author:     Krzysztof Grabczewski
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
     4
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
     5
The proofs concerning the Axiom of Dependent Choice
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
     6
*)
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
     7
27678
85ea2be46c71 dropped locale (open)
haftmann
parents: 24893
diff changeset
     8
theory DC
85ea2be46c71 dropped locale (open)
haftmann
parents: 24893
diff changeset
     9
imports AC_Equiv Hartog Cardinal_aux
85ea2be46c71 dropped locale (open)
haftmann
parents: 24893
diff changeset
    10
begin
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    11
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    12
lemma RepFun_lepoll: "Ord(a) ==> {P(b). b \<in> a} \<lesssim> a"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    13
apply (unfold lepoll_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    14
apply (rule_tac x = "\<lambda>z \<in> RepFun (a,P) . LEAST i. z=P (i) " in exI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    15
apply (rule_tac d="%z. P (z)" in lam_injective)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    16
 apply (fast intro!: Least_in_Ord)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    17
apply (rule sym) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    18
apply (fast intro: LeastI Ord_in_Ord) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    19
done
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    20
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    21
text{*Trivial in the presence of AC, but here we need a wellordering of X*}
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    22
lemma image_Ord_lepoll: "[| f \<in> X->Y; Ord(X) |] ==> f``X \<lesssim> X"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    23
apply (unfold lepoll_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    24
apply (rule_tac x = "\<lambda>x \<in> f``X. LEAST y. f`y = x" in exI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    25
apply (rule_tac d = "%z. f`z" in lam_injective)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    26
apply (fast intro!: Least_in_Ord apply_equality, clarify) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    27
apply (rule LeastI) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    28
 apply (erule apply_equality, assumption+) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    29
apply (blast intro: Ord_in_Ord)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    30
done
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    31
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    32
lemma range_subset_domain: 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    33
      "[| R \<subseteq> X*X;   !!g. g \<in> X ==> \<exists>u. <g,u> \<in> R |] 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    34
       ==> range(R) \<subseteq> domain(R)"
13175
81082cfa5618 new definition of "apply" and new simprule "beta_if"
paulson
parents: 12891
diff changeset
    35
by blast 
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    36
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    37
lemma cons_fun_type: "g \<in> n->X ==> cons(<n,x>, g) \<in> succ(n) -> cons(x, X)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    38
apply (unfold succ_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    39
apply (fast intro!: fun_extend elim!: mem_irrefl)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    40
done
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    41
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    42
lemma cons_fun_type2:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    43
     "[| g \<in> n->X; x \<in> X |] ==> cons(<n,x>, g) \<in> succ(n) -> X"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    44
by (erule cons_absorb [THEN subst], erule cons_fun_type)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    45
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    46
lemma cons_image_n: "n \<in> nat ==> cons(<n,x>, g)``n = g``n"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    47
by (fast elim!: mem_irrefl)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    48
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    49
lemma cons_val_n: "g \<in> n->X ==> cons(<n,x>, g)`n = x"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    50
by (fast intro!: apply_equality elim!: cons_fun_type)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    51
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    52
lemma cons_image_k: "k \<in> n ==> cons(<n,x>, g)``k = g``k"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    53
by (fast elim: mem_asym)
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    54
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    55
lemma cons_val_k: "[| k \<in> n; g \<in> n->X |] ==> cons(<n,x>, g)`k = g`k"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    56
by (fast intro!: apply_equality consI2 elim!: cons_fun_type apply_Pair)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    57
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    58
lemma domain_cons_eq_succ: "domain(f)=x ==> domain(cons(<x,y>, f)) = succ(x)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    59
by (simp add: domain_cons succ_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    60
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    61
lemma restrict_cons_eq: "g \<in> n->X ==> restrict(cons(<n,x>, g), n) = g"
12891
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12820
diff changeset
    62
apply (simp add: restrict_def Pi_iff)
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12820
diff changeset
    63
apply (blast intro: elim: mem_irrefl)  
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    64
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    65
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    66
lemma succ_in_succ: "[| Ord(k); i \<in> k |] ==> succ(i) \<in> succ(k)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    67
apply (rule Ord_linear [of "succ(i)" "succ(k)", THEN disjE])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    68
apply (fast elim: Ord_in_Ord mem_irrefl mem_asym)+
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    69
done
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
    70
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    71
lemma restrict_eq_imp_val_eq: 
12891
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12820
diff changeset
    72
      "[|restrict(f, domain(g)) = g; x \<in> domain(g)|] 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12820
diff changeset
    73
       ==> f`x = g`x" 
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12820
diff changeset
    74
by (erule subst, simp add: restrict)
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    75
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    76
lemma domain_eq_imp_fun_type: "[| domain(f)=A; f \<in> B->C |] ==> f \<in> A->C"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    77
by (frule domain_of_fun, fast)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    78
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    79
lemma ex_in_domain: "[| R \<subseteq> A * B; R \<noteq> 0 |] ==> \<exists>x. x \<in> domain(R)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    80
by (fast elim!: not_emptyE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    81
5482
73dc3b2a7102 tidied using locales
paulson
parents: 3892
diff changeset
    82
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    83
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    84
  DC  :: "i => o"  where
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    85
    "DC(a) == \<forall>X R. R \<subseteq> Pow(X)*X  &
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    86
		    (\<forall>Y \<in> Pow(X). Y \<prec> a --> (\<exists>x \<in> X. <Y,x> \<in> R)) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    87
		    --> (\<exists>f \<in> a->X. \<forall>b<a. <f``b,f`b> \<in> R)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    88
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    89
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    90
  DC0 :: o  where
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    91
    "DC0 == \<forall>A B R. R \<subseteq> A*B & R\<noteq>0 & range(R) \<subseteq> domain(R) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    92
                    --> (\<exists>f \<in> nat->domain(R). \<forall>n \<in> nat. <f`n,f`succ(n)>:R)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    93
24893
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    94
definition
b8ef7afe3a6b modernized specifications;
wenzelm
parents: 16417
diff changeset
    95
  ff  :: "[i, i, i, i] => i"  where
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    96
    "ff(b, X, Q, R) ==
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    97
	   transrec(b, %c r. THE x. first(x, {x \<in> X. <r``c, x> \<in> R}, Q))"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
    98
5482
73dc3b2a7102 tidied using locales
paulson
parents: 3892
diff changeset
    99
27678
85ea2be46c71 dropped locale (open)
haftmann
parents: 24893
diff changeset
   100
locale DC0_imp =
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   101
  fixes XX and RR and X and R
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   102
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   103
  assumes all_ex: "\<forall>Y \<in> Pow(X). Y \<prec> nat --> (\<exists>x \<in> X. <Y, x> \<in> R)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   104
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   105
  defines XX_def: "XX == (\<Union>n \<in> nat. {f \<in> n->X. \<forall>k \<in> n. <f``k, f`k> \<in> R})"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   106
     and RR_def:  "RR == {<z1,z2>:XX*XX. domain(z2)=succ(domain(z1))  
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   107
                                       & restrict(z2, domain(z1)) = z1}"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   108
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   109
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   110
(* ********************************************************************** *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   111
(* DC ==> DC(omega)                                                       *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   112
(*                                                                        *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   113
(* The scheme of the proof:                                               *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   114
(*                                                                        *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   115
(* Assume DC. Let R and X satisfy the premise of DC(omega).               *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   116
(*                                                                        *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   117
(* Define XX and RR as follows:                                           *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   118
(*                                                                        *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   119
(*       XX = (\<Union>n \<in> nat. {f \<in> n->X. \<forall>k \<in> n. <f``k, f`k> \<in> R})           *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   120
(*       f RR g iff domain(g)=succ(domain(f)) &                           *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   121
(*              restrict(g, domain(f)) = f                                *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   122
(*                                                                        *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   123
(* Then RR satisfies the hypotheses of DC.                                *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   124
(* So applying DC:                                                        *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   125
(*                                                                        *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   126
(*       \<exists>f \<in> nat->XX. \<forall>n \<in> nat. f`n RR f`succ(n)                        *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   127
(*                                                                        *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   128
(* Thence                                                                 *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   129
(*                                                                        *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   130
(*       ff = {<n, f`succ(n)`n>. n \<in> nat}                                 *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   131
(*                                                                        *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   132
(* is the desired function.                                               *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   133
(*                                                                        *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   134
(* ********************************************************************** *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   135
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   136
lemma (in DC0_imp) lemma1_1: "RR \<subseteq> XX*XX"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   137
by (unfold RR_def, fast)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   138
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   139
lemma (in DC0_imp) lemma1_2: "RR \<noteq> 0"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   140
apply (unfold RR_def XX_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   141
apply (rule all_ex [THEN ballE])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   142
apply (erule_tac [2] notE [OF _ empty_subsetI [THEN PowI]])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   143
apply (erule_tac impE [OF _ nat_0I [THEN n_lesspoll_nat]])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   144
apply (erule bexE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   145
apply (rule_tac a = "<0, {<0, x>}>" in not_emptyI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   146
apply (rule CollectI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   147
apply (rule SigmaI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   148
apply (rule nat_0I [THEN UN_I])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   149
apply (simp (no_asm_simp) add: nat_0I [THEN UN_I])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   150
apply (rule nat_1I [THEN UN_I])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   151
apply (force intro!: singleton_fun [THEN Pi_type]
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   152
             simp add: singleton_0 [symmetric])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   153
apply (simp add: singleton_0)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   154
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   155
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   156
lemma (in DC0_imp) lemma1_3: "range(RR) \<subseteq> domain(RR)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   157
apply (unfold RR_def XX_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   158
apply (rule range_subset_domain, blast, clarify)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   159
apply (frule fun_is_rel [THEN image_subset, THEN PowI, 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   160
                         THEN all_ex [THEN bspec]])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   161
apply (erule impE[OF _ lesspoll_trans1[OF image_Ord_lepoll 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   162
                                          [OF _ nat_into_Ord] n_lesspoll_nat]],
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   163
       assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   164
apply (erule bexE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   165
apply (rule_tac x = "cons (<n,x>, g) " in exI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   166
apply (rule CollectI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   167
apply (force elim!: cons_fun_type2 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   168
             simp add: cons_image_n cons_val_n cons_image_k cons_val_k)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   169
apply (simp add: domain_of_fun succ_def restrict_cons_eq)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   170
done
5482
73dc3b2a7102 tidied using locales
paulson
parents: 3892
diff changeset
   171
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   172
lemma (in DC0_imp) lemma2:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   173
     "[| \<forall>n \<in> nat. <f`n, f`succ(n)> \<in> RR;  f \<in> nat -> XX;  n \<in> nat |]   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   174
      ==> \<exists>k \<in> nat. f`succ(n) \<in> k -> X & n \<in> k   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   175
                  & <f`succ(n)``n, f`succ(n)`n> \<in> R"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   176
apply (induct_tac "n")
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   177
apply (drule apply_type [OF _ nat_1I])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   178
apply (drule bspec [OF _ nat_0I])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   179
apply (simp add: XX_def, safe)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   180
apply (rule rev_bexI, assumption)
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13175
diff changeset
   181
apply (subgoal_tac "0 \<in> y", force)
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   182
apply (force simp add: RR_def
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   183
	     intro: ltD elim!: nat_0_le [THEN leE])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   184
(** LEVEL 7, other subgoal **)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   185
apply (drule bspec [OF _ nat_succI], assumption)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   186
apply (subgoal_tac "f ` succ (succ (x)) \<in> succ (k) ->X")
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   187
apply (drule apply_type [OF _ nat_succI [THEN nat_succI]], assumption)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   188
apply (simp (no_asm_use) add: XX_def RR_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   189
apply safe
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   190
apply (frule_tac a="succ(k)" in domain_of_fun [symmetric, THEN trans], 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   191
       assumption)
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13175
diff changeset
   192
apply (frule_tac a=y in domain_of_fun [symmetric, THEN trans], 
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   193
       assumption)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   194
apply (fast elim!: nat_into_Ord [THEN succ_in_succ] 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   195
            dest!: bspec [OF _ nat_into_Ord [THEN succ_in_succ]])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   196
apply (drule domain_of_fun)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   197
apply (simp add: XX_def RR_def, clarify) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   198
apply (blast dest: domain_of_fun [symmetric, THEN trans] )
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   199
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   200
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   201
lemma (in DC0_imp) lemma3_1:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   202
     "[| \<forall>n \<in> nat. <f`n, f`succ(n)> \<in> RR;  f \<in> nat -> XX;  m \<in> nat |]   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   203
      ==>  {f`succ(x)`x. x \<in> m} = {f`succ(m)`x. x \<in> m}"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   204
apply (subgoal_tac "\<forall>x \<in> m. f`succ (m) `x = f`succ (x) `x")
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   205
apply simp
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   206
apply (induct_tac "m", blast)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   207
apply (rule ballI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   208
apply (erule succE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   209
 apply (rule restrict_eq_imp_val_eq)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   210
  apply (drule bspec [OF _ nat_succI], assumption)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   211
  apply (simp add: RR_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   212
 apply (drule lemma2, assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   213
 apply (fast dest!: domain_of_fun)
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13175
diff changeset
   214
apply (drule_tac x = xa in bspec, assumption)
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   215
apply (erule sym [THEN trans, symmetric])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   216
apply (rule restrict_eq_imp_val_eq [symmetric])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   217
 apply (drule bspec [OF _ nat_succI], assumption)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   218
 apply (simp add: RR_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   219
apply (drule lemma2, assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   220
apply (blast dest!: domain_of_fun 
12891
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12820
diff changeset
   221
	     intro: nat_into_Ord OrdmemD [THEN subsetD])
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   222
done
5482
73dc3b2a7102 tidied using locales
paulson
parents: 3892
diff changeset
   223
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   224
lemma (in DC0_imp) lemma3:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   225
     "[| \<forall>n \<in> nat. <f`n, f`succ(n)> \<in> RR;  f \<in> nat -> XX;  m \<in> nat |]  
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   226
      ==> (\<lambda>x \<in> nat. f`succ(x)`x) `` m = f`succ(m)``m"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   227
apply (erule natE, simp)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   228
apply (subst image_lam)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   229
 apply (fast elim!: OrdmemD [OF nat_succI Ord_nat])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   230
apply (subst lemma3_1, assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   231
 apply fast
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   232
apply (fast dest!: lemma2 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   233
            elim!: image_fun [symmetric, OF _ OrdmemD [OF _ nat_into_Ord]])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   234
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   235
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   236
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   237
theorem DC0_imp_DC_nat: "DC0 ==> DC(nat)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   238
apply (unfold DC_def DC0_def, clarify)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   239
apply (elim allE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   240
apply (erule impE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   241
   (*these three results comprise Lemma 1*)
27678
85ea2be46c71 dropped locale (open)
haftmann
parents: 24893
diff changeset
   242
apply (blast intro!: DC0_imp.lemma1_1 [OF DC0_imp.intro] DC0_imp.lemma1_2 [OF DC0_imp.intro] DC0_imp.lemma1_3 [OF DC0_imp.intro])
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   243
apply (erule bexE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   244
apply (rule_tac x = "\<lambda>n \<in> nat. f`succ (n) `n" in rev_bexI)
27678
85ea2be46c71 dropped locale (open)
haftmann
parents: 24893
diff changeset
   245
 apply (rule lam_type, blast dest!: DC0_imp.lemma2 [OF DC0_imp.intro] intro: fun_weaken_type)
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   246
apply (rule oallI)
27678
85ea2be46c71 dropped locale (open)
haftmann
parents: 24893
diff changeset
   247
apply (frule DC0_imp.lemma2 [OF DC0_imp.intro], assumption)
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   248
  apply (blast intro: fun_weaken_type)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   249
 apply (erule ltD) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   250
(** LEVEL 11: last subgoal **)
27678
85ea2be46c71 dropped locale (open)
haftmann
parents: 24893
diff changeset
   251
apply (subst DC0_imp.lemma3 [OF DC0_imp.intro], assumption+) 
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   252
  apply (fast elim!: fun_weaken_type)
13175
81082cfa5618 new definition of "apply" and new simprule "beta_if"
paulson
parents: 12891
diff changeset
   253
 apply (erule ltD) 
81082cfa5618 new definition of "apply" and new simprule "beta_if"
paulson
parents: 12891
diff changeset
   254
apply (force simp add: lt_def) 
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   255
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   256
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   257
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   258
(* ************************************************************************
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   259
   DC(omega) ==> DC                                                       
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   260
                                                                          
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   261
   The scheme of the proof:                                               
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   262
                                                                          
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   263
   Assume DC(omega). Let R and x satisfy the premise of DC.               
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   264
                                                                          
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   265
   Define XX and RR as follows:                                           
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   266
                                                                          
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   267
    XX = (\<Union>n \<in> nat. {f \<in> succ(n)->domain(R). \<forall>k \<in> n. <f`k, f`succ(k)> \<in> R})
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   268
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   269
    RR = {<z1,z2>:Fin(XX)*XX. 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   270
           (domain(z2)=succ(\<Union>f \<in> z1. domain(f)) &
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   271
	    (\<forall>f \<in> z1. restrict(z2, domain(f)) = f)) |      
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   272
	   (~ (\<exists>g \<in> XX. domain(g)=succ(\<Union>f \<in> z1. domain(f)) &
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   273
	                (\<forall>f \<in> z1. restrict(g, domain(f)) = f)) &           
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   274
	    z2={<0,x>})}                                          
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   275
                                                                          
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   276
   Then XX and RR satisfy the hypotheses of DC(omega).                    
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   277
   So applying DC:                                                        
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   278
                                                                          
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   279
         \<exists>f \<in> nat->XX. \<forall>n \<in> nat. f``n RR f`n                             
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   280
                                                                          
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   281
   Thence                                                                 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   282
                                                                          
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   283
         ff = {<n, f`n`n>. n \<in> nat}                                         
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   284
                                                                          
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   285
   is the desired function.                                               
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   286
                                                                          
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   287
************************************************************************* *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   288
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   289
lemma singleton_in_funs: 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   290
 "x \<in> X ==> {<0,x>} \<in> 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   291
            (\<Union>n \<in> nat. {f \<in> succ(n)->X. \<forall>k \<in> n. <f`k, f`succ(k)> \<in> R})"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   292
apply (rule nat_0I [THEN UN_I])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   293
apply (force simp add: singleton_0 [symmetric]
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   294
	     intro!: singleton_fun [THEN Pi_type])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   295
done
5482
73dc3b2a7102 tidied using locales
paulson
parents: 3892
diff changeset
   296
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   297
27678
85ea2be46c71 dropped locale (open)
haftmann
parents: 24893
diff changeset
   298
locale imp_DC0 =
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   299
  fixes XX and RR and x and R and f and allRR
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   300
  defines XX_def: "XX == (\<Union>n \<in> nat.
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   301
		      {f \<in> succ(n)->domain(R). \<forall>k \<in> n. <f`k, f`succ(k)> \<in> R})"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   302
      and RR_def:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   303
	 "RR == {<z1,z2>:Fin(XX)*XX. 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   304
		  (domain(z2)=succ(\<Union>f \<in> z1. domain(f))  
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   305
		    & (\<forall>f \<in> z1. restrict(z2, domain(f)) = f))
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   306
		  | (~ (\<exists>g \<in> XX. domain(g)=succ(\<Union>f \<in> z1. domain(f))  
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   307
		     & (\<forall>f \<in> z1. restrict(g, domain(f)) = f)) & z2={<0,x>})}"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   308
      and allRR_def:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   309
	"allRR == \<forall>b<nat.
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   310
		   <f``b, f`b> \<in>  
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   311
		    {<z1,z2>\<in>Fin(XX)*XX. (domain(z2)=succ(\<Union>f \<in> z1. domain(f))
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   312
				    & (\<Union>f \<in> z1. domain(f)) = b  
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   313
				    & (\<forall>f \<in> z1. restrict(z2,domain(f)) = f))}"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   314
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   315
lemma (in imp_DC0) lemma4:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   316
     "[| range(R) \<subseteq> domain(R);  x \<in> domain(R) |]   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   317
      ==> RR \<subseteq> Pow(XX)*XX &   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   318
             (\<forall>Y \<in> Pow(XX). Y \<prec> nat --> (\<exists>x \<in> XX. <Y,x>:RR))"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   319
apply (rule conjI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   320
apply (force dest!: FinD [THEN PowI] simp add: RR_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   321
apply (rule impI [THEN ballI])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   322
apply (drule Finite_Fin [OF lesspoll_nat_is_Finite PowD], assumption)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   323
apply (case_tac
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   324
       "\<exists>g \<in> XX. domain (g) =
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   325
             succ(\<Union>f \<in> Y. domain(f)) & (\<forall>f\<in>Y. restrict(g, domain(f)) = f)")
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   326
apply (simp add: RR_def, blast)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   327
apply (safe del: domainE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   328
apply (unfold XX_def RR_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   329
apply (rule rev_bexI, erule singleton_in_funs)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   330
apply (simp add: nat_0I [THEN rev_bexI] cons_fun_type2)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   331
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   332
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   333
lemma (in imp_DC0) UN_image_succ_eq:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   334
     "[| f \<in> nat->X; n \<in> nat |] 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   335
      ==> (\<Union>x \<in> f``succ(n). P(x)) =  P(f`n) Un (\<Union>x \<in> f``n. P(x))"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   336
by (simp add: image_fun OrdmemD) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   337
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   338
lemma (in imp_DC0) UN_image_succ_eq_succ:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   339
     "[| (\<Union>x \<in> f``n. P(x)) = y; P(f`n) = succ(y);   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   340
         f \<in> nat -> X; n \<in> nat |] ==> (\<Union>x \<in> f``succ(n). P(x)) = succ(y)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   341
by (simp add: UN_image_succ_eq, blast)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   342
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   343
lemma (in imp_DC0) apply_domain_type:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   344
     "[| h \<in> succ(n) -> D;  n \<in> nat; domain(h)=succ(y) |] ==> h`y \<in> D"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   345
by (fast elim: apply_type dest!: trans [OF sym domain_of_fun])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   346
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   347
lemma (in imp_DC0) image_fun_succ:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   348
     "[| h \<in> nat -> X; n \<in> nat |] ==> h``succ(n) = cons(h`n, h``n)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   349
by (simp add: image_fun OrdmemD) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   350
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   351
lemma (in imp_DC0) f_n_type:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   352
     "[| domain(f`n) = succ(k); f \<in> nat -> XX;  n \<in> nat |]    
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   353
      ==> f`n \<in> succ(k) -> domain(R)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   354
apply (unfold XX_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   355
apply (drule apply_type, assumption)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   356
apply (fast elim: domain_eq_imp_fun_type)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   357
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   358
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   359
lemma (in imp_DC0) f_n_pairs_in_R [rule_format]: 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   360
     "[| h \<in> nat -> XX;  domain(h`n) = succ(k);  n \<in> nat |]   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   361
      ==> \<forall>i \<in> k. <h`n`i, h`n`succ(i)> \<in> R"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   362
apply (unfold XX_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   363
apply (drule apply_type, assumption)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   364
apply (elim UN_E CollectE)
12820
02e2ff3e4d37 lexical tidying
paulson
parents: 12776
diff changeset
   365
apply (drule domain_of_fun [symmetric, THEN trans], assumption, simp)
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   366
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   367
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   368
lemma (in imp_DC0) restrict_cons_eq_restrict: 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   369
     "[| restrict(h, domain(u))=u;  h \<in> n->X;  domain(u) \<subseteq> n |]   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   370
      ==> restrict(cons(<n, y>, h), domain(u)) = u"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   371
apply (unfold restrict_def)
12891
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12820
diff changeset
   372
apply (simp add: restrict_def Pi_iff)
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   373
apply (erule sym [THEN trans, symmetric])
12891
92af5c3a10fb a new definition of "restrict"
paulson
parents: 12820
diff changeset
   374
apply (blast elim: mem_irrefl)  
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   375
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   376
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   377
lemma (in imp_DC0) all_in_image_restrict_eq:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   378
     "[| \<forall>x \<in> f``n. restrict(f`n, domain(x))=x;   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   379
         f \<in> nat -> XX;   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   380
         n \<in> nat;  domain(f`n) = succ(n);   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   381
         (\<Union>x \<in> f``n. domain(x)) \<subseteq> n |]  
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   382
      ==> \<forall>x \<in> f``succ(n). restrict(cons(<succ(n),y>, f`n), domain(x)) = x"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   383
apply (rule ballI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   384
apply (simp add: image_fun_succ)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   385
apply (drule f_n_type, assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   386
apply (erule disjE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   387
 apply (simp add: domain_of_fun restrict_cons_eq) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   388
apply (blast intro!: restrict_cons_eq_restrict)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   389
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   390
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   391
lemma (in imp_DC0) simplify_recursion: 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   392
     "[| \<forall>b<nat. <f``b, f`b> \<in> RR;   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   393
         f \<in> nat -> XX; range(R) \<subseteq> domain(R); x \<in> domain(R)|]    
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   394
      ==> allRR"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   395
apply (unfold RR_def allRR_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   396
apply (rule oallI, drule ltD)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   397
apply (erule nat_induct)
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13175
diff changeset
   398
apply (drule_tac x=0 in ospec, blast intro: Limit_has_0) 
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   399
apply (force simp add: singleton_fun [THEN domain_of_fun] singleton_in_funs) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   400
(*induction step*) (** LEVEL 5 **)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   401
(*prevent simplification of ~\<exists> to \<forall>~ *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   402
apply (simp only: separation split)
12820
02e2ff3e4d37 lexical tidying
paulson
parents: 12776
diff changeset
   403
apply (drule_tac x="succ(xa)" in ospec, blast intro: ltI)
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   404
apply (elim conjE disjE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   405
apply (force elim!: trans subst_context
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   406
             intro!: UN_image_succ_eq_succ)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   407
apply (erule notE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   408
apply (simp add: XX_def UN_image_succ_eq_succ)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   409
apply (elim conjE bexE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   410
apply (drule apply_domain_type, assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   411
apply (erule domainE)+
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   412
apply (frule f_n_type)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   413
apply (simp add: XX_def, assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   414
apply (rule rev_bexI, erule nat_succI)
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13175
diff changeset
   415
apply (rename_tac m i j y z) 
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13175
diff changeset
   416
apply (rule_tac x = "cons(<succ(m), z>, f`m)" in bexI)
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   417
prefer 2 apply (blast intro: cons_fun_type2) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   418
apply (rule conjI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   419
prefer 2 apply (fast del: ballI subsetI
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   420
		 elim: trans [OF _ subst_context, THEN domain_cons_eq_succ]
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   421
		       subst_context
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   422
		       all_in_image_restrict_eq [simplified XX_def]
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   423
		       trans equalityD1)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   424
(*one remaining subgoal*)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   425
apply (rule ballI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   426
apply (erule succE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   427
(** LEVEL 25 **)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   428
 apply (simp add: cons_val_n cons_val_k)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   429
(*assumption+ will not perform the required backtracking!*)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   430
apply (drule f_n_pairs_in_R [simplified XX_def, OF _ domain_of_fun], 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   431
       assumption, assumption, assumption)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   432
apply (simp add: nat_into_Ord [THEN succ_in_succ] succI2 cons_val_k)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   433
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   434
5482
73dc3b2a7102 tidied using locales
paulson
parents: 3892
diff changeset
   435
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   436
lemma (in imp_DC0) lemma2: 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   437
     "[| allRR; f \<in> nat->XX; range(R) \<subseteq> domain(R); x \<in> domain(R); n \<in> nat |]
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   438
      ==> f`n \<in> succ(n) -> domain(R) & (\<forall>i \<in> n. <f`n`i, f`n`succ(i)>:R)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   439
apply (unfold allRR_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   440
apply (drule ospec)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   441
apply (erule ltI [OF _ Ord_nat])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   442
apply (erule CollectE, simp)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   443
apply (rule conjI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   444
prefer 2 apply (fast elim!: f_n_pairs_in_R trans subst_context)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   445
apply (unfold XX_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   446
apply (fast elim!: trans [THEN domain_eq_imp_fun_type] subst_context)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   447
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   448
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   449
lemma (in imp_DC0) lemma3:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   450
     "[| allRR; f \<in> nat->XX; n\<in>nat; range(R) \<subseteq> domain(R);  x \<in> domain(R) |]
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   451
      ==> f`n`n = f`succ(n)`n"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   452
apply (frule lemma2 [THEN conjunct1, THEN domain_of_fun], assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   453
apply (unfold allRR_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   454
apply (drule ospec) 
12820
02e2ff3e4d37 lexical tidying
paulson
parents: 12776
diff changeset
   455
apply (drule ltI [OF nat_succI Ord_nat], assumption, simp)
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   456
apply (elim conjE ballE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   457
apply (erule restrict_eq_imp_val_eq [symmetric], force) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   458
apply (simp add: image_fun OrdmemD) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   459
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   460
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   461
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   462
theorem DC_nat_imp_DC0: "DC(nat) ==> DC0"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   463
apply (unfold DC_def DC0_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   464
apply (intro allI impI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   465
apply (erule asm_rl conjE ex_in_domain [THEN exE] allE)+
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   466
apply (erule impE [OF _ imp_DC0.lemma4], assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   467
apply (erule bexE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   468
apply (drule imp_DC0.simplify_recursion, assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   469
apply (rule_tac x = "\<lambda>n \<in> nat. f`n`n" in bexI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   470
apply (rule_tac [2] lam_type)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   471
apply (erule_tac [2] apply_type [OF imp_DC0.lemma2 [THEN conjunct1] succI1])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   472
apply (rule ballI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   473
apply (frule_tac n="succ(n)" in imp_DC0.lemma2, 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   474
       (assumption|erule nat_succI)+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   475
apply (drule imp_DC0.lemma3, auto)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   476
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   477
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   478
(* ********************************************************************** *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   479
(* \<forall>K. Card(K) --> DC(K) ==> WO3                                       *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   480
(* ********************************************************************** *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   481
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   482
lemma fun_Ord_inj:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   483
      "[| f \<in> a->X;  Ord(a); 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   484
          !!b c. [| b<c; c \<in> a |] ==> f`b\<noteq>f`c |]    
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   485
       ==> f \<in> inj(a, X)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   486
apply (unfold inj_def, simp) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   487
apply (intro ballI impI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   488
apply (rule_tac j=x in Ord_in_Ord [THEN Ord_linear_lt], assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   489
apply (blast intro: Ord_in_Ord, auto) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   490
apply (atomize, blast dest: not_sym) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   491
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   492
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   493
lemma value_in_image: "[| f \<in> X->Y; A \<subseteq> X; a \<in> A |] ==> f`a \<in> f``A"
13175
81082cfa5618 new definition of "apply" and new simprule "beta_if"
paulson
parents: 12891
diff changeset
   494
by (fast elim!: image_fun [THEN ssubst])
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   495
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   496
theorem DC_WO3: "(\<forall>K. Card(K) --> DC(K)) ==> WO3"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   497
apply (unfold DC_def WO3_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   498
apply (rule allI)
12820
02e2ff3e4d37 lexical tidying
paulson
parents: 12776
diff changeset
   499
apply (case_tac "A \<prec> Hartog (A)")
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   500
apply (fast dest!: lesspoll_imp_ex_lt_eqpoll 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   501
            intro!: Ord_Hartog leI [THEN le_imp_subset])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   502
apply (erule allE impE)+
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   503
apply (rule Card_Hartog)
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13175
diff changeset
   504
apply (erule_tac x = A in allE)
12776
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   505
apply (erule_tac x = "{<z1,z2> \<in> Pow (A) *A . z1 \<prec> Hartog (A) & z2 \<notin> z1}" 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   506
                 in allE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   507
apply simp
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   508
apply (erule impE, fast elim: lesspoll_lemma [THEN not_emptyE])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   509
apply (erule bexE)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   510
apply (rule Hartog_lepoll_selfE) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   511
apply (rule lepoll_def [THEN def_imp_iff, THEN iffD2])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   512
apply (rule exI, rule fun_Ord_inj, assumption, rule Ord_Hartog)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   513
apply (drule value_in_image) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   514
apply (drule OrdmemD, rule Ord_Hartog, assumption+, erule ltD) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   515
apply (drule ospec)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   516
apply (blast intro: ltI Ord_Hartog, force) 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   517
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   518
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   519
(* ********************************************************************** *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   520
(* WO1 ==> \<forall>K. Card(K) --> DC(K)                                       *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   521
(* ********************************************************************** *)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   522
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   523
lemma images_eq:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   524
     "[| \<forall>x \<in> A. f`x=g`x; f \<in> Df->Cf; g \<in> Dg->Cg; A \<subseteq> Df; A \<subseteq> Dg |] 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   525
      ==> f``A = g``A"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   526
apply (simp (no_asm_simp) add: image_fun)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   527
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   528
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   529
lemma lam_images_eq:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   530
     "[| Ord(a); b \<in> a |] ==> (\<lambda>x \<in> a. h(x))``b = (\<lambda>x \<in> b. h(x))``b"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   531
apply (rule images_eq)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   532
    apply (rule ballI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   533
    apply (drule OrdmemD [THEN subsetD], assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   534
    apply simp
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   535
   apply (fast elim!: RepFunI OrdmemD intro!: lam_type)+
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   536
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   537
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   538
lemma lam_type_RepFun: "(\<lambda>b \<in> a. h(b)) \<in> a -> {h(b). b \<in> a}"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   539
by (fast intro!: lam_type RepFunI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   540
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   541
lemma lemmaX:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   542
     "[| \<forall>Y \<in> Pow(X). Y \<prec> K --> (\<exists>x \<in> X. <Y, x> \<in> R);   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   543
         b \<in> K; Z \<in> Pow(X); Z \<prec> K |]   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   544
      ==> {x \<in> X. <Z,x> \<in> R} \<noteq> 0"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   545
by blast
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   546
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   547
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   548
lemma WO1_DC_lemma:
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   549
     "[| Card(K); well_ord(X,Q);   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   550
         \<forall>Y \<in> Pow(X). Y \<prec> K --> (\<exists>x \<in> X. <Y, x> \<in> R); b \<in> K |]   
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   551
      ==> ff(b, X, Q, R) \<in> {x \<in> X. <(\<lambda>c \<in> b. ff(c, X, Q, R))``b, x> \<in> R}"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   552
apply (rule_tac P = "b \<in> K" in impE, (erule_tac [2] asm_rl)+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   553
apply (rule_tac i=b in Card_is_Ord [THEN Ord_in_Ord, THEN trans_induct], 
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   554
       assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   555
apply (rule impI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   556
apply (rule ff_def [THEN def_transrec, THEN ssubst])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   557
apply (erule the_first_in, fast)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   558
apply (simp add: image_fun [OF lam_type_RepFun subset_refl])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   559
apply (erule lemmaX, assumption)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   560
 apply (blast intro: Card_is_Ord OrdmemD [THEN subsetD])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   561
apply (blast intro: lesspoll_trans1 in_Card_imp_lesspoll RepFun_lepoll)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   562
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   563
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   564
theorem WO1_DC_Card: "WO1 ==> \<forall>K. Card(K) --> DC(K)"
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   565
apply (unfold DC_def WO1_def)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   566
apply (rule allI impI)+
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   567
apply (erule allE exE conjE)+
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   568
apply (rule_tac x = "\<lambda>b \<in> K. ff (b, X, Ra, R) " in bexI)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   569
 apply (simp add: lam_images_eq [OF Card_is_Ord ltD])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   570
 apply (fast elim!: ltE WO1_DC_lemma [THEN CollectD2])
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   571
apply (rule_tac lam_type)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   572
apply (rule WO1_DC_lemma [THEN CollectD1], assumption+)
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   573
done
249600a63ba9 Isar version of AC
paulson
parents: 11317
diff changeset
   574
1196
d43c1f7a53fe Numerous small improvements by KG and LCP
lcp
parents:
diff changeset
   575
end