src/ZF/Constructible/L_axioms.thy
author wenzelm
Fri, 17 Nov 2006 02:20:03 +0100
changeset 21404 eb85850d3eb7
parent 21233 5a5c8ea5f66a
child 29223 e09c53289830
permissions -rw-r--r--
more robust syntax for definition/abbreviation/notation;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13496
diff changeset
     1
(*  Title:      ZF/Constructible/L_axioms.thy
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13496
diff changeset
     2
    ID:         $Id$
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13496
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13496
diff changeset
     4
*)
13429
wenzelm
parents: 13428
diff changeset
     5
wenzelm
parents: 13428
diff changeset
     6
header {* The ZF Axioms (Except Separation) in L *}
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
     7
16417
9bc16273c2d4 migrated theory headers to new format
haftmann
parents: 15764
diff changeset
     8
theory L_axioms imports Formula Relative Reflection MetaExists begin
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
     9
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
    10
text {* The class L satisfies the premises of locale @{text M_trivial} *}
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    11
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    12
lemma transL: "[| y\<in>x; L(x) |] ==> L(y)"
13429
wenzelm
parents: 13428
diff changeset
    13
apply (insert Transset_Lset)
wenzelm
parents: 13428
diff changeset
    14
apply (simp add: Transset_def L_def, blast)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    15
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    16
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    17
lemma nonempty: "L(0)"
13429
wenzelm
parents: 13428
diff changeset
    18
apply (simp add: L_def)
wenzelm
parents: 13428
diff changeset
    19
apply (blast intro: zero_in_Lset)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    20
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    21
13563
paulson
parents: 13506
diff changeset
    22
theorem upair_ax: "upair_ax(L)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    23
apply (simp add: upair_ax_def upair_def, clarify)
13429
wenzelm
parents: 13428
diff changeset
    24
apply (rule_tac x="{x,y}" in rexI)
wenzelm
parents: 13428
diff changeset
    25
apply (simp_all add: doubleton_in_L)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    26
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    27
13563
paulson
parents: 13506
diff changeset
    28
theorem Union_ax: "Union_ax(L)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    29
apply (simp add: Union_ax_def big_union_def, clarify)
13429
wenzelm
parents: 13428
diff changeset
    30
apply (rule_tac x="Union(x)" in rexI)
wenzelm
parents: 13428
diff changeset
    31
apply (simp_all add: Union_in_L, auto)
wenzelm
parents: 13428
diff changeset
    32
apply (blast intro: transL)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    33
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    34
13563
paulson
parents: 13506
diff changeset
    35
theorem power_ax: "power_ax(L)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    36
apply (simp add: power_ax_def powerset_def Relative.subset_def, clarify)
13429
wenzelm
parents: 13428
diff changeset
    37
apply (rule_tac x="{y \<in> Pow(x). L(y)}" in rexI)
13299
3a932abf97e8 More use of relativized quantifiers
paulson
parents: 13298
diff changeset
    38
apply (simp_all add: LPow_in_L, auto)
13429
wenzelm
parents: 13428
diff changeset
    39
apply (blast intro: transL)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    40
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    41
13563
paulson
parents: 13506
diff changeset
    42
text{*We don't actually need @{term L} to satisfy the foundation axiom.*}
paulson
parents: 13506
diff changeset
    43
theorem foundation_ax: "foundation_ax(L)"
paulson
parents: 13506
diff changeset
    44
apply (simp add: foundation_ax_def)
paulson
parents: 13506
diff changeset
    45
apply (rule rallI) 
paulson
parents: 13506
diff changeset
    46
apply (cut_tac A=x in foundation)
paulson
parents: 13506
diff changeset
    47
apply (blast intro: transL)
paulson
parents: 13506
diff changeset
    48
done
paulson
parents: 13506
diff changeset
    49
13506
acc18a5d2b1a Various tweaks of the presentation
paulson
parents: 13505
diff changeset
    50
subsection{*For L to satisfy Replacement *}
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    51
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    52
(*Can't move these to Formula unless the definition of univalent is moved
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    53
there too!*)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    54
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    55
lemma LReplace_in_Lset:
13429
wenzelm
parents: 13428
diff changeset
    56
     "[|X \<in> Lset(i); univalent(L,X,Q); Ord(i)|]
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    57
      ==> \<exists>j. Ord(j) & Replace(X, %x y. Q(x,y) & L(y)) \<subseteq> Lset(j)"
13429
wenzelm
parents: 13428
diff changeset
    58
apply (rule_tac x="\<Union>y \<in> Replace(X, %x y. Q(x,y) & L(y)). succ(lrank(y))"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    59
       in exI)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    60
apply simp
13429
wenzelm
parents: 13428
diff changeset
    61
apply clarify
wenzelm
parents: 13428
diff changeset
    62
apply (rule_tac a=x in UN_I)
wenzelm
parents: 13428
diff changeset
    63
 apply (simp_all add: Replace_iff univalent_def)
wenzelm
parents: 13428
diff changeset
    64
apply (blast dest: transL L_I)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    65
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    66
13429
wenzelm
parents: 13428
diff changeset
    67
lemma LReplace_in_L:
wenzelm
parents: 13428
diff changeset
    68
     "[|L(X); univalent(L,X,Q)|]
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    69
      ==> \<exists>Y. L(Y) & Replace(X, %x y. Q(x,y) & L(y)) \<subseteq> Y"
13429
wenzelm
parents: 13428
diff changeset
    70
apply (drule L_D, clarify)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    71
apply (drule LReplace_in_Lset, assumption+)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    72
apply (blast intro: L_I Lset_in_Lset_succ)
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    73
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    74
13563
paulson
parents: 13506
diff changeset
    75
theorem replacement: "replacement(L,P)"
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    76
apply (simp add: replacement_def, clarify)
13429
wenzelm
parents: 13428
diff changeset
    77
apply (frule LReplace_in_L, assumption+, clarify)
wenzelm
parents: 13428
diff changeset
    78
apply (rule_tac x=Y in rexI)
wenzelm
parents: 13428
diff changeset
    79
apply (simp_all add: Replace_iff univalent_def, blast)
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    80
done
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
    81
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
    82
subsection{*Instantiating the locale @{text M_trivial}*}
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
    83
text{*No instances of Separation yet.*}
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
    84
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
    85
lemma Lset_mono_le: "mono_le_subset(Lset)"
13429
wenzelm
parents: 13428
diff changeset
    86
by (simp add: mono_le_subset_def le_imp_subset Lset_mono)
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
    87
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
    88
lemma Lset_cont: "cont_Ord(Lset)"
13429
wenzelm
parents: 13428
diff changeset
    89
by (simp add: cont_Ord_def Limit_Lset_eq OUnion_def Limit_is_Ord)
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
    90
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13418
diff changeset
    91
lemmas L_nat = Ord_in_L [OF Ord_nat]
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
    92
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
    93
theorem M_trivial_L: "PROP M_trivial(L)"
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
    94
  apply (rule M_trivial.intro)
13628
87482b5e3f2e Various simplifications of the Constructible theories
paulson
parents: 13566
diff changeset
    95
       apply (erule (1) transL)
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13418
diff changeset
    96
      apply (rule upair_ax)
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13418
diff changeset
    97
     apply (rule Union_ax)
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13418
diff changeset
    98
    apply (rule power_ax)
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13418
diff changeset
    99
   apply (rule replacement)
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13418
diff changeset
   100
  apply (rule L_nat)
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13418
diff changeset
   101
  done
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   102
15696
1da4ce092c0b First release of interpretation commands.
ballarin
parents: 14171
diff changeset
   103
interpretation M_trivial ["L"] by (rule M_trivial_L)
1da4ce092c0b First release of interpretation commands.
ballarin
parents: 14171
diff changeset
   104
15764
250df939a1de deleted obsolete code
paulson
parents: 15696
diff changeset
   105
(* Replaces the following declarations...
13564
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   106
lemmas rall_abs = M_trivial.rall_abs [OF M_trivial_L]
1500a2e48d44 renamed M_triv_axioms to M_trivial and M_axioms to M_basic
paulson
parents: 13563
diff changeset
   107
  and rex_abs = M_trivial.rex_abs [OF M_trivial_L]
15764
250df939a1de deleted obsolete code
paulson
parents: 15696
diff changeset
   108
...
13429
wenzelm
parents: 13428
diff changeset
   109
declare rall_abs [simp]
wenzelm
parents: 13428
diff changeset
   110
declare rex_abs [simp]
15764
250df939a1de deleted obsolete code
paulson
parents: 15696
diff changeset
   111
...and dozens of similar ones.
15696
1da4ce092c0b First release of interpretation commands.
ballarin
parents: 14171
diff changeset
   112
*)
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   113
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   114
subsection{*Instantiation of the locale @{text reflection}*}
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   115
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   116
text{*instances of locale constants*}
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   117
21233
5a5c8ea5f66a tuned specifications;
wenzelm
parents: 16417
diff changeset
   118
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   119
  L_F0 :: "[i=>o,i] => i" where
14171
0cab06e3bbd0 Extended the notion of letter and digit, such that now one may use greek,
skalberg
parents: 13807
diff changeset
   120
    "L_F0(P,y) == \<mu> b. (\<exists>z. L(z) \<and> P(<y,z>)) --> (\<exists>z\<in>Lset(b). P(<y,z>))"
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   121
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   122
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   123
  L_FF :: "[i=>o,i] => i" where
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   124
    "L_FF(P)   == \<lambda>a. \<Union>y\<in>Lset(a). L_F0(P,y)"
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   125
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   126
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   127
  L_ClEx :: "[i=>o,i] => o" where
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   128
    "L_ClEx(P) == \<lambda>a. Limit(a) \<and> normalize(L_FF(P),a) = a"
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   129
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   130
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   131
text{*We must use the meta-existential quantifier; otherwise the reflection
13429
wenzelm
parents: 13428
diff changeset
   132
      terms become enormous!*}
21233
5a5c8ea5f66a tuned specifications;
wenzelm
parents: 16417
diff changeset
   133
definition
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   134
  L_Reflects :: "[i=>o,[i,i]=>o] => prop"  ("(3REFLECTS/ [_,/ _])") where
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   135
    "REFLECTS[P,Q] == (??Cl. Closed_Unbounded(Cl) &
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   136
                           (\<forall>a. Cl(a) --> (\<forall>x \<in> Lset(a). P(x) <-> Q(a,x))))"
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   137
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   138
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   139
theorem Triv_reflection:
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   140
     "REFLECTS[P, \<lambda>a x. P(x)]"
