src/ZF/Constructible/Separation.thy
author paulson
Wed, 09 Oct 2002 11:07:13 +0200
changeset 13634 99a593b49b04
parent 13628 87482b5e3f2e
child 13687 22dce9134953
permissions -rw-r--r--
Re-organization of Constructible theories
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13437
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
     1
(*  Title:      ZF/Constructible/Separation.thy
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
     2
    ID:         $Id$
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
     4
*)
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
     5
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13324
diff changeset
     6
header{*Early Instances of Separation and Strong Replacement*}
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
     7
13324
39d1b3a4c6f4 more and simpler separation proofs
paulson
parents: 13323
diff changeset
     8
theory Separation = L_axioms + WF_absolute:
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
     9
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
    10
text{*This theory proves all instances needed for locale @{text "M_basic"}*}
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13324
diff changeset
    11
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    12
text{*Helps us solve for de Bruijn indices!*}
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    13
lemma nth_ConsI: "[|nth(n,l) = x; n \<in> nat|] ==> nth(succ(n), Cons(a,l)) = x"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    14
by simp
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    15
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
    16
lemmas nth_rules = nth_0 nth_ConsI nat_0I nat_succI
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
    17
lemmas sep_rules = nth_0 nth_ConsI FOL_iff_sats function_iff_sats
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
    18
                   fun_plus_iff_sats
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    19
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    20
lemma Collect_conj_in_DPow:
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
    21
     "[| {x\<in>A. P(x)} \<in> DPow(A);  {x\<in>A. Q(x)} \<in> DPow(A) |]
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    22
      ==> {x\<in>A. P(x) & Q(x)} \<in> DPow(A)"
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
    23
by (simp add: Int_in_DPow Collect_Int_Collect_eq [symmetric])
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    24
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    25
lemma Collect_conj_in_DPow_Lset:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    26
     "[|z \<in> Lset(j); {x \<in> Lset(j). P(x)} \<in> DPow(Lset(j))|]
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    27
      ==> {x \<in> Lset(j). x \<in> z & P(x)} \<in> DPow(Lset(j))"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    28
apply (frule mem_Lset_imp_subset_Lset)
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
    29
apply (simp add: Collect_conj_in_DPow Collect_mem_eq
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    30
                 subset_Int_iff2 elem_subset_in_DPow)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    31
done
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    32
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    33
lemma separation_CollectI:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    34
     "(\<And>z. L(z) ==> L({x \<in> z . P(x)})) ==> separation(L, \<lambda>x. P(x))"
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
    35
apply (unfold separation_def, clarify)
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
    36
apply (rule_tac x="{x\<in>z. P(x)}" in rexI)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    37
apply simp_all
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    38
done
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    39
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    40
text{*Reduces the original comprehension to the reflected one*}
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    41
lemma reflection_imp_L_separation:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    42
      "[| \<forall>x\<in>Lset(j). P(x) <-> Q(x);
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
    43
          {x \<in> Lset(j) . Q(x)} \<in> DPow(Lset(j));
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    44
          Ord(j);  z \<in> Lset(j)|] ==> L({x \<in> z . P(x)})"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    45
apply (rule_tac i = "succ(j)" in L_I)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    46
 prefer 2 apply simp
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    47
apply (subgoal_tac "{x \<in> z. P(x)} = {x \<in> Lset(j). x \<in> z & (Q(x))}")
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    48
 prefer 2
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
    49
 apply (blast dest: mem_Lset_imp_subset_Lset)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    50
apply (simp add: Lset_succ Collect_conj_in_DPow_Lset)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    51
done
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    52
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    53
text{*Encapsulates the standard proof script for proving instances of 
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    54
Separation.  Typically @{term u} is a finite enumeration.*}
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    55
lemma gen_separation:
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    56
 assumes reflection: "REFLECTS [P,Q]"
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    57
     and Lu:         "L(u)"
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    58
     and collI: "!!j. u \<in> Lset(j)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    59
                \<Longrightarrow> Collect(Lset(j), Q(j)) \<in> DPow(Lset(j))"
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    60
 shows "separation(L,P)"
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    61
apply (rule separation_CollectI)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    62
apply (rule_tac A="{u,z}" in subset_LsetE, blast intro: Lu)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    63
apply (rule ReflectsE [OF reflection], assumption)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    64
apply (drule subset_Lset_ltD, assumption)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    65
apply (erule reflection_imp_L_separation)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    66
  apply (simp_all add: lt_Ord2, clarify)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    67
