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