src/ZF/Constructible/Rank_Separation.thy
author ballarin
Thu Dec 11 18:30:26 2008 +0100 (2008-12-11)
changeset 29223 e09c53289830
parent 19931 fb32b43e7f80
child 32960 69916a850301
permissions -rw-r--r--
Conversion of HOL-Main and ZF to new locales.
paulson@13634
     1
(*  Title:      ZF/Constructible/Rank_Separation.thy
paulson@13634
     2
    ID:   $Id$
paulson@13634
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
paulson@13634
     4
*)
paulson@13634
     5
paulson@13634
     6
header {*Separation for Facts About Order Types, Rank Functions and 
paulson@13634
     7
      Well-Founded Relations*}
paulson@13634
     8
haftmann@16417
     9
theory Rank_Separation imports Rank Rec_Separation begin
paulson@13634
    10
paulson@13634
    11
paulson@13634
    12
text{*This theory proves all instances needed for locales
paulson@13687
    13
 @{text "M_ordertype"} and  @{text "M_wfrank"}.  But the material is not
paulson@13687
    14
 needed for proving the relative consistency of AC.*}
paulson@13634
    15
paulson@13634
    16
subsection{*The Locale @{text "M_ordertype"}*}
paulson@13634
    17
paulson@13634
    18
subsubsection{*Separation for Order-Isomorphisms*}
paulson@13634
    19
paulson@13634
    20
lemma well_ord_iso_Reflects:
paulson@13634
    21
  "REFLECTS[\<lambda>x. x\<in>A -->
paulson@13634
    22
                (\<exists>y[L]. \<exists>p[L]. fun_apply(L,f,x,y) & pair(L,y,x,p) & p \<in> r),
