@@ -21,6 +21,11 @@ theorem eFresh_mem {x y: EVar} (phi: Pattern x y)
21
21
theorem eFresh_ctximp_same_var {box: SVar} (ctx phi: Pattern box):
22
22
$ _eFresh x (ctximp_app box ctx phi) $ =
23
23
'(eFresh_exists_same_var);
24
+ theorem eFresh_subset {x: EVar} (phi psi: Pattern x)
25
+ (h1: $ _eFresh x phi $)
26
+ (h2: $ _eFresh x psi $):
27
+ $ _eFresh x (phi C= psi) $ =
28
+ '(eFresh_not @ eFresh_ceil @ eFresh_not @ eFresh_imp h1 h2);
24
29
25
30
theorem sFresh_ceil {X: SVar} (phi: Pattern X)
26
31
(h: $ _sFresh X phi $):
@@ -114,6 +119,12 @@ theorem prop_43_exists {box: SVar} {x: EVar} (ctx: Pattern box) (phi: Pattern bo
114
119
$ (exists x (app[ phi / box ] ctx)) -> app[ exists x phi / box ] ctx $ =
115
120
'(exists_generalization (eFresh_appCtx eFresh_disjoint eFresh_exists_same_var) (framing exists_intro_same_var));
116
121
122
+ theorem prop_43_exists_fresh {box: SVar} {x: EVar} (ctx phi: Pattern box x)
123
+ (ctx_fresh: $ _eFresh x ctx $):
124
+ $ (exists x (app[ phi / box ] ctx)) -> app[ exists x phi / box ] ctx $ =
125
+ '(exists_generalization (eFresh_appCtx ctx_fresh eFresh_exists_same_var) (framing exists_intro_same_var));
126
+
127
+
117
128
theorem exists_appCtx {x: EVar} {box: SVar} (ctx: Pattern box) (phi: Pattern x):
118
129
$ (app[ exists x phi / box ] ctx) <-> exists x (app[ phi / box ] ctx) $ =
119
130
'(ibii propag_exists_disjoint prop_43_exists);
@@ -246,6 +257,16 @@ theorem var_subst {x y: EVar} (phi: Pattern x y):
246
257
theorem var_subst_same_var {x: EVar} (phi: Pattern x):
247
258
$ (forall x phi) -> phi $ = '(con1 exists_intro_same_var);
248
259
260
+
261
+ theorem imp_forall_fresh {x: EVar} (phi1 phi2: Pattern x) (freshness_phi1: $ _eFresh x phi1 $):
262
+ $ (phi1 -> forall x phi2) <-> forall x (phi1 -> phi2) $ =
263
+ '(con2b @ bitr (cong_of_equiv_exists @ con3b @ imeq2i notnot) @ and_exists_fresh freshness_phi1);
264
+
265
+ theorem imp_forall {x: EVar} (phi1: Pattern) (phi2: Pattern x):
266
+ $ (phi1 -> forall x phi2) <-> forall x (phi1 -> phi2) $ =
267
+ '(imp_forall_fresh eFresh_disjoint);
268
+
269
+
249
270
theorem lemma_46 (phi: Pattern) {box: SVar} (ctx: Pattern box)
250
271
(p : $ phi $):
251
272
$ ~ (app[ (~ phi) / box ] ctx) $ = '(syl propag_bot @ framing @ notnot1 p);
@@ -555,7 +576,7 @@ theorem lemma_14 {box: SVar} (ctx psi phi1 phi2: Pattern box)
555
576
(imim2 @ norm (norm_imp_l @ norm_trans appCtxNested_disjoint @ norm_ctxApp_pt norm_refl defNorm) (! lemma_56 box2))
556
577
);
557
578
558
- theorem appCtx_pointwise {box: SVar} (ctx: Pattern box) (phi: Pattern):
579
+ theorem appCtx_pointwise {box: SVar} {x: EVar} (ctx: Pattern box) (phi: Pattern):
559
580
$ app[ phi / box ] ctx <-> exists x ((app[ eVar x / box ] ctx) /\ x in phi) $ =
560
581
'(bitr (cong_of_equiv_appCtx (bicom lemma_62)) @
561
582
bitr exists_appCtx @
@@ -1027,6 +1048,12 @@ do {
1027
1048
(def (func_subst x phi1 phi1_pf func_phi2) '(
1028
1049
exists_generalization_disjoint (mp (com12 @ syl anl ,(func_subst_explicit_helper x phi1)) ,phi1_pf) ,func_phi2
1029
1050
))
1051
+ (def (func_subst_alt x phi1 func_phi2) '(
1052
+ anr imp_exists_disjoint (mp (exists_framing @ syl anr ,(func_subst_explicit_helper x phi1)) ,func_phi2)
1053
+ ))
1054
+ (def (func_subst_alt_thm_sorted x phi1) '(
1055
+ syl (rsyl (exists_framing imancom) (anr imp_exists_disjoint)) @ exists_framing @ anim2 @ syl anr ,(func_subst_explicit_helper x phi1)
1056
+ ))
1030
1057
(def (func_subst_thm func_phi2 x phi1) '(
1031
1058
exists_generalization_disjoint (mp (com12 @ syl anl ,(func_subst_explicit_helper x (nth 4 @ get-decl phi1))) ,phi1) ,func_phi2
1032
1059
))
@@ -1101,6 +1128,12 @@ theorem propag_mem_test_12 {x y z: EVar}:
1101
1128
(propag_mem 'x $~(app (sym defSym) (bot -> eVar y))$);
1102
1129
1103
1130
1131
+
1132
+ theorem eq_equiv_to_eq_eq
1133
+ (eq_equiv: $ (phi1 == phi2) -> (psi1 <-> psi2) $):
1134
+ $ (phi1 == phi2) -> (psi1 == psi2) $ =
1135
+ '(syl (framing_floor eq_equiv) @ anr floor_idem);
1136
+
1104
1137
theorem lemma_14_subset {box: SVar} (ctx psi phi1 phi2: Pattern box)
1105
1138
(h: $ |_ psi _| -> (phi1 C= phi2) $):
1106
1139
$ |_ psi _| -> ((app[ phi1 / box ] ctx) C= app[ phi2 / box ] ctx) $ =
@@ -1208,4 +1241,17 @@ theorem pointwise_decomposition_imp {box: SVar} {x: EVar} (ctx: Pattern box) (ph
1208
1241
1209
1242
do {
1210
1243
(def (pointwise_decomposition_imp_subst subst) '(norm (norm_imp (norm_forall @ norm_imp_r @ norm_subset ,subst norm_refl) @ norm_subset ,subst norm_refl) pointwise_decomposition_imp))
1211
- };
1244
+ };
1245
+
1246
+ theorem subset_mem_disjoint_lemma {x: EVar} (phi: Pattern) (psi: Pattern x)
1247
+ (freshness_psi: $ _eFresh x psi $):
1248
+ $ (phi C= psi) -> forall x ((x in phi) -> x in psi) $ =
1249
+ '(anr (imp_forall_fresh @ eFresh_subset eFresh_disjoint freshness_psi) @ univ_gene @ com12 @ rsyl eVar_in_subset_forward @ rsyl subset_trans @ imim2 eVar_in_subset_reverse);
1250
+
1251
+ do {
1252
+ (def (forall_imp_climb n) (iterate n (fn (pf) '(syl (anl imp_forall) @ imim2 ,pf)) 'id))
1253
+
1254
+ (def (inst_foralls n) (if {n = 0} 'id
1255
+ '(rsyl (rsyl ,(inst_foralls {n - 1}) ,(forall_imp_climb {n - 1})) var_subst_same_var)
1256
+ ))
1257
+ };
0 commit comments