apply (rule collI)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    68
apply assumption;  
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    69
done
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    70
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    71
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
    72
subsection{*Separation for Intersection*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    73
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    74
lemma Inter_Reflects:
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
    75
     "REFLECTS[\<lambda>x. \<forall>y[L]. y\<in>A --> x \<in> y,
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
    76
               \<lambda>i x. \<forall>y\<in>Lset(i). y\<in>A --> x \<in> y]"
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
    77
by (intro FOL_reflections)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    78
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    79
lemma Inter_separation:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    80
     "L(A) ==> separation(L, \<lambda>x. \<forall>y[L]. y\<in>A --> x\<in>y)"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    81
apply (rule gen_separation [OF Inter_Reflects], simp)
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
    82
apply (rule DPow_LsetI)
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
    83
apply (rule ball_iff_sats)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    84
apply (rule imp_iff_sats)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    85
apply (rule_tac [2] i=1 and j=0 and env="[y,x,A]" in mem_iff_sats)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    86
apply (rule_tac i=0 and j=2 in mem_iff_sats)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    87
apply (simp_all add: succ_Un_distrib [symmetric])
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    88
done
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
    89
13437
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
    90
subsection{*Separation for Set Difference*}
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
    91
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
    92
lemma Diff_Reflects:
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
    93
     "REFLECTS[\<lambda>x. x \<notin> B, \<lambda>i x. x \<notin> B]"
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
    94
by (intro FOL_reflections)  
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
    95
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
    96
lemma Diff_separation:
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
    97
     "L(B) ==> separation(L, \<lambda>x. x \<notin> B)"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    98
apply (rule gen_separation [OF Diff_Reflects], simp)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
    99
apply (rule DPow_LsetI)
13437
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
   100
apply (rule not_iff_sats) 
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
   101
apply (rule_tac env="[x,B]" in mem_iff_sats)
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
   102
apply (rule sep_rules | simp)+
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
   103
done
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
   104
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   105
subsection{*Separation for Cartesian Product*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   106
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   107
lemma cartprod_Reflects:
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   108
     "REFLECTS[\<lambda>z. \<exists>x[L]. x\<in>A & (\<exists>y[L]. y\<in>B & pair(L,x,y,z)),
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   109
                \<lambda>i z. \<exists>x\<in>Lset(i). x\<in>A & (\<exists>y\<in>Lset(i). y\<in>B &
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   110
                                   pair(**Lset(i),x,y,z))]"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   111
by (intro FOL_reflections function_reflections)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   112
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   113
lemma cartprod_separation:
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   114
     "[| L(A); L(B) |]
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   115
      ==> separation(L, \<lambda>z. \<exists>x[L]. x\<in>A & (\<exists>y[L]. y\<in>B & pair(L,x,y,z)))"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   116
apply (rule gen_separation [OF cartprod_Reflects, of "{A,B}"], simp)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   117
apply (drule mem_Lset_imp_subset_Lset, clarsimp)
13385
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   118
apply (rule DPow_LsetI)
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   119
apply (rule bex_iff_sats)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   120
apply (rule conj_iff_sats)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   121
apply (rule_tac i=0 and j=2 and env="[x,z,A,B]" in mem_iff_sats, simp_all)
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   122
apply (rule sep_rules | simp)+
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   123
done
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   124
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   125
subsection{*Separation for Image*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   126
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   127
lemma image_Reflects:
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   128
     "REFLECTS[\<lambda>y. \<exists>p[L]. p\<in>r & (\<exists>x[L]. x\<in>A & pair(L,x,y,p)),
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   129
           \<lambda>i y. \<exists>p\<in>Lset(i). p\<in>r & (\<exists>x\<in>Lset(i). x\<in>A & pair(**Lset(i),x,y,p))]"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   130
