author | paulson |
Wed, 14 Aug 2002 14:33:26 +0200 | |
changeset 13502 | da43ebc02f17 |
parent 13496 | 6f0c57def6d5 |
child 13503 | d93f41fe35d2 |
permissions | -rw-r--r-- |
13494 | 1 |
(* Title: ZF/Constructible/Satisfies_absolute.thy |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 2002 University of Cambridge |
|
5 |
*) |
|
6 |
||
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
7 |
header {*Absoluteness for the Satisfies Relation on Formulas*} |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
8 |
|
13494 | 9 |
theory Satisfies_absolute = Datatype_absolute + Rec_Separation: |
10 |
||
11 |
||
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
12 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
13 |
subsubsection{*The Formula @{term is_list_N}, Internalized*} |
13494 | 14 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
15 |
(* "is_list_N(M,A,n,Z) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
16 |
\<exists>zero[M]. \<exists>sn[M]. \<exists>msn[M]. |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
17 |
empty(M,zero) & |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
18 |
successor(M,n,sn) & membership(M,sn,msn) & |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
19 |
is_wfrec(M, iterates_MH(M, is_list_functor(M,A),zero), msn, n, Z)" *) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
20 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
21 |
constdefs list_N_fm :: "[i,i,i]=>i" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
22 |
"list_N_fm(A,n,Z) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
23 |
Exists(Exists(Exists( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
24 |
And(empty_fm(2), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
25 |
And(succ_fm(n#+3,1), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
26 |
And(Memrel_fm(1,0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
27 |
is_wfrec_fm(iterates_MH_fm(list_functor_fm(A#+9#+3,1,0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
28 |
7,2,1,0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
29 |
0, n#+3, Z#+3)))))))" |
13494 | 30 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
31 |
lemma list_N_fm_type [TC]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
32 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> list_N_fm(x,y,z) \<in> formula" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
33 |
by (simp add: list_N_fm_def) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
34 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
35 |
lemma sats_list_N_fm [simp]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
36 |
"[| x \<in> nat; y < length(env); z < length(env); env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
37 |
==> sats(A, list_N_fm(x,y,z), env) <-> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
38 |
is_list_N(**A, nth(x,env), nth(y,env), nth(z,env))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
39 |
apply (frule_tac x=z in lt_length_in_nat, assumption) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
40 |
apply (frule_tac x=y in lt_length_in_nat, assumption) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
41 |
apply (simp add: list_N_fm_def is_list_N_def sats_is_wfrec_fm |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
42 |
sats_iterates_MH_fm) |
13494 | 43 |
done |
44 |
||
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
45 |
lemma list_N_iff_sats: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
46 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
47 |
i \<in> nat; j < length(env); k < length(env); env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
48 |
==> is_list_N(**A, x, y, z) <-> sats(A, list_N_fm(i,j,k), env)" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
49 |
by (simp add: sats_list_N_fm) |
13494 | 50 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
51 |
theorem list_N_reflection: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
52 |
"REFLECTS[\<lambda>x. is_list_N(L, f(x), g(x), h(x)), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
53 |
\<lambda>i x. is_list_N(**Lset(i), f(x), g(x), h(x))]" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
54 |
apply (simp only: is_list_N_def setclass_simps) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
55 |
apply (intro FOL_reflections function_reflections is_wfrec_reflection |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
56 |
iterates_MH_reflection list_functor_reflection) |
13494 | 57 |
done |
58 |
||
59 |
||
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
60 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
61 |
subsubsection{*The Predicate ``Is A List''*} |
13494 | 62 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
63 |
(* mem_list(M,A,l) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
64 |
\<exists>n[M]. \<exists>listn[M]. |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
65 |
finite_ordinal(M,n) & is_list_N(M,A,n,listn) & l \<in> listn *) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
66 |
constdefs mem_list_fm :: "[i,i]=>i" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
67 |
"mem_list_fm(x,y) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
68 |
Exists(Exists( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
69 |
And(finite_ordinal_fm(1), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
70 |
And(list_N_fm(x#+2,1,0), Member(y#+2,0)))))" |
13494 | 71 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
72 |
lemma mem_list_type [TC]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
73 |
"[| x \<in> nat; y \<in> nat |] ==> mem_list_fm(x,y) \<in> formula" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
74 |
by (simp add: mem_list_fm_def) |
13494 | 75 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
76 |
lemma sats_mem_list_fm [simp]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
77 |
"[| x \<in> nat; y \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
78 |
==> sats(A, mem_list_fm(x,y), env) <-> mem_list(**A, nth(x,env), nth(y,env))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
79 |
by (simp add: mem_list_fm_def mem_list_def) |
13494 | 80 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
81 |
lemma mem_list_iff_sats: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
82 |
"[| nth(i,env) = x; nth(j,env) = y; |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
83 |
i \<in> nat; j \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
84 |
==> mem_list(**A, x, y) <-> sats(A, mem_list_fm(i,j), env)" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
85 |
by simp |
13494 | 86 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
87 |
theorem mem_list_reflection: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
88 |
"REFLECTS[\<lambda>x. mem_list(L,f(x),g(x)), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
89 |
\<lambda>i x. mem_list(**Lset(i),f(x),g(x))]" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
90 |
apply (simp only: mem_list_def setclass_simps) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
91 |
apply (intro FOL_reflections finite_ordinal_reflection list_N_reflection) |
13494 | 92 |
done |
93 |
||
94 |
||
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
95 |
subsubsection{*The Predicate ``Is @{term "list(A)"}''*} |
13494 | 96 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
97 |
(* is_list(M,A,Z) == \<forall>l[M]. l \<in> Z <-> mem_list(M,A,l) *) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
98 |
constdefs is_list_fm :: "[i,i]=>i" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
99 |
"is_list_fm(A,Z) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
100 |
Forall(Iff(Member(0,succ(Z)), mem_list_fm(succ(A),0)))" |
13494 | 101 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
102 |
lemma is_list_type [TC]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
103 |
"[| x \<in> nat; y \<in> nat |] ==> is_list_fm(x,y) \<in> formula" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
104 |
by (simp add: is_list_fm_def) |
13494 | 105 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
106 |
lemma sats_is_list_fm [simp]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
107 |
"[| x \<in> nat; y \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
108 |
==> sats(A, is_list_fm(x,y), env) <-> is_list(**A, nth(x,env), nth(y,env))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
109 |
by (simp add: is_list_fm_def is_list_def) |
13494 | 110 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
111 |
lemma is_list_iff_sats: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
112 |
"[| nth(i,env) = x; nth(j,env) = y; |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
113 |
i \<in> nat; j \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
114 |
==> is_list(**A, x, y) <-> sats(A, is_list_fm(i,j), env)" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
115 |
by simp |
13494 | 116 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
117 |
theorem is_list_reflection: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
118 |
"REFLECTS[\<lambda>x. is_list(L,f(x),g(x)), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
119 |
\<lambda>i x. is_list(**Lset(i),f(x),g(x))]" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
120 |
apply (simp only: is_list_def setclass_simps) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
121 |
apply (intro FOL_reflections mem_list_reflection) |
13494 | 122 |
done |
123 |
||
124 |
||
125 |
subsubsection{*The Formula @{term is_formula_N}, Internalized*} |
|
126 |
||
127 |
(* "is_formula_N(M,n,Z) == |
|
128 |
\<exists>zero[M]. \<exists>sn[M]. \<exists>msn[M]. |
|
129 |
2 1 0 |
|
130 |
empty(M,zero) & |
|
131 |
successor(M,n,sn) & membership(M,sn,msn) & |
|
132 |
is_wfrec(M, iterates_MH(M, is_formula_functor(M),zero), msn, n, Z)" *) |
|
133 |
constdefs formula_N_fm :: "[i,i]=>i" |
|
134 |
"formula_N_fm(n,Z) == |
|
135 |
Exists(Exists(Exists( |
|
136 |
And(empty_fm(2), |
|
137 |
And(succ_fm(n#+3,1), |
|
138 |
And(Memrel_fm(1,0), |
|
139 |
is_wfrec_fm(iterates_MH_fm(formula_functor_fm(1,0),7,2,1,0), |
|
140 |
0, n#+3, Z#+3)))))))" |
|
141 |
||
142 |
lemma formula_N_fm_type [TC]: |
|
143 |
"[| x \<in> nat; y \<in> nat |] ==> formula_N_fm(x,y) \<in> formula" |
|
144 |
by (simp add: formula_N_fm_def) |
|
145 |
||
146 |
lemma sats_formula_N_fm [simp]: |
|
147 |
"[| x < length(env); y < length(env); env \<in> list(A)|] |
|
148 |
==> sats(A, formula_N_fm(x,y), env) <-> |
|
149 |
is_formula_N(**A, nth(x,env), nth(y,env))" |
|
150 |
apply (frule_tac x=y in lt_length_in_nat, assumption) |
|
151 |
apply (frule lt_length_in_nat, assumption) |
|
152 |
apply (simp add: formula_N_fm_def is_formula_N_def sats_is_wfrec_fm sats_iterates_MH_fm) |
|
153 |
done |
|
154 |
||
155 |
lemma formula_N_iff_sats: |
|
156 |
"[| nth(i,env) = x; nth(j,env) = y; |
|
157 |
i < length(env); j < length(env); env \<in> list(A)|] |
|
158 |
==> is_formula_N(**A, x, y) <-> sats(A, formula_N_fm(i,j), env)" |
|
159 |
by (simp add: sats_formula_N_fm) |
|
160 |
||
161 |
theorem formula_N_reflection: |
|
162 |
"REFLECTS[\<lambda>x. is_formula_N(L, f(x), g(x)), |
|
163 |
\<lambda>i x. is_formula_N(**Lset(i), f(x), g(x))]" |
|
164 |
apply (simp only: is_formula_N_def setclass_simps) |
|
165 |
apply (intro FOL_reflections function_reflections is_wfrec_reflection |
|
166 |
iterates_MH_reflection formula_functor_reflection) |
|
167 |
done |
|
168 |
||
169 |
||
170 |
||
171 |
subsubsection{*The Predicate ``Is A Formula''*} |
|
172 |
||
173 |
(* mem_formula(M,p) == |
|
174 |
\<exists>n[M]. \<exists>formn[M]. |
|
175 |
finite_ordinal(M,n) & is_formula_N(M,n,formn) & p \<in> formn *) |
|
176 |
constdefs mem_formula_fm :: "i=>i" |
|
177 |
"mem_formula_fm(x) == |
|
178 |
Exists(Exists( |
|
179 |
And(finite_ordinal_fm(1), |
|
180 |
And(formula_N_fm(1,0), Member(x#+2,0)))))" |
|
181 |
||
182 |
lemma mem_formula_type [TC]: |
|
183 |
"x \<in> nat ==> mem_formula_fm(x) \<in> formula" |
|
184 |
by (simp add: mem_formula_fm_def) |
|
185 |
||
186 |
lemma sats_mem_formula_fm [simp]: |
|
187 |
"[| x \<in> nat; env \<in> list(A)|] |
|
188 |
==> sats(A, mem_formula_fm(x), env) <-> mem_formula(**A, nth(x,env))" |
|
189 |
by (simp add: mem_formula_fm_def mem_formula_def) |
|
190 |
||
191 |
lemma mem_formula_iff_sats: |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
192 |
"[| nth(i,env) = x; i \<in> nat; env \<in> list(A)|] |
13494 | 193 |
==> mem_formula(**A, x) <-> sats(A, mem_formula_fm(i), env)" |
194 |
by simp |
|
195 |
||
196 |
theorem mem_formula_reflection: |
|
197 |
"REFLECTS[\<lambda>x. mem_formula(L,f(x)), |
|
198 |
\<lambda>i x. mem_formula(**Lset(i),f(x))]" |
|
199 |
apply (simp only: mem_formula_def setclass_simps) |
|
200 |
apply (intro FOL_reflections finite_ordinal_reflection formula_N_reflection) |
|
201 |
done |
|
202 |
||
203 |
||
204 |
||
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
205 |
subsubsection{*The Predicate ``Is @{term "formula"}''*} |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
206 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
207 |
(* is_formula(M,Z) == \<forall>p[M]. p \<in> Z <-> mem_formula(M,p) *) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
208 |
constdefs is_formula_fm :: "i=>i" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
209 |
"is_formula_fm(Z) == Forall(Iff(Member(0,succ(Z)), mem_formula_fm(0)))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
210 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
211 |
lemma is_formula_type [TC]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
212 |
"x \<in> nat ==> is_formula_fm(x) \<in> formula" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
213 |
by (simp add: is_formula_fm_def) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
214 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
215 |
lemma sats_is_formula_fm [simp]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
216 |
"[| x \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
217 |
==> sats(A, is_formula_fm(x), env) <-> is_formula(**A, nth(x,env))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
218 |
by (simp add: is_formula_fm_def is_formula_def) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
219 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
220 |
lemma is_formula_iff_sats: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
221 |
"[| nth(i,env) = x; i \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
222 |
==> is_formula(**A, x) <-> sats(A, is_formula_fm(i), env)" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
223 |
by simp |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
224 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
225 |
theorem is_formula_reflection: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
226 |
"REFLECTS[\<lambda>x. is_formula(L,f(x)), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
227 |
\<lambda>i x. is_formula(**Lset(i),f(x))]" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
228 |
apply (simp only: is_formula_def setclass_simps) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
229 |
apply (intro FOL_reflections mem_formula_reflection) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
230 |
done |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
231 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
232 |
|
13494 | 233 |
subsubsection{*The Formula @{term is_depth}, Internalized*} |
234 |
||
235 |
(* "is_depth(M,p,n) == |
|
236 |
\<exists>sn[M]. \<exists>formula_n[M]. \<exists>formula_sn[M]. |
|
237 |
2 1 0 |
|
238 |
is_formula_N(M,n,formula_n) & p \<notin> formula_n & |
|
239 |
successor(M,n,sn) & is_formula_N(M,sn,formula_sn) & p \<in> formula_sn" *) |
|
240 |
constdefs depth_fm :: "[i,i]=>i" |
|
241 |
"depth_fm(p,n) == |
|
242 |
Exists(Exists(Exists( |
|
243 |
And(formula_N_fm(n#+3,1), |
|
244 |
And(Neg(Member(p#+3,1)), |
|
245 |
And(succ_fm(n#+3,2), |
|
246 |
And(formula_N_fm(2,0), Member(p#+3,0))))))))" |
|
247 |
||
248 |
lemma depth_fm_type [TC]: |
|
249 |
"[| x \<in> nat; y \<in> nat |] ==> depth_fm(x,y) \<in> formula" |
|
250 |
by (simp add: depth_fm_def) |
|
251 |
||
252 |
lemma sats_depth_fm [simp]: |
|
253 |
"[| x \<in> nat; y < length(env); env \<in> list(A)|] |
|
254 |
==> sats(A, depth_fm(x,y), env) <-> |
|
255 |
is_depth(**A, nth(x,env), nth(y,env))" |
|
256 |
apply (frule_tac x=y in lt_length_in_nat, assumption) |
|
257 |
apply (simp add: depth_fm_def is_depth_def) |
|
258 |
done |
|
259 |
||
260 |
lemma depth_iff_sats: |
|
261 |
"[| nth(i,env) = x; nth(j,env) = y; |
|
262 |
i \<in> nat; j < length(env); env \<in> list(A)|] |
|
263 |
==> is_depth(**A, x, y) <-> sats(A, depth_fm(i,j), env)" |
|
264 |
by (simp add: sats_depth_fm) |
|
265 |
||
266 |
theorem depth_reflection: |
|
267 |
"REFLECTS[\<lambda>x. is_depth(L, f(x), g(x)), |
|
268 |
\<lambda>i x. is_depth(**Lset(i), f(x), g(x))]" |
|
269 |
apply (simp only: is_depth_def setclass_simps) |
|
270 |
apply (intro FOL_reflections function_reflections formula_N_reflection) |
|
271 |
done |
|
272 |
||
273 |
||
274 |
||
275 |
subsubsection{*The Operator @{term is_formula_case}*} |
|
276 |
||
277 |
text{*The arguments of @{term is_a} are always 2, 1, 0, and the formula |
|
278 |
will be enclosed by three quantifiers.*} |
|
279 |
||
280 |
(* is_formula_case :: |
|
281 |
"[i=>o, [i,i,i]=>o, [i,i,i]=>o, [i,i,i]=>o, [i,i]=>o, i, i] => o" |
|
282 |
"is_formula_case(M, is_a, is_b, is_c, is_d, v, z) == |
|
283 |
(\<forall>x[M]. \<forall>y[M]. x\<in>nat --> y\<in>nat --> is_Member(M,x,y,v) --> is_a(x,y,z)) & |
|
284 |
(\<forall>x[M]. \<forall>y[M]. x\<in>nat --> y\<in>nat --> is_Equal(M,x,y,v) --> is_b(x,y,z)) & |
|
285 |
(\<forall>x[M]. \<forall>y[M]. x\<in>formula --> y\<in>formula --> |
|
286 |
is_Nand(M,x,y,v) --> is_c(x,y,z)) & |
|
287 |
(\<forall>x[M]. x\<in>formula --> is_Forall(M,x,v) --> is_d(x,z))" *) |
|
288 |
||
289 |
constdefs formula_case_fm :: "[i, i, i, i, i, i]=>i" |
|
290 |
"formula_case_fm(is_a, is_b, is_c, is_d, v, z) == |
|
291 |
And(Forall(Forall(Implies(finite_ordinal_fm(1), |
|
292 |
Implies(finite_ordinal_fm(0), |
|
293 |
Implies(Member_fm(1,0,v#+2), |
|
294 |
Forall(Implies(Equal(0,z#+3), is_a))))))), |
|
295 |
And(Forall(Forall(Implies(finite_ordinal_fm(1), |
|
296 |
Implies(finite_ordinal_fm(0), |
|
297 |
Implies(Equal_fm(1,0,v#+2), |
|
298 |
Forall(Implies(Equal(0,z#+3), is_b))))))), |
|
299 |
And(Forall(Forall(Implies(mem_formula_fm(1), |
|
300 |
Implies(mem_formula_fm(0), |
|
301 |
Implies(Nand_fm(1,0,v#+2), |
|
302 |
Forall(Implies(Equal(0,z#+3), is_c))))))), |
|
303 |
Forall(Implies(mem_formula_fm(0), |
|
304 |
Implies(Forall_fm(0,succ(v)), |
|
305 |
Forall(Implies(Equal(0,z#+2), is_d))))))))" |
|
306 |
||
307 |
||
308 |
lemma is_formula_case_type [TC]: |
|
309 |
"[| is_a \<in> formula; is_b \<in> formula; is_c \<in> formula; is_d \<in> formula; |
|
310 |
x \<in> nat; y \<in> nat |] |
|
311 |
==> formula_case_fm(is_a, is_b, is_c, is_d, x, y) \<in> formula" |
|
312 |
by (simp add: formula_case_fm_def) |
|
313 |
||
314 |
lemma sats_formula_case_fm: |
|
315 |
assumes is_a_iff_sats: |
|
316 |
"!!a0 a1 a2. |
|
317 |
[|a0\<in>A; a1\<in>A; a2\<in>A|] |
|
318 |
==> ISA(a2, a1, a0) <-> sats(A, is_a, Cons(a0,Cons(a1,Cons(a2,env))))" |
|
319 |
and is_b_iff_sats: |
|
320 |
"!!a0 a1 a2. |
|
321 |
[|a0\<in>A; a1\<in>A; a2\<in>A|] |
|
322 |
==> ISB(a2, a1, a0) <-> sats(A, is_b, Cons(a0,Cons(a1,Cons(a2,env))))" |
|
323 |
and is_c_iff_sats: |
|
324 |
"!!a0 a1 a2. |
|
325 |
[|a0\<in>A; a1\<in>A; a2\<in>A|] |
|
326 |
==> ISC(a2, a1, a0) <-> sats(A, is_c, Cons(a0,Cons(a1,Cons(a2,env))))" |
|
327 |
and is_d_iff_sats: |
|
328 |
"!!a0 a1. |
|
329 |
[|a0\<in>A; a1\<in>A|] |
|
330 |
==> ISD(a1, a0) <-> sats(A, is_d, Cons(a0,Cons(a1,env)))" |
|
331 |
shows |
|
332 |
"[|x \<in> nat; y < length(env); env \<in> list(A)|] |
|
333 |
==> sats(A, formula_case_fm(is_a,is_b,is_c,is_d,x,y), env) <-> |
|
334 |
is_formula_case(**A, ISA, ISB, ISC, ISD, nth(x,env), nth(y,env))" |
|
335 |
apply (frule_tac x=y in lt_length_in_nat, assumption) |
|
336 |
apply (simp add: formula_case_fm_def is_formula_case_def |
|
337 |
is_a_iff_sats [THEN iff_sym] is_b_iff_sats [THEN iff_sym] |
|
338 |
is_c_iff_sats [THEN iff_sym] is_d_iff_sats [THEN iff_sym]) |
|
339 |
done |
|
340 |
||
341 |
lemma formula_case_iff_sats: |
|
342 |
assumes is_a_iff_sats: |
|
343 |
"!!a0 a1 a2. |
|
344 |
[|a0\<in>A; a1\<in>A; a2\<in>A|] |
|
345 |
==> ISA(a2, a1, a0) <-> sats(A, is_a, Cons(a0,Cons(a1,Cons(a2,env))))" |
|
346 |
and is_b_iff_sats: |
|
347 |
"!!a0 a1 a2. |
|
348 |
[|a0\<in>A; a1\<in>A; a2\<in>A|] |
|
349 |
==> ISB(a2, a1, a0) <-> sats(A, is_b, Cons(a0,Cons(a1,Cons(a2,env))))" |
|
350 |
and is_c_iff_sats: |
|
351 |
"!!a0 a1 a2. |
|
352 |
[|a0\<in>A; a1\<in>A; a2\<in>A|] |
|
353 |
==> ISC(a2, a1, a0) <-> sats(A, is_c, Cons(a0,Cons(a1,Cons(a2,env))))" |
|
354 |
and is_d_iff_sats: |
|
355 |
"!!a0 a1. |
|
356 |
[|a0\<in>A; a1\<in>A|] |
|
357 |
==> ISD(a1, a0) <-> sats(A, is_d, Cons(a0,Cons(a1,env)))" |
|
358 |
shows |
|
359 |
"[|nth(i,env) = x; nth(j,env) = y; |
|
360 |
i \<in> nat; j < length(env); env \<in> list(A)|] |
|
361 |
==> is_formula_case(**A, ISA, ISB, ISC, ISD, x, y) <-> |
|
362 |
sats(A, formula_case_fm(is_a,is_b,is_c,is_d,i,j), env)" |
|
363 |
by (simp add: sats_formula_case_fm [OF is_a_iff_sats is_b_iff_sats |
|
364 |
is_c_iff_sats is_d_iff_sats]) |
|
365 |
||
366 |
||
367 |
text{*The second argument of @{term is_a} gives it direct access to @{term x}, |
|
368 |
which is essential for handling free variable references. Treatment is |
|
369 |
based on that of @{text is_nat_case_reflection}.*} |
|
370 |
theorem is_formula_case_reflection: |
|
371 |
assumes is_a_reflection: |
|
372 |
"!!h f g g'. REFLECTS[\<lambda>x. is_a(L, h(x), f(x), g(x), g'(x)), |
|
373 |
\<lambda>i x. is_a(**Lset(i), h(x), f(x), g(x), g'(x))]" |
|
374 |
and is_b_reflection: |
|
375 |
"!!h f g g'. REFLECTS[\<lambda>x. is_b(L, h(x), f(x), g(x), g'(x)), |
|
376 |
\<lambda>i x. is_b(**Lset(i), h(x), f(x), g(x), g'(x))]" |
|
377 |
and is_c_reflection: |
|
378 |
"!!h f g g'. REFLECTS[\<lambda>x. is_c(L, h(x), f(x), g(x), g'(x)), |
|
379 |
\<lambda>i x. is_c(**Lset(i), h(x), f(x), g(x), g'(x))]" |
|
380 |
and is_d_reflection: |
|
381 |
"!!h f g g'. REFLECTS[\<lambda>x. is_d(L, h(x), f(x), g(x)), |
|
382 |
\<lambda>i x. is_d(**Lset(i), h(x), f(x), g(x))]" |
|
383 |
shows "REFLECTS[\<lambda>x. is_formula_case(L, is_a(L,x), is_b(L,x), is_c(L,x), is_d(L,x), g(x), h(x)), |
|
384 |
\<lambda>i x. is_formula_case(**Lset(i), is_a(**Lset(i), x), is_b(**Lset(i), x), is_c(**Lset(i), x), is_d(**Lset(i), x), g(x), h(x))]" |
|
385 |
apply (simp (no_asm_use) only: is_formula_case_def setclass_simps) |
|
386 |
apply (intro FOL_reflections function_reflections finite_ordinal_reflection |
|
387 |
mem_formula_reflection |
|
388 |
Member_reflection Equal_reflection Nand_reflection Forall_reflection |
|
389 |
is_a_reflection is_b_reflection is_c_reflection is_d_reflection) |
|
390 |
done |
|
391 |
||
392 |
||
393 |
||
394 |
subsection {*Absoluteness for @{term formula_rec}*} |
|
395 |
||
396 |
constdefs |
|
397 |
||
398 |
formula_rec_case :: "[[i,i]=>i, [i,i]=>i, [i,i,i,i]=>i, [i,i]=>i, i, i] => i" |
|
399 |
--{* the instance of @{term formula_case} in @{term formula_rec}*} |
|
400 |
"formula_rec_case(a,b,c,d,h) == |
|
401 |
formula_case (a, b, |
|
402 |
\<lambda>u v. c(u, v, h ` succ(depth(u)) ` u, |
|
403 |
h ` succ(depth(v)) ` v), |
|
404 |
\<lambda>u. d(u, h ` succ(depth(u)) ` u))" |
|
405 |
||
13502 | 406 |
is_formula_rec :: "[i=>o, [i,i,i]=>o, i, i] => o" |
13494 | 407 |
--{* predicate to relative the functional @{term formula_rec}*} |
13502 | 408 |
"is_formula_rec(M,MH,p,z) == |
13494 | 409 |
\<exists>i[M]. \<exists>f[M]. i = succ(depth(p)) & fun_apply(M,f,p,z) & |
410 |
is_transrec(M,MH,i,f)" |
|
411 |
||
412 |
text{*Unfold @{term formula_rec} to @{term formula_rec_case}*} |
|
413 |
lemma (in M_triv_axioms) formula_rec_eq2: |
|
414 |
"p \<in> formula ==> |
|
415 |
formula_rec(a,b,c,d,p) = |
|
416 |
transrec (succ(depth(p)), |
|
417 |
\<lambda>x h. Lambda (formula, formula_rec_case(a,b,c,d,h))) ` p" |
|
418 |
by (simp add: formula_rec_eq formula_rec_case_def) |
|
419 |
||
420 |
||
421 |
text{*Sufficient conditions to relative the instance of @{term formula_case} |
|
422 |
in @{term formula_rec}*} |
|
423 |
lemma (in M_datatypes) Relativize1_formula_rec_case: |
|
424 |
"[|Relativize2(M, nat, nat, is_a, a); |
|
425 |
Relativize2(M, nat, nat, is_b, b); |
|
426 |
Relativize2 (M, formula, formula, |
|
427 |
is_c, \<lambda>u v. c(u, v, h`succ(depth(u))`u, h`succ(depth(v))`v)); |
|
428 |
Relativize1(M, formula, |
|
429 |
is_d, \<lambda>u. d(u, h ` succ(depth(u)) ` u)); |
|
430 |
M(h) |] |
|
431 |
==> Relativize1(M, formula, |
|
432 |
is_formula_case (M, is_a, is_b, is_c, is_d), |
|
433 |
formula_rec_case(a, b, c, d, h))" |
|
434 |
apply (simp (no_asm) add: formula_rec_case_def Relativize1_def) |
|
435 |
apply (simp add: formula_case_abs) |
|
436 |
done |
|
437 |
||
438 |
||
439 |
text{*This locale packages the premises of the following theorems, |
|
440 |
which is the normal purpose of locales. It doesn't accumulate |
|
441 |
constraints on the class @{term M}, as in most of this deveopment.*} |
|
442 |
locale M_formula_rec = M_eclose + |
|
443 |
fixes a and is_a and b and is_b and c and is_c and d and is_d and MH |
|
444 |
defines |
|
445 |
"MH(u::i,f,z) == |
|
13502 | 446 |
\<forall>fml[M]. is_formula(M,fml) --> |
447 |
is_lambda |
|
448 |
(M, fml, is_formula_case (M, is_a, is_b, is_c(f), is_d(f)), z)" |
|
13494 | 449 |
|
450 |
assumes a_closed: "[|x\<in>nat; y\<in>nat|] ==> M(a(x,y))" |
|
451 |
and a_rel: "Relativize2(M, nat, nat, is_a, a)" |
|
452 |
and b_closed: "[|x\<in>nat; y\<in>nat|] ==> M(b(x,y))" |
|
453 |
and b_rel: "Relativize2(M, nat, nat, is_b, b)" |
|
454 |
and c_closed: "[|x \<in> formula; y \<in> formula; M(gx); M(gy)|] |
|
455 |
==> M(c(x, y, gx, gy))" |
|
456 |
and c_rel: |
|
457 |
"M(f) ==> |
|
458 |
Relativize2 (M, formula, formula, is_c(f), |
|
459 |
\<lambda>u v. c(u, v, f ` succ(depth(u)) ` u, f ` succ(depth(v)) ` v))" |
|
460 |
and d_closed: "[|x \<in> formula; M(gx)|] ==> M(d(x, gx))" |
|
461 |
and d_rel: |
|
462 |
"M(f) ==> |
|
463 |
Relativize1(M, formula, is_d(f), \<lambda>u. d(u, f ` succ(depth(u)) ` u))" |
|
464 |
and fr_replace: "n \<in> nat ==> transrec_replacement(M,MH,n)" |
|
465 |
and fr_lam_replace: |
|
466 |
"M(g) ==> |
|
467 |
strong_replacement |
|
468 |
(M, \<lambda>x y. x \<in> formula & |
|
469 |
y = \<langle>x, formula_rec_case(a,b,c,d,g,x)\<rangle>)"; |
|
470 |
||
471 |
lemma (in M_formula_rec) formula_rec_case_closed: |
|
472 |
"[|M(g); p \<in> formula|] ==> M(formula_rec_case(a, b, c, d, g, p))" |
|
473 |
by (simp add: formula_rec_case_def a_closed b_closed c_closed d_closed) |
|
474 |
||
475 |
lemma (in M_formula_rec) formula_rec_lam_closed: |
|
476 |
"M(g) ==> M(Lambda (formula, formula_rec_case(a,b,c,d,g)))" |
|
477 |
by (simp add: lam_closed2 fr_lam_replace formula_rec_case_closed) |
|
478 |
||
479 |
lemma (in M_formula_rec) MH_rel2: |
|
480 |
"relativize2 (M, MH, |
|
481 |
\<lambda>x h. Lambda (formula, formula_rec_case(a,b,c,d,h)))" |
|
482 |
apply (simp add: relativize2_def MH_def, clarify) |
|
483 |
apply (rule lambda_abs2) |
|
484 |
apply (rule fr_lam_replace, assumption) |
|
485 |
apply (rule Relativize1_formula_rec_case) |
|
486 |
apply (simp_all add: a_rel b_rel c_rel d_rel formula_rec_case_closed) |
|
487 |
done |
|
488 |
||
489 |
lemma (in M_formula_rec) fr_transrec_closed: |
|
490 |
"n \<in> nat |
|
491 |
==> M(transrec |
|
492 |
(n, \<lambda>x h. Lambda(formula, formula_rec_case(a, b, c, d, h))))" |
|
493 |
by (simp add: transrec_closed [OF fr_replace MH_rel2] |
|
494 |
nat_into_M formula_rec_lam_closed) |
|
495 |
||
496 |
text{*The main two results: @{term formula_rec} is absolute for @{term M}.*} |
|
497 |
theorem (in M_formula_rec) formula_rec_closed: |
|
498 |
"p \<in> formula ==> M(formula_rec(a,b,c,d,p))" |
|
499 |
by (simp add: formula_rec_eq2 fr_transrec_closed |
|
500 |
transM [OF _ formula_closed]) |
|
501 |
||
502 |
theorem (in M_formula_rec) formula_rec_abs: |
|
503 |
"[| p \<in> formula; M(z)|] |
|
13502 | 504 |
==> is_formula_rec(M,MH,p,z) <-> z = formula_rec(a,b,c,d,p)" |
13494 | 505 |
by (simp add: is_formula_rec_def formula_rec_eq2 transM [OF _ formula_closed] |
506 |
transrec_abs [OF fr_replace MH_rel2] |
|
507 |
fr_transrec_closed formula_rec_lam_closed eq_commute) |
|
508 |
||
509 |
||
510 |
subsection {*Absoluteness for the Function @{term satisfies}*} |
|
511 |
||
512 |
constdefs |
|
513 |
is_depth_apply :: "[i=>o,i,i,i] => o" |
|
514 |
--{*Merely a useful abbreviation for the sequel.*} |
|
515 |
"is_depth_apply(M,h,p,z) == |
|
516 |
\<exists>dp[M]. \<exists>sdp[M]. \<exists>hsdp[M]. |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
517 |
finite_ordinal(M,dp) & is_depth(M,p,dp) & successor(M,dp,sdp) & |
13494 | 518 |
fun_apply(M,h,sdp,hsdp) & fun_apply(M,hsdp,p,z)" |
519 |
||
520 |
lemma (in M_datatypes) is_depth_apply_abs [simp]: |
|
521 |
"[|M(h); p \<in> formula; M(z)|] |
|
522 |
==> is_depth_apply(M,h,p,z) <-> z = h ` succ(depth(p)) ` p" |
|
523 |
by (simp add: is_depth_apply_def formula_into_M depth_type eq_commute) |
|
524 |
||
525 |
||
526 |
||
527 |
text{*There is at present some redundancy between the relativizations in |
|
528 |
e.g. @{text satisfies_is_a} and those in e.g. @{text Member_replacement}.*} |
|
529 |
||
530 |
text{*These constants let us instantiate the parameters @{term a}, @{term b}, |
|
531 |
@{term c}, @{term d}, etc., of the locale @{text M_formula_rec}.*} |
|
532 |
constdefs |
|
533 |
satisfies_a :: "[i,i,i]=>i" |
|
534 |
"satisfies_a(A) == |
|
535 |
\<lambda>x y. \<lambda>env \<in> list(A). bool_of_o (nth(x,env) \<in> nth(y,env))" |
|
536 |
||
537 |
satisfies_is_a :: "[i=>o,i,i,i,i]=>o" |
|
538 |
"satisfies_is_a(M,A) == |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
539 |
\<lambda>x y zz. \<forall>lA[M]. is_list(M,A,lA) --> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
540 |
is_lambda(M, lA, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
541 |
\<lambda>env z. is_bool_of_o(M, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
542 |
\<exists>nx[M]. \<exists>ny[M]. |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
543 |
is_nth(M,x,env,nx) & is_nth(M,y,env,ny) & nx \<in> ny, z), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
544 |
zz)" |
13494 | 545 |
|
546 |
satisfies_b :: "[i,i,i]=>i" |
|
547 |
"satisfies_b(A) == |
|
548 |
\<lambda>x y. \<lambda>env \<in> list(A). bool_of_o (nth(x,env) = nth(y,env))" |
|
549 |
||
550 |
satisfies_is_b :: "[i=>o,i,i,i,i]=>o" |
|
551 |
--{*We simplify the formula to have just @{term nx} rather than |
|
552 |
introducing @{term ny} with @{term "nx=ny"} *} |
|
553 |
"satisfies_is_b(M,A) == |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
554 |
\<lambda>x y zz. \<forall>lA[M]. is_list(M,A,lA) --> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
555 |
is_lambda(M, lA, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
556 |
\<lambda>env z. is_bool_of_o(M, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
557 |
\<exists>nx[M]. is_nth(M,x,env,nx) & is_nth(M,y,env,nx), z), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
558 |
zz)" |
13494 | 559 |
|
560 |
satisfies_c :: "[i,i,i,i,i]=>i" |
|
13502 | 561 |
"satisfies_c(A) == \<lambda>p q rp rq. \<lambda>env \<in> list(A). not(rp ` env and rq ` env)" |
13494 | 562 |
|
563 |
satisfies_is_c :: "[i=>o,i,i,i,i,i]=>o" |
|
564 |
"satisfies_is_c(M,A,h) == |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
565 |
\<lambda>p q zz. \<forall>lA[M]. is_list(M,A,lA) --> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
566 |
is_lambda(M, lA, \<lambda>env z. \<exists>hp[M]. \<exists>hq[M]. |
13494 | 567 |
(\<exists>rp[M]. is_depth_apply(M,h,p,rp) & fun_apply(M,rp,env,hp)) & |
568 |
(\<exists>rq[M]. is_depth_apply(M,h,q,rq) & fun_apply(M,rq,env,hq)) & |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
569 |
(\<exists>pq[M]. is_and(M,hp,hq,pq) & is_not(M,pq,z)), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
570 |
zz)" |
13494 | 571 |
|
572 |
satisfies_d :: "[i,i,i]=>i" |
|
573 |
"satisfies_d(A) |
|
574 |
== \<lambda>p rp. \<lambda>env \<in> list(A). bool_of_o (\<forall>x\<in>A. rp ` (Cons(x,env)) = 1)" |
|
575 |
||
576 |
satisfies_is_d :: "[i=>o,i,i,i,i]=>o" |
|
577 |
"satisfies_is_d(M,A,h) == |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
578 |
\<lambda>p zz. \<forall>lA[M]. is_list(M,A,lA) --> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
579 |
is_lambda(M, lA, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
580 |
\<lambda>env z. \<exists>rp[M]. is_depth_apply(M,h,p,rp) & |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
581 |
is_bool_of_o(M, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
582 |
\<forall>x[M]. \<forall>xenv[M]. \<forall>hp[M]. |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
583 |
x\<in>A --> is_Cons(M,x,env,xenv) --> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
584 |
fun_apply(M,rp,xenv,hp) --> number1(M,hp), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
585 |
z), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
586 |
zz)" |
13494 | 587 |
|
588 |
satisfies_MH :: "[i=>o,i,i,i,i]=>o" |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
589 |
--{*The variable @{term u} is unused, but gives @{term satisfies_MH} |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
590 |
the correct arity.*} |
13494 | 591 |
"satisfies_MH == |
13502 | 592 |
\<lambda>M A u f z. |
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
593 |
\<forall>fml[M]. is_formula(M,fml) --> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
594 |
is_lambda (M, fml, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
595 |
is_formula_case (M, satisfies_is_a(M,A), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
596 |
satisfies_is_b(M,A), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
597 |
satisfies_is_c(M,A,f), satisfies_is_d(M,A,f)), |
13502 | 598 |
z)" |
13494 | 599 |
|
13502 | 600 |
is_satisfies :: "[i=>o,i,i,i]=>o" |
601 |
"is_satisfies(M,A) == |
|
602 |
is_formula_rec (M, \<lambda>u f z. |
|
603 |
\<forall>fml[M]. |
|
604 |
is_formula(M,fml) \<longrightarrow> |
|
605 |
is_lambda |
|
606 |
(M, fml, |
|
607 |
is_formula_case |
|
608 |
(M, satisfies_is_a(M,A), satisfies_is_b(M,A), |
|
609 |
satisfies_is_c(M,A,f), satisfies_is_d(M,A,f)), z))" |
|
610 |
||
611 |
||
612 |
text{*This lemma relates the fragments defined above to the original primitive |
|
613 |
recursion in @{term satisfies}. |
|
614 |
Induction is not required: the definitions are directly equal!*} |
|
615 |
lemma satisfies_eq: |
|
616 |
"satisfies(A,p) = |
|
617 |
formula_rec (satisfies_a(A), satisfies_b(A), |
|
618 |
satisfies_c(A), satisfies_d(A), p)" |
|
619 |
by (simp add: satisfies_formula_def satisfies_a_def satisfies_b_def |
|
620 |
satisfies_c_def satisfies_d_def) |
|
13494 | 621 |
|
622 |
text{*Further constraints on the class @{term M} in order to prove |
|
623 |
absoluteness for the constants defined above. The ultimate goal |
|
624 |
is the absoluteness of the function @{term satisfies}. *} |
|
13502 | 625 |
locale M_satisfies = M_eclose + |
13494 | 626 |
assumes |
627 |
Member_replacement: |
|
628 |
"[|M(A); x \<in> nat; y \<in> nat|] |
|
629 |
==> strong_replacement |
|
630 |
(M, \<lambda>env z. \<exists>bo[M]. \<exists>nx[M]. \<exists>ny[M]. |
|
631 |
env \<in> list(A) & is_nth(M,x,env,nx) & is_nth(M,y,env,ny) & |
|
632 |
is_bool_of_o(M, nx \<in> ny, bo) & |
|
633 |
pair(M, env, bo, z))" |
|
634 |
and |
|
635 |
Equal_replacement: |
|
636 |
"[|M(A); x \<in> nat; y \<in> nat|] |
|
637 |
==> strong_replacement |
|
638 |
(M, \<lambda>env z. \<exists>bo[M]. \<exists>nx[M]. \<exists>ny[M]. |
|
639 |
env \<in> list(A) & is_nth(M,x,env,nx) & is_nth(M,y,env,ny) & |
|
640 |
is_bool_of_o(M, nx = ny, bo) & |
|
641 |
pair(M, env, bo, z))" |
|
642 |
and |
|
643 |
Nand_replacement: |
|
644 |
"[|M(A); M(rp); M(rq)|] |
|
645 |
==> strong_replacement |
|
646 |
(M, \<lambda>env z. \<exists>rpe[M]. \<exists>rqe[M]. \<exists>andpq[M]. \<exists>notpq[M]. |
|
647 |
fun_apply(M,rp,env,rpe) & fun_apply(M,rq,env,rqe) & |
|
648 |
is_and(M,rpe,rqe,andpq) & is_not(M,andpq,notpq) & |
|
649 |
env \<in> list(A) & pair(M, env, notpq, z))" |
|
650 |
and |
|
651 |
Forall_replacement: |
|
652 |
"[|M(A); M(rp)|] |
|
653 |
==> strong_replacement |
|
654 |
(M, \<lambda>env z. \<exists>bo[M]. |
|
655 |
env \<in> list(A) & |
|
656 |
is_bool_of_o (M, |
|
657 |
\<forall>a[M]. \<forall>co[M]. \<forall>rpco[M]. |
|
658 |
a\<in>A --> is_Cons(M,a,env,co) --> |
|
659 |
fun_apply(M,rp,co,rpco) --> number1(M, rpco), |
|
660 |
bo) & |
|
661 |
pair(M,env,bo,z))" |
|
662 |
and |
|
663 |
formula_rec_replacement: |
|
664 |
--{*For the @{term transrec}*} |
|
665 |
"[|n \<in> nat; M(A)|] ==> transrec_replacement(M, satisfies_MH(M,A), n)" |
|
666 |
and |
|
667 |
formula_rec_lambda_replacement: |
|
668 |
--{*For the @{text "\<lambda>-abstraction"} in the @{term transrec} body*} |
|
13502 | 669 |
"[|M(g); M(A)|] ==> |
670 |
strong_replacement (M, |
|
671 |
\<lambda>x y. mem_formula(M,x) & |
|
672 |
(\<exists>c[M]. is_formula_case(M, satisfies_is_a(M,A), |
|
673 |
satisfies_is_b(M,A), |
|
674 |
satisfies_is_c(M,A,g), |
|
675 |
satisfies_is_d(M,A,g), x, c) & |
|
676 |
pair(M, x, c, y)))" |
|
13494 | 677 |
|
678 |
||
679 |
lemma (in M_satisfies) Member_replacement': |
|
680 |
"[|M(A); x \<in> nat; y \<in> nat|] |
|
681 |
==> strong_replacement |
|
682 |
(M, \<lambda>env z. env \<in> list(A) & |
|
683 |
z = \<langle>env, bool_of_o(nth(x, env) \<in> nth(y, env))\<rangle>)" |
|
684 |
by (insert Member_replacement, simp) |
|
685 |
||
686 |
lemma (in M_satisfies) Equal_replacement': |
|
687 |
"[|M(A); x \<in> nat; y \<in> nat|] |
|
688 |
==> strong_replacement |
|
689 |
(M, \<lambda>env z. env \<in> list(A) & |
|
690 |
z = \<langle>env, bool_of_o(nth(x, env) = nth(y, env))\<rangle>)" |
|
691 |
by (insert Equal_replacement, simp) |
|
692 |
||
693 |
lemma (in M_satisfies) Nand_replacement': |
|
694 |
"[|M(A); M(rp); M(rq)|] |
|
695 |
==> strong_replacement |
|
696 |
(M, \<lambda>env z. env \<in> list(A) & z = \<langle>env, not(rp`env and rq`env)\<rangle>)" |
|
697 |
by (insert Nand_replacement, simp) |
|
698 |
||
699 |
lemma (in M_satisfies) Forall_replacement': |
|
700 |
"[|M(A); M(rp)|] |
|
701 |
==> strong_replacement |
|
702 |
(M, \<lambda>env z. |
|
703 |
env \<in> list(A) & |
|
704 |
z = \<langle>env, bool_of_o (\<forall>a\<in>A. rp ` Cons(a,env) = 1)\<rangle>)" |
|
705 |
by (insert Forall_replacement, simp) |
|
706 |
||
707 |
lemma (in M_satisfies) a_closed: |
|
708 |
"[|M(A); x\<in>nat; y\<in>nat|] ==> M(satisfies_a(A,x,y))" |
|
709 |
apply (simp add: satisfies_a_def) |
|
710 |
apply (blast intro: lam_closed2 Member_replacement') |
|
711 |
done |
|
712 |
||
713 |
lemma (in M_satisfies) a_rel: |
|
714 |
"M(A) ==> Relativize2(M, nat, nat, satisfies_is_a(M,A), satisfies_a(A))" |
|
715 |
apply (simp add: Relativize2_def satisfies_is_a_def satisfies_a_def) |
|
716 |
apply (simp add: lambda_abs2 [OF Member_replacement'] Relativize1_def) |
|
717 |
done |
|
718 |
||
719 |
lemma (in M_satisfies) b_closed: |
|
720 |
"[|M(A); x\<in>nat; y\<in>nat|] ==> M(satisfies_b(A,x,y))" |
|
721 |
apply (simp add: satisfies_b_def) |
|
722 |
apply (blast intro: lam_closed2 Equal_replacement') |
|
723 |
done |
|
724 |
||
725 |
lemma (in M_satisfies) b_rel: |
|
726 |
"M(A) ==> Relativize2(M, nat, nat, satisfies_is_b(M,A), satisfies_b(A))" |
|
727 |
apply (simp add: Relativize2_def satisfies_is_b_def satisfies_b_def) |
|
728 |
apply (simp add: lambda_abs2 [OF Equal_replacement'] Relativize1_def) |
|
729 |
done |
|
730 |
||
731 |
lemma (in M_satisfies) c_closed: |
|
732 |
"[|M(A); x \<in> formula; y \<in> formula; M(rx); M(ry)|] |
|
733 |
==> M(satisfies_c(A,x,y,rx,ry))" |
|
734 |
apply (simp add: satisfies_c_def) |
|
735 |
apply (rule lam_closed2) |
|
736 |
apply (rule Nand_replacement') |
|
737 |
apply (simp_all add: formula_into_M list_into_M [of _ A]) |
|
738 |
done |
|
739 |
||
740 |
lemma (in M_satisfies) c_rel: |
|
741 |
"[|M(A); M(f)|] ==> |
|
742 |
Relativize2 (M, formula, formula, |
|
743 |
satisfies_is_c(M,A,f), |
|
744 |
\<lambda>u v. satisfies_c(A, u, v, f ` succ(depth(u)) ` u, |
|
745 |
f ` succ(depth(v)) ` v))" |
|
746 |
apply (simp add: Relativize2_def satisfies_is_c_def satisfies_c_def) |
|
747 |
apply (simp add: lambda_abs2 [OF Nand_replacement' triv_Relativize1] |
|
748 |
formula_into_M) |
|
749 |
done |
|
750 |
||
751 |
lemma (in M_satisfies) d_closed: |
|
752 |
"[|M(A); x \<in> formula; M(rx)|] ==> M(satisfies_d(A,x,rx))" |
|
753 |
apply (simp add: satisfies_d_def) |
|
754 |
apply (rule lam_closed2) |
|
755 |
apply (rule Forall_replacement') |
|
756 |
apply (simp_all add: formula_into_M list_into_M [of _ A]) |
|
757 |
done |
|
758 |
||
759 |
lemma (in M_satisfies) d_rel: |
|
760 |
"[|M(A); M(f)|] ==> |
|
761 |
Relativize1(M, formula, satisfies_is_d(M,A,f), |
|
762 |
\<lambda>u. satisfies_d(A, u, f ` succ(depth(u)) ` u))" |
|
763 |
apply (simp del: rall_abs |
|
764 |
add: Relativize1_def satisfies_is_d_def satisfies_d_def) |
|
765 |
apply (simp add: lambda_abs2 [OF Forall_replacement' triv_Relativize1] |
|
766 |
formula_into_M) |
|
767 |
done |
|
768 |
||
769 |
||
770 |
lemma (in M_satisfies) fr_replace: |
|
771 |
"[|n \<in> nat; M(A)|] ==> transrec_replacement(M,satisfies_MH(M,A),n)" |
|
772 |
by (blast intro: formula_rec_replacement) |
|
773 |
||
13502 | 774 |
lemma (in M_satisfies) formula_case_satisfies_closed: |
775 |
"[|M(g); M(A); x \<in> formula|] ==> |
|
776 |
M(formula_case (satisfies_a(A), satisfies_b(A), |
|
777 |
\<lambda>u v. satisfies_c(A, u, v, |
|
778 |
g ` succ(depth(u)) ` u, g ` succ(depth(v)) ` v), |
|
779 |
\<lambda>u. satisfies_d (A, u, g ` succ(depth(u)) ` u), |
|
780 |
x))" |
|
781 |
by (blast intro: formula_case_closed a_closed b_closed c_closed d_closed) |
|
782 |
||
13494 | 783 |
lemma (in M_satisfies) fr_lam_replace: |
13502 | 784 |
"[|M(g); M(A)|] ==> |
13494 | 785 |
strong_replacement (M, \<lambda>x y. x \<in> formula & |
786 |
y = \<langle>x, |
|
787 |
formula_rec_case(satisfies_a(A), |
|
788 |
satisfies_b(A), |
|
789 |
satisfies_c(A), |
|
790 |
satisfies_d(A), g, x)\<rangle>)" |
|
13502 | 791 |
apply (insert formula_rec_lambda_replacement) |
792 |
apply (simp add: formula_rec_case_def formula_case_satisfies_closed |
|
793 |
formula_case_abs [OF a_rel b_rel c_rel d_rel]) |
|
794 |
done |
|
13494 | 795 |
|
796 |
||
797 |
||
13502 | 798 |
text{*Instantiate locale @{text M_formula_rec} for the |
799 |
Function @{term satisfies}*} |
|
13494 | 800 |
|
13502 | 801 |
lemma (in M_satisfies) M_formula_rec_axioms_M: |
802 |
"M(A) ==> |
|
803 |
M_formula_rec_axioms(M, satisfies_a(A), satisfies_is_a(M,A), |
|
804 |
satisfies_b(A), satisfies_is_b(M,A), |
|
805 |
satisfies_c(A), satisfies_is_c(M,A), |
|
806 |
satisfies_d(A), satisfies_is_d(M,A))" |
|
807 |
apply (rule M_formula_rec_axioms.intro) |
|
808 |
apply (assumption | |
|
809 |
rule a_closed a_rel b_closed b_rel c_closed c_rel d_closed d_rel |
|
810 |
fr_replace [unfolded satisfies_MH_def] |
|
811 |
fr_lam_replace) + |
|
13494 | 812 |
done |
813 |
||
814 |
||
13502 | 815 |
theorem (in M_satisfies) M_formula_rec_M: |
816 |
"M(A) ==> |
|
817 |
PROP M_formula_rec(M, satisfies_a(A), satisfies_is_a(M,A), |
|
818 |
satisfies_b(A), satisfies_is_b(M,A), |
|
819 |
satisfies_c(A), satisfies_is_c(M,A), |
|
820 |
satisfies_d(A), satisfies_is_d(M,A))" |
|
821 |
apply (rule M_formula_rec.intro, assumption+) |
|
822 |
apply (erule M_formula_rec_axioms_M) |
|
13494 | 823 |
done |
824 |
||
13502 | 825 |
lemmas (in M_satisfies) |
826 |
satisfies_closed = M_formula_rec.formula_rec_closed [OF M_formula_rec_M] |
|
827 |
and |
|
828 |
satisfies_abs = M_formula_rec.formula_rec_abs [OF M_formula_rec_M]; |
|
13494 | 829 |
|
830 |
||
13502 | 831 |
lemma (in M_satisfies) satisfies_closed: |
832 |
"[|M(A); p \<in> formula|] ==> M(satisfies(A,p))" |
|
833 |
by (simp add: M_formula_rec.formula_rec_closed [OF M_formula_rec_M] |
|
834 |
satisfies_eq) |
|
13494 | 835 |
|
13502 | 836 |
lemma (in M_satisfies) satisfies_abs: |
837 |
"[|M(A); M(z); p \<in> formula|] |
|
838 |
==> is_satisfies(M,A,p,z) <-> z = satisfies(A,p)" |
|
839 |
by (simp only: M_formula_rec.formula_rec_abs [OF M_formula_rec_M] |
|
840 |
satisfies_eq is_satisfies_def) |
|
13494 | 841 |
|
842 |
||
13502 | 843 |
subsection{*Internalizations Needed to Instantiate @{text "M_satisfies"}*} |
13494 | 844 |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
845 |
subsubsection{*The Operator @{term is_depth_apply}, Internalized*} |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
846 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
847 |
(* is_depth_apply(M,h,p,z) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
848 |
\<exists>dp[M]. \<exists>sdp[M]. \<exists>hsdp[M]. |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
849 |
2 1 0 |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
850 |
finite_ordinal(M,dp) & is_depth(M,p,dp) & successor(M,dp,sdp) & |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
851 |
fun_apply(M,h,sdp,hsdp) & fun_apply(M,hsdp,p,z) *) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
852 |
constdefs depth_apply_fm :: "[i,i,i]=>i" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
853 |
"depth_apply_fm(h,p,z) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
854 |
Exists(Exists(Exists( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
855 |
And(finite_ordinal_fm(2), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
856 |
And(depth_fm(p#+3,2), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
857 |
And(succ_fm(2,1), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
858 |
And(fun_apply_fm(h#+3,1,0), fun_apply_fm(0,p#+3,z#+3))))))))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
859 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
860 |
lemma depth_apply_type [TC]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
861 |
"[| x \<in> nat; y \<in> nat; z \<in> nat |] ==> depth_apply_fm(x,y,z) \<in> formula" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
862 |
by (simp add: depth_apply_fm_def) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
863 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
864 |
lemma sats_depth_apply_fm [simp]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
865 |
"[| x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
866 |
==> sats(A, depth_apply_fm(x,y,z), env) <-> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
867 |
is_depth_apply(**A, nth(x,env), nth(y,env), nth(z,env))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
868 |
by (simp add: depth_apply_fm_def is_depth_apply_def) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
869 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
870 |
lemma depth_apply_iff_sats: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
871 |
"[| nth(i,env) = x; nth(j,env) = y; nth(k,env) = z; |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
872 |
i \<in> nat; j \<in> nat; k \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
873 |
==> is_depth_apply(**A, x, y, z) <-> sats(A, depth_apply_fm(i,j,k), env)" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
874 |
by simp |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
875 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
876 |
lemma depth_apply_reflection: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
877 |
"REFLECTS[\<lambda>x. is_depth_apply(L,f(x),g(x),h(x)), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
878 |
\<lambda>i x. is_depth_apply(**Lset(i),f(x),g(x),h(x))]" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
879 |
apply (simp only: is_depth_apply_def setclass_simps) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
880 |
apply (intro FOL_reflections function_reflections depth_reflection |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
881 |
finite_ordinal_reflection) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
882 |
done |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
883 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
884 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
885 |
subsubsection{*The Operator @{term satisfies_is_a}, Internalized*} |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
886 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
887 |
(* satisfies_is_a(M,A) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
888 |
\<lambda>x y zz. \<forall>lA[M]. is_list(M,A,lA) --> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
889 |
is_lambda(M, lA, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
890 |
\<lambda>env z. is_bool_of_o(M, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
891 |
\<exists>nx[M]. \<exists>ny[M]. |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
892 |
is_nth(M,x,env,nx) & is_nth(M,y,env,ny) & nx \<in> ny, z), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
893 |
zz) *) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
894 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
895 |
constdefs satisfies_is_a_fm :: "[i,i,i,i]=>i" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
896 |
"satisfies_is_a_fm(A,x,y,z) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
897 |
Forall( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
898 |
Implies(is_list_fm(succ(A),0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
899 |
lambda_fm( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
900 |
bool_of_o_fm(Exists( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
901 |
Exists(And(nth_fm(x#+6,3,1), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
902 |
And(nth_fm(y#+6,3,0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
903 |
Member(1,0))))), 0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
904 |
0, succ(z))))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
905 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
906 |
lemma satisfies_is_a_type [TC]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
907 |
"[| A \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat |] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
908 |
==> satisfies_is_a_fm(A,x,y,z) \<in> formula" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
909 |
by (simp add: satisfies_is_a_fm_def) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
910 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
911 |
lemma sats_satisfies_is_a_fm [simp]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
912 |
"[| u \<in> nat; x < length(env); y < length(env); z \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
913 |
==> sats(A, satisfies_is_a_fm(u,x,y,z), env) <-> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
914 |
satisfies_is_a(**A, nth(u,env), nth(x,env), nth(y,env), nth(z,env))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
915 |
apply (frule_tac x=x in lt_length_in_nat, assumption) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
916 |
apply (frule_tac x=y in lt_length_in_nat, assumption) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
917 |
apply (simp add: satisfies_is_a_fm_def satisfies_is_a_def sats_lambda_fm |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
918 |
sats_bool_of_o_fm) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
919 |
done |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
920 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
921 |
lemma satisfies_is_a_iff_sats: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
922 |
"[| nth(u,env) = nu; nth(x,env) = nx; nth(y,env) = ny; nth(z,env) = nz; |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
923 |
u \<in> nat; x < length(env); y < length(env); z \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
924 |
==> satisfies_is_a(**A,nu,nx,ny,nz) <-> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
925 |
sats(A, satisfies_is_a_fm(u,x,y,z), env)" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
926 |
by simp |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
927 |
|
13494 | 928 |
theorem satisfies_is_a_reflection: |
929 |
"REFLECTS[\<lambda>x. satisfies_is_a(L,f(x),g(x),h(x),g'(x)), |
|
930 |
\<lambda>i x. satisfies_is_a(**Lset(i),f(x),g(x),h(x),g'(x))]" |
|
931 |
apply (unfold satisfies_is_a_def) |
|
932 |
apply (intro FOL_reflections is_lambda_reflection bool_of_o_reflection |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
933 |
nth_reflection is_list_reflection) |
13494 | 934 |
done |
935 |
||
936 |
||
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
937 |
subsubsection{*The Operator @{term satisfies_is_b}, Internalized*} |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
938 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
939 |
(* satisfies_is_b(M,A) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
940 |
\<lambda>x y zz. \<forall>lA[M]. is_list(M,A,lA) --> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
941 |
is_lambda(M, lA, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
942 |
\<lambda>env z. is_bool_of_o(M, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
943 |
\<exists>nx[M]. is_nth(M,x,env,nx) & is_nth(M,y,env,nx), z), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
944 |
zz) *) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
945 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
946 |
constdefs satisfies_is_b_fm :: "[i,i,i,i]=>i" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
947 |
"satisfies_is_b_fm(A,x,y,z) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
948 |
Forall( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
949 |
Implies(is_list_fm(succ(A),0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
950 |
lambda_fm( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
951 |
bool_of_o_fm(Exists(And(nth_fm(x#+5,2,0), nth_fm(y#+5,2,0))), 0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
952 |
0, succ(z))))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
953 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
954 |
lemma satisfies_is_b_type [TC]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
955 |
"[| A \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat |] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
956 |
==> satisfies_is_b_fm(A,x,y,z) \<in> formula" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
957 |
by (simp add: satisfies_is_b_fm_def) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
958 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
959 |
lemma sats_satisfies_is_b_fm [simp]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
960 |
"[| u \<in> nat; x < length(env); y < length(env); z \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
961 |
==> sats(A, satisfies_is_b_fm(u,x,y,z), env) <-> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
962 |
satisfies_is_b(**A, nth(u,env), nth(x,env), nth(y,env), nth(z,env))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
963 |
apply (frule_tac x=x in lt_length_in_nat, assumption) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
964 |
apply (frule_tac x=y in lt_length_in_nat, assumption) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
965 |
apply (simp add: satisfies_is_b_fm_def satisfies_is_b_def sats_lambda_fm |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
966 |
sats_bool_of_o_fm) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
967 |
done |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
968 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
969 |
lemma satisfies_is_b_iff_sats: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
970 |
"[| nth(u,env) = nu; nth(x,env) = nx; nth(y,env) = ny; nth(z,env) = nz; |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
971 |
u \<in> nat; x < length(env); y < length(env); z \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
972 |
==> satisfies_is_b(**A,nu,nx,ny,nz) <-> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
973 |
sats(A, satisfies_is_b_fm(u,x,y,z), env)" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
974 |
by simp |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
975 |
|
13494 | 976 |
theorem satisfies_is_b_reflection: |
977 |
"REFLECTS[\<lambda>x. satisfies_is_b(L,f(x),g(x),h(x),g'(x)), |
|
978 |
\<lambda>i x. satisfies_is_b(**Lset(i),f(x),g(x),h(x),g'(x))]" |
|
979 |
apply (unfold satisfies_is_b_def) |
|
980 |
apply (intro FOL_reflections is_lambda_reflection bool_of_o_reflection |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
981 |
nth_reflection is_list_reflection) |
13494 | 982 |
done |
983 |
||
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
984 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
985 |
subsubsection{*The Operator @{term satisfies_is_c}, Internalized*} |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
986 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
987 |
(* satisfies_is_c(M,A,h) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
988 |
\<lambda>p q zz. \<forall>lA[M]. is_list(M,A,lA) --> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
989 |
is_lambda(M, lA, \<lambda>env z. \<exists>hp[M]. \<exists>hq[M]. |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
990 |
(\<exists>rp[M]. is_depth_apply(M,h,p,rp) & fun_apply(M,rp,env,hp)) & |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
991 |
(\<exists>rq[M]. is_depth_apply(M,h,q,rq) & fun_apply(M,rq,env,hq)) & |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
992 |
(\<exists>pq[M]. is_and(M,hp,hq,pq) & is_not(M,pq,z)), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
993 |
zz) *) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
994 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
995 |
constdefs satisfies_is_c_fm :: "[i,i,i,i,i]=>i" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
996 |
"satisfies_is_c_fm(A,h,p,q,zz) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
997 |
Forall( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
998 |
Implies(is_list_fm(succ(A),0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
999 |
lambda_fm( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1000 |
Exists(Exists( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1001 |
And(Exists(And(depth_apply_fm(h#+7,p#+7,0), fun_apply_fm(0,4,2))), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1002 |
And(Exists(And(depth_apply_fm(h#+7,q#+7,0), fun_apply_fm(0,4,1))), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1003 |
Exists(And(and_fm(2,1,0), not_fm(0,3))))))), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1004 |
0, succ(zz))))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1005 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1006 |
lemma satisfies_is_c_type [TC]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1007 |
"[| A \<in> nat; h \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat |] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1008 |
==> satisfies_is_c_fm(A,h,x,y,z) \<in> formula" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1009 |
by (simp add: satisfies_is_c_fm_def) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1010 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1011 |
lemma sats_satisfies_is_c_fm [simp]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1012 |
"[| u \<in> nat; v \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1013 |
==> sats(A, satisfies_is_c_fm(u,v,x,y,z), env) <-> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1014 |
satisfies_is_c(**A, nth(u,env), nth(v,env), nth(x,env), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1015 |
nth(y,env), nth(z,env))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1016 |
by (simp add: satisfies_is_c_fm_def satisfies_is_c_def sats_lambda_fm) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1017 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1018 |
lemma satisfies_is_c_iff_sats: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1019 |
"[| nth(u,env) = nu; nth(v,env) = nv; nth(x,env) = nx; nth(y,env) = ny; |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1020 |
nth(z,env) = nz; |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1021 |
u \<in> nat; v \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1022 |
==> satisfies_is_c(**A,nu,nv,nx,ny,nz) <-> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1023 |
sats(A, satisfies_is_c_fm(u,v,x,y,z), env)" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1024 |
by simp |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1025 |
|
13494 | 1026 |
theorem satisfies_is_c_reflection: |
1027 |
"REFLECTS[\<lambda>x. satisfies_is_c(L,f(x),g(x),h(x),g'(x),h'(x)), |
|
1028 |
\<lambda>i x. satisfies_is_c(**Lset(i),f(x),g(x),h(x),g'(x),h'(x))]" |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1029 |
apply (unfold satisfies_is_c_def) |
13494 | 1030 |
apply (intro FOL_reflections function_reflections is_lambda_reflection |
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1031 |
extra_reflections nth_reflection depth_apply_reflection |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1032 |
is_list_reflection) |
13494 | 1033 |
done |
1034 |
||
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1035 |
subsubsection{*The Operator @{term satisfies_is_d}, Internalized*} |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1036 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1037 |
(* satisfies_is_d(M,A,h) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1038 |
\<lambda>p zz. \<forall>lA[M]. is_list(M,A,lA) --> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1039 |
is_lambda(M, lA, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1040 |
\<lambda>env z. \<exists>rp[M]. is_depth_apply(M,h,p,rp) & |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1041 |
is_bool_of_o(M, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1042 |
\<forall>x[M]. \<forall>xenv[M]. \<forall>hp[M]. |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1043 |
x\<in>A --> is_Cons(M,x,env,xenv) --> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1044 |
fun_apply(M,rp,xenv,hp) --> number1(M,hp), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1045 |
z), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1046 |
zz) *) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1047 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1048 |
constdefs satisfies_is_d_fm :: "[i,i,i,i]=>i" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1049 |
"satisfies_is_d_fm(A,h,p,zz) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1050 |
Forall( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1051 |
Implies(is_list_fm(succ(A),0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1052 |
lambda_fm( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1053 |
Exists( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1054 |
And(depth_apply_fm(h#+5,p#+5,0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1055 |
bool_of_o_fm( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1056 |
Forall(Forall(Forall( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1057 |
Implies(Member(2,A#+8), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1058 |
Implies(Cons_fm(2,5,1), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1059 |
Implies(fun_apply_fm(3,1,0), number1_fm(0))))))), 1))), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1060 |
0, succ(zz))))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1061 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1062 |
lemma satisfies_is_d_type [TC]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1063 |
"[| A \<in> nat; h \<in> nat; x \<in> nat; z \<in> nat |] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1064 |
==> satisfies_is_d_fm(A,h,x,z) \<in> formula" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1065 |
by (simp add: satisfies_is_d_fm_def) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1066 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1067 |
lemma sats_satisfies_is_d_fm [simp]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1068 |
"[| u \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1069 |
==> sats(A, satisfies_is_d_fm(u,x,y,z), env) <-> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1070 |
satisfies_is_d(**A, nth(u,env), nth(x,env), nth(y,env), nth(z,env))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1071 |
by (simp add: satisfies_is_d_fm_def satisfies_is_d_def sats_lambda_fm |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1072 |
sats_bool_of_o_fm) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1073 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1074 |
lemma satisfies_is_d_iff_sats: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1075 |
"[| nth(u,env) = nu; nth(x,env) = nx; nth(y,env) = ny; nth(z,env) = nz; |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1076 |
u \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1077 |
==> satisfies_is_d(**A,nu,nx,ny,nz) <-> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1078 |
sats(A, satisfies_is_d_fm(u,x,y,z), env)" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1079 |
by simp |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1080 |
|
13494 | 1081 |
theorem satisfies_is_d_reflection: |
1082 |
"REFLECTS[\<lambda>x. satisfies_is_d(L,f(x),g(x),h(x),g'(x)), |
|
1083 |
\<lambda>i x. satisfies_is_d(**Lset(i),f(x),g(x),h(x),g'(x))]" |
|
1084 |
apply (unfold satisfies_is_d_def ) |
|
1085 |
apply (intro FOL_reflections function_reflections is_lambda_reflection |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1086 |
extra_reflections nth_reflection depth_apply_reflection |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1087 |
is_list_reflection) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1088 |
done |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1089 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1090 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1091 |
subsubsection{*The Operator @{term satisfies_MH}, Internalized*} |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1092 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1093 |
(* satisfies_MH == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1094 |
\<lambda>M A u f zz. |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1095 |
\<forall>fml[M]. is_formula(M,fml) --> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1096 |
is_lambda (M, fml, |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1097 |
is_formula_case (M, satisfies_is_a(M,A), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1098 |
satisfies_is_b(M,A), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1099 |
satisfies_is_c(M,A,f), satisfies_is_d(M,A,f)), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1100 |
zz) *) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1101 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1102 |
constdefs satisfies_MH_fm :: "[i,i,i,i]=>i" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1103 |
"satisfies_MH_fm(A,u,f,zz) == |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1104 |
Forall( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1105 |
Implies(is_formula_fm(0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1106 |
lambda_fm( |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1107 |
formula_case_fm(satisfies_is_a_fm(A#+7,2,1,0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1108 |
satisfies_is_b_fm(A#+7,2,1,0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1109 |
satisfies_is_c_fm(A#+7,f#+7,2,1,0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1110 |
satisfies_is_d_fm(A#+6,f#+6,1,0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1111 |
1, 0), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1112 |
0, succ(zz))))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1113 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1114 |
lemma satisfies_MH_type [TC]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1115 |
"[| A \<in> nat; u \<in> nat; x \<in> nat; z \<in> nat |] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1116 |
==> satisfies_MH_fm(A,u,x,z) \<in> formula" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1117 |
by (simp add: satisfies_MH_fm_def) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1118 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1119 |
lemma sats_satisfies_MH_fm [simp]: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1120 |
"[| u \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1121 |
==> sats(A, satisfies_MH_fm(u,x,y,z), env) <-> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1122 |
satisfies_MH(**A, nth(u,env), nth(x,env), nth(y,env), nth(z,env))" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1123 |
by (simp add: satisfies_MH_fm_def satisfies_MH_def sats_lambda_fm |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1124 |
sats_formula_case_fm) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1125 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1126 |
lemma satisfies_MH_iff_sats: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1127 |
"[| nth(u,env) = nu; nth(x,env) = nx; nth(y,env) = ny; nth(z,env) = nz; |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1128 |
u \<in> nat; x \<in> nat; y \<in> nat; z \<in> nat; env \<in> list(A)|] |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1129 |
==> satisfies_MH(**A,nu,nx,ny,nz) <-> |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1130 |
sats(A, satisfies_MH_fm(u,x,y,z), env)" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1131 |
by simp |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1132 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1133 |
lemmas satisfies_reflections = |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1134 |
is_lambda_reflection is_formula_reflection |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1135 |
is_formula_case_reflection |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1136 |
satisfies_is_a_reflection satisfies_is_b_reflection |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1137 |
satisfies_is_c_reflection satisfies_is_d_reflection |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1138 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1139 |
theorem satisfies_MH_reflection: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1140 |
"REFLECTS[\<lambda>x. satisfies_MH(L,f(x),g(x),h(x),g'(x)), |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1141 |
\<lambda>i x. satisfies_MH(**Lset(i),f(x),g(x),h(x),g'(x))]" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1142 |
apply (unfold satisfies_MH_def) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1143 |
apply (intro FOL_reflections satisfies_reflections) |
13494 | 1144 |
done |
1145 |
||
1146 |
||
13502 | 1147 |
subsection{*Lemmas for Instantiating the Locale @{text "M_satisfies"}*} |
1148 |
||
1149 |
||
1150 |
subsubsection{*The @{term "Member"} Case*} |
|
1151 |
||
1152 |
lemma Member_Reflects: |
|
1153 |
"REFLECTS[\<lambda>u. \<exists>v[L]. v \<in> B \<and> (\<exists>bo[L]. \<exists>nx[L]. \<exists>ny[L]. |
|
1154 |
v \<in> lstA \<and> is_nth(L,x,v,nx) \<and> is_nth(L,y,v,ny) \<and> |
|
1155 |
is_bool_of_o(L, nx \<in> ny, bo) \<and> pair(L,v,bo,u)), |
|
1156 |
\<lambda>i u. \<exists>v \<in> Lset(i). v \<in> B \<and> (\<exists>bo \<in> Lset(i). \<exists>nx \<in> Lset(i). \<exists>ny \<in> Lset(i). |
|
1157 |
v \<in> lstA \<and> is_nth(**Lset(i), x, v, nx) \<and> |
|
1158 |
is_nth(**Lset(i), y, v, ny) \<and> |
|
1159 |
is_bool_of_o(**Lset(i), nx \<in> ny, bo) \<and> pair(**Lset(i), v, bo, u))]" |
|
1160 |
by (intro FOL_reflections function_reflections nth_reflection |
|
1161 |
bool_of_o_reflection) |
|
1162 |
||
1163 |
||
1164 |
lemma Member_replacement: |
|
1165 |
"[|L(A); x \<in> nat; y \<in> nat|] |
|
1166 |
==> strong_replacement |
|
1167 |
(L, \<lambda>env z. \<exists>bo[L]. \<exists>nx[L]. \<exists>ny[L]. |
|
1168 |
env \<in> list(A) & is_nth(L,x,env,nx) & is_nth(L,y,env,ny) & |
|
1169 |
is_bool_of_o(L, nx \<in> ny, bo) & |
|
1170 |
pair(L, env, bo, z))" |
|
1171 |
apply (frule list_closed) |
|
1172 |
apply (rule strong_replacementI) |
|
1173 |
apply (rule rallI) |
|
1174 |
apply (rename_tac B) |
|
1175 |
apply (rule separation_CollectI) |
|
1176 |
apply (rule_tac A="{list(A),B,x,y,z}" in subset_LsetE, blast ) |
|
1177 |
apply (rule ReflectsE [OF Member_Reflects], assumption) |
|
1178 |
apply (drule subset_Lset_ltD, assumption) |
|
1179 |
apply (erule reflection_imp_L_separation) |
|
1180 |
apply (simp_all add: lt_Ord2) |
|
1181 |
apply (simp add: is_nth_def is_wfrec_def is_bool_of_o_def) |
|
1182 |
apply (rule DPow_LsetI) |
|
1183 |
apply (rename_tac u) |
|
1184 |
apply (rule bex_iff_sats conj_iff_sats conj_iff_sats)+ |
|
1185 |
apply (rule_tac env = "[v,u,list(A),B,x,y,z]" in mem_iff_sats) |
|
1186 |
apply (rule sep_rules is_nat_case_iff_sats iterates_MH_iff_sats |
|
1187 |
is_recfun_iff_sats hd_iff_sats tl_iff_sats quasinat_iff_sats |
|
1188 |
| simp)+ |
|
1189 |
done |
|
1190 |
||
1191 |
||
1192 |
subsubsection{*The @{term "Equal"} Case*} |
|
1193 |
||
1194 |
lemma Equal_Reflects: |
|
1195 |
"REFLECTS[\<lambda>u. \<exists>v[L]. v \<in> B \<and> (\<exists>bo[L]. \<exists>nx[L]. \<exists>ny[L]. |
|
1196 |
v \<in> lstA \<and> is_nth(L, x, v, nx) \<and> is_nth(L, y, v, ny) \<and> |
|
1197 |
is_bool_of_o(L, nx = ny, bo) \<and> pair(L, v, bo, u)), |
|
1198 |
\<lambda>i u. \<exists>v \<in> Lset(i). v \<in> B \<and> (\<exists>bo \<in> Lset(i). \<exists>nx \<in> Lset(i). \<exists>ny \<in> Lset(i). |
|
1199 |
v \<in> lstA \<and> is_nth(**Lset(i), x, v, nx) \<and> |
|
1200 |
is_nth(**Lset(i), y, v, ny) \<and> |
|
1201 |
is_bool_of_o(**Lset(i), nx = ny, bo) \<and> pair(**Lset(i), v, bo, u))]" |
|
1202 |
by (intro FOL_reflections function_reflections nth_reflection |
|
1203 |
bool_of_o_reflection) |
|
1204 |
||
1205 |
||
1206 |
lemma Equal_replacement: |
|
1207 |
"[|L(A); x \<in> nat; y \<in> nat|] |
|
1208 |
==> strong_replacement |
|
1209 |
(L, \<lambda>env z. \<exists>bo[L]. \<exists>nx[L]. \<exists>ny[L]. |
|
1210 |
env \<in> list(A) & is_nth(L,x,env,nx) & is_nth(L,y,env,ny) & |
|
1211 |
is_bool_of_o(L, nx = ny, bo) & |
|
1212 |
pair(L, env, bo, z))" |
|
1213 |
apply (frule list_closed) |
|
1214 |
apply (rule strong_replacementI) |
|
1215 |
apply (rule rallI) |
|
1216 |
apply (rename_tac B) |
|
1217 |
apply (rule separation_CollectI) |
|
1218 |
apply (rule_tac A="{list(A),B,x,y,z}" in subset_LsetE, blast ) |
|
1219 |
apply (rule ReflectsE [OF Equal_Reflects], assumption) |
|
1220 |
apply (drule subset_Lset_ltD, assumption) |
|
1221 |
apply (erule reflection_imp_L_separation) |
|
1222 |
apply (simp_all add: lt_Ord2) |
|
1223 |
apply (simp add: is_nth_def is_wfrec_def is_bool_of_o_def) |
|
1224 |
apply (rule DPow_LsetI) |
|
1225 |
apply (rename_tac u) |
|
1226 |
apply (rule bex_iff_sats conj_iff_sats conj_iff_sats)+ |
|
1227 |
apply (rule_tac env = "[v,u,list(A),B,x,y,z]" in mem_iff_sats) |
|
1228 |
apply (rule sep_rules is_nat_case_iff_sats iterates_MH_iff_sats |
|
1229 |
is_recfun_iff_sats hd_iff_sats tl_iff_sats quasinat_iff_sats |
|
1230 |
| simp)+ |
|
1231 |
done |
|
1232 |
||
1233 |
subsubsection{*The @{term "Nand"} Case*} |
|
1234 |
||
1235 |
lemma Nand_Reflects: |
|
1236 |
"REFLECTS [\<lambda>x. \<exists>u[L]. u \<in> B \<and> |
|
1237 |
(\<exists>rpe[L]. \<exists>rqe[L]. \<exists>andpq[L]. \<exists>notpq[L]. |
|
1238 |
fun_apply(L, rp, u, rpe) \<and> fun_apply(L, rq, u, rqe) \<and> |
|
1239 |
is_and(L, rpe, rqe, andpq) \<and> is_not(L, andpq, notpq) \<and> |
|
1240 |
u \<in> list(A) \<and> pair(L, u, notpq, x)), |
|
1241 |
\<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B \<and> |
|
1242 |
(\<exists>rpe \<in> Lset(i). \<exists>rqe \<in> Lset(i). \<exists>andpq \<in> Lset(i). \<exists>notpq \<in> Lset(i). |
|
1243 |
fun_apply(**Lset(i), rp, u, rpe) \<and> fun_apply(**Lset(i), rq, u, rqe) \<and> |
|
1244 |
is_and(**Lset(i), rpe, rqe, andpq) \<and> is_not(**Lset(i), andpq, notpq) \<and> |
|
1245 |
u \<in> list(A) \<and> pair(**Lset(i), u, notpq, x))]" |
|
1246 |
apply (unfold is_and_def is_not_def) |
|
1247 |
apply (intro FOL_reflections function_reflections) |
|
1248 |
done |
|
1249 |
||
1250 |
lemma Nand_replacement: |
|
1251 |
"[|L(A); L(rp); L(rq)|] |
|
1252 |
==> strong_replacement |
|
1253 |
(L, \<lambda>env z. \<exists>rpe[L]. \<exists>rqe[L]. \<exists>andpq[L]. \<exists>notpq[L]. |
|
1254 |
fun_apply(L,rp,env,rpe) & fun_apply(L,rq,env,rqe) & |
|
1255 |
is_and(L,rpe,rqe,andpq) & is_not(L,andpq,notpq) & |
|
1256 |
env \<in> list(A) & pair(L, env, notpq, z))" |
|
1257 |
apply (frule list_closed) |
|
1258 |
apply (rule strong_replacementI) |
|
1259 |
apply (rule rallI) |
|
1260 |
apply (rename_tac B) |
|
1261 |
apply (rule separation_CollectI) |
|
1262 |
apply (rule_tac A="{list(A),B,rp,rq,z}" in subset_LsetE, blast ) |
|
1263 |
apply (rule ReflectsE [OF Nand_Reflects], assumption) |
|
1264 |
apply (drule subset_Lset_ltD, assumption) |
|
1265 |
apply (erule reflection_imp_L_separation) |
|
1266 |
apply (simp_all add: lt_Ord2) |
|
1267 |
apply (simp add: is_and_def is_not_def) |
|
1268 |
apply (rule DPow_LsetI) |
|
1269 |
apply (rename_tac v) |
|
1270 |
apply (rule bex_iff_sats conj_iff_sats conj_iff_sats)+ |
|
1271 |
apply (rule_tac env = "[u,v,list(A),B,rp,rq,z]" in mem_iff_sats) |
|
1272 |
apply (rule sep_rules | simp)+ |
|
1273 |
done |
|
1274 |
||
1275 |
||
1276 |
subsubsection{*The @{term "Forall"} Case*} |
|
1277 |
||
1278 |
lemma Forall_Reflects: |
|
1279 |
"REFLECTS [\<lambda>x. \<exists>u[L]. u \<in> B \<and> (\<exists>bo[L]. u \<in> list(A) \<and> |
|
1280 |
is_bool_of_o (L, |
|
1281 |
\<forall>a[L]. \<forall>co[L]. \<forall>rpco[L]. a \<in> A \<longrightarrow> |
|
1282 |
is_Cons(L,a,u,co) \<longrightarrow> fun_apply(L,rp,co,rpco) \<longrightarrow> |
|
1283 |
number1(L,rpco), |
|
1284 |
bo) \<and> pair(L,u,bo,x)), |
|
1285 |
\<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B \<and> (\<exists>bo \<in> Lset(i). u \<in> list(A) \<and> |
|
1286 |
is_bool_of_o (**Lset(i), |
|
1287 |
\<forall>a \<in> Lset(i). \<forall>co \<in> Lset(i). \<forall>rpco \<in> Lset(i). a \<in> A \<longrightarrow> |
|
1288 |
is_Cons(**Lset(i),a,u,co) \<longrightarrow> fun_apply(**Lset(i),rp,co,rpco) \<longrightarrow> |
|
1289 |
number1(**Lset(i),rpco), |
|
1290 |
bo) \<and> pair(**Lset(i),u,bo,x))]" |
|
1291 |
apply (unfold is_bool_of_o_def) |
|
1292 |
apply (intro FOL_reflections function_reflections Cons_reflection) |
|
1293 |
done |
|
1294 |
||
1295 |
lemma Forall_replacement: |
|
1296 |
"[|L(A); L(rp)|] |
|
1297 |
==> strong_replacement |
|
1298 |
(L, \<lambda>env z. \<exists>bo[L]. |
|
1299 |
env \<in> list(A) & |
|
1300 |
is_bool_of_o (L, |
|
1301 |
\<forall>a[L]. \<forall>co[L]. \<forall>rpco[L]. |
|
1302 |
a\<in>A --> is_Cons(L,a,env,co) --> |
|
1303 |
fun_apply(L,rp,co,rpco) --> number1(L, rpco), |
|
1304 |
bo) & |
|
1305 |
pair(L,env,bo,z))" |
|
1306 |
apply (frule list_closed) |
|
1307 |
apply (rule strong_replacementI) |
|
1308 |
apply (rule rallI) |
|
1309 |
apply (rename_tac B) |
|
1310 |
apply (rule separation_CollectI) |
|
1311 |
apply (rule_tac A="{A,list(A),B,rp,z}" in subset_LsetE, blast ) |
|
1312 |
apply (rule ReflectsE [OF Forall_Reflects], assumption) |
|
1313 |
apply (drule subset_Lset_ltD, assumption) |
|
1314 |
apply (erule reflection_imp_L_separation) |
|
1315 |
apply (simp_all add: lt_Ord2) |
|
1316 |
apply (simp add: is_bool_of_o_def) |
|
1317 |
apply (rule DPow_LsetI) |
|
1318 |
apply (rename_tac v) |
|
1319 |
apply (rule bex_iff_sats conj_iff_sats conj_iff_sats)+ |
|
1320 |
apply (rule_tac env = "[u,v,A,list(A),B,rp,z]" in mem_iff_sats) |
|
1321 |
apply (rule sep_rules Cons_iff_sats | simp)+ |
|
1322 |
done |
|
1323 |
||
1324 |
subsubsection{*The @{term "transrec_replacement"} Case*} |
|
1325 |
||
13494 | 1326 |
lemma formula_rec_replacement_Reflects: |
1327 |
"REFLECTS [\<lambda>x. \<exists>u[L]. u \<in> B \<and> (\<exists>y[L]. pair(L, u, y, x) \<and> |
|
1328 |
is_wfrec (L, satisfies_MH(L,A), mesa, u, y)), |
|
1329 |
\<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B \<and> (\<exists>y \<in> Lset(i). pair(**Lset(i), u, y, x) \<and> |
|
1330 |
is_wfrec (**Lset(i), satisfies_MH(**Lset(i),A), mesa, u, y))]" |
|
13496
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1331 |
by (intro FOL_reflections function_reflections satisfies_MH_reflection |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1332 |
is_wfrec_reflection) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1333 |
|
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1334 |
lemma formula_rec_replacement: |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1335 |
--{*For the @{term transrec}*} |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1336 |
"[|n \<in> nat; L(A)|] ==> transrec_replacement(L, satisfies_MH(L,A), n)" |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1337 |
apply (subgoal_tac "L(Memrel(eclose({n})))") |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1338 |
prefer 2 apply (simp add: nat_into_M) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1339 |
apply (rule transrec_replacementI) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1340 |
apply (simp add: nat_into_M) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1341 |
apply (rule strong_replacementI) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1342 |
apply (rule rallI) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1343 |
apply (rename_tac B) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1344 |
apply (rule separation_CollectI) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1345 |
apply (rule_tac A="{B,A,n,z,Memrel(eclose({n}))}" in subset_LsetE, blast ) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1346 |
apply (rule ReflectsE [OF formula_rec_replacement_Reflects], assumption) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1347 |
apply (drule subset_Lset_ltD, assumption) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1348 |
apply (erule reflection_imp_L_separation) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1349 |
apply (simp_all add: lt_Ord2 Memrel_closed) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1350 |
apply (elim conjE) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1351 |
apply (rule DPow_LsetI) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1352 |
apply (rename_tac v) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1353 |
apply (rule bex_iff_sats conj_iff_sats)+ |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1354 |
apply (rule_tac env = "[u,v,A,n,B,Memrel(eclose({n}))]" in mem_iff_sats) |
6f0c57def6d5
In ZF/Constructible, moved many results from Satisfies_absolute, etc., to
paulson
parents:
13494
diff
changeset
|
1355 |
apply (rule sep_rules satisfies_MH_iff_sats is_wfrec_iff_sats | simp)+ |
13494 | 1356 |
done |
1357 |
||
13502 | 1358 |
|
1359 |
subsubsection{*The Lambda Replacement Case*} |
|
1360 |
||
1361 |
lemma formula_rec_lambda_replacement_Reflects: |
|
1362 |
"REFLECTS [\<lambda>x. \<exists>u[L]. u \<in> B & |
|
1363 |
mem_formula(L,u) & |
|
1364 |
(\<exists>c[L]. |
|
1365 |
is_formula_case |
|
1366 |
(L, satisfies_is_a(L,A), satisfies_is_b(L,A), |
|
1367 |
satisfies_is_c(L,A,g), satisfies_is_d(L,A,g), |
|
1368 |
u, c) & |
|
1369 |
pair(L,u,c,x)), |
|
1370 |
\<lambda>i x. \<exists>u \<in> Lset(i). u \<in> B & mem_formula(**Lset(i),u) & |
|
1371 |
(\<exists>c \<in> Lset(i). |
|
1372 |
is_formula_case |
|
1373 |
(**Lset(i), satisfies_is_a(**Lset(i),A), satisfies_is_b(**Lset(i),A), |
|
1374 |
satisfies_is_c(**Lset(i),A,g), satisfies_is_d(**Lset(i),A,g), |
|
1375 |
u, c) & |
|
1376 |
pair(**Lset(i),u,c,x))]" |
|
1377 |
by (intro FOL_reflections function_reflections mem_formula_reflection |
|
1378 |
is_formula_case_reflection satisfies_is_a_reflection |
|
1379 |
satisfies_is_b_reflection satisfies_is_c_reflection |
|
1380 |
satisfies_is_d_reflection) |
|
1381 |
||
1382 |
lemma formula_rec_lambda_replacement: |
|
1383 |
--{*For the @{term transrec}*} |
|
1384 |
"[|L(g); L(A)|] ==> |
|
1385 |
strong_replacement (L, |
|
1386 |
\<lambda>x y. mem_formula(L,x) & |
|
1387 |
(\<exists>c[L]. is_formula_case(L, satisfies_is_a(L,A), |
|
1388 |
satisfies_is_b(L,A), |
|
1389 |
satisfies_is_c(L,A,g), |
|
1390 |
satisfies_is_d(L,A,g), x, c) & |
|
1391 |
pair(L, x, c, y)))" |
|
1392 |
apply (rule strong_replacementI) |
|
1393 |
apply (rule rallI) |
|
1394 |
apply (rename_tac B) |
|
1395 |
apply (rule separation_CollectI) |
|
1396 |
apply (rule_tac A="{B,A,g,z}" in subset_LsetE, blast) |
|
1397 |
apply (rule ReflectsE [OF formula_rec_lambda_replacement_Reflects], assumption) |
|
1398 |
apply (drule subset_Lset_ltD, assumption) |
|
1399 |
apply (erule reflection_imp_L_separation) |
|
1400 |
apply (simp_all add: lt_Ord2 Memrel_closed) |
|
1401 |
apply (elim conjE) |
|
1402 |
apply (rule DPow_LsetI) |
|
1403 |
apply (rename_tac v) |
|
1404 |
apply (rule bex_iff_sats conj_iff_sats)+ |
|
1405 |
apply (rule_tac env = "[u,v,A,g,B]" in mem_iff_sats) |
|
1406 |
apply (rule sep_rules mem_formula_iff_sats |
|
1407 |
formula_case_iff_sats satisfies_is_a_iff_sats |
|
1408 |
satisfies_is_b_iff_sats satisfies_is_c_iff_sats |
|
1409 |
satisfies_is_d_iff_sats | simp)+ |
|
1410 |
done |
|
1411 |
||
1412 |
||
1413 |
subsection{*Instantiating @{text M_satisfies}*} |
|
1414 |
||
1415 |
lemma M_satisfies_axioms_L: "M_satisfies_axioms(L)" |
|
1416 |
apply (rule M_satisfies_axioms.intro) |
|
1417 |
apply (assumption | rule |
|
1418 |
Member_replacement Equal_replacement |
|
1419 |
Nand_replacement Forall_replacement |
|
1420 |
formula_rec_replacement formula_rec_lambda_replacement)+ |
|
1421 |
done |
|
1422 |
||
1423 |
theorem M_satisfies_L: "PROP M_satisfies(L)" |
|
1424 |
apply (rule M_satisfies.intro) |
|
1425 |
apply (rule M_eclose.axioms [OF M_eclose_L])+ |
|
1426 |
apply (rule M_satisfies_axioms_L) |
|
1427 |
done |
|
1428 |
||
13494 | 1429 |
end |