src/ZF/Constructible/AC_in_L.thy
author wenzelm
Wed, 27 Mar 2013 16:38:25 +0100
changeset 51553 63327f679cff
parent 47085 4a8a8b9bf414
child 58871 c399ae4b836f
permissions -rw-r--r--
more ambitious Goal.skip_proofs: covers Goal.prove forms as well, and do not insist in quick_and_dirty (for the sake of Isabelle/jEdit);
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
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     3
*)
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
header {* The Axiom of Choice Holds in L! *}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     6
47084
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
     7
theory AC_in_L imports Formula Separation begin
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     8
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
     9
subsection{*Extending a Wellordering over a List -- Lexicographic Power*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    10
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    11
text{*This could be moved into a library.*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    12
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    13
consts
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    14
  rlist   :: "[i,i]=>i"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    15
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    16
inductive
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    17
  domains "rlist(A,r)" \<subseteq> "list(A) * list(A)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    18
  intros
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    19
    shorterI:
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    20
      "[| 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
    21
       ==> <l', l> \<in> rlist(A,r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    22
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    23
    sameI:
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    24
      "[| <l',l> \<in> rlist(A,r); a \<in> A |]
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    25
       ==> <Cons(a,l'), Cons(a,l)> \<in> rlist(A,r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    26
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    27
    diffI:
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    28
      "[| length(l') = length(l); <a',a> \<in> r;
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    29
          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
    30
       ==> <Cons(a',l'), Cons(a,l)> \<in> rlist(A,r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    31
  type_intros list.intros
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    32
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
subsubsection{*Type checking*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    35
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    36
lemmas rlist_type = rlist.dom_subset
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    37
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    38
lemmas field_rlist = rlist_type [THEN field_rel_subset]
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    39
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    40
subsubsection{*Linearity*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    41
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    42
lemma rlist_Nil_Cons [intro]:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    43
    "[|a \<in> A; l \<in> list(A)|] ==> <[], Cons(a,l)> \<in> rlist(A, r)"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    44
by (simp add: shorterI)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    45
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    46
lemma linear_rlist:
47085
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    47
  assumes r: "linear(A,r)" shows "linear(list(A),rlist(A,r))"
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    48
proof -
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    49
  { fix xs ys
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    50
    have "xs \<in> list(A) \<Longrightarrow> ys \<in> list(A) \<Longrightarrow> \<langle>xs,ys\<rangle> \<in> rlist(A,r) \<or> xs = ys \<or> \<langle>ys,xs\<rangle> \<in> rlist(A, r) "
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    51
    proof (induct xs arbitrary: ys rule: list.induct)
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    52
      case Nil 
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    53
      thus ?case by (induct ys rule: list.induct) (auto simp add: shorterI)
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    54
    next
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    55
      case (Cons x xs)
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    56
      { fix y ys
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    57
        assume "y \<in> A" and "ys \<in> list(A)"
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    58
        with Cons
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    59
        have "\<langle>Cons(x,xs),Cons(y,ys)\<rangle> \<in> rlist(A,r) \<or> x=y & xs = ys \<or> \<langle>Cons(y,ys), Cons(x,xs)\<rangle> \<in> rlist(A,r)" 
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    60
          apply (rule_tac i = "length(xs)" and j = "length(ys)" in Ord_linear_lt)
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    61
          apply (simp_all add: shorterI)
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    62
          apply (rule linearE [OF r, of x y]) 
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    63
          apply (auto simp add: diffI intro: sameI) 
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    64
          done
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    65
      }
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    66
      note yConsCase = this
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    67
      show ?case using `ys \<in> list(A)`
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    68
        by (cases rule: list.cases) (simp_all add: Cons rlist_Nil_Cons yConsCase) 
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    69
    qed
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    70
  }
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    71
  thus ?thesis by (simp add: linear_def) 
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
    72
qed
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    73
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    74
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    75
subsubsection{*Well-foundedness*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    76
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    77
text{*Nothing preceeds Nil in this ordering.*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    78
inductive_cases rlist_NilE: " <l,[]> \<in> rlist(A,r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    79
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    80
inductive_cases rlist_ConsE: " <l', Cons(x,l)> \<in> rlist(A,r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    81
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    82
lemma not_rlist_Nil [simp]: " <l,[]> \<notin> rlist(A,r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    83
by (blast intro: elim: rlist_NilE)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    84
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    85
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
    86
apply (erule rlist.induct)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    87
apply (simp_all add: leI)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    88
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    89
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    90
lemma wf_on_rlist_n:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    91
  "[| 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
    92
apply (induct_tac n)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    93
 apply (rule wf_onI2, simp)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    94
apply (rule wf_onI2, clarify)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    95
apply (erule_tac a=y in list.cases, clarify)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    96
 apply (simp (no_asm_use))
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
    97
apply clarify
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
    98
apply (simp (no_asm_use))
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
    99
apply (subgoal_tac "\<forall>l2 \<in> list(A). length(l2) = x \<longrightarrow> Cons(a,l2) \<in> B", blast)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   100
apply (erule_tac a=a in wf_on_induct, assumption)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   101
apply (rule ballI)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   102
apply (rule impI)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   103
apply (erule_tac a=l2 in wf_on_induct, blast, clarify)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   104
apply (rename_tac a' l2 l')
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   105
apply (drule_tac x="Cons(a',l')" in bspec, typecheck)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   106
apply simp
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   107
apply (erule mp, clarify)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   108
apply (erule rlist_ConsE, auto)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   109
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   110
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   111
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
   112
by (blast intro: length_type)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   113
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   114
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   115
lemma wf_on_rlist: "wf[A](r) ==> wf[list(A)](rlist(A,r))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   116
apply (subst list_eq_UN_length)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   117
apply (rule wf_on_Union)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   118
  apply (rule wf_imp_wf_on [OF wf_Memrel [of nat]])
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   119
 apply (simp add: wf_on_rlist_n)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   120
apply (frule rlist_type [THEN subsetD])
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   121
apply (simp add: length_type)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   122
apply (drule rlist_imp_length_le)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   123
apply (erule leE)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   124
apply (simp_all add: lt_def)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   125
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   126
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   127
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   128
lemma wf_rlist: "wf(r) ==> wf(rlist(field(r),r))"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   129
apply (simp add: wf_iff_wf_on_field)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   130
apply (rule wf_on_subset_A [OF _ field_rlist])
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   131
apply (blast intro: wf_on_rlist)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   132
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   133
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   134
lemma well_ord_rlist:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   135
     "well_ord(A,r) ==> well_ord(list(A), rlist(A,r))"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   136
apply (rule well_ordI)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   137
apply (simp add: well_ord_def wf_on_rlist)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   138
apply (simp add: well_ord_def tot_ord_def linear_rlist)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   139
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   140
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   141
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   142
subsection{*An Injection from Formulas into the Natural Numbers*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   143
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   144
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
   145
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
   146
enumerates the triangular numbers and can be defined by triangle(0)=0,
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   147
triangle(succ(k)) = succ(k + triangle(k)).  Some small amount of effort is
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   148
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
   149
@{thm[display] well_ord_InfCard_square_eq[no_vars]}
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   150
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   151
However, this result merely states that there is a bijection between the two
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   152
sets.  It provides no means of naming a specific bijection.  Therefore, we
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   153
conduct the proofs under the assumption that a bijection exists.  The simplest
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   154
way to organize this is to use a locale.*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   155
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   156
text{*Locale for any arbitrary injection between @{term "nat*nat"}
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   157
      and @{term nat}*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   158
locale Nat_Times_Nat =
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   159
  fixes fn
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   160
  assumes fn_inj: "fn \<in> inj(nat*nat, nat)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   161
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   162
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   163
consts   enum :: "[i,i]=>i"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   164
primrec
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   165
  "enum(f, Member(x,y)) = f ` <0, f ` <x,y>>"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   166
  "enum(f, Equal(x,y)) = f ` <1, f ` <x,y>>"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   167
  "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
   168
  "enum(f, Forall(p)) = f ` <succ(2), enum(f,p)>"
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) fn_type [TC,simp]:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   171
    "[|x \<in> nat; y \<in> nat|] ==> fn`<x,y> \<in> nat"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   172
by (blast intro: inj_is_fun [OF fn_inj] apply_funtype)
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) fn_iff:
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   175
    "[|x \<in> nat; y \<in> nat; u \<in> nat; v \<in> nat|]
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   176
     ==> (fn`<x,y> = fn`<u,v>) \<longleftrightarrow> (x=u & y=v)"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   177
by (blast dest: inj_apply_equality [OF fn_inj])
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   178
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   179
lemma (in Nat_Times_Nat) enum_type [TC,simp]:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   180
    "p \<in> formula ==> enum(fn,p) \<in> nat"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   181
by (induct_tac p, simp_all)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   182
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   183
lemma (in Nat_Times_Nat) enum_inject [rule_format]:
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   184
    "p \<in> formula ==> \<forall>q\<in>formula. enum(fn,p) = enum(fn,q) \<longrightarrow> p=q"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   185
apply (induct_tac p, simp_all)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   186
   apply (rule ballI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   187
   apply (erule formula.cases)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   188
   apply (simp_all add: fn_iff)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   189
  apply (rule ballI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   190
  apply (erule formula.cases)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   191
  apply (simp_all add: fn_iff)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   192
 apply (rule ballI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   193
 apply (erule_tac a=qa in formula.cases)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   194
 apply (simp_all add: fn_iff)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   195
 apply blast
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   196
apply (rule ballI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   197
apply (erule_tac a=q in formula.cases)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   198
apply (simp_all add: fn_iff, blast)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   199
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   200
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   201
lemma (in Nat_Times_Nat) inj_formula_nat:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   202
    "(\<lambda>p \<in> formula. enum(fn,p)) \<in> inj(formula, nat)"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   203
apply (simp add: inj_def lam_type)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   204
apply (blast intro: enum_inject)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   205
done
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
lemma (in Nat_Times_Nat) well_ord_formula:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   208
    "well_ord(formula, measure(formula, enum(fn)))"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   209
apply (rule well_ord_measure, simp)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   210
apply (blast intro: enum_inject)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   211
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   212
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   213
lemmas nat_times_nat_lepoll_nat =
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   214
    InfCard_nat [THEN InfCard_square_eqpoll, THEN eqpoll_imp_lepoll]
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   215
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   216
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   217
text{*Not needed--but interesting?*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   218
theorem formula_lepoll_nat: "formula \<lesssim> nat"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   219
apply (insert nat_times_nat_lepoll_nat)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   220
apply (unfold lepoll_def)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   221
apply (blast intro: Nat_Times_Nat.inj_formula_nat Nat_Times_Nat.intro)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   222
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   223
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   224
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   225
subsection{*Defining the Wellordering on @{term "DPow(A)"}*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   226
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   227
text{*The objective is to build a wellordering on @{term "DPow(A)"} from a
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   228
given one on @{term A}.  We first introduce wellorderings for environments,
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   229
which are lists built over @{term "A"}.  We combine it with the enumeration of
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   230
formulas.  The order type of the resulting wellordering gives us a map from
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   231
(environment, formula) pairs into the ordinals.  For each member of @{term
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   232
"DPow(A)"}, we take the minimum such ordinal.*}
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   233
21233
5a5c8ea5f66a tuned specifications;
wenzelm
parents: 16417
diff changeset
   234
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   235
  env_form_r :: "[i,i,i]=>i" where
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   236
    --{*wellordering on (environment, formula) pairs*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   237
   "env_form_r(f,r,A) ==
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   238
      rmult(list(A), rlist(A, r),
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 21404
diff changeset
   239
            formula, measure(formula, enum(f)))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   240
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   241
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   242
  env_form_map :: "[i,i,i,i]=>i" where
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   243
    --{*map from (environment, formula) pairs to ordinals*}
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   244
   "env_form_map(f,r,A,z)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   245
      == ordermap(list(A) * formula, env_form_r(f,r,A)) ` z"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   246
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   247
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   248
  DPow_ord :: "[i,i,i,i,i]=>o" where
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   249
    --{*predicate that holds if @{term k} is a valid index for @{term X}*}
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   250
   "DPow_ord(f,r,A,X,k) ==
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   251
           \<exists>env \<in> list(A). \<exists>p \<in> formula.
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   252
             arity(p) \<le> succ(length(env)) &
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   253
             X = {x\<in>A. sats(A, p, Cons(x,env))} &
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   254
             env_form_map(f,r,A,<env,p>) = k"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   255
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   256
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   257
  DPow_least :: "[i,i,i,i]=>i" where
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   258
    --{*function yielding the smallest index for @{term X}*}
14171
0cab06e3bbd0 Extended the notion of letter and digit, such that now one may use greek,
skalberg
parents: 13702
diff changeset
   259
   "DPow_least(f,r,A,X) == \<mu> k. DPow_ord(f,r,A,X,k)"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   260
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   261
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   262
  DPow_r :: "[i,i,i]=>i" where
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   263
    --{*a wellordering on @{term "DPow(A)"}*}
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   264
   "DPow_r(f,r,A) == measure(DPow(A), DPow_least(f,r,A))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   265
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   266
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   267
lemma (in Nat_Times_Nat) well_ord_env_form_r:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   268
    "well_ord(A,r)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   269
     ==> well_ord(list(A) * formula, env_form_r(fn,r,A))"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   270
by (simp add: env_form_r_def well_ord_rmult well_ord_rlist well_ord_formula)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   271
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   272
lemma (in Nat_Times_Nat) Ord_env_form_map:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   273
    "[|well_ord(A,r); z \<in> list(A) * formula|]
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   274
     ==> Ord(env_form_map(fn,r,A,z))"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   275
by (simp add: env_form_map_def Ord_ordermap well_ord_env_form_r)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   276
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   277
lemma DPow_imp_ex_DPow_ord:
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   278
    "X \<in> DPow(A) ==> \<exists>k. DPow_ord(fn,r,A,X,k)"
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   279
apply (simp add: DPow_ord_def)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   280
apply (blast dest!: DPowD)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   281
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   282
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   283
lemma (in Nat_Times_Nat) DPow_ord_imp_Ord:
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   284
     "[|DPow_ord(fn,r,A,X,k); well_ord(A,r)|] ==> Ord(k)"
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   285
apply (simp add: DPow_ord_def, clarify)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   286
apply (simp add: Ord_env_form_map)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   287
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   288
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   289
lemma (in Nat_Times_Nat) DPow_imp_DPow_least:
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   290
    "[|X \<in> DPow(A); well_ord(A,r)|]
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   291
     ==> DPow_ord(fn, r, A, X, DPow_least(fn,r,A,X))"
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   292
apply (simp add: DPow_least_def)
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   293
apply (blast dest: DPow_imp_ex_DPow_ord intro: DPow_ord_imp_Ord LeastI)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   294
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   295
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   296
lemma (in Nat_Times_Nat) env_form_map_inject:
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   297
    "[|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
   298
       u \<in> list(A) * formula;  v \<in> list(A) * formula|]
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   299
     ==> u=v"
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   300
apply (simp add: env_form_map_def)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   301
apply (rule inj_apply_equality [OF bij_is_inj, OF ordermap_bij,
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   302
                                OF well_ord_env_form_r], assumption+)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   303
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   304
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   305
lemma (in Nat_Times_Nat) DPow_ord_unique:
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   306
    "[|DPow_ord(fn,r,A,X,k); DPow_ord(fn,r,A,Y,k); well_ord(A,r)|]
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   307
     ==> X=Y"
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   308
apply (simp add: DPow_ord_def, clarify)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   309
apply (drule env_form_map_inject, auto)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   310
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   311
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   312
lemma (in Nat_Times_Nat) well_ord_DPow_r:
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   313
    "well_ord(A,r) ==> well_ord(DPow(A), DPow_r(fn,r,A))"
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   314
apply (simp add: DPow_r_def)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   315
apply (rule well_ord_measure)
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   316
 apply (simp add: DPow_least_def Ord_Least)
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   317
apply (drule DPow_imp_DPow_least, assumption)+
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   318
apply simp
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   319
apply (blast intro: DPow_ord_unique)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   320
done
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   321
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   322
lemma (in Nat_Times_Nat) DPow_r_type:
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   323
    "DPow_r(fn,r,A) \<subseteq> DPow(A) * DPow(A)"
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   324
by (simp add: DPow_r_def measure_def, blast)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   325
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   326
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   327
subsection{*Limit Construction for Well-Orderings*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   328
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   329
text{*Now we work towards the transfinite definition of wellorderings for
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   330
@{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
   331
of wellorderings for smaller ordinals.*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   332
21233
5a5c8ea5f66a tuned specifications;
wenzelm
parents: 16417
diff changeset
   333
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   334
  rlimit :: "[i,i=>i]=>i" where
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   335
  --{*Expresses the wellordering at limit ordinals.  The conditional
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   336
      lets us remove the premise @{term "Limit(i)"} from some theorems.*}
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   337
    "rlimit(i,r) ==
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   338
       if Limit(i) then 
32960
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 21404
diff changeset
   339
         {z: Lset(i) * Lset(i).
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 21404
diff changeset
   340
          \<exists>x' x. z = <x',x> &
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 21404
diff changeset
   341
                 (lrank(x') < lrank(x) |
69916a850301 eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents: 21404
diff changeset
   342
                  (lrank(x') = lrank(x) & <x',x> \<in> r(succ(lrank(x)))))}
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   343
       else 0"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   344
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   345
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   346
  Lset_new :: "i=>i" where
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   347
  --{*This constant denotes the set of elements introduced at level
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   348
      @{term "succ(i)"}*}
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   349
    "Lset_new(i) == {x \<in> Lset(succ(i)). lrank(x) = i}"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   350
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   351
lemma Limit_Lset_eq2:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   352
    "Limit(i) ==> Lset(i) = (\<Union>j\<in>i. Lset_new(j))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   353
apply (simp add: Limit_Lset_eq)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   354
apply (rule equalityI)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   355
 apply safe
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   356
 apply (subgoal_tac "Ord(y)")
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   357
  prefer 2 apply (blast intro: Ord_in_Ord Limit_is_Ord)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   358
 apply (simp_all add: Limit_is_Ord Lset_iff_lrank_lt Lset_new_def
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   359
                      Ord_mem_iff_lt)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   360
 apply (blast intro: lt_trans)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   361
apply (rule_tac x = "succ(lrank(x))" in bexI)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   362
 apply (simp add: Lset_succ_lrank_iff)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   363
apply (blast intro: Limit_has_succ ltD)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   364
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   365
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   366
lemma wf_on_Lset:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   367
    "wf[Lset(succ(j))](r(succ(j))) ==> wf[Lset_new(j)](rlimit(i,r))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   368
apply (simp add: wf_on_def Lset_new_def)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   369
apply (erule wf_subset)
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   370
apply (simp add: rlimit_def, force)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   371
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   372
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   373
lemma wf_on_rlimit:
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   374
    "(\<forall>j<i. wf[Lset(j)](r(j))) ==> wf[Lset(i)](rlimit(i,r))"
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   375
apply (case_tac "Limit(i)") 
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   376
 prefer 2
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   377
 apply (simp add: rlimit_def wf_on_any_0)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   378
apply (simp add: Limit_Lset_eq2)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   379
apply (rule wf_on_Union)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   380
  apply (rule wf_imp_wf_on [OF wf_Memrel [of i]])
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   381
 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
   382
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
   383
                       Ord_mem_iff_lt)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   384
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   385
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   386
lemma linear_rlimit:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   387
    "[|Limit(i); \<forall>j<i. linear(Lset(j), r(j)) |]
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   388
     ==> linear(Lset(i), rlimit(i,r))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   389
apply (frule Limit_is_Ord)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   390
apply (simp add: Limit_Lset_eq2 Lset_new_def)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   391
apply (simp add: linear_def rlimit_def Ball_def lt_Ord Lset_iff_lrank_lt)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   392
apply (simp add: ltI, clarify)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   393
apply (rename_tac u v)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   394
apply (rule_tac i="lrank(u)" and j="lrank(v)" in Ord_linear_lt, simp_all) 
46823
57bf0cecb366 More mathematical symbols for ZF examples
paulson
parents: 32960
diff changeset
   395
apply (drule_tac x="succ(lrank(u) \<union> lrank(v))" in ospec)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   396
 apply (simp add: ltI)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   397
apply (drule_tac x=u in spec, simp)
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   398
apply (drule_tac x=v in spec, simp)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   399
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   400
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   401
lemma well_ord_rlimit:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   402
    "[|Limit(i); \<forall>j<i. well_ord(Lset(j), r(j)) |]
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   403
     ==> well_ord(Lset(i), rlimit(i,r))"
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   404
by (blast intro: well_ordI wf_on_rlimit well_ord_is_wf
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   405
                           linear_rlimit well_ord_is_linear)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   406
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   407
lemma rlimit_cong:
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   408
     "(!!j. j<i ==> r'(j) = r(j)) ==> rlimit(i,r) = rlimit(i,r')"
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   409
apply (simp add: rlimit_def, clarify) 
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   410
apply (rule refl iff_refl Collect_cong ex_cong conj_cong)+
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   411
apply (simp add: Limit_is_Ord Lset_lrank_lt)
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   412
done
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   413
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   414
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   415
subsection{*Transfinite Definition of the Wellordering on @{term "L"}*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   416
21233
5a5c8ea5f66a tuned specifications;
wenzelm
parents: 16417
diff changeset
   417
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   418
  L_r :: "[i, i] => i" where
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   419
  "L_r(f) == %i.
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   420
      transrec3(i, 0, \<lambda>x r. DPow_r(f, r, Lset(x)), 
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   421
                \<lambda>x r. rlimit(x, \<lambda>y. r`y))"
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   422
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   423
subsubsection{*The Corresponding Recursion Equations*}
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   424
lemma [simp]: "L_r(f,0) = 0"
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   425
by (simp add: L_r_def)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   426
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   427
lemma [simp]: "L_r(f, succ(i)) = DPow_r(f, L_r(f,i), Lset(i))"
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   428
by (simp add: L_r_def)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   429
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   430
text{*The limit case is non-trivial because of the distinction between
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   431
object-level and meta-level abstraction.*}
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   432
lemma [simp]: "Limit(i) ==> L_r(f,i) = rlimit(i, L_r(f))"
13702
c7cf8fa66534 Polishing.
paulson
parents: 13692
diff changeset
   433
by (simp cong: rlimit_cong add: transrec3_Limit L_r_def ltD)
13543
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 (in Nat_Times_Nat) L_r_type:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   436
    "Ord(i) ==> L_r(fn,i) \<subseteq> Lset(i) * Lset(i)"
46927
faf4a0b02b71 rationalising the induction rule trans_induct3
paulson
parents: 46823
diff changeset
   437
apply (induct i rule: trans_induct3)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   438
  apply (simp_all add: Lset_succ DPow_r_type well_ord_DPow_r rlimit_def
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   439
                       Transset_subset_DPow [OF Transset_Lset], blast)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   440
done
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
lemma (in Nat_Times_Nat) well_ord_L_r:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   443
    "Ord(i) ==> well_ord(Lset(i), L_r(fn,i))"
46927
faf4a0b02b71 rationalising the induction rule trans_induct3
paulson
parents: 46823
diff changeset
   444
apply (induct i rule: trans_induct3)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   445
apply (simp_all add: well_ord0 Lset_succ L_r_type well_ord_DPow_r
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   446
                     well_ord_rlimit ltD)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   447
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   448
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   449
lemma well_ord_L_r:
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   450
    "Ord(i) ==> \<exists>r. well_ord(Lset(i), r)"
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   451
apply (insert nat_times_nat_lepoll_nat)
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   452
apply (unfold lepoll_def)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   453
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
   454
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   455
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   456
47072
777549486d44 refinements to constructibility
paulson
parents: 46927
diff changeset
   457
text{*Every constructible set is well-ordered! Therefore the Wellordering Theorem and
777549486d44 refinements to constructibility
paulson
parents: 46927
diff changeset
   458
      the Axiom of Choice hold in @{term L}!!*}
777549486d44 refinements to constructibility
paulson
parents: 46927
diff changeset
   459
theorem L_implies_AC: assumes x: "L(x)" shows "\<exists>r. well_ord(x,r)"
777549486d44 refinements to constructibility
paulson
parents: 46927
diff changeset
   460
  using Transset_Lset x
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   461
apply (simp add: Transset_def L_def)
13692
27f3c83e2984 proof streamlining
paulson
parents: 13634
diff changeset
   462
apply (blast dest!: well_ord_L_r intro: well_ord_subset)
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   463
done
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   464
47084
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
   465
interpretation L?: M_basic L by (rule M_basic_L)
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
   466
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
   467
theorem "\<forall>x[L]. \<exists>r. wellordered(L,x,r)"
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
   468
proof 
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
   469
  fix x
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
   470
  assume "L(x)"
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
   471
  then obtain r where "well_ord(x,r)" 
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
   472
    by (blast dest: L_implies_AC) 
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
   473
  thus "\<exists>r. wellordered(L,x,r)" 
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
   474
    by (blast intro: well_ord_imp_relativized)
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
   475
qed
2e3dcec91653 New Message
paulson
parents: 47072
diff changeset
   476
47085
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
   477
text{*In order to prove @{term" \<exists>r[L]. wellordered(L,x,r)"}, it's necessary to know 
4a8a8b9bf414 more structured proofs
paulson
parents: 47084
diff changeset
   478
that @{term r} is actually constructible. It follows from the assumption ``@{term V} equals @{term L''}, 
47072
777549486d44 refinements to constructibility
paulson
parents: 46927
diff changeset
   479
but this reasoning doesn't appear to work in Isabelle.*}
777549486d44 refinements to constructibility
paulson
parents: 46927
diff changeset
   480
13543
2b3c7e319d82 completion of the consistency proof for AC
paulson
parents:
diff changeset
   481
end