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