by (intro FOL_reflections function_reflections)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   131
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   132
lemma image_separation:
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   133
     "[| L(A); L(r) |]
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   134
      ==> separation(L, \<lambda>y. \<exists>p[L]. p\<in>r & (\<exists>x[L]. x\<in>A & pair(L,x,y,p)))"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   135
apply (rule gen_separation [OF image_Reflects, of "{A,r}"], simp)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   136
apply (drule mem_Lset_imp_subset_Lset, clarsimp)
13385
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   137
apply (rule DPow_LsetI)
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   138
apply (rule bex_iff_sats)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   139
apply (rule conj_iff_sats)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   140
apply (rule_tac env="[p,y,A,r]" in mem_iff_sats)
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   141
apply (rule sep_rules | simp)+
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   142
done
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   143
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   144
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   145
subsection{*Separation for Converse*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   146
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   147
lemma converse_Reflects:
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   148
  "REFLECTS[\<lambda>z. \<exists>p[L]. p\<in>r & (\<exists>x[L]. \<exists>y[L]. pair(L,x,y,p) & pair(L,y,x,z)),
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   149
     \<lambda>i z. \<exists>p\<in>Lset(i). p\<in>r & (\<exists>x\<in>Lset(i). \<exists>y\<in>Lset(i).
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   150
                     pair(**Lset(i),x,y,p) & pair(**Lset(i),y,x,z))]"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   151
by (intro FOL_reflections function_reflections)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   152
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   153
lemma converse_separation:
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   154
     "L(r) ==> separation(L,
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   155
         \<lambda>z. \<exists>p[L]. p\<in>r & (\<exists>x[L]. \<exists>y[L]. pair(L,x,y,p) & pair(L,y,x,z)))"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   156
apply (rule gen_separation [OF converse_Reflects], simp)
13385
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   157
apply (rule DPow_LsetI)
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   158
apply (rule bex_iff_sats)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   159
apply (rule conj_iff_sats)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   160
apply (rule_tac i=0 and j=2 and env="[p,z,r]" in mem_iff_sats, simp_all)
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   161
apply (rule sep_rules | simp)+
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   162
done
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   163
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   164
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   165
subsection{*Separation for Restriction*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   166
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   167
lemma restrict_Reflects:
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   168
     "REFLECTS[\<lambda>z. \<exists>x[L]. x\<in>A & (\<exists>y[L]. pair(L,x,y,z)),
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   169
        \<lambda>i z. \<exists>x\<in>Lset(i). x\<in>A & (\<exists>y\<in>Lset(i). pair(**Lset(i),x,y,z))]"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   170
by (intro FOL_reflections function_reflections)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   171
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   172
lemma restrict_separation:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   173
   "L(A) ==> separation(L, \<lambda>z. \<exists>x[L]. x\<in>A & (\<exists>y[L]. pair(L,x,y,z)))"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   174
apply (rule gen_separation [OF restrict_Reflects], simp)
13385
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   175
apply (rule DPow_LsetI)
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   176
apply (rule bex_iff_sats)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   177
apply (rule conj_iff_sats)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   178
apply (rule_tac i=0 and j=2 and env="[x,z,A]" in mem_iff_sats, simp_all)
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   179
apply (rule sep_rules | simp)+
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   180
done
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   181
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   182
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   183
subsection{*Separation for Composition*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   184
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   185
lemma comp_Reflects:
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   186
     "REFLECTS[\<lambda>xz. \<exists>x[L]. \<exists>y[L]. \<exists>z[L]. \<exists>xy[L]. \<exists>yz[L].
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   187
                  pair(L,x,z,xz) & pair(L,x,y,xy) & pair(L,y,z,yz) &
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   188
                  xy\<in>s & yz\<in>r,
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   189
        \<lambda>i xz. \<exists>x\<in>Lset(i). \<exists>y\<in>Lset(i). \<exists>z\<in>Lset(i). \<exists>xy\<in>Lset(i). \<exists>yz\<in>Lset(i).
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   190
                  pair(**Lset(i),x,z,xz) & pair(**Lset(i),x,y,xy) &
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   191
                  pair(**Lset(i),y,z,yz) & xy\<in>s & yz\<in>r]"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   192
