src/ZF/Constructible/AC_in_L.thy
author paulson
Fri, 01 Nov 2002 17:44:26 +0100
changeset 13692 27f3c83e2984
parent 13634 99a593b49b04
child 13702 c7cf8fa66534
permissions -rw-r--r--
proof streamlining
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     1
(*  Title:      ZF/Constructible/AC_in_L.thy
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     2
    ID: $Id$
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     4
*)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     5
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     6
header {* The Axiom of Choice Holds in L! *}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     7
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     8
theory AC_in_L = Formula:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     9
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    10
subsection{*Extending a Wellordering over a List -- Lexicographic Power*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    11
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    12
text{*This could be moved into a library.*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    13
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    14
consts
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    15
  rlist   :: "[i,i]=>i"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    16
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    17
inductive
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    18
  domains "rlist(A,r)" \<subseteq> "list(A) * list(A)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    19
  intros
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    20
    shorterI:
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    21
      "[| length(l') < length(l); l' \<in> list(A); l \<in> list(A) |]
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    22
       ==> <l', l> \<in> rlist(A,r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    23
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    24
    sameI:
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    25
      "[| <l',l> \<in> rlist(A,r); a \<in> A |]
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    26
       ==> <Cons(a,l'), Cons(a,l)> \<in> rlist(A,r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    27
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    28
    diffI:
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    29
      "[| length(l') = length(l); <a',a> \<in> r;
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    30
          l' \<in> list(A); l \<in> list(A); a' \<in> A; a \<in> A |]
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    31
       ==> <Cons(a',l'), Cons(a,l)> \<in> rlist(A,r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    32
  type_intros list.intros
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    33
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    34
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    35
subsubsection{*Type checking*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    36
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    37
lemmas rlist_type = rlist.dom_subset
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    38
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    39
lemmas field_rlist = rlist_type [THEN field_rel_subset]
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    40
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    41
subsubsection{*Linearity*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    42
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    43
lemma rlist_Nil_Cons [intro]:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    44
    "[|a \<in> A; l \<in> list(A)|] ==> <[], Cons(a,l)> \<in> rlist(A, r)"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    45
by (simp add: shorterI)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    46
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    47
lemma linear_rlist:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    48
    "linear(A,r) ==> linear(list(A),rlist(A,r))"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    49
apply (simp (no_asm_simp) add: linear_def)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    50
apply (rule ballI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    51
apply (induct_tac x)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    52
 apply (rule ballI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    53
 apply (induct_tac y)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    54
  apply (simp_all add: shorterI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    55
apply (rule ballI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    56
apply (erule_tac a=y in list.cases)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    57
 apply (rename_tac [2] a2 l2)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    58
 apply (rule_tac [2] i = "length(l)" and j = "length(l2)" in Ord_linear_lt)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    59
     apply (simp_all add: shorterI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    60
apply (erule_tac x=a and y=a2 in linearE)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    61
    apply (simp_all add: diffI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    62
apply (blast intro: sameI)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    63
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    64
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    65
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    66
subsubsection{*Well-foundedness*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    67
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    68
text{*Nothing preceeds Nil in this ordering.*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    69
inductive_cases rlist_NilE: " <l,[]> \<in> rlist(A,r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    70
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    71
inductive_cases rlist_ConsE: " <l', Cons(x,l)> \<in> rlist(A,r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    72
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    73
lemma not_rlist_Nil [simp]: " <l,[]> \<notin> rlist(A,r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    74
by (blast intro: elim: rlist_NilE)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    75
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    76
lemma rlist_imp_length_le: "<l',l> \<in> rlist(A,r) ==> length(l') \<le> length(l)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    77
apply (erule rlist.induct)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    78
apply (simp_all add: leI)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    79
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    80
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    81
lemma wf_on_rlist_n:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    82
  "[| n \<in> nat; wf[A](r) |] ==> wf[{l \<in> list(A). length(l) = n}](rlist(A,r))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    83
apply (induct_tac n)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    84
 apply (rule wf_onI2, simp)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    85
apply (rule wf_onI2, clarify)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    86
apply (erule_tac a=y in list.cases, clarify)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    87
 apply (simp (no_asm_use))
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    88
apply clarify
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    89
apply (simp (no_asm_use))
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    90
apply (subgoal_tac "\<forall>l2 \<in> list(A). length(l2) = x --> Cons(a,l2) \<in> B", blast)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    91
apply (erule_tac a=a in wf_on_induct, assumption)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    92
apply (rule ballI)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    93
apply (rule impI)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    94
apply (erule_tac a=l2 in wf_on_induct, blast, clarify)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    95
apply (rename_tac a' l2 l')
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    96
apply (drule_tac x="Cons(a',l')" in bspec, typecheck)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    97
apply simp
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    98
apply (erule mp, clarify)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    99
apply (erule rlist_ConsE, auto)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   100
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   101
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   102
lemma list_eq_UN_length: "list(A) = (\<Union>n\<in>nat. {l \<in> list(A). length(l) = n})"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   103
by (blast intro: length_type)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   104
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   105
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   106
lemma wf_on_rlist: "wf[A](r) ==> wf[list(A)](rlist(A,r))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   107
apply (subst list_eq_UN_length)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   108
apply (rule wf_on_Union)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   109
  apply (rule wf_imp_wf_on [OF wf_Memrel [of nat]])
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   110
 apply (simp add: wf_on_rlist_n)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   111
apply (frule rlist_type [THEN subsetD])
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   112
apply (simp add: length_type)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   113
apply (drule rlist_imp_length_le)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   114
apply (erule leE)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   115
apply (simp_all add: lt_def)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   116
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   117
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   118
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   119
lemma wf_rlist: "wf(r) ==> wf(rlist(field(r),r))"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   120
apply (simp add: wf_iff_wf_on_field)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   121
apply (rule wf_on_subset_A [OF _ field_rlist])
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   122
apply (blast intro: wf_on_rlist)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   123
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   124
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   125
lemma well_ord_rlist:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   126
     "well_ord(A,r) ==> well_ord(list(A), rlist(A,r))"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   127
apply (rule well_ordI)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   128
apply (simp add: well_ord_def wf_on_rlist)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   129
apply (simp add: well_ord_def tot_ord_def linear_rlist)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   130
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   131
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   132
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   133
subsection{*An Injection from Formulas into the Natural Numbers*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   134
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   135
text{*There is a well-known bijection between @{term "nat*nat"} and @{term
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   136
nat} given by the expression f(m,n) = triangle(m+n) + m, where triangle(k)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   137
enumerates the triangular numbers and can be defined by triangle(0)=0,
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   138
triangle(succ(k)) = succ(k + triangle(k)).  Some small amount of effort is
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   139
needed to show that f is a bijection.  We already know that such a bijection exists by the theorem @{text well_ord_InfCard_square_eq}:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   140
@{thm[display] well_ord_InfCard_square_eq[no_vars]}
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   141
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   142
However, this result merely states that there is a bijection between the two
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   143
sets.  It provides no means of naming a specific bijection.  Therefore, we
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   144
conduct the proofs under the assumption that a bijection exists.  The simplest
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   145
way to organize this is to use a locale.*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   146
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   147
text{*Locale for any arbitrary injection between @{term "nat*nat"}
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   148
      and @{term nat}*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   149
locale Nat_Times_Nat =
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   150
  fixes fn
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   151
  assumes fn_inj: "fn \<in> inj(nat*nat, nat)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   152
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   153
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   154
consts   enum :: "[i,i]=>i"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   155
primrec
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   156
  "enum(f, Member(x,y)) = f ` <0, f ` <x,y>>"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   157
  "enum(f, Equal(x,y)) = f ` <1, f ` <x,y>>"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   158
  "enum(f, Nand(p,q)) = f ` <2, f ` <enum(f,p), enum(f,q)>>"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   159
  "enum(f, Forall(p)) = f ` <succ(2), enum(f,p)>"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   160
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   161
lemma (in Nat_Times_Nat) fn_type [TC,simp]:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   162
    "[|x \<in> nat; y \<in> nat|] ==> fn`<x,y> \<in> nat"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   163
by (blast intro: inj_is_fun [OF fn_inj] apply_funtype)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   164
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   165
lemma (in Nat_Times_Nat) fn_iff:
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   166
    "[|x \<in> nat; y \<in> nat; u \<in> nat; v \<in> nat|]
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   167
     ==> (fn`<x,y> = fn`<u,v>) <-> (x=u & y=v)"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   168
by (blast dest: inj_apply_equality [OF fn_inj])
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   169
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   170
lemma (in Nat_Times_Nat) enum_type [TC,simp]:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   171
    "p \<in> formula ==> enum(fn,p) \<in> nat"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   172
by (induct_tac p, simp_all)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   173
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   174
lemma (in Nat_Times_Nat) enum_inject [rule_format]:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   175
    "p \<in> formula ==> \<forall>q\<in>formula. enum(fn,p) = enum(fn,q) --> p=q"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   176
apply (induct_tac p, simp_all)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   177
   apply (rule ballI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   178
   apply (erule formula.cases)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   179
   apply (simp_all add: fn_iff)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   180
  apply (rule ballI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   181
  apply (erule formula.cases)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   182
  apply (simp_all add: fn_iff)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   183
 apply (rule ballI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   184
 apply (erule_tac a=qa in formula.cases)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   185
 apply (simp_all add: fn_iff)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   186
 apply blast
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   187
apply (rule ballI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   188
apply (erule_tac a=q in formula.cases)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   189
apply (simp_all add: fn_iff, blast)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   190
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   191
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   192
lemma (in Nat_Times_Nat) inj_formula_nat:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   193
    "(\<lambda>p \<in> formula. enum(fn,p)) \<in> inj(formula, nat)"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   194
apply (simp add: inj_def lam_type)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   195
apply (blast intro: enum_inject)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   196
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   197
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   198
lemma (in Nat_Times_Nat) well_ord_formula:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   199
    "well_ord(formula, measure(formula, enum(fn)))"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   200
apply (rule well_ord_measure, simp)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   201
apply (blast intro: enum_inject)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   202
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   203
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   204
lemmas nat_times_nat_lepoll_nat =
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   205
    InfCard_nat [THEN InfCard_square_eqpoll, THEN eqpoll_imp_lepoll]
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   206
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   207
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   208
text{*Not needed--but interesting?*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   209
theorem formula_lepoll_nat: "formula \<lesssim> nat"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   210
apply (insert nat_times_nat_lepoll_nat)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   211
apply (unfold lepoll_def)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   212
apply (blast intro: Nat_Times_Nat.inj_formula_nat Nat_Times_Nat.intro)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   213
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   214
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   215
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   216
subsection{*Defining the Wellordering on @{term "DPow(A)"}*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   217
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   218
text{*The objective is to build a wellordering on @{term "DPow(A)"} from a
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   219
given one on @{term A}.  We first introduce wellorderings for environments,
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   220
which are lists built over @{term "A"}.  We combine it with the enumeration of
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   221
formulas.  The order type of the resulting wellordering gives us a map from
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   222
(environment, formula) pairs into the ordinals.  For each member of @{term
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   223
"DPow(A)"}, we take the minimum such ordinal.  This yields a wellordering of
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   224
@{term "DPow(A)-A"}, namely the set of elements just introduced, which we then
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   225
extend to the full set @{term "DPow(A)"}.*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   226
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   227
constdefs
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   228
  env_form_r :: "[i,i,i]=>i"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   229
    --{*wellordering on (environment, formula) pairs*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   230
   "env_form_r(f,r,A) ==
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   231
      rmult(list(A), rlist(A, r),
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   232
	    formula, measure(formula, enum(f)))"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   233
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   234
  env_form_map :: "[i,i,i,i]=>i"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   235
    --{*map from (environment, formula) pairs to ordinals*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   236
   "env_form_map(f,r,A,z)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   237
      == ordermap(list(A) * formula, env_form_r(f,r,A)) ` z"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   238
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   239
  DPow_new_ord :: "[i,i,i,i,i]=>o"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   240
    --{*predicate that holds if @{term k} is a valid index for @{term X}*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   241
   "DPow_new_ord(f,r,A,X,k) ==
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   242
           \<exists>env \<in> list(A). \<exists>p \<in> formula.
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   243
             arity(p) \<le> succ(length(env)) &
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   244
             X = {x\<in>A. sats(A, p, Cons(x,env))} &
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   245
             env_form_map(f,r,A,<env,p>) = k"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   246
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   247
  DPow_new_least :: "[i,i,i,i]=>i"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   248
    --{*function yielding the smallest index for @{term X}*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   249
   "DPow_new_least(f,r,A,X) == \<mu>k. DPow_new_ord(f,r,A,X,k)"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   250
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   251
  DPow_new_r :: "[i,i,i]=>i"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   252
    --{*a wellordering on the difference set @{term "DPow(A)-A"}*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   253
   "DPow_new_r(f,r,A) == measure(DPow(A)-A, DPow_new_least(f,r,A))"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   254
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   255
  DPow_r :: "[i,i,i]=>i"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   256
    --{*a wellordering on @{term "DPow(A)"}*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   257
   "DPow_r(f,r,A) == (DPow_new_r(f,r,A) Un (A * (DPow(A)-A))) Un r"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   258
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   259
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   260
lemma (in Nat_Times_Nat) well_ord_env_form_r:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   261
    "well_ord(A,r)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   262
     ==> well_ord(list(A) * formula, env_form_r(fn,r,A))"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   263
by (simp add: env_form_r_def well_ord_rmult well_ord_rlist well_ord_formula)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   264
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   265
lemma (in Nat_Times_Nat) Ord_env_form_map:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   266
    "[|well_ord(A,r); z \<in> list(A) * formula|]
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   267
     ==> Ord(env_form_map(fn,r,A,z))"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   268
by (simp add: env_form_map_def Ord_ordermap well_ord_env_form_r)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   269
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   270
lemma DPow_imp_ex_DPow_new_ord:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   271
    "X \<in> DPow(A) ==> \<exists>k. DPow_new_ord(fn,r,A,X,k)"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   272
apply (simp add: DPow_new_ord_def)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   273
apply (blast dest!: DPowD)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   274
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   275
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   276
lemma (in Nat_Times_Nat) DPow_new_ord_imp_Ord:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   277
     "[|DPow_new_ord(fn,r,A,X,k); well_ord(A,r)|] ==> Ord(k)"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   278
apply (simp add: DPow_new_ord_def, clarify)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   279
apply (simp add: Ord_env_form_map)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   280
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   281
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   282
lemma (in Nat_Times_Nat) DPow_imp_DPow_new_least:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   283
    "[|X \<in> DPow(A); well_ord(A,r)|]
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   284
     ==> DPow_new_ord(fn, r, A, X, DPow_new_least(fn,r,A,X))"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   285
apply (simp add: DPow_new_least_def)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   286
apply (blast dest: DPow_imp_ex_DPow_new_ord intro: DPow_new_ord_imp_Ord LeastI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   287
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   288
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   289
lemma (in Nat_Times_Nat) env_form_map_inject:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   290
    "[|env_form_map(fn,r,A,u) = env_form_map(fn,r,A,v); well_ord(A,r);
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   291
       u \<in> list(A) * formula;  v \<in> list(A) * formula|]
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   292
     ==> u=v"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   293
apply (simp add: env_form_map_def)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   294
apply (rule inj_apply_equality [OF bij_is_inj, OF ordermap_bij,
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   295
                                OF well_ord_env_form_r], assumption+)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   296
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   297
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   298
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   299
lemma (in Nat_Times_Nat) DPow_new_ord_unique:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   300
    "[|DPow_new_ord(fn,r,A,X,k); DPow_new_ord(fn,r,A,Y,k); well_ord(A,r)|]
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   301
     ==> X=Y"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   302
apply (simp add: DPow_new_ord_def, clarify)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   303
apply (drule env_form_map_inject, auto)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   304
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   305
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   306
lemma (in Nat_Times_Nat) well_ord_DPow_new_r:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   307
    "well_ord(A,r) ==> well_ord(DPow(A)-A, DPow_new_r(fn,r,A))"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   308
apply (simp add: DPow_new_r_def)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   309
apply (rule well_ord_measure)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   310
 apply (simp add: DPow_new_least_def Ord_Least, clarify)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   311
apply (drule DPow_imp_DPow_new_least, assumption)+
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   312
apply simp
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   313
apply (blast intro: DPow_new_ord_unique)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   314
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   315
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   316
lemma DPow_new_r_subset: "DPow_new_r(f,r,A) <= (DPow(A)-A) * (DPow(A)-A)"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   317
by (simp add: DPow_new_r_def measure_type)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   318
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   319
lemma (in Nat_Times_Nat) linear_DPow_r:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   320
    "well_ord(A,r)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   321
     ==> linear(DPow(A), DPow_r(fn, r, A))"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   322
apply (frule well_ord_DPow_new_r)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   323
apply (drule well_ord_is_linear)+
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   324
apply (auto simp add: linear_def DPow_r_def)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   325
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   326
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   327
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   328
lemma (in Nat_Times_Nat) wf_DPow_new_r:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   329
    "well_ord(A,r) ==> wf(DPow_new_r(fn,r,A))"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   330
apply (rule well_ord_DPow_new_r [THEN well_ord_is_wf, THEN wf_on_imp_wf],
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   331
       assumption+)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   332
apply (rule DPow_new_r_subset)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   333
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   334
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   335
lemma (in Nat_Times_Nat) well_ord_DPow_r:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   336
    "[|well_ord(A,r); r \<subseteq> A * A|]
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   337
     ==> well_ord(DPow(A), DPow_r(fn,r,A))"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   338
apply (rule well_ordI [OF wf_imp_wf_on])
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   339
 prefer 2 apply (blast intro: linear_DPow_r)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   340
apply (simp add: DPow_r_def)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   341
apply (rule wf_Un)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   342
  apply (cut_tac DPow_new_r_subset [of fn r A], blast)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   343
 apply (rule wf_Un)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   344
   apply (cut_tac DPow_new_r_subset [of fn r A], blast)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   345
  apply (blast intro: wf_DPow_new_r)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   346
 apply (simp add: wf_times Diff_disjoint)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   347
apply (blast intro: well_ord_is_wf wf_on_imp_wf)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   348
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   349
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   350
lemma (in Nat_Times_Nat) DPow_r_type:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   351
    "[|r \<subseteq> A * A; A \<subseteq> DPow(A)|]
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   352
     ==> DPow_r(fn,r,A) \<subseteq> DPow(A) * DPow(A)"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   353
apply (simp add: DPow_r_def DPow_new_r_def measure_def, blast)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   354
done		
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   355
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   356
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   357
subsection{*Limit Construction for Well-Orderings*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   358
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   359
text{*Now we work towards the transfinite definition of wellorderings for
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   360
@{term "Lset(i)"}.  We assume as an inductive hypothesis that there is a family
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   361
of wellorderings for smaller ordinals.*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   362
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   363
constdefs
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   364
  rlimit :: "[i,i=>i]=>i"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   365
  --{*expresses the wellordering at limit ordinals.*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   366
    "rlimit(i,r) ==
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   367
       {z: Lset(i) * Lset(i).
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   368
        \<exists>x' x. z = <x',x> &
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   369
               (lrank(x') < lrank(x) |
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   370
                (lrank(x') = lrank(x) & <x',x> \<in> r(succ(lrank(x)))))}"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   371
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   372
  Lset_new :: "i=>i"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   373
  --{*This constant denotes the set of elements introduced at level
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   374
      @{term "succ(i)"}*}
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   375
    "Lset_new(i) == {x \<in> Lset(succ(i)). lrank(x) = i}"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   376
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   377
lemma Lset_new_iff_lrank_eq:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   378
     "Ord(i) ==> x \<in> Lset_new(i) <-> L(x) & lrank(x) = i"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   379
by (auto simp add: Lset_new_def Lset_iff_lrank_lt)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   380
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   381
lemma Lset_new_eq:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   382
     "Ord(i) ==> Lset_new(i) = Lset(succ(i)) - Lset(i)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   383
apply (rule equality_iffI)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   384
apply (simp add: Lset_new_iff_lrank_eq Lset_iff_lrank_lt, auto)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   385
apply (blast elim: leE)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   386
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   387
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   388
lemma Limit_Lset_eq2:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   389
    "Limit(i) ==> Lset(i) = (\<Union>j\<in>i. Lset_new(j))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   390
apply (simp add: Limit_Lset_eq)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   391
apply (rule equalityI)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   392
 apply safe
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   393
 apply (subgoal_tac "Ord(y)")
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   394
  prefer 2 apply (blast intro: Ord_in_Ord Limit_is_Ord)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   395
 apply (simp_all add: Limit_is_Ord Lset_iff_lrank_lt Lset_new_def
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   396
                      Ord_mem_iff_lt)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   397
 apply (blast intro: lt_trans)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   398
apply (rule_tac x = "succ(lrank(x))" in bexI)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   399
 apply (simp add: Lset_succ_lrank_iff)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   400
apply (blast intro: Limit_has_succ ltD)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   401
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   402
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   403
lemma wf_on_Lset:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   404
    "wf[Lset(succ(j))](r(succ(j))) ==> wf[Lset_new(j)](rlimit(i,r))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   405
apply (simp add: wf_on_def Lset_new_def)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   406
apply (erule wf_subset)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   407
apply (force simp add: rlimit_def)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   408
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   409
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   410
lemma wf_on_rlimit:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   411
    "[|Limit(i); \<forall>j<i. wf[Lset(j)](r(j)) |] ==> wf[Lset(i)](rlimit(i,r))"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   412
apply (simp add: Limit_Lset_eq2)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   413
apply (rule wf_on_Union)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   414
  apply (rule wf_imp_wf_on [OF wf_Memrel [of i]])
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   415
 apply (blast intro: wf_on_Lset Limit_has_succ Limit_is_Ord ltI)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   416
apply (force simp add: rlimit_def Limit_is_Ord Lset_iff_lrank_lt Lset_new_def
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   417
                       Ord_mem_iff_lt)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   418
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   419
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   420
lemma linear_rlimit:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   421
    "[|Limit(i); \<forall>j<i. linear(Lset(j), r(j)) |]
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   422
     ==> linear(Lset(i), rlimit(i,r))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   423
apply (frule Limit_is_Ord)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   424
apply (simp add: Limit_Lset_eq2 Lset_new_def)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   425
apply (simp add: linear_def rlimit_def Ball_def lt_Ord Lset_iff_lrank_lt)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   426
apply (simp add: ltI, clarify)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   427
apply (rename_tac u v)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   428
apply (rule_tac i="lrank(u)" and j="lrank(v)" in Ord_linear_lt, simp_all) 
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   429
apply (drule_tac x="succ(lrank(u) Un lrank(v))" in ospec)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   430
 apply (simp add: ltI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   431
apply (drule_tac x=u in spec, simp)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   432
apply (drule_tac x=v in spec, simp)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   433
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   434
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   435
lemma well_ord_rlimit:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   436
    "[|Limit(i); \<forall>j<i. well_ord(Lset(j), r(j)) |]
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   437
     ==> well_ord(Lset(i), rlimit(i,r))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   438
by (blast intro: well_ordI wf_on_rlimit well_ord_is_wf
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   439
                           linear_rlimit well_ord_is_linear)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   440
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   441
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   442
subsection{*Transfinite Definition of the Wellordering on @{term "L"}*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   443
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   444
constdefs
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   445
 L_r :: "[i, i] => i"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   446
  "L_r(f,i) ==
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   447
      transrec(i, \<lambda>x r.
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   448
         if x=0 then 0
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   449
         else if Limit(x) then rlimit(x, \<lambda>y. r`y)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   450
         else DPow_r(f, r ` Arith.pred(x), Lset(Arith.pred(x))))"
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   451
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   452
subsubsection{*The Corresponding Recursion Equations*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   453
lemma [simp]: "L_r(f,0) = 0"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   454
by (simp add: def_transrec [OF L_r_def])
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   455
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   456
lemma [simp]: "Ord(i) ==> L_r(f, succ(i)) = DPow_r(f, L_r(f,i), Lset(i))"
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   457
by (simp add: def_transrec [OF L_r_def])
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   458
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   459
text{*Needed to handle the limit case*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   460
lemma L_r_eq:
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   461
     "Ord(i) ==>
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   462
      L_r(f, i) =
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   463
      (if i = 0 then 0
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   464
       else if Limit(i) then rlimit(i, op `(Lambda(i, L_r(f))))
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   465
       else DPow_r (f, Lambda(i, L_r(f)) ` Arith.pred(i),
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   466
                    Lset(Arith.pred(i))))"
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   467
apply (induct i rule: trans_induct3_rule)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   468
apply (simp_all add: def_transrec [OF L_r_def])
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   469
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   470
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   471
lemma rlimit_eqI:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   472
     "[|Limit(i); \<forall>j<i. r'(j) = r(j)|] ==> rlimit(i,r) = rlimit(i,r')"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   473
apply (simp add: rlimit_def)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   474
apply (rule refl iff_refl Collect_cong ex_cong conj_cong)+
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   475
apply (simp add: Limit_is_Ord Lset_lrank_lt)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   476
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   477
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   478
text{*I don't know why the limit case is so complicated.*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   479
lemma [simp]: "Limit(i) ==> L_r(f,i) = rlimit(i, L_r(f))"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   480
apply (simp add: Limit_nonzero def_transrec [OF L_r_def])
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   481
apply (rule rlimit_eqI, assumption)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   482
apply (rule oallI)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   483
apply (frule lt_Ord)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   484
apply (simp only: beta ltD L_r_eq [symmetric])
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   485
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   486
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   487
lemma (in Nat_Times_Nat) L_r_type:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   488
    "Ord(i) ==> L_r(fn,i) \<subseteq> Lset(i) * Lset(i)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   489
apply (induct i rule: trans_induct3_rule)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   490
  apply (simp_all add: Lset_succ DPow_r_type well_ord_DPow_r rlimit_def
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   491
                       Transset_subset_DPow [OF Transset_Lset], blast)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   492
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   493
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   494
lemma (in Nat_Times_Nat) well_ord_L_r:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   495
    "Ord(i) ==> well_ord(Lset(i), L_r(fn,i))"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   496
apply (induct i rule: trans_induct3_rule)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   497
apply (simp_all add: well_ord0 Lset_succ L_r_type well_ord_DPow_r
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   498
                     well_ord_rlimit ltD)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   499
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   500
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   501
lemma well_ord_L_r:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   502
    "Ord(i) ==> \<exists>r. well_ord(Lset(i), r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   503
apply (insert nat_times_nat_lepoll_nat)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   504
apply (unfold lepoll_def)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   505
apply (blast intro: Nat_Times_Nat.well_ord_L_r Nat_Times_Nat.intro)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   506
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   507
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   508
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   509
text{*Locale for proving results under the assumption @{text "V=L"}*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   510
locale V_equals_L =
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   511
  assumes VL: "L(x)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   512
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   513
text{*The Axiom of Choice holds in @{term L}!  Or, to be precise, the
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   514
Wellordering Theorem.*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   515
theorem (in V_equals_L) AC: "\<exists>r. well_ord(x,r)"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   516
apply (insert Transset_Lset VL [of x])
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   517
apply (simp add: Transset_def L_def)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   518
apply (blast dest!: well_ord_L_r intro: well_ord_subset)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   519
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   520
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   521
end