13429
wenzelm
parents: 13428
diff changeset
   141
apply (simp add: L_Reflects_def)
wenzelm
parents: 13428
diff changeset
   142
apply (rule meta_exI)
wenzelm
parents: 13428
diff changeset
   143
apply (rule Closed_Unbounded_Ord)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   144
done
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   145
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   146
theorem Not_reflection:
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   147
     "REFLECTS[P,Q] ==> REFLECTS[\<lambda>x. ~P(x), \<lambda>a x. ~Q(a,x)]"
13429
wenzelm
parents: 13428
diff changeset
   148
apply (unfold L_Reflects_def)
wenzelm
parents: 13428
diff changeset
   149
apply (erule meta_exE)
wenzelm
parents: 13428
diff changeset
   150
apply (rule_tac x=Cl in meta_exI, simp)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   151
done
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   152
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   153
theorem And_reflection:
13429
wenzelm
parents: 13428
diff changeset
   154
     "[| REFLECTS[P,Q]; REFLECTS[P',Q'] |]
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   155
      ==> REFLECTS[\<lambda>x. P(x) \<and> P'(x), \<lambda>a x. Q(a,x) \<and> Q'(a,x)]"
13429
wenzelm
parents: 13428
diff changeset
   156
apply (unfold L_Reflects_def)
wenzelm
parents: 13428
diff changeset
   157
apply (elim meta_exE)
wenzelm
parents: 13428
diff changeset
   158
apply (rule_tac x="\<lambda>a. Cl(a) \<and> Cla(a)" in meta_exI)
wenzelm
parents: 13428
diff changeset
   159
apply (simp add: Closed_Unbounded_Int, blast)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   160
done
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   161
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   162
theorem Or_reflection:
13429
wenzelm
parents: 13428
diff changeset
   163
     "[| REFLECTS[P,Q]; REFLECTS[P',Q'] |]
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   164
      ==> REFLECTS[\<lambda>x. P(x) \<or> P'(x), \<lambda>a x. Q(a,x) \<or> Q'(a,x)]"
13429
wenzelm
parents: 13428
diff changeset
   165
apply (unfold L_Reflects_def)
wenzelm
parents: 13428
diff changeset
   166
apply (elim meta_exE)
wenzelm
parents: 13428
diff changeset
   167
apply (rule_tac x="\<lambda>a. Cl(a) \<and> Cla(a)" in meta_exI)
wenzelm
parents: 13428
diff changeset
   168
apply (simp add: Closed_Unbounded_Int, blast)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   169
done
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   170
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   171
theorem Imp_reflection:
13429
wenzelm
parents: 13428
diff changeset
   172
     "[| REFLECTS[P,Q]; REFLECTS[P',Q'] |]
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   173
      ==> REFLECTS[\<lambda>x. P(x) --> P'(x), \<lambda>a x. Q(a,x) --> Q'(a,x)]"
13429
wenzelm
parents: 13428
diff changeset
   174
apply (unfold L_Reflects_def)
wenzelm
parents: 13428
diff changeset
   175
apply (elim meta_exE)
wenzelm
parents: 13428
diff changeset
   176
apply (rule_tac x="\<lambda>a. Cl(a) \<and> Cla(a)" in meta_exI)
wenzelm
parents: 13428
diff changeset
   177
apply (simp add: Closed_Unbounded_Int, blast)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   178
done
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   179
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   180
theorem Iff_reflection:
13429
wenzelm
parents: 13428
diff changeset
   181
     "[| REFLECTS[P,Q]; REFLECTS[P',Q'] |]
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   182
      ==> REFLECTS[\<lambda>x. P(x) <-> P'(x), \<lambda>a x. Q(a,x) <-> Q'(a,x)]"
13429
wenzelm
parents: 13428
diff changeset
   183
apply (unfold L_Reflects_def)
wenzelm
parents: 13428
diff changeset
   184
apply (elim meta_exE)
wenzelm
parents: 13428
diff changeset
   185
apply (rule_tac x="\<lambda>a. Cl(a) \<and> Cla(a)" in meta_exI)
wenzelm
parents: 13428
diff changeset
   186
apply (simp add: Closed_Unbounded_Int, blast)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   187
done
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   188
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   189
13434
78b93a667c01 better sats rules for higher-order operators
paulson
parents: 13429
diff changeset
   190
lemma reflection_Lset: "reflection(Lset)"
13651
ac80e101306a Cosmetic changes suggested by writing the paper. Deleted some
paulson
parents: 13634
diff changeset
   191
by (blast intro: reflection.intro Lset_mono_le Lset_cont 
ac80e101306a Cosmetic changes suggested by writing the paper. Deleted some
paulson
parents: 13634
diff changeset
   192
                 Formula.Pair_in_LLimit)+
ac80e101306a Cosmetic changes suggested by writing the paper. Deleted some
paulson
parents: 13634
diff changeset
   193
13434
78b93a667c01 better sats rules for higher-order operators
paulson
parents: 13429
diff changeset
   194
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   195
theorem Ex_reflection:
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   196
     "REFLECTS[\<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))]
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   197
      ==> REFLECTS[\<lambda>x. \<exists>z. L(z) \<and> P(x,z), \<lambda>a x. \<exists>z\<in>Lset(a). Q(a,x,z)]"
13429
wenzelm
parents: 13428
diff changeset
   198
apply (unfold L_Reflects_def L_ClEx_def L_FF_def L_F0_def L_def)
wenzelm
parents: 13428
diff changeset
   199
apply (elim meta_exE)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   200
apply (rule meta_exI)
13434
78b93a667c01 better sats rules for higher-order operators
paulson
parents: 13429
diff changeset
   201
apply (erule reflection.Ex_reflection [OF reflection_Lset])
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   202
done
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   203
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   204
theorem All_reflection:
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   205
     "REFLECTS[\<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))]
13429
wenzelm
parents: 13428
diff changeset
   206
      ==> REFLECTS[\<lambda>x. \<forall>z. L(z) --> P(x,z), \<lambda>a x. \<forall>z\<in>Lset(a). Q(a,x,z)]"
wenzelm
parents: 13428
diff changeset
   207
apply (unfold L_Reflects_def L_ClEx_def L_FF_def L_F0_def L_def)
wenzelm
parents: 13428
diff changeset
   208
apply (elim meta_exE)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   209
apply (rule meta_exI)
13434
78b93a667c01 better sats rules for higher-order operators
paulson
parents: 13429
diff changeset
   210
apply (erule reflection.All_reflection [OF reflection_Lset])
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   211
done
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   212
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   213
theorem Rex_reflection:
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   214
     "REFLECTS[ \<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))]
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   215
      ==> REFLECTS[\<lambda>x. \<exists>z[L]. P(x,z), \<lambda>a x. \<exists>z\<in>Lset(a). Q(a,x,z)]"
13429
wenzelm
parents: 13428
diff changeset
   216
apply (unfold rex_def)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   217
apply (intro And_reflection Ex_reflection, assumption)
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   218
done
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   219
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   220
theorem Rall_reflection:
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   221
     "REFLECTS[\<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))]
13429
wenzelm
parents: 13428
diff changeset
   222
      ==> REFLECTS[\<lambda>x. \<forall>z[L]. P(x,z), \<lambda>a x. \<forall>z\<in>Lset(a). Q(a,x,z)]"
wenzelm
parents: 13428
diff changeset
   223