by (intro FOL_reflections function_reflections)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   193
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   194
lemma comp_separation:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   195
     "[| L(r); L(s) |]
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   196
      ==> separation(L, \<lambda>xz. \<exists>x[L]. \<exists>y[L]. \<exists>z[L]. \<exists>xy[L]. \<exists>yz[L].
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   197
                  pair(L,x,z,xz) & pair(L,x,y,xy) & pair(L,y,z,yz) &
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   198
                  xy\<in>s & yz\<in>r)"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   199
apply (rule gen_separation [OF comp_Reflects, of "{r,s}"], simp)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   200
apply (drule mem_Lset_imp_subset_Lset, clarsimp)
13385
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   201
apply (rule DPow_LsetI)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   202
apply (rule bex_iff_sats)+
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   203
apply (rule conj_iff_sats)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   204
apply (rule_tac env="[z,y,x,xz,r,s]" in pair_iff_sats)
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   205
apply (rule sep_rules | simp)+
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   206
done
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   207
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   208
subsection{*Separation for Predecessors in an Order*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   209
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   210
lemma pred_Reflects:
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   211
     "REFLECTS[\<lambda>y. \<exists>p[L]. p\<in>r & pair(L,y,x,p),
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   212
                    \<lambda>i y. \<exists>p \<in> Lset(i). p\<in>r & pair(**Lset(i),y,x,p)]"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   213
by (intro FOL_reflections function_reflections)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   214
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   215
lemma pred_separation:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   216
     "[| L(r); L(x) |] ==> separation(L, \<lambda>y. \<exists>p[L]. p\<in>r & pair(L,y,x,p))"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   217
apply (rule gen_separation [OF pred_Reflects, of "{r,x}"], simp)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   218
apply (drule mem_Lset_imp_subset_Lset, clarsimp)
13385
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   219
apply (rule DPow_LsetI)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   220
apply (rule bex_iff_sats)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   221
apply (rule conj_iff_sats)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   222
apply (rule_tac env = "[p,y,r,x]" in mem_iff_sats)
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   223
apply (rule sep_rules | simp)+
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   224
done
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   225
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   226
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   227
subsection{*Separation for the Membership Relation*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   228
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   229
lemma Memrel_Reflects:
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   230
     "REFLECTS[\<lambda>z. \<exists>x[L]. \<exists>y[L]. pair(L,x,y,z) & x \<in> y,
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13306
diff changeset
   231
            \<lambda>i z. \<exists>x \<in> Lset(i). \<exists>y \<in> Lset(i). pair(**Lset(i),x,y,z) & x \<in> y]"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   232
by (intro FOL_reflections function_reflections)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   233
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   234
lemma Memrel_separation:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   235
     "separation(L, \<lambda>z. \<exists>x[L]. \<exists>y[L]. pair(L,x,y,z) & x \<in> y)"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   236
apply (rule gen_separation [OF Memrel_Reflects nonempty])
13385
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   237
apply (rule DPow_LsetI)
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   238
apply (rule bex_iff_sats conj_iff_sats)+
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   239
apply (rule_tac env = "[y,x,z]" in pair_iff_sats)
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   240
apply (rule sep_rules | simp)+
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   241
done
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   242
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   243
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   244
subsection{*Replacement for FunSpace*}
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   245
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   246
lemma funspace_succ_Reflects:
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   247
 "REFLECTS[\<lambda>z. \<exists>p[L]. p\<in>A & (\<exists>f[L]. \<exists>b[L]. \<exists>nb[L]. \<exists>cnbf[L].
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   248
            pair(L,f,b,p) & pair(L,n,b,nb) & is_cons(L,nb,f,cnbf) &
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   249
            upair(L,cnbf,cnbf,z)),
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   250
        \<lambda>i z. \<exists>p \<in> Lset(i). p\<in>A & (\<exists>f \<in> Lset(i). \<exists>b \<in> Lset(i).
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   251
              \<exists>nb \<in> Lset(i). \<exists>cnbf \<in> Lset(i).
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   252
                pair(**Lset(i),f,b,p) & pair(**Lset(i),n,b,nb) &
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   253
                is_cons(**Lset(i),nb,f,cnbf) & upair(**Lset(i),cnbf,cnbf,z))]"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   254