paulson@13634
    23
        \<lambda>i x. x\<in>A --> (\<exists>y \<in> Lset(i). \<exists>p \<in> Lset(i).
paulson@13807
    24
                fun_apply(##Lset(i),f,x,y) & pair(##Lset(i),y,x,p) & p \<in> r)]"
paulson@13634
    25
by (intro FOL_reflections function_reflections)
paulson@13634
    26
paulson@13634
    27
lemma well_ord_iso_separation:
paulson@13634
    28
     "[| L(A); L(f); L(r) |]
paulson@13634
    29
      ==> separation (L, \<lambda>x. x\<in>A --> (\<exists>y[L]. (\<exists>p[L].
paulson@13634
    30
                     fun_apply(L,f,x,y) & pair(L,y,x,p) & p \<in> r)))"
paulson@13687
    31
apply (rule gen_separation_multi [OF well_ord_iso_Reflects, of "{A,f,r}"], 
paulson@13687
    32
       auto)
paulson@13687
    33
apply (rule_tac env="[A,f,r]" in DPow_LsetI)
paulson@13634
    34
apply (rule sep_rules | simp)+
paulson@13634
    35
done
paulson@13634
    36
paulson@13634
    37
paulson@13634
    38
subsubsection{*Separation for @{term "obase"}*}
paulson@13634
    39
paulson@13634
    40
lemma obase_reflects:
paulson@13634
    41
  "REFLECTS[\<lambda>a. \<exists>x[L]. \<exists>g[L]. \<exists>mx[L]. \<exists>par[L].
paulson@13634
    42
             ordinal(L,x) & membership(L,x,mx) & pred_set(L,A,a,r,par) &
paulson@13634
    43
             order_isomorphism(L,par,r,x,mx,g),
paulson@13634
    44
        \<lambda>i a. \<exists>x \<in> Lset(i). \<exists>g \<in> Lset(i). \<exists>mx \<in> Lset(i). \<exists>par \<in> Lset(i).
paulson@13807
    45
             ordinal(##Lset(i),x) & membership(##Lset(i),x,mx) & pred_set(##Lset(i),A,a,r,par) &
paulson@13807
    46
             order_isomorphism(##Lset(i),par,r,x,mx,g)]"
paulson@13634
    47
by (intro FOL_reflections function_reflections fun_plus_reflections)
paulson@13634
    48
paulson@13634
    49
lemma obase_separation:
paulson@13634
    50
     --{*part of the order type formalization*}
paulson@13634
    51
     "[| L(A); L(r) |]
paulson@13634
    52
      ==> separation(L, \<lambda>a. \<exists>x[L]. \<exists>g[L]. \<exists>mx[L]. \<exists>par[L].
paulson@13634
    53
             ordinal(L,x) & membership(L,x,mx) & pred_set(L,A,a,r,par) &
paulson@13634
    54
             order_isomorphism(L,par,r,x,mx,g))"
paulson@13687
    55
apply (rule gen_separation_multi [OF obase_reflects, of "{A,r}"], auto)
paulson@13687
    56
apply (rule_tac env="[A,r]" in DPow_LsetI)
paulson@13687
    57
apply (rule ordinal_iff_sats sep_rules | simp)+
paulson@13634
    58
done
paulson@13634
    59
paulson@13634
    60
paulson@13634
    61
subsubsection{*Separation for a Theorem about @{term "obase"}*}
paulson@13634
    62
paulson@13634
    63
lemma obase_equals_reflects:
paulson@13634
    64
  "REFLECTS[\<lambda>x. x\<in>A --> ~(\<exists>y[L]. \<exists>g[L].
paulson@13634
    65
                ordinal(L,y) & (\<exists>my[L]. \<exists>pxr[L].
paulson@13634
    66
                membership(L,y,my) & pred_set(L,A,x,r,pxr) &
paulson@13634
    67
                order_isomorphism(L,pxr,r,y,my,g))),
paulson@13634
    68
        \<lambda>i x. x\<in>A --> ~(\<exists>y \<in> Lset(i). \<exists>g \<in> Lset(i).
paulson@13807
    69
                ordinal(##Lset(i),y) & (\<exists>my \<in> Lset(i). \<exists>pxr \<in> Lset(i).
paulson@13807
    70
                membership(##Lset(i),y,my) & pred_set(##Lset(i),A,x,r,pxr) &
paulson@13807
    71
                order_isomorphism(##Lset(i),pxr,r,y,my,g)))]"
paulson@13634
    72
by (intro FOL_reflections function_reflections fun_plus_reflections)
paulson@13634
    73
paulson@13634
    74
lemma obase_equals_separation:
paulson@13634
    75
     "[| L(A); L(r) |]
paulson@13634
    76
      ==> separation (L, \<lambda>x. x\<in>A --> ~(\<exists>y[L]. \<exists>g[L].
paulson@13634
    77
                              ordinal(L,y) & (\<exists>my[L]. \<exists>pxr[L].
paulson@13634
    78
                              membership(L,y,my) & pred_set(L,A,x,r,pxr) &
paulson@13634
    79
                              order_isomorphism(L,pxr,r,y,my,g))))"
paulson@13687
    80
apply (rule gen_separation_multi [OF obase_equals_reflects, of "{A,r}"], auto)
paulson@13687
    81
apply (rule_tac env="[A,r]" in DPow_LsetI)
paulson@13634
    82
apply (rule sep_rules | simp)+
paulson@13634
    83
done
paulson@13634
    84
paulson@13634
    85
paulson@13634
    86
subsubsection{*Replacement for @{term "omap"}*}
paulson@13634
    87
paulson@13634
    88
lemma omap_reflects:
paulson@13634
    89
 "REFLECTS[\<lambda>z. \<exists>a[L]. a\<in>B & (\<exists>x[L]. \<exists>g[L]. \<exists>mx[L]. \<exists>par[L].
paulson@13634
    90
     ordinal(L,x) & pair(L,a,x,z) & membership(L,x,mx) &
paulson@13634
    91
     pred_set(L,A,a,r,par) & order_isomorphism(L,par,r,x,mx,g)),
paulson@13634
    92
 \<lambda>i z. \<exists>a \<in> Lset(i). a\<in>B & (\<exists>x \<in> Lset(i). \<exists>g \<in> Lset(i). \<exists>mx \<in> Lset(i).
paulson@13634
    93
        \<exists>par \<in> Lset(i).
paulson@13807
    94
         ordinal(##Lset(i),x) & pair(##Lset(i),a,x,z) &
paulson@13807
    95
         membership(##Lset(i),x,mx) & pred_set(##Lset(i),A,a,r,par) &
paulson@13807
    96
         order_isomorphism(##Lset(i),par,r,x,mx,g))]"
paulson@13634
    97
by (intro FOL_reflections function_reflections fun_plus_reflections)
paulson@13634
    98
paulson@13634
    99
lemma omap_replacement:
paulson@13634
   100
     "[| L(A); L(r) |]
paulson@13634
   101
      ==> strong_replacement(L,
paulson@13634
   102
             \<lambda>a z. \<exists>x[L]. \<exists>g[L]. \<exists>mx[L]. \<exists>par[L].
paulson@13634
   103
             ordinal(L,x) & pair(L,a,x,z) & membership(L,x,mx) &
paulson@13634
   104
             pred_set(L,A,a,r,par) & order_isomorphism(L,par,r,x,mx,g))"
paulson@13634
   105
apply (rule strong_replacementI)
paulson@13687
   106
apply (rule_tac u="{A,r,B}" in gen_separation_multi [OF omap_reflects], auto)
paulson@13687
   107
apply (rule_tac env="[A,B,r]" in DPow_LsetI)
paulson@13634
   108
apply (rule sep_rules | simp)+
paulson@13634
   109
done
paulson@13634
   110
paulson@13634
   111
paulson@13634
   112
paulson@13634
   113
subsection{*Instantiating the locale @{text M_ordertype}*}
paulson@13634
   114
text{*Separation (and Strong Replacement) for basic set-theoretic constructions
paulson@13634
   115
such as intersection, Cartesian Product and image.*}
paulson@13634
   116
paulson@13634
   117
lemma M_ordertype_axioms_L: "M_ordertype_axioms(L)"
paulson@13634
   118
  apply (rule M_ordertype_axioms.intro)
paulson@13634
   119
       apply (assumption | rule well_ord_iso_separation
paulson@13634
   120
	 obase_separation obase_equals_separation
paulson@13634
   121
	 omap_replacement)+
paulson@13634
   122
  done
paulson@13634
   123
paulson@13634
   124
theorem M_ordertype_L: "PROP M_ordertype(L)"
ballarin@19931
   125
  apply (rule M_ordertype.intro)
ballarin@19931
   126
   apply (rule M_basic_L)
ballarin@19931
   127
  apply (rule M_ordertype_axioms_L) 
ballarin@19931
   128
  done
paulson@13634
   129
paulson@13634
   130
paulson@13634
   131
subsection{*The Locale @{text "M_wfrank"}*}
paulson@13634
   132
paulson@13634
   133
subsubsection{*Separation for @{term "wfrank"}*}
paulson@13634
   134
paulson@13634
   135
lemma wfrank_Reflects:
paulson@13634
   136
 "REFLECTS[\<lambda>x. \<forall>rplus[L]. tran_closure(L,r,rplus) -->
paulson@13634
   137
              ~ (\<exists>f[L]. M_is_recfun(L, %x f y. is_range(L,f,y), rplus, x, f)),
paulson@13807
   138
      \<lambda>i x. \<forall>rplus \<in> Lset(i). tran_closure(##Lset(i),r,rplus) -->
paulson@13634
   139
         ~ (\<exists>f \<in> Lset(i).
paulson@13807
   140
            M_is_recfun(##Lset(i), %x f y. is_range(##Lset(i),f,y),
paulson@13634
   141
                        rplus, x, f))]"
paulson@13634
   142
by (intro FOL_reflections function_reflections is_recfun_reflection tran_closure_reflection)
paulson@13634
   143
paulson@13634
   144
lemma wfrank_separation:
paulson@13634
   145
     "L(r) ==>
paulson@13634
   146
      separation (L, \<lambda>x. \<forall>rplus[L]. tran_closure(L,r,rplus) -->
paulson@13634
   147
         ~ (\<exists>f[L]. M_is_recfun(L, %x f y. is_range(L,f,y), rplus, x, f)))"
paulson@13634
   148
apply (rule gen_separation [OF wfrank_Reflects], simp)
paulson@13687
   149
apply (rule_tac env="[r]" in DPow_LsetI)
paulson@13687
   150
apply (rule sep_rules tran_closure_iff_sats is_recfun_iff_sats | simp)+
paulson@13634
   151
done
paulson@13634
   152
paulson@13634
   153
paulson@13634
   154
subsubsection{*Replacement for @{term "wfrank"}*}
paulson@13634
   155
paulson@13634
   156
lemma wfrank_replacement_Reflects:
paulson@13634
   157
 "REFLECTS[\<lambda>z. \<exists>x[L]. x \<in> A &
paulson@13634
   158
        (\<forall>rplus[L]. tran_closure(L,r,rplus) -->
paulson@13634
   159
         (\<exists>y[L]. \<exists>f[L]. pair(L,x,y,z)  &
paulson@13634
   160
                        M_is_recfun(L, %x f y. is_range(L,f,y), rplus, x, f) &
paulson@13634
   161
                        is_range(L,f,y))),
paulson@13634
   162
 \<lambda>i z. \<exists>x \<in> Lset(i). x \<in> A &
paulson@13807
   163
      (\<forall>rplus \<in> Lset(i). tran_closure(##Lset(i),r,rplus) -->
paulson@13807
   164
       (\<exists>y \<in> Lset(i). \<exists>f \<in> Lset(i). pair(##Lset(i),x,y,z)  &
paulson@13807
   165
         M_is_recfun(##Lset(i), %x f y. is_range(##Lset(i),f,y), rplus, x, f) &
paulson@13807
   166
         is_range(##Lset(i),f,y)))]"
paulson@13634
   167
by (intro FOL_reflections function_reflections fun_plus_reflections
paulson@13634
   168
             is_recfun_reflection tran_closure_reflection)
paulson@13634
   169
paulson@13634
   170
lemma wfrank_strong_replacement:
paulson@13634
   171
     "L(r) ==>
paulson@13634
   172
      strong_replacement(L, \<lambda>x z.
paulson@13634
   173
         \<forall>rplus[L]. tran_closure(L,r,rplus) -->
paulson@13634
   174
         (\<exists>y[L]. \<exists>f[L]. pair(L,x,y,z)  &
paulson@13634
   175
                        M_is_recfun(L, %x f y. is_range(L,f,y), rplus, x, f) &
paulson@13634
   176
                        is_range(L,f,y)))"
paulson@13634
   177
apply (rule strong_replacementI)
paulson@13687
   178
apply (rule_tac u="{r,B}" 
paulson@13687
   179
         in gen_separation_multi [OF wfrank_replacement_Reflects], 
paulson@13687
   180
       auto)
paulson@13687
   181
apply (rule_tac env="[r,B]" in DPow_LsetI)
paulson@13687
   182
apply (rule sep_rules tran_closure_iff_sats is_recfun_iff_sats | simp)+
paulson@13634
   183
done
paulson@13634
   184
paulson@13634
   185
paulson@13634
   186
subsubsection{*Separation for Proving @{text Ord_wfrank_range}*}
paulson@13634
   187
paulson@13634
   188
lemma Ord_wfrank_Reflects:
paulson@13634
   189
 "REFLECTS[\<lambda>x. \<forall>rplus[L]. tran_closure(L,r,rplus) -->
paulson@13634
   190
          ~ (\<forall>f[L]. \<forall>rangef[L].
paulson@13634
   191
             is_range(L,f,rangef) -->
paulson@13634
   192
             M_is_recfun(L, \<lambda>x f y. is_range(L,f,y), rplus, x, f) -->
paulson@13634
   193
             ordinal(L,rangef)),
paulson@13807
   194
      \<lambda>i x. \<forall>rplus \<in> Lset(i). tran_closure(##Lset(i),r,rplus) -->
paulson@13634
   195
          ~ (\<forall>f \<in> Lset(i). \<forall>rangef \<in> Lset(i).
paulson@13807
   196
             is_range(##Lset(i),f,rangef) -->
paulson@13807
   197
             M_is_recfun(##Lset(i), \<lambda>x f y. is_range(##Lset(i),f,y),
paulson@13634
   198
                         rplus, x, f) -->
paulson@13807
   199
             ordinal(##Lset(i),rangef))]"
paulson@13634
   200
by (intro FOL_reflections function_reflections is_recfun_reflection
paulson@13634
   201
          tran_closure_reflection ordinal_reflection)
paulson@13634
   202
paulson@13634
   203
lemma  Ord_wfrank_separation:
paulson@13634
   204
     "L(r) ==>
paulson@13634
   205
      separation (L, \<lambda>x.
paulson@13634
   206
         \<forall>rplus[L]. tran_closure(L,r,rplus) -->
paulson@13634
   207
          ~ (\<forall>f[L]. \<forall>rangef[L].
paulson@13634
   208
             is_range(L,f,rangef) -->
paulson@13634
   209
             M_is_recfun(L, \<lambda>x f y. is_range(L,f,y), rplus, x, f) -->
paulson@13634
   210
             ordinal(L,rangef)))"
paulson@13634
   211
apply (rule gen_separation [OF Ord_wfrank_Reflects], simp)
paulson@13687
   212
apply (rule_tac env="[r]" in DPow_LsetI)
paulson@13687
   213
apply (rule sep_rules tran_closure_iff_sats is_recfun_iff_sats | simp)+
paulson@13634
   214
done
paulson@13634
   215
paulson@13634
   216
paulson@13634
   217
subsubsection{*Instantiating the locale @{text M_wfrank}*}
paulson@13634
   218
paulson@13634
   219
lemma M_wfrank_axioms_L: "M_wfrank_axioms(L)"
paulson@13634
   220
  apply (rule M_wfrank_axioms.intro)
paulson@13634
   221
   apply (assumption | rule
paulson@13634
   222
     wfrank_separation wfrank_strong_replacement Ord_wfrank_separation)+
paulson@13634
   223
  done
paulson@13634
   224
paulson@13634
   225
theorem M_wfrank_L: "PROP M_wfrank(L)"
paulson@13634
   226
  apply (rule M_wfrank.intro)
ballarin@19931
   227
   apply (rule M_trancl_L)
paulson@13634
   228
  apply (rule M_wfrank_axioms_L) 
paulson@13634
   229
  done
paulson@13634
   230
paulson@13634
   231
lemmas exists_wfrank = M_wfrank.exists_wfrank [OF M_wfrank_L]
paulson@13634
   232
  and M_wellfoundedrank = M_wfrank.M_wellfoundedrank [OF M_wfrank_L]
paulson@13634
   233
  and Ord_wfrank_range = M_wfrank.Ord_wfrank_range [OF M_wfrank_L]
paulson@13634
   234
  and Ord_range_wellfoundedrank = M_wfrank.Ord_range_wellfoundedrank [OF M_wfrank_L]
paulson@13634
   235
  and function_wellfoundedrank = M_wfrank.function_wellfoundedrank [OF M_wfrank_L]
paulson@13634
   236
  and domain_wellfoundedrank = M_wfrank.domain_wellfoundedrank [OF M_wfrank_L]
paulson@13634
   237
  and wellfoundedrank_type = M_wfrank.wellfoundedrank_type [OF M_wfrank_L]
paulson@13634
   238
  and Ord_wellfoundedrank = M_wfrank.Ord_wellfoundedrank [OF M_wfrank_L]
paulson@13634
   239
  and wellfoundedrank_eq = M_wfrank.wellfoundedrank_eq [OF M_wfrank_L]
paulson@13634
   240
  and wellfoundedrank_lt = M_wfrank.wellfoundedrank_lt [OF M_wfrank_L]
paulson@13634
   241
  and wellfounded_imp_subset_rvimage = M_wfrank.wellfounded_imp_subset_rvimage [OF M_wfrank_L]
paulson@13634
   242
  and wellfounded_imp_wf = M_wfrank.wellfounded_imp_wf [OF M_wfrank_L]
paulson@13634
   243
  and wellfounded_on_imp_wf_on = M_wfrank.wellfounded_on_imp_wf_on [OF M_wfrank_L]
paulson@13634
   244
  and wf_abs = M_wfrank.wf_abs [OF M_wfrank_L]
paulson@13634
   245
  and wf_on_abs = M_wfrank.wf_on_abs [OF M_wfrank_L]
paulson@13634
   246
paulson@13634
   247
end