apply (unfold rall_def)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   224
apply (intro Imp_reflection All_reflection, assumption)
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   225
done
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   226
13440
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   227
text{*This version handles an alternative form of the bounded quantifier
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   228
      in the second argument of @{text REFLECTS}.*}
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   229
theorem Rex_reflection':
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   230
     "REFLECTS[\<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))]
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   231
      ==> REFLECTS[\<lambda>x. \<exists>z[L]. P(x,z), \<lambda>a x. \<exists>z[##Lset(a)]. Q(a,x,z)]"
13440
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   232
apply (unfold setclass_def rex_def)
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   233
apply (erule Rex_reflection [unfolded rex_def Bex_def]) 
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   234
done
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   235
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   236
text{*As above.*}
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   237
theorem Rall_reflection':
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   238
     "REFLECTS[\<lambda>x. P(fst(x),snd(x)), \<lambda>a x. Q(a,fst(x),snd(x))]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   239
      ==> REFLECTS[\<lambda>x. \<forall>z[L]. P(x,z), \<lambda>a x. \<forall>z[##Lset(a)]. Q(a,x,z)]"
13440
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   240
apply (unfold setclass_def rall_def)
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   241
apply (erule Rall_reflection [unfolded rall_def Ball_def]) 
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   242
done
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   243
13429
wenzelm
parents: 13428
diff changeset
   244
lemmas FOL_reflections =
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   245
        Triv_reflection Not_reflection And_reflection Or_reflection
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   246
        Imp_reflection Iff_reflection Ex_reflection All_reflection
13440
cdde97e1db1c some progress towards "satisfies"
paulson
parents: 13434
diff changeset
   247
        Rex_reflection Rall_reflection Rex_reflection' Rall_reflection'
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   248
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   249
lemma ReflectsD:
13429
wenzelm
parents: 13428
diff changeset
   250
     "[|REFLECTS[P,Q]; Ord(i)|]
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   251
      ==> \<exists>j. i<j & (\<forall>x \<in> Lset(j). P(x) <-> Q(j,x))"
13429
wenzelm
parents: 13428
diff changeset
   252
apply (unfold L_Reflects_def Closed_Unbounded_def)
wenzelm
parents: 13428
diff changeset
   253
apply (elim meta_exE, clarify)
wenzelm
parents: 13428
diff changeset
   254
apply (blast dest!: UnboundedD)
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   255
done
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   256
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   257
lemma ReflectsE:
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   258
     "[| REFLECTS[P,Q]; Ord(i);
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   259
         !!j. [|i<j;  \<forall>x \<in> Lset(j). P(x) <-> Q(j,x)|] ==> R |]
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   260
      ==> R"
15764
250df939a1de deleted obsolete code
paulson
parents: 15696
diff changeset
   261
by (drule ReflectsD, assumption, blast)
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   262
13428
99e52e78eb65 eliminate open locales and special ML code;
wenzelm
parents: 13418
diff changeset
   263
lemma Collect_mem_eq: "{x\<in>A. x\<in>B} = A \<inter> B"
13291
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   264
by blast
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   265
a73ab154f75c towards proving separation for L
paulson
parents: 13269
diff changeset
   266
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   267
subsection{*Internalized Formulas for some Set-Theoretic Concepts*}
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   268
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   269
subsubsection{*Some numbers to help write de Bruijn indices*}
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   270
21233
5a5c8ea5f66a tuned specifications;
wenzelm
parents: 16417
diff changeset
   271
abbreviation
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   272
  digit3 :: i   ("3") where "3 == succ(2)"
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   273
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   274
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   275
  digit4 :: i   ("4") where "4 == succ(3)"
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   276
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   277
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   278
  digit5 :: i   ("5") where "5 == succ(4)"
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   279
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   280
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   281
  digit6 :: i   ("6") where "6 == succ(5)"
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   282
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   283
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   284
  digit7 :: i   ("7") where "7 == succ(6)"
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   285
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   286
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   287
  digit8 :: i   ("8") where "8 == succ(7)"
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   288
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   289
abbreviation
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   290
  digit9 :: i   ("9") where "9 == succ(8)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   291
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   292
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   293
subsubsection{*The Empty Set, Internalized*}
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   294
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   295
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   296
  empty_fm :: "i=>i" where
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   297
    "empty_fm(x) == Forall(Neg(Member(0,succ(x))))"
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   298
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   299
lemma empty_type [TC]:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   300
     "x \<in> nat ==> empty_fm(x) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   301
by (simp add: empty_fm_def)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   302
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   303
lemma sats_empty_fm [simp]:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   304
   "[| x \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   305
    ==> sats(A, empty_fm(x), env) <-> empty(##A, nth(x,env))"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   306
by (simp add: empty_fm_def empty_def)
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   307
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   308
lemma empty_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   309
      "[| nth(i,env) = x; nth(j,env) = y;
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   310
          i \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   311
       ==> empty(##A, x) <-> sats(A, empty_fm(i), env)"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   312
by simp
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   313
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   314
theorem empty_reflection:
13429
wenzelm
parents: 13428
diff changeset
   315
     "REFLECTS[\<lambda>x. empty(L,f(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   316
               \<lambda>i x. empty(##Lset(i),f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   317
apply (simp only: empty_def)
13429
wenzelm
parents: 13428
diff changeset
   318
apply (intro FOL_reflections)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   319
done
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   320
13385
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   321
text{*Not used.  But maybe useful?*}
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   322
lemma Transset_sats_empty_fm_eq_0:
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   323
   "[| n \<in> nat; env \<in> list(A); Transset(A)|]
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   324
    ==> sats(A, empty_fm(n), env) <-> nth(n,env) = 0"
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   325
apply (simp add: empty_fm_def empty_def Transset_def, auto)
13429
wenzelm
parents: 13428
diff changeset
   326
apply (case_tac "n < length(env)")
wenzelm
parents: 13428
diff changeset
   327
apply (frule nth_type, assumption+, blast)
wenzelm
parents: 13428
diff changeset
   328
apply (simp_all add: not_lt_iff_le nth_eq_0)
13385
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   329
done
31df66ca0780 Expressing Lset and L without using length and arity; simplifies Separation
paulson
parents: 13363
diff changeset
   330
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   331
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   332
subsubsection{*Unordered Pairs, Internalized*}
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   333
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   334
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   335
  upair_fm :: "[i,i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   336
    "upair_fm(x,y,z) ==
wenzelm
parents: 13428
diff changeset
   337
       And(Member(x,z),
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   338
           And(Member(y,z),
13429
wenzelm
parents: 13428
diff changeset
   339
               Forall(Implies(Member(0,succ(z)),
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   340
                              Or(Equal(0,succ(x)), Equal(0,succ(y)))))))"
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   341
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   342
lemma upair_type [TC]:
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   343
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> upair_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   344
by (simp add: upair_fm_def)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   345
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   346
lemma sats_upair_fm [simp]:
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   347
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   348
    ==> sats(A, upair_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   349
            upair(##A, nth(x,env), nth(y,env), nth(z,env))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   350
by (simp add: upair_fm_def upair_def)
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   351
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   352
lemma upair_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   353
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   354
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   355
       ==> upair(##A, x, y, z) <-> sats(A, upair_fm(i,j,k), env)"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   356
by (simp add: sats_upair_fm)
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   357
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   358
text{*Useful? At least it refers to "real" unordered pairs*}
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   359
lemma sats_upair_fm2 [simp]:
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   360
   "[| x \<in> nat; y \<in> nat; z < length(env); env \<in> list(A); Transset(A)|]
13429
wenzelm
parents: 13428
diff changeset
   361
    ==> sats(A, upair_fm(x,y,z), env) <->
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   362
        nth(z,env) = {nth(x,env), nth(y,env)}"
13429
wenzelm
parents: 13428
diff changeset
   363
apply (frule lt_length_in_nat, assumption)
wenzelm
parents: 13428
diff changeset
   364
apply (simp add: upair_fm_def Transset_def, auto)
wenzelm
parents: 13428
diff changeset
   365
apply (blast intro: nth_type)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   366
done
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   367
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   368
theorem upair_reflection:
13429
wenzelm
parents: 13428
diff changeset
   369
     "REFLECTS[\<lambda>x. upair(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   370
               \<lambda>i x. upair(##Lset(i),f(x),g(x),h(x))]"
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   371
apply (simp add: upair_def)
13429
wenzelm
parents: 13428
diff changeset
   372
apply (intro FOL_reflections)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   373
done
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   374
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   375
subsubsection{*Ordered pairs, Internalized*}
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   376
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   377
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   378
  pair_fm :: "[i,i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   379
    "pair_fm(x,y,z) ==
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   380
       Exists(And(upair_fm(succ(x),succ(x),0),
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   381
              Exists(And(upair_fm(succ(succ(x)),succ(succ(y)),0),
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   382
                         upair_fm(1,0,succ(succ(z)))))))"
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   383
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   384
lemma pair_type [TC]:
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   385
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> pair_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   386
by (simp add: pair_fm_def)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   387
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   388
lemma sats_pair_fm [simp]:
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   389
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   390
    ==> sats(A, pair_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   391
        pair(##A, nth(x,env), nth(y,env), nth(z,env))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   392
by (simp add: pair_fm_def pair_def)
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   393
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   394
lemma pair_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   395
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   396
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   397
       ==> pair(##A, x, y, z) <-> sats(A, pair_fm(i,j,k), env)"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   398
by (simp add: sats_pair_fm)
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   399
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   400
theorem pair_reflection:
13429
wenzelm
parents: 13428
diff changeset
   401
     "REFLECTS[\<lambda>x. pair(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   402
               \<lambda>i x. pair(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   403
apply (simp only: pair_def)
13429
wenzelm
parents: 13428
diff changeset
   404
apply (intro FOL_reflections upair_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   405
done
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   406
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   407
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   408
subsubsection{*Binary Unions, Internalized*}
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   409
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   410
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   411
  union_fm :: "[i,i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   412
    "union_fm(x,y,z) ==
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   413
       Forall(Iff(Member(0,succ(z)),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   414
                  Or(Member(0,succ(x)),Member(0,succ(y)))))"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   415
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   416
lemma union_type [TC]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   417
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> union_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   418
by (simp add: union_fm_def)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   419
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   420
lemma sats_union_fm [simp]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   421
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   422
    ==> sats(A, union_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   423
        union(##A, nth(x,env), nth(y,env), nth(z,env))"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   424
by (simp add: union_fm_def union_def)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   425
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   426
lemma union_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   427
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   428
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   429
       ==> union(##A, x, y, z) <-> sats(A, union_fm(i,j,k), env)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   430
by (simp add: sats_union_fm)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   431
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   432
theorem union_reflection:
13429
wenzelm
parents: 13428
diff changeset
   433
     "REFLECTS[\<lambda>x. union(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   434
               \<lambda>i x. union(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   435
apply (simp only: union_def)
13429
wenzelm
parents: 13428
diff changeset
   436
apply (intro FOL_reflections)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   437
done
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   438
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   439
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   440
subsubsection{*Set ``Cons,'' Internalized*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   441
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   442
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   443
  cons_fm :: "[i,i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   444
    "cons_fm(x,y,z) ==
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   445
       Exists(And(upair_fm(succ(x),succ(x),0),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   446
                  union_fm(0,succ(y),succ(z))))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   447
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   448
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   449
lemma cons_type [TC]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   450
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> cons_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   451
by (simp add: cons_fm_def)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   452
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   453
lemma sats_cons_fm [simp]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   454
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   455
    ==> sats(A, cons_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   456
        is_cons(##A, nth(x,env), nth(y,env), nth(z,env))"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   457
by (simp add: cons_fm_def is_cons_def)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   458
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   459
lemma cons_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   460
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   461
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   462
       ==> is_cons(##A, x, y, z) <-> sats(A, cons_fm(i,j,k), env)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   463
by simp
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   464
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   465
theorem cons_reflection:
13429
wenzelm
parents: 13428
diff changeset
   466
     "REFLECTS[\<lambda>x. is_cons(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   467
               \<lambda>i x. is_cons(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   468
apply (simp only: is_cons_def)
13429
wenzelm
parents: 13428
diff changeset
   469
apply (intro FOL_reflections upair_reflection union_reflection)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   470
done
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   471
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   472
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   473
subsubsection{*Successor Function, Internalized*}
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   474
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   475
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   476
  succ_fm :: "[i,i]=>i" where
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   477
    "succ_fm(x,y) == cons_fm(x,x,y)"
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   478
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   479
lemma succ_type [TC]:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   480
     "[| x \<in> nat; y \<in> nat |] ==> succ_fm(x,y) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   481
by (simp add: succ_fm_def)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   482
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   483
lemma sats_succ_fm [simp]:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   484
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   485
    ==> sats(A, succ_fm(x,y), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   486
        successor(##A, nth(x,env), nth(y,env))"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   487
by (simp add: succ_fm_def successor_def)
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   488
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   489
lemma successor_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   490
      "[| nth(i,env) = x; nth(j,env) = y;
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   491
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   492
       ==> successor(##A, x, y) <-> sats(A, succ_fm(i,j), env)"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   493
by simp
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   494
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   495
theorem successor_reflection:
13429
wenzelm
parents: 13428
diff changeset
   496
     "REFLECTS[\<lambda>x. successor(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   497
               \<lambda>i x. successor(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   498
apply (simp only: successor_def)
13429
wenzelm
parents: 13428
diff changeset
   499
apply (intro cons_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   500
done
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   501
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   502
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   503
subsubsection{*The Number 1, Internalized*}
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   504
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   505
(* "number1(M,a) == (\<exists>x[M]. empty(M,x) & successor(M,x,a))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   506
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   507
  number1_fm :: "i=>i" where
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   508
    "number1_fm(a) == Exists(And(empty_fm(0), succ_fm(0,succ(a))))"
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   509
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   510
lemma number1_type [TC]:
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   511
     "x \<in> nat ==> number1_fm(x) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   512
by (simp add: number1_fm_def)
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   513
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   514
lemma sats_number1_fm [simp]:
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   515
   "[| x \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   516
    ==> sats(A, number1_fm(x), env) <-> number1(##A, nth(x,env))"
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   517
by (simp add: number1_fm_def number1_def)
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   518
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   519
lemma number1_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   520
      "[| nth(i,env) = x; nth(j,env) = y;
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   521
          i \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   522
       ==> number1(##A, x) <-> sats(A, number1_fm(i), env)"
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   523
by simp
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   524
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   525
theorem number1_reflection:
13429
wenzelm
parents: 13428
diff changeset
   526
     "REFLECTS[\<lambda>x. number1(L,f(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   527
               \<lambda>i x. number1(##Lset(i),f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   528
apply (simp only: number1_def)
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   529
apply (intro FOL_reflections empty_reflection successor_reflection)
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   530
done
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   531
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
   532
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   533
subsubsection{*Big Union, Internalized*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   534
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   535
(*  "big_union(M,A,z) == \<forall>x[M]. x \<in> z <-> (\<exists>y[M]. y\<in>A & x \<in> y)" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   536
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   537
  big_union_fm :: "[i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   538
    "big_union_fm(A,z) ==
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   539
       Forall(Iff(Member(0,succ(z)),
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   540
                  Exists(And(Member(0,succ(succ(A))), Member(1,0)))))"
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   541
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   542
lemma big_union_type [TC]:
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   543
     "[| x \<in> nat; y \<in> nat |] ==> big_union_fm(x,y) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   544
by (simp add: big_union_fm_def)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   545
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   546
lemma sats_big_union_fm [simp]:
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   547
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   548
    ==> sats(A, big_union_fm(x,y), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   549
        big_union(##A, nth(x,env), nth(y,env))"
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   550
by (simp add: big_union_fm_def big_union_def)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   551
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   552
lemma big_union_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   553
      "[| nth(i,env) = x; nth(j,env) = y;
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   554
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   555
       ==> big_union(##A, x, y) <-> sats(A, big_union_fm(i,j), env)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   556
by simp
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   557
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   558
theorem big_union_reflection:
13429
wenzelm
parents: 13428
diff changeset
   559
     "REFLECTS[\<lambda>x. big_union(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   560
               \<lambda>i x. big_union(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   561
apply (simp only: big_union_def)
13429
wenzelm
parents: 13428
diff changeset
   562
apply (intro FOL_reflections)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   563
done
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   564
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   565
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   566
subsubsection{*Variants of Satisfaction Definitions for Ordinals, etc.*}
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   567
13651
ac80e101306a Cosmetic changes suggested by writing the paper. Deleted some
paulson
parents: 13634
diff changeset
   568
text{*The @{text sats} theorems below are standard versions of the ones proved
ac80e101306a Cosmetic changes suggested by writing the paper. Deleted some
paulson
parents: 13634
diff changeset
   569
in theory @{text Formula}.  They relate elements of type @{term formula} to
ac80e101306a Cosmetic changes suggested by writing the paper. Deleted some
paulson
parents: 13634
diff changeset
   570
relativized concepts such as @{term subset} or @{term ordinal} rather than to
ac80e101306a Cosmetic changes suggested by writing the paper. Deleted some
paulson
parents: 13634
diff changeset
   571
real concepts such as @{term Ord}.  Now that we have instantiated the locale
ac80e101306a Cosmetic changes suggested by writing the paper. Deleted some
paulson
parents: 13634
diff changeset
   572
@{text M_trivial}, we no longer require the earlier versions.*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   573
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   574
lemma sats_subset_fm':
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   575
   "[|x \<in> nat; y \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   576
    ==> sats(A, subset_fm(x,y), env) <-> subset(##A, nth(x,env), nth(y,env))"
13429
wenzelm
parents: 13428
diff changeset
   577
by (simp add: subset_fm_def Relative.subset_def)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   578
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   579
theorem subset_reflection:
13429
wenzelm
parents: 13428
diff changeset
   580
     "REFLECTS[\<lambda>x. subset(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   581
               \<lambda>i x. subset(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   582
apply (simp only: Relative.subset_def)
13429
wenzelm
parents: 13428
diff changeset
   583
apply (intro FOL_reflections)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   584
done
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   585
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   586
lemma sats_transset_fm':
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   587
   "[|x \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   588
    ==> sats(A, transset_fm(x), env) <-> transitive_set(##A, nth(x,env))"
13429
wenzelm
parents: 13428
diff changeset
   589
by (simp add: sats_subset_fm' transset_fm_def transitive_set_def)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   590
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   591
theorem transitive_set_reflection:
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   592
     "REFLECTS[\<lambda>x. transitive_set(L,f(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   593
               \<lambda>i x. transitive_set(##Lset(i),f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   594
apply (simp only: transitive_set_def)
13429
wenzelm
parents: 13428
diff changeset
   595
apply (intro FOL_reflections subset_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   596
done
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   597
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   598
lemma sats_ordinal_fm':
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   599
   "[|x \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   600
    ==> sats(A, ordinal_fm(x), env) <-> ordinal(##A,nth(x,env))"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   601
by (simp add: sats_transset_fm' ordinal_fm_def ordinal_def)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   602
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   603
lemma ordinal_iff_sats:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   604
      "[| nth(i,env) = x;  i \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   605
       ==> ordinal(##A, x) <-> sats(A, ordinal_fm(i), env)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   606
by (simp add: sats_ordinal_fm')
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   607
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   608
theorem ordinal_reflection:
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   609
     "REFLECTS[\<lambda>x. ordinal(L,f(x)), \<lambda>i x. ordinal(##Lset(i),f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   610
apply (simp only: ordinal_def)
13429
wenzelm
parents: 13428
diff changeset
   611
apply (intro FOL_reflections transitive_set_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   612
done
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   613
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   614
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   615
subsubsection{*Membership Relation, Internalized*}
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   616
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   617
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   618
  Memrel_fm :: "[i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   619
    "Memrel_fm(A,r) ==
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   620
       Forall(Iff(Member(0,succ(r)),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   621
                  Exists(And(Member(0,succ(succ(A))),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   622
                             Exists(And(Member(0,succ(succ(succ(A)))),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   623
                                        And(Member(1,0),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   624
                                            pair_fm(1,0,2))))))))"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   625
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   626
lemma Memrel_type [TC]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   627
     "[| x \<in> nat; y \<in> nat |] ==> Memrel_fm(x,y) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   628
by (simp add: Memrel_fm_def)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   629
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   630
lemma sats_Memrel_fm [simp]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   631
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   632
    ==> sats(A, Memrel_fm(x,y), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   633
        membership(##A, nth(x,env), nth(y,env))"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   634
by (simp add: Memrel_fm_def membership_def)
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   635
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   636
lemma Memrel_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   637
      "[| nth(i,env) = x; nth(j,env) = y;
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   638
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   639
       ==> membership(##A, x, y) <-> sats(A, Memrel_fm(i,j), env)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   640
by simp
13304
43ef6c6dd906 more separation instances
paulson
parents: 13299
diff changeset
   641
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   642
theorem membership_reflection:
13429
wenzelm
parents: 13428
diff changeset
   643
     "REFLECTS[\<lambda>x. membership(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   644
               \<lambda>i x. membership(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   645
apply (simp only: membership_def)
13429
wenzelm
parents: 13428
diff changeset
   646
apply (intro FOL_reflections pair_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   647
done
13304
43ef6c6dd906 more separation instances
paulson
parents: 13299
diff changeset
   648
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   649
subsubsection{*Predecessor Set, Internalized*}
13304
43ef6c6dd906 more separation instances
paulson
parents: 13299
diff changeset
   650
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   651
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   652
  pred_set_fm :: "[i,i,i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   653
    "pred_set_fm(A,x,r,B) ==
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   654
       Forall(Iff(Member(0,succ(B)),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   655
                  Exists(And(Member(0,succ(succ(r))),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   656
                             And(Member(1,succ(succ(A))),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   657
                                 pair_fm(1,succ(succ(x)),0))))))"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   658
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   659
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   660
lemma pred_set_type [TC]:
13429
wenzelm
parents: 13428
diff changeset
   661
     "[| A \<in> nat; x \<in> nat; r \<in> nat; B \<in> nat |]
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   662
      ==> pred_set_fm(A,x,r,B) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   663
by (simp add: pred_set_fm_def)
13304
43ef6c6dd906 more separation instances
paulson
parents: 13299
diff changeset
   664
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   665
lemma sats_pred_set_fm [simp]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   666
   "[| U \<in> nat; x \<in> nat; r \<in> nat; B \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   667
    ==> sats(A, pred_set_fm(U,x,r,B), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   668
        pred_set(##A, nth(U,env), nth(x,env), nth(r,env), nth(B,env))"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   669
by (simp add: pred_set_fm_def pred_set_def)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   670
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   671
lemma pred_set_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   672
      "[| nth(i,env) = U; nth(j,env) = x; nth(k,env) = r; nth(l,env) = B;
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   673
          i \<in> nat; j \<in> nat; k \<in> nat; l \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   674
       ==> pred_set(##A,U,x,r,B) <-> sats(A, pred_set_fm(i,j,k,l), env)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   675
by (simp add: sats_pred_set_fm)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   676
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   677
theorem pred_set_reflection:
13429
wenzelm
parents: 13428
diff changeset
   678
     "REFLECTS[\<lambda>x. pred_set(L,f(x),g(x),h(x),b(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   679
               \<lambda>i x. pred_set(##Lset(i),f(x),g(x),h(x),b(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   680
apply (simp only: pred_set_def)
13429
wenzelm
parents: 13428
diff changeset
   681
apply (intro FOL_reflections pair_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   682
done
13304
43ef6c6dd906 more separation instances
paulson
parents: 13299
diff changeset
   683
43ef6c6dd906 more separation instances
paulson
parents: 13299
diff changeset
   684
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   685
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   686
subsubsection{*Domain of a Relation, Internalized*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   687
13429
wenzelm
parents: 13428
diff changeset
   688
(* "is_domain(M,r,z) ==
wenzelm
parents: 13428
diff changeset
   689
        \<forall>x[M]. (x \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>y[M]. pair(M,x,y,w))))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   690
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   691
  domain_fm :: "[i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   692
    "domain_fm(r,z) ==
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   693
       Forall(Iff(Member(0,succ(z)),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   694
                  Exists(And(Member(0,succ(succ(r))),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   695
                             Exists(pair_fm(2,0,1))))))"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   696
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   697
lemma domain_type [TC]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   698
     "[| x \<in> nat; y \<in> nat |] ==> domain_fm(x,y) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   699
by (simp add: domain_fm_def)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   700
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   701
lemma sats_domain_fm [simp]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   702
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   703
    ==> sats(A, domain_fm(x,y), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   704
        is_domain(##A, nth(x,env), nth(y,env))"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   705
by (simp add: domain_fm_def is_domain_def)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   706
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   707
lemma domain_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   708
      "[| nth(i,env) = x; nth(j,env) = y;
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   709
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   710
       ==> is_domain(##A, x, y) <-> sats(A, domain_fm(i,j), env)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   711
by simp
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   712
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   713
theorem domain_reflection:
13429
wenzelm
parents: 13428
diff changeset
   714
     "REFLECTS[\<lambda>x. is_domain(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   715
               \<lambda>i x. is_domain(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   716
apply (simp only: is_domain_def)
13429
wenzelm
parents: 13428
diff changeset
   717
apply (intro FOL_reflections pair_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   718
done
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   719
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   720
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   721
subsubsection{*Range of a Relation, Internalized*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   722
13429
wenzelm
parents: 13428
diff changeset
   723
(* "is_range(M,r,z) ==
wenzelm
parents: 13428
diff changeset
   724
        \<forall>y[M]. (y \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>x[M]. pair(M,x,y,w))))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   725
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   726
  range_fm :: "[i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   727
    "range_fm(r,z) ==
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   728
       Forall(Iff(Member(0,succ(z)),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   729
                  Exists(And(Member(0,succ(succ(r))),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   730
                             Exists(pair_fm(0,2,1))))))"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   731
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   732
lemma range_type [TC]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   733
     "[| x \<in> nat; y \<in> nat |] ==> range_fm(x,y) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   734
by (simp add: range_fm_def)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   735
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   736
lemma sats_range_fm [simp]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   737
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   738
    ==> sats(A, range_fm(x,y), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   739
        is_range(##A, nth(x,env), nth(y,env))"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   740
by (simp add: range_fm_def is_range_def)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   741
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   742
lemma range_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   743
      "[| nth(i,env) = x; nth(j,env) = y;
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   744
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   745
       ==> is_range(##A, x, y) <-> sats(A, range_fm(i,j), env)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   746
by simp
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   747
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   748
theorem range_reflection:
13429
wenzelm
parents: 13428
diff changeset
   749
     "REFLECTS[\<lambda>x. is_range(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   750
               \<lambda>i x. is_range(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   751
apply (simp only: is_range_def)
13429
wenzelm
parents: 13428
diff changeset
   752
apply (intro FOL_reflections pair_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   753
done
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   754
13429
wenzelm
parents: 13428
diff changeset
   755
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   756
subsubsection{*Field of a Relation, Internalized*}
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   757
13429
wenzelm
parents: 13428
diff changeset
   758
(* "is_field(M,r,z) ==
wenzelm
parents: 13428
diff changeset
   759
        \<exists>dr[M]. is_domain(M,r,dr) &
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   760
            (\<exists>rr[M]. is_range(M,r,rr) & union(M,dr,rr,z))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   761
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   762
  field_fm :: "[i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   763
    "field_fm(r,z) ==
wenzelm
parents: 13428
diff changeset
   764
       Exists(And(domain_fm(succ(r),0),
wenzelm
parents: 13428
diff changeset
   765
              Exists(And(range_fm(succ(succ(r)),0),
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   766
                         union_fm(1,0,succ(succ(z)))))))"
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   767
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   768
lemma field_type [TC]:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   769
     "[| x \<in> nat; y \<in> nat |] ==> field_fm(x,y) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   770
by (simp add: field_fm_def)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   771
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   772
lemma sats_field_fm [simp]:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   773
   "[| x \<in> nat; y \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   774
    ==> sats(A, field_fm(x,y), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   775
        is_field(##A, nth(x,env), nth(y,env))"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   776
by (simp add: field_fm_def is_field_def)
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   777
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   778
lemma field_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   779
      "[| nth(i,env) = x; nth(j,env) = y;
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   780
          i \<in> nat; j \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   781
       ==> is_field(##A, x, y) <-> sats(A, field_fm(i,j), env)"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   782
by simp
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   783
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   784
theorem field_reflection:
13429
wenzelm
parents: 13428
diff changeset
   785
     "REFLECTS[\<lambda>x. is_field(L,f(x),g(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   786
               \<lambda>i x. is_field(##Lset(i),f(x),g(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   787
apply (simp only: is_field_def)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   788
apply (intro FOL_reflections domain_reflection range_reflection
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   789
             union_reflection)
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   790
done
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   791
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   792
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   793
subsubsection{*Image under a Relation, Internalized*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   794
13429
wenzelm
parents: 13428
diff changeset
   795
(* "image(M,r,A,z) ==
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   796
        \<forall>y[M]. (y \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>x[M]. x\<in>A & pair(M,x,y,w))))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   797
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   798
  image_fm :: "[i,i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   799
    "image_fm(r,A,z) ==
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   800
       Forall(Iff(Member(0,succ(z)),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   801
                  Exists(And(Member(0,succ(succ(r))),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   802
                             Exists(And(Member(0,succ(succ(succ(A)))),
13429
wenzelm
parents: 13428
diff changeset
   803
                                        pair_fm(0,2,1)))))))"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   804
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   805
lemma image_type [TC]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   806
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> image_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   807
by (simp add: image_fm_def)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   808
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   809
lemma sats_image_fm [simp]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   810
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   811
    ==> sats(A, image_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   812
        image(##A, nth(x,env), nth(y,env), nth(z,env))"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
   813
by (simp add: image_fm_def Relative.image_def)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   814
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   815
lemma image_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   816
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   817
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   818
       ==> image(##A, x, y, z) <-> sats(A, image_fm(i,j,k), env)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   819
by (simp add: sats_image_fm)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   820
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   821
theorem image_reflection:
13429
wenzelm
parents: 13428
diff changeset
   822
     "REFLECTS[\<lambda>x. image(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   823
               \<lambda>i x. image(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   824
apply (simp only: Relative.image_def)
13429
wenzelm
parents: 13428
diff changeset
   825
apply (intro FOL_reflections pair_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   826
done
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   827
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   828
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   829
subsubsection{*Pre-Image under a Relation, Internalized*}
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   830
13429
wenzelm
parents: 13428
diff changeset
   831
(* "pre_image(M,r,A,z) ==
wenzelm
parents: 13428
diff changeset
   832
        \<forall>x[M]. x \<in> z <-> (\<exists>w[M]. w\<in>r & (\<exists>y[M]. y\<in>A & pair(M,x,y,w)))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   833
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   834
  pre_image_fm :: "[i,i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   835
    "pre_image_fm(r,A,z) ==
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   836
       Forall(Iff(Member(0,succ(z)),
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   837
                  Exists(And(Member(0,succ(succ(r))),
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   838
                             Exists(And(Member(0,succ(succ(succ(A)))),
13429
wenzelm
parents: 13428
diff changeset
   839
                                        pair_fm(2,0,1)))))))"
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   840
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   841
lemma pre_image_type [TC]:
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   842
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> pre_image_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   843
by (simp add: pre_image_fm_def)
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   844
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   845
lemma sats_pre_image_fm [simp]:
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   846
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   847
    ==> sats(A, pre_image_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   848
        pre_image(##A, nth(x,env), nth(y,env), nth(z,env))"
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   849
by (simp add: pre_image_fm_def Relative.pre_image_def)
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   850
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   851
lemma pre_image_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   852
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   853
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   854
       ==> pre_image(##A, x, y, z) <-> sats(A, pre_image_fm(i,j,k), env)"
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   855
by (simp add: sats_pre_image_fm)
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   856
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   857
theorem pre_image_reflection:
13429
wenzelm
parents: 13428
diff changeset
   858
     "REFLECTS[\<lambda>x. pre_image(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   859
               \<lambda>i x. pre_image(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   860
apply (simp only: Relative.pre_image_def)
13429
wenzelm
parents: 13428
diff changeset
   861
apply (intro FOL_reflections pair_reflection)
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   862
done
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   863
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
   864
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   865
subsubsection{*Function Application, Internalized*}
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   866
13429
wenzelm
parents: 13428
diff changeset
   867
(* "fun_apply(M,f,x,y) ==
wenzelm
parents: 13428
diff changeset
   868
        (\<exists>xs[M]. \<exists>fxs[M].
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   869
         upair(M,x,x,xs) & image(M,f,xs,fxs) & big_union(M,fxs,y))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   870
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   871
  fun_apply_fm :: "[i,i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   872
    "fun_apply_fm(f,x,y) ==
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   873
       Exists(Exists(And(upair_fm(succ(succ(x)), succ(succ(x)), 1),
13429
wenzelm
parents: 13428
diff changeset
   874
                         And(image_fm(succ(succ(f)), 1, 0),
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   875
                             big_union_fm(0,succ(succ(y)))))))"
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   876
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   877
lemma fun_apply_type [TC]:
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   878
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> fun_apply_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   879
by (simp add: fun_apply_fm_def)
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   880
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   881
lemma sats_fun_apply_fm [simp]:
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   882
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   883
    ==> sats(A, fun_apply_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   884
        fun_apply(##A, nth(x,env), nth(y,env), nth(z,env))"
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   885
by (simp add: fun_apply_fm_def fun_apply_def)
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   886
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   887
lemma fun_apply_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   888
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   889
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   890
       ==> fun_apply(##A, x, y, z) <-> sats(A, fun_apply_fm(i,j,k), env)"
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   891
by simp
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   892
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   893
theorem fun_apply_reflection:
13429
wenzelm
parents: 13428
diff changeset
   894
     "REFLECTS[\<lambda>x. fun_apply(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   895
               \<lambda>i x. fun_apply(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   896
apply (simp only: fun_apply_def)
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   897
apply (intro FOL_reflections upair_reflection image_reflection
13429
wenzelm
parents: 13428
diff changeset
   898
             big_union_reflection)
13352
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   899
done
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   900
3cd767f8d78b new definitions of fun_apply and M_is_recfun
paulson
parents: 13348
diff changeset
   901
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   902
subsubsection{*The Concept of Relation, Internalized*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   903
13429
wenzelm
parents: 13428
diff changeset
   904
(* "is_relation(M,r) ==
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   905
        (\<forall>z[M]. z\<in>r --> (\<exists>x[M]. \<exists>y[M]. pair(M,x,y,z)))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   906
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   907
  relation_fm :: "i=>i" where
13429
wenzelm
parents: 13428
diff changeset
   908
    "relation_fm(r) ==
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   909
       Forall(Implies(Member(0,succ(r)), Exists(Exists(pair_fm(1,0,2)))))"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   910
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   911
lemma relation_type [TC]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   912
     "[| x \<in> nat |] ==> relation_fm(x) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   913
by (simp add: relation_fm_def)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   914
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   915
lemma sats_relation_fm [simp]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   916
   "[| x \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   917
    ==> sats(A, relation_fm(x), env) <-> is_relation(##A, nth(x,env))"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   918
by (simp add: relation_fm_def is_relation_def)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   919
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   920
lemma relation_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   921
      "[| nth(i,env) = x; nth(j,env) = y;
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   922
          i \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   923
       ==> is_relation(##A, x) <-> sats(A, relation_fm(i), env)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   924
by simp
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   925
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   926
theorem is_relation_reflection:
13429
wenzelm
parents: 13428
diff changeset
   927
     "REFLECTS[\<lambda>x. is_relation(L,f(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   928
               \<lambda>i x. is_relation(##Lset(i),f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   929
apply (simp only: is_relation_def)
13429
wenzelm
parents: 13428
diff changeset
   930
apply (intro FOL_reflections pair_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   931
done
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   932
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   933
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   934
subsubsection{*The Concept of Function, Internalized*}
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   935
13429
wenzelm
parents: 13428
diff changeset
   936
(* "is_function(M,r) ==
wenzelm
parents: 13428
diff changeset
   937
        \<forall>x[M]. \<forall>y[M]. \<forall>y'[M]. \<forall>p[M]. \<forall>p'[M].
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   938
           pair(M,x,y,p) --> pair(M,x,y',p') --> p\<in>r --> p'\<in>r --> y=y'" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   939
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   940
  function_fm :: "i=>i" where
13429
wenzelm
parents: 13428
diff changeset
   941
    "function_fm(r) ==
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   942
       Forall(Forall(Forall(Forall(Forall(
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   943
         Implies(pair_fm(4,3,1),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   944
                 Implies(pair_fm(4,2,0),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   945
                         Implies(Member(1,r#+5),
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   946
                                 Implies(Member(0,r#+5), Equal(3,2))))))))))"
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   947
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   948
lemma function_type [TC]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   949
     "[| x \<in> nat |] ==> function_fm(x) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   950
by (simp add: function_fm_def)
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   951
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   952
lemma sats_function_fm [simp]:
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   953
   "[| x \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   954
    ==> sats(A, function_fm(x), env) <-> is_function(##A, nth(x,env))"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   955
by (simp add: function_fm_def is_function_def)
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   956
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13496
diff changeset
   957
lemma is_function_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   958
      "[| nth(i,env) = x; nth(j,env) = y;
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   959
          i \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   960
       ==> is_function(##A, x) <-> sats(A, function_fm(i), env)"
13306
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   961
by simp
6eebcddee32b more internalized formulas and separation proofs
paulson
parents: 13304
diff changeset
   962
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   963
theorem is_function_reflection:
13429
wenzelm
parents: 13428
diff changeset
   964
     "REFLECTS[\<lambda>x. is_function(L,f(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   965
               \<lambda>i x. is_function(##Lset(i),f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
   966
apply (simp only: is_function_def)
13429
wenzelm
parents: 13428
diff changeset
   967
apply (intro FOL_reflections pair_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
   968
done
13298
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   969
b4f370679c65 Constructible: some separation axioms
paulson
parents: 13291
diff changeset
   970
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
   971
subsubsection{*Typed Functions, Internalized*}
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   972
13429
wenzelm
parents: 13428
diff changeset
   973
(* "typed_function(M,A,B,r) ==
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   974
        is_function(M,r) & is_relation(M,r) & is_domain(M,r,A) &
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   975
        (\<forall>u[M]. u\<in>r --> (\<forall>x[M]. \<forall>y[M]. pair(M,x,y,u) --> y\<in>B))" *)
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   976
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   977
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
   978
  typed_function_fm :: "[i,i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
   979
    "typed_function_fm(A,B,r) ==
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   980
       And(function_fm(r),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   981
         And(relation_fm(r),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   982
           And(domain_fm(r,A),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   983
             Forall(Implies(Member(0,succ(r)),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   984
                  Forall(Forall(Implies(pair_fm(1,0,2),Member(0,B#+3)))))))))"
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   985
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   986
lemma typed_function_type [TC]:
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   987
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> typed_function_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
   988
by (simp add: typed_function_fm_def)
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   989
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   990
lemma sats_typed_function_fm [simp]:
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   991
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
   992
    ==> sats(A, typed_function_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   993
        typed_function(##A, nth(x,env), nth(y,env), nth(z,env))"
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   994
by (simp add: typed_function_fm_def typed_function_def)
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   995
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   996
lemma typed_function_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
   997
  "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
   998
      i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
   999
   ==> typed_function(##A, x, y, z) <-> sats(A, typed_function_fm(i,j,k), env)"
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1000
by simp
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1001
13429
wenzelm
parents: 13428
diff changeset
  1002
lemmas function_reflections =
13363
c26eeb000470 instantiation of locales M_trancl and M_wfrank;
paulson
parents: 13352
diff changeset
  1003
        empty_reflection number1_reflection
13429
wenzelm
parents: 13428
diff changeset
  1004
        upair_reflection pair_reflection union_reflection
wenzelm
parents: 13428
diff changeset
  1005
        big_union_reflection cons_reflection successor_reflection
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1006
        fun_apply_reflection subset_reflection
13429
wenzelm
parents: 13428
diff changeset
  1007
        transitive_set_reflection membership_reflection
wenzelm
parents: 13428
diff changeset
  1008
        pred_set_reflection domain_reflection range_reflection field_reflection
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1009
        image_reflection pre_image_reflection
13429
wenzelm
parents: 13428
diff changeset
  1010
        is_relation_reflection is_function_reflection
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1011
13429
wenzelm
parents: 13428
diff changeset
  1012
lemmas function_iff_sats =
wenzelm
parents: 13428
diff changeset
  1013
        empty_iff_sats number1_iff_sats
wenzelm
parents: 13428
diff changeset
  1014
        upair_iff_sats pair_iff_sats union_iff_sats
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13496
diff changeset
  1015
        big_union_iff_sats cons_iff_sats successor_iff_sats
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1016
        fun_apply_iff_sats  Memrel_iff_sats
13429
wenzelm
parents: 13428
diff changeset
  1017
        pred_set_iff_sats domain_iff_sats range_iff_sats field_iff_sats
wenzelm
parents: 13428
diff changeset
  1018
        image_iff_sats pre_image_iff_sats
13505
52a16cb7fefb Relativized right up to L satisfies V=L!
paulson
parents: 13496
diff changeset
  1019
        relation_iff_sats is_function_iff_sats
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1020
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1021
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
  1022
theorem typed_function_reflection:
13429
wenzelm
parents: 13428
diff changeset
  1023
     "REFLECTS[\<lambda>x. typed_function(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1024
               \<lambda>i x. typed_function(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1025
apply (simp only: typed_function_def)
13429
wenzelm
parents: 13428
diff changeset
  1026
apply (intro FOL_reflections function_reflections)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1027
done
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1028
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1029
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
  1030
subsubsection{*Composition of Relations, Internalized*}
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1031
13429
wenzelm
parents: 13428
diff changeset
  1032
(* "composition(M,r,s,t) ==
wenzelm
parents: 13428
diff changeset
  1033
        \<forall>p[M]. p \<in> t <->
wenzelm
parents: 13428
diff changeset
  1034
               (\<exists>x[M]. \<exists>y[M]. \<exists>z[M]. \<exists>xy[M]. \<exists>yz[M].
wenzelm
parents: 13428
diff changeset
  1035
                pair(M,x,z,p) & pair(M,x,y,xy) & pair(M,y,z,yz) &
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1036
                xy \<in> s & yz \<in> r)" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1037
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1038
  composition_fm :: "[i,i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
  1039
  "composition_fm(r,s,t) ==
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1040
     Forall(Iff(Member(0,succ(t)),
13429
wenzelm
parents: 13428
diff changeset
  1041
             Exists(Exists(Exists(Exists(Exists(
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1042
              And(pair_fm(4,2,5),
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1043
               And(pair_fm(4,3,1),
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1044
                And(pair_fm(3,2,0),
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1045
                 And(Member(1,s#+6), Member(0,r#+6))))))))))))"
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1046
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1047
lemma composition_type [TC]:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1048
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> composition_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
  1049
by (simp add: composition_fm_def)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1050
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1051
lemma sats_composition_fm [simp]:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1052
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
  1053
    ==> sats(A, composition_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1054
        composition(##A, nth(x,env), nth(y,env), nth(z,env))"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1055
by (simp add: composition_fm_def composition_def)
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1056
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1057
lemma composition_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
  1058
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1059
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1060
       ==> composition(##A, x, y, z) <-> sats(A, composition_fm(i,j,k), env)"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1061
by simp
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1062
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1063
theorem composition_reflection:
13429
wenzelm
parents: 13428
diff changeset
  1064
     "REFLECTS[\<lambda>x. composition(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1065
               \<lambda>i x. composition(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1066
apply (simp only: composition_def)
13429
wenzelm
parents: 13428
diff changeset
  1067
apply (intro FOL_reflections pair_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
  1068
done
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
  1069
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1070
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
  1071
subsubsection{*Injections, Internalized*}
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1072
13429
wenzelm
parents: 13428
diff changeset
  1073
(* "injection(M,A,B,f) ==
wenzelm
parents: 13428
diff changeset
  1074
        typed_function(M,A,B,f) &
wenzelm
parents: 13428
diff changeset
  1075
        (\<forall>x[M]. \<forall>x'[M]. \<forall>y[M]. \<forall>p[M]. \<forall>p'[M].
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1076
          pair(M,x,y,p) --> pair(M,x',y,p') --> p\<in>f --> p'\<in>f --> x=x')" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1077
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1078
  injection_fm :: "[i,i,i]=>i" where
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1079
  "injection_fm(A,B,f) ==
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1080
    And(typed_function_fm(A,B,f),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1081
       Forall(Forall(Forall(Forall(Forall(
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1082
         Implies(pair_fm(4,2,1),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1083
                 Implies(pair_fm(3,2,0),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1084
                         Implies(Member(1,f#+5),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1085
                                 Implies(Member(0,f#+5), Equal(4,3)))))))))))"
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1086
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1087
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1088
lemma injection_type [TC]:
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1089
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> injection_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
  1090
by (simp add: injection_fm_def)
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1091
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1092
lemma sats_injection_fm [simp]:
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1093
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
  1094
    ==> sats(A, injection_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1095
        injection(##A, nth(x,env), nth(y,env), nth(z,env))"
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1096
by (simp add: injection_fm_def injection_def)
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1097
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1098
lemma injection_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
  1099
  "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1100
      i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1101
   ==> injection(##A, x, y, z) <-> sats(A, injection_fm(i,j,k), env)"
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1102
by simp
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1103
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
  1104
theorem injection_reflection:
13429
wenzelm
parents: 13428
diff changeset
  1105
     "REFLECTS[\<lambda>x. injection(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1106
               \<lambda>i x. injection(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1107
apply (simp only: injection_def)
13429
wenzelm
parents: 13428
diff changeset
  1108
apply (intro FOL_reflections function_reflections typed_function_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
  1109
done
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1110
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1111
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
  1112
subsubsection{*Surjections, Internalized*}
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1113
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1114
(*  surjection :: "[i=>o,i,i,i] => o"
13429
wenzelm
parents: 13428
diff changeset
  1115
    "surjection(M,A,B,f) ==
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1116
        typed_function(M,A,B,f) &
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1117
        (\<forall>y[M]. y\<in>B --> (\<exists>x[M]. x\<in>A & fun_apply(M,f,x,y)))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1118
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1119
  surjection_fm :: "[i,i,i]=>i" where
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1120
  "surjection_fm(A,B,f) ==
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1121
    And(typed_function_fm(A,B,f),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1122
       Forall(Implies(Member(0,succ(B)),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1123
                      Exists(And(Member(0,succ(succ(A))),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1124
                                 fun_apply_fm(succ(succ(f)),0,1))))))"
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1125
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1126
lemma surjection_type [TC]:
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1127
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> surjection_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
  1128
by (simp add: surjection_fm_def)
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1129
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1130
lemma sats_surjection_fm [simp]:
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1131
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
  1132
    ==> sats(A, surjection_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1133
        surjection(##A, nth(x,env), nth(y,env), nth(z,env))"
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1134
by (simp add: surjection_fm_def surjection_def)
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1135
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1136
lemma surjection_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
  1137
  "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1138
      i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1139
   ==> surjection(##A, x, y, z) <-> sats(A, surjection_fm(i,j,k), env)"
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1140
by simp
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1141
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
  1142
theorem surjection_reflection:
13429
wenzelm
parents: 13428
diff changeset
  1143
     "REFLECTS[\<lambda>x. surjection(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1144
               \<lambda>i x. surjection(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1145
apply (simp only: surjection_def)
13429
wenzelm
parents: 13428
diff changeset
  1146
apply (intro FOL_reflections function_reflections typed_function_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
  1147
done
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1148
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1149
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1150
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
  1151
subsubsection{*Bijections, Internalized*}
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1152
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1153
(*   bijection :: "[i=>o,i,i,i] => o"
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1154
    "bijection(M,A,B,f) == injection(M,A,B,f) & surjection(M,A,B,f)" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1155
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1156
  bijection_fm :: "[i,i,i]=>i" where
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1157
  "bijection_fm(A,B,f) == And(injection_fm(A,B,f), surjection_fm(A,B,f))"
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1158
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1159
lemma bijection_type [TC]:
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1160
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> bijection_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
  1161
by (simp add: bijection_fm_def)
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1162
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1163
lemma sats_bijection_fm [simp]:
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1164
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
  1165
    ==> sats(A, bijection_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1166
        bijection(##A, nth(x,env), nth(y,env), nth(z,env))"
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1167
by (simp add: bijection_fm_def bijection_def)
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1168
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1169
lemma bijection_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
  1170
  "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1171
      i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1172
   ==> bijection(##A, x, y, z) <-> sats(A, bijection_fm(i,j,k), env)"
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1173
by simp
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1174
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
  1175
theorem bijection_reflection:
13429
wenzelm
parents: 13428
diff changeset
  1176
     "REFLECTS[\<lambda>x. bijection(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1177
               \<lambda>i x. bijection(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1178
apply (simp only: bijection_def)
13429
wenzelm
parents: 13428
diff changeset
  1179
apply (intro And_reflection injection_reflection surjection_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
  1180
done
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1181
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1182
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1183
subsubsection{*Restriction of a Relation, Internalized*}
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1184
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1185
13429
wenzelm
parents: 13428
diff changeset
  1186
(* "restriction(M,r,A,z) ==
wenzelm
parents: 13428
diff changeset
  1187
        \<forall>x[M]. x \<in> z <-> (x \<in> r & (\<exists>u[M]. u\<in>A & (\<exists>v[M]. pair(M,u,v,x))))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1188
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1189
  restriction_fm :: "[i,i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
  1190
    "restriction_fm(r,A,z) ==
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1191
       Forall(Iff(Member(0,succ(z)),
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1192
                  And(Member(0,succ(r)),
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1193
                      Exists(And(Member(0,succ(succ(A))),
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1194
                                 Exists(pair_fm(1,0,2)))))))"
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1195
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1196
lemma restriction_type [TC]:
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1197
     "[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> restriction_fm(x,y,z) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
  1198
by (simp add: restriction_fm_def)
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1199
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1200
lemma sats_restriction_fm [simp]:
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1201
   "[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
  1202
    ==> sats(A, restriction_fm(x,y,z), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1203
        restriction(##A, nth(x,env), nth(y,env), nth(z,env))"
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1204
by (simp add: restriction_fm_def restriction_def)
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1205
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1206
lemma restriction_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
  1207
      "[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z;
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1208
          i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1209
       ==> restriction(##A, x, y, z) <-> sats(A, restriction_fm(i,j,k), env)"
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1210
by simp
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1211
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1212
theorem restriction_reflection:
13429
wenzelm
parents: 13428
diff changeset
  1213
     "REFLECTS[\<lambda>x. restriction(L,f(x),g(x),h(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1214
               \<lambda>i x. restriction(##Lset(i),f(x),g(x),h(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1215
apply (simp only: restriction_def)
13429
wenzelm
parents: 13428
diff changeset
  1216
apply (intro FOL_reflections pair_reflection)
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1217
done
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1218
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
  1219
subsubsection{*Order-Isomorphisms, Internalized*}
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1220
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1221
(*  order_isomorphism :: "[i=>o,i,i,i,i,i] => o"
13429
wenzelm
parents: 13428
diff changeset
  1222
   "order_isomorphism(M,A,r,B,s,f) ==
wenzelm
parents: 13428
diff changeset
  1223
        bijection(M,A,B,f) &
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1224
        (\<forall>x[M]. x\<in>A --> (\<forall>y[M]. y\<in>A -->
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1225
          (\<forall>p[M]. \<forall>fx[M]. \<forall>fy[M]. \<forall>q[M].
13429
wenzelm
parents: 13428
diff changeset
  1226
            pair(M,x,y,p) --> fun_apply(M,f,x,fx) --> fun_apply(M,f,y,fy) -->
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1227
            pair(M,fx,fy,q) --> (p\<in>r <-> q\<in>s))))"
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1228
  *)
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1229
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1230
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1231
  order_isomorphism_fm :: "[i,i,i,i,i]=>i" where
13429
wenzelm
parents: 13428
diff changeset
  1232
 "order_isomorphism_fm(A,r,B,s,f) ==
wenzelm
parents: 13428
diff changeset
  1233
   And(bijection_fm(A,B,f),
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1234
     Forall(Implies(Member(0,succ(A)),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1235
       Forall(Implies(Member(0,succ(succ(A))),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1236
         Forall(Forall(Forall(Forall(
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1237
           Implies(pair_fm(5,4,3),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1238
             Implies(fun_apply_fm(f#+6,5,2),
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1239
               Implies(fun_apply_fm(f#+6,4,1),
13429
wenzelm
parents: 13428
diff changeset
  1240
                 Implies(pair_fm(2,1,0),
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1241
                   Iff(Member(3,r#+6), Member(0,s#+6)))))))))))))))"
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1242
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1243
lemma order_isomorphism_type [TC]:
13429
wenzelm
parents: 13428
diff changeset
  1244
     "[| A \<in> nat; r \<in> nat; B \<in> nat; s \<in> nat; f \<in> nat |]
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1245
      ==> order_isomorphism_fm(A,r,B,s,f) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
  1246
by (simp add: order_isomorphism_fm_def)
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1247
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1248
lemma sats_order_isomorphism_fm [simp]:
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1249
   "[| U \<in> nat; r \<in> nat; B \<in> nat; s \<in> nat; f \<in> nat; env \<in> list(A)|]
13429
wenzelm
parents: 13428
diff changeset
  1250
    ==> sats(A, order_isomorphism_fm(U,r,B,s,f), env) <->
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1251
        order_isomorphism(##A, nth(U,env), nth(r,env), nth(B,env),
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1252
                               nth(s,env), nth(f,env))"
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1253
by (simp add: order_isomorphism_fm_def order_isomorphism_def)
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1254
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1255
lemma order_isomorphism_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
  1256
  "[| nth(i,env) = U; nth(j,env) = r; nth(k,env) = B; nth(j',env) = s;
wenzelm
parents: 13428
diff changeset
  1257
      nth(k',env) = f;
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1258
      i \<in> nat; j \<in> nat; k \<in> nat; j' \<in> nat; k' \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1259
   ==> order_isomorphism(##A,U,r,B,s,f) <->
13429
wenzelm
parents: 13428
diff changeset
  1260
       sats(A, order_isomorphism_fm(i,j,k,j',k'), env)"
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1261
by simp
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1262
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
  1263
theorem order_isomorphism_reflection:
13429
wenzelm
parents: 13428
diff changeset
  1264
     "REFLECTS[\<lambda>x. order_isomorphism(L,f(x),g(x),h(x),g'(x),h'(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1265
               \<lambda>i x. order_isomorphism(##Lset(i),f(x),g(x),h(x),g'(x),h'(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1266
apply (simp only: order_isomorphism_def)
13429
wenzelm
parents: 13428
diff changeset
  1267
apply (intro FOL_reflections function_reflections bijection_reflection)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1268
done
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1269
13339
0f89104dd377 Fixed quantified variable name preservation for ball and bex (bounded quants)
paulson
parents: 13323
diff changeset
  1270
subsubsection{*Limit Ordinals, Internalized*}
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1271
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1272
text{*A limit ordinal is a non-empty, successor-closed ordinal*}
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1273
13429
wenzelm
parents: 13428
diff changeset
  1274
(* "limit_ordinal(M,a) ==
wenzelm
parents: 13428
diff changeset
  1275
        ordinal(M,a) & ~ empty(M,a) &
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1276
        (\<forall>x[M]. x\<in>a --> (\<exists>y[M]. y\<in>a & successor(M,x,y)))" *)
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1277
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1278
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1279
  limit_ordinal_fm :: "i=>i" where
13429
wenzelm
parents: 13428
diff changeset
  1280
    "limit_ordinal_fm(x) ==
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1281
        And(ordinal_fm(x),
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1282
            And(Neg(empty_fm(x)),
13429
wenzelm
parents: 13428
diff changeset
  1283
                Forall(Implies(Member(0,succ(x)),
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1284
                               Exists(And(Member(0,succ(succ(x))),
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1285
                                          succ_fm(1,0)))))))"
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1286
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1287
lemma limit_ordinal_type [TC]:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1288
     "x \<in> nat ==> limit_ordinal_fm(x) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
  1289
by (simp add: limit_ordinal_fm_def)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1290
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1291
lemma sats_limit_ordinal_fm [simp]:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1292
   "[| x \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1293
    ==> sats(A, limit_ordinal_fm(x), env) <-> limit_ordinal(##A, nth(x,env))"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1294
by (simp add: limit_ordinal_fm_def limit_ordinal_def sats_ordinal_fm')
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1295
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1296
lemma limit_ordinal_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
  1297
      "[| nth(i,env) = x; nth(j,env) = y;
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1298
          i \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1299
       ==> limit_ordinal(##A, x) <-> sats(A, limit_ordinal_fm(i), env)"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1300
by simp
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1301
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1302
theorem limit_ordinal_reflection:
13429
wenzelm
parents: 13428
diff changeset
  1303
     "REFLECTS[\<lambda>x. limit_ordinal(L,f(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1304
               \<lambda>i x. limit_ordinal(##Lset(i),f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1305
apply (simp only: limit_ordinal_def)
13429
wenzelm
parents: 13428
diff changeset
  1306
apply (intro FOL_reflections ordinal_reflection
wenzelm
parents: 13428
diff changeset
  1307
             empty_reflection successor_reflection)
13314
84b9de3cbc91 Defining a meta-existential quantifier.
paulson
parents: 13309
diff changeset
  1308
done
13309
a6adee8ea75a reflection for more internal formulas
paulson
parents: 13306
diff changeset
  1309
13493
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1310
subsubsection{*Finite Ordinals: The Predicate ``Is A Natural Number''*}
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1311
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1312
(*     "finite_ordinal(M,a) == 
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1313
	ordinal(M,a) & ~ limit_ordinal(M,a) & 
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1314
        (\<forall>x[M]. x\<in>a --> ~ limit_ordinal(M,x))" *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1315
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1316
  finite_ordinal_fm :: "i=>i" where
13493
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1317
    "finite_ordinal_fm(x) ==
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1318
       And(ordinal_fm(x),
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1319
          And(Neg(limit_ordinal_fm(x)),
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1320
           Forall(Implies(Member(0,succ(x)),
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1321
                          Neg(limit_ordinal_fm(0))))))"
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1322
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1323
lemma finite_ordinal_type [TC]:
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1324
     "x \<in> nat ==> finite_ordinal_fm(x) \<in> formula"
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1325
by (simp add: finite_ordinal_fm_def)
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1326
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1327
lemma sats_finite_ordinal_fm [simp]:
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1328
   "[| x \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1329
    ==> sats(A, finite_ordinal_fm(x), env) <-> finite_ordinal(##A, nth(x,env))"
13493
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1330
by (simp add: finite_ordinal_fm_def sats_ordinal_fm' finite_ordinal_def)
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1331
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1332
lemma finite_ordinal_iff_sats:
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1333
      "[| nth(i,env) = x; nth(j,env) = y;
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1334
          i \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1335
       ==> finite_ordinal(##A, x) <-> sats(A, finite_ordinal_fm(i), env)"
13493
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1336
by simp
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1337
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1338
theorem finite_ordinal_reflection:
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1339
     "REFLECTS[\<lambda>x. finite_ordinal(L,f(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1340
               \<lambda>i x. finite_ordinal(##Lset(i),f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1341
apply (simp only: finite_ordinal_def)
13493
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1342
apply (intro FOL_reflections ordinal_reflection limit_ordinal_reflection)
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1343
done
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1344
5aa68c051725 Lots of new results concerning recursive datatypes, towards absoluteness of
paulson
parents: 13440
diff changeset
  1345
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1346
subsubsection{*Omega: The Set of Natural Numbers*}
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1347
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1348
(* omega(M,a) == limit_ordinal(M,a) & (\<forall>x[M]. x\<in>a --> ~ limit_ordinal(M,x)) *)
21404
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1349
definition
eb85850d3eb7 more robust syntax for definition/abbreviation/notation;
wenzelm
parents: 21233
diff changeset
  1350
  omega_fm :: "i=>i" where
13429
wenzelm
parents: 13428
diff changeset
  1351
    "omega_fm(x) ==
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1352
       And(limit_ordinal_fm(x),
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1353
           Forall(Implies(Member(0,succ(x)),
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1354
                          Neg(limit_ordinal_fm(0)))))"
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1355
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1356
lemma omega_type [TC]:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1357
     "x \<in> nat ==> omega_fm(x) \<in> formula"
13429
wenzelm
parents: 13428
diff changeset
  1358
by (simp add: omega_fm_def)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1359
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1360
lemma sats_omega_fm [simp]:
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1361
   "[| x \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1362
    ==> sats(A, omega_fm(x), env) <-> omega(##A, nth(x,env))"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1363
by (simp add: omega_fm_def omega_def)
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
  1364
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1365
lemma omega_iff_sats:
13429
wenzelm
parents: 13428
diff changeset
  1366
      "[| nth(i,env) = x; nth(j,env) = y;
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1367
          i \<in> nat; env \<in> list(A)|]
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1368
       ==> omega(##A, x) <-> sats(A, omega_fm(i), env)"
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1369
by simp
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1370
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1371
theorem omega_reflection:
13429
wenzelm
parents: 13428
diff changeset
  1372
     "REFLECTS[\<lambda>x. omega(L,f(x)),
13807
a28a8fbc76d4 changed ** to ## to avoid conflict with new comment syntax
paulson
parents: 13655
diff changeset
  1373
               \<lambda>i x. omega(##Lset(i),f(x))]"
13655
95b95cdb4704 Tidying up. New primitives is_iterates and is_iterates_fm.
paulson
parents: 13651
diff changeset
  1374
apply (simp only: omega_def)
13429
wenzelm
parents: 13428
diff changeset
  1375
apply (intro FOL_reflections limit_ordinal_reflection)
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1376
done
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1377
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1378
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1379
lemmas fun_plus_reflections =
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1380
        typed_function_reflection composition_reflection
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1381
        injection_reflection surjection_reflection
13348
374d05460db4 Separation/Replacement up to M_wfrank!
paulson
parents: 13339
diff changeset
  1382
        bijection_reflection restriction_reflection
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13493
diff changeset
  1383
        order_isomorphism_reflection finite_ordinal_reflection 
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1384
        ordinal_reflection limit_ordinal_reflection omega_reflection
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1385
13429
wenzelm
parents: 13428
diff changeset
  1386
lemmas fun_plus_iff_sats =
wenzelm
parents: 13428
diff changeset
  1387
        typed_function_iff_sats composition_iff_sats
wenzelm
parents: 13428
diff changeset
  1388
        injection_iff_sats surjection_iff_sats
wenzelm
parents: 13428
diff changeset
  1389
        bijection_iff_sats restriction_iff_sats
13496
6f0c57def6d5 In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents: 13493
diff changeset
  1390
        order_isomorphism_iff_sats finite_ordinal_iff_sats
13323
2c287f50c9f3 More relativization, reflection and proofs of separation
paulson
parents: 13316
diff changeset
  1391
        ordinal_iff_sats limit_ordinal_iff_sats omega_iff_sats
13316
d16629fd0f95 more and simpler separation proofs
paulson
parents: 13314
diff changeset
  1392
13223
45be08fbdcff new theory of inner models
paulson
parents:
diff changeset
  1393
end