by (intro FOL_reflections function_reflections)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   255
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   256
lemma funspace_succ_replacement:
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   257
     "L(n) ==>
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   258
      strong_replacement(L, \<lambda>p z. \<exists>f[L]. \<exists>b[L]. \<exists>nb[L]. \<exists>cnbf[L].
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   259
                pair(L,f,b,p) & pair(L,n,b,nb) & is_cons(L,nb,f,cnbf) &
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   260
                upair(L,cnbf,cnbf,z))"
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   261
apply (rule strong_replacementI)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   262
apply (rule_tac u="{n,A}" in gen_separation [OF funspace_succ_Reflects], simp)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   263
apply (drule mem_Lset_imp_subset_Lset, clarsimp)
13385
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   264
apply (rule DPow_LsetI)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   265
apply (rule bex_iff_sats)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   266
apply (rule conj_iff_sats)
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   267
apply (rule_tac env = "[p,z,n,A]" in mem_iff_sats)
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
   268
apply (rule sep_rules | simp)+
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   269
done
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   270
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   271
13634
99a593b49b04 Re-organization of Constructible theories
paulson
parents: 13628
diff changeset
   272
subsection{*Separation for a Theorem about @{term "is_recfun"}*}
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   273
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   274
lemma is_recfun_reflects:
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   275
  "REFLECTS[\<lambda>x. \<exists>xa[L]. \<exists>xb[L].
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   276
                pair(L,x,a,xa) & xa \<in> r & pair(L,x,b,xb) & xb \<in> r &
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   277
                (\<exists>fx[L]. \<exists>gx[L]. fun_apply(L,f,x,fx) & fun_apply(L,g,x,gx) &
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   278
                                   fx \<noteq> gx),
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   279
   \<lambda>i x. \<exists>xa \<in> Lset(i). \<exists>xb \<in> Lset(i).
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   280
          pair(**Lset(i),x,a,xa) & xa \<in> r & pair(**Lset(i),x,b,xb) & xb \<in> r &
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   281
                (\<exists>fx \<in> Lset(i). \<exists>gx \<in> Lset(i). fun_apply(**Lset(i),f,x,fx) &
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   282
                  fun_apply(**Lset(i),g,x,gx) & fx \<noteq> gx)]"
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   283
by (intro FOL_reflections function_reflections fun_plus_reflections)
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   284
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   285
lemma is_recfun_separation:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   286
     --{*for well-founded recursion*}
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   287
     "[| L(r); L(f); L(g); L(a); L(b) |]
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   288
     ==> separation(L,
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   289
            \<lambda>x. \<exists>xa[L]. \<exists>xb[L].
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   290
                pair(L,x,a,xa) & xa \<in> r & pair(L,x,b,xb) & xb \<in> r &
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   291
                (\<exists>fx[L]. \<exists>gx[L]. fun_apply(L,f,x,fx) & fun_apply(L,g,x,gx) &
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   292
                                   fx \<noteq> gx))"
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   293
apply (rule gen_separation [OF is_recfun_reflects, of "{r,f,g,a,b}"], simp)
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   294
apply (drule mem_Lset_imp_subset_Lset, clarsimp)
13385
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   295
apply (rule DPow_LsetI)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   296
apply (rule bex_iff_sats conj_iff_sats)+
13566
52a419210d5c Streamlined proofs of instances of Separation
paulson
parents: 13564
diff changeset
   297
apply (rule_tac env = "[xa,x,r,f,g,a,b]" in pair_iff_sats)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   298
apply (rule sep_rules | simp)+
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   299
done
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   300
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   301
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   302
subsection{*Instantiating the locale @{text M_basic}*}
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   303
text{*Separation (and Strong Replacement) for basic set-theoretic constructions
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   304
such as intersection, Cartesian Product and image.*}
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   305
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   306
lemma M_basic_axioms_L: "M_basic_axioms(L)"
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   307
  apply (rule M_basic_axioms.intro)
13437
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
   308
       apply (assumption | rule
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
   309
	 Inter_separation Diff_separation cartprod_separation image_separation
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
   310
	 converse_separation restrict_separation
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
   311
	 comp_separation pred_separation Memrel_separation
13634
99a593b49b04 Re-organization of Constructible theories
paulson
parents: 13628
diff changeset
   312
	 funspace_succ_replacement is_recfun_separation)+
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   313
  done
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   314
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   315
theorem M_basic_L: "PROP M_basic(L)"
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   316
by (rule M_basic.intro [OF M_trivial_L M_basic_axioms_L])
13437
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
   317
01b3fc0cc1b8 separate "axioms" proofs: more flexible for locale reasoning
paulson
parents: 13429
diff changeset
   318
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   319
lemmas cartprod_iff = M_basic.cartprod_iff [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   320
  and cartprod_closed = M_basic.cartprod_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   321
  and sum_closed = M_basic.sum_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   322
  and M_converse_iff = M_basic.M_converse_iff [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   323
  and converse_closed = M_basic.converse_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   324
  and converse_abs = M_basic.converse_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   325
  and image_closed = M_basic.image_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   326
  and vimage_abs = M_basic.vimage_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   327
  and vimage_closed = M_basic.vimage_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   328
  and domain_abs = M_basic.domain_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   329
  and domain_closed = M_basic.domain_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   330
  and range_abs = M_basic.range_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   331
  and range_closed = M_basic.range_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   332
  and field_abs = M_basic.field_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   333
  and field_closed = M_basic.field_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   334
  and relation_abs = M_basic.relation_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   335
  and function_abs = M_basic.function_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   336
  and apply_closed = M_basic.apply_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   337
  and apply_abs = M_basic.apply_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   338
  and typed_function_abs = M_basic.typed_function_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   339
  and injection_abs = M_basic.injection_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   340
  and surjection_abs = M_basic.surjection_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   341
  and bijection_abs = M_basic.bijection_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   342
  and M_comp_iff = M_basic.M_comp_iff [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   343
  and comp_closed = M_basic.comp_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   344
  and composition_abs = M_basic.composition_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   345
  and restriction_is_function = M_basic.restriction_is_function [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   346
  and restriction_abs = M_basic.restriction_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   347
  and M_restrict_iff = M_basic.M_restrict_iff [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   348
  and restrict_closed = M_basic.restrict_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   349
  and Inter_abs = M_basic.Inter_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   350
  and Inter_closed = M_basic.Inter_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   351
  and Int_closed = M_basic.Int_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   352
  and is_funspace_abs = M_basic.is_funspace_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   353
  and succ_fun_eq2 = M_basic.succ_fun_eq2 [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   354
  and funspace_succ = M_basic.funspace_succ [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   355
  and finite_funspace_closed = M_basic.finite_funspace_closed [OF M_basic_L]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   356
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   357
lemmas is_recfun_equal = M_basic.is_recfun_equal [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   358
  and is_recfun_cut = M_basic.is_recfun_cut [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   359
  and is_recfun_functional = M_basic.is_recfun_functional [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   360
  and is_recfun_relativize = M_basic.is_recfun_relativize [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   361
  and is_recfun_restrict = M_basic.is_recfun_restrict [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   362
  and univalent_is_recfun = M_basic.univalent_is_recfun [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   363
  and wellfounded_exists_is_recfun = M_basic.wellfounded_exists_is_recfun [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   364
  and wf_exists_is_recfun = M_basic.wf_exists_is_recfun [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   365
  and is_recfun_abs = M_basic.is_recfun_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   366
  and irreflexive_abs = M_basic.irreflexive_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   367
  and transitive_rel_abs = M_basic.transitive_rel_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   368
  and linear_rel_abs = M_basic.linear_rel_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   369
  and wellordered_is_trans_on = M_basic.wellordered_is_trans_on [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   370
  and wellordered_is_linear = M_basic.wellordered_is_linear [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   371
  and wellordered_is_wellfounded_on = M_basic.wellordered_is_wellfounded_on [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   372
  and wellfounded_imp_wellfounded_on = M_basic.wellfounded_imp_wellfounded_on [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   373
  and wellfounded_on_subset_A = M_basic.wellfounded_on_subset_A [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   374
  and wellfounded_on_iff_wellfounded = M_basic.wellfounded_on_iff_wellfounded [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   375
  and wellfounded_on_imp_wellfounded = M_basic.wellfounded_on_imp_wellfounded [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   376
  and wellfounded_on_field_imp_wellfounded = M_basic.wellfounded_on_field_imp_wellfounded [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   377
  and wellfounded_iff_wellfounded_on_field = M_basic.wellfounded_iff_wellfounded_on_field [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   378
  and wellfounded_induct = M_basic.wellfounded_induct [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   379
  and wellfounded_on_induct = M_basic.wellfounded_on_induct [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   380
  and linear_imp_relativized = M_basic.linear_imp_relativized [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   381
  and trans_on_imp_relativized = M_basic.trans_on_imp_relativized [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   382
  and wf_on_imp_relativized = M_basic.wf_on_imp_relativized [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   383
  and wf_imp_relativized = M_basic.wf_imp_relativized [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   384
  and well_ord_imp_relativized = M_basic.well_ord_imp_relativized [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   385
  and order_isomorphism_abs = M_basic.order_isomorphism_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   386
  and pred_set_abs = M_basic.pred_set_abs [OF M_basic_L]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   387
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   388
lemmas pred_closed = M_basic.pred_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   389
  and membership_abs = M_basic.membership_abs [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   390
  and M_Memrel_iff = M_basic.M_Memrel_iff [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   391
  and Memrel_closed = M_basic.Memrel_closed [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   392
  and wellfounded_on_asym = M_basic.wellfounded_on_asym [OF M_basic_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13505
diff changeset
   393
  and wellordered_asym = M_basic.wellordered_asym [OF M_basic_L]
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13385
diff changeset
   394
13429
wenzelm
parents: 13428
diff changeset
   395
declare cartprod_closed [intro, simp]
wenzelm
parents: 13428
diff changeset
   396
declare sum_closed [intro, simp]
wenzelm
parents: 13428
diff changeset
   397
declare converse_closed [intro, simp]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   398
declare converse_abs [simp]
13429
wenzelm
parents: 13428
diff changeset
   399
declare image_closed [intro, simp]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   400
declare vimage_abs [simp]
13429
wenzelm
parents: 13428
diff changeset
   401
declare vimage_closed [intro, simp]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   402
declare domain_abs [simp]
13429
wenzelm
parents: 13428
diff changeset
   403
declare domain_closed [intro, simp]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   404
declare range_abs [simp]
13429
wenzelm
parents: 13428
diff changeset
   405
declare range_closed [intro, simp]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   406
declare field_abs [simp]
13429
wenzelm
parents: 13428
diff changeset
   407
declare field_closed [intro, simp]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   408
declare relation_abs [simp]
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   409
declare function_abs [simp]
13429
wenzelm
parents: 13428
diff changeset
   410
declare apply_closed [intro, simp]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   411
declare typed_function_abs [simp]
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   412
declare injection_abs [simp]
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   413
declare surjection_abs [simp]
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   414
declare bijection_abs [simp]
13429
wenzelm
parents: 13428
diff changeset
   415
declare comp_closed [intro, simp]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   416
declare composition_abs [simp]
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   417
declare restriction_abs [simp]
13429
wenzelm
parents: 13428
diff changeset
   418
declare restrict_closed [intro, simp]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   419
declare Inter_abs [simp]
13429
wenzelm
parents: 13428
diff changeset
   420
declare Inter_closed [intro, simp]
wenzelm
parents: 13428
diff changeset
   421
declare Int_closed [intro, simp]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   422
declare is_funspace_abs [simp]
13429
wenzelm
parents: 13428
diff changeset
   423
declare finite_funspace_closed [intro, simp]
13440
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13437
diff changeset
   424
declare membership_abs [simp] 
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13437
diff changeset
   425
declare Memrel_closed  [intro,simp]
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13319
diff changeset
   426
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents:
diff changeset
   427
end