@@ -21,6 +21,11 @@ theorem eFresh_mem {x y: EVar} (phi: Pattern x y)
2121theorem eFresh_ctximp_same_var {box: SVar} (ctx phi: Pattern box):
2222 $ _eFresh x (ctximp_app box ctx phi) $ =
2323 '(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);
2429
2530theorem sFresh_ceil {X: SVar} (phi: Pattern X)
2631 (h: $ _sFresh X phi $):
@@ -114,6 +119,12 @@ theorem prop_43_exists {box: SVar} {x: EVar} (ctx: Pattern box) (phi: Pattern bo
114119 $ (exists x (app[ phi / box ] ctx)) -> app[ exists x phi / box ] ctx $ =
115120 '(exists_generalization (eFresh_appCtx eFresh_disjoint eFresh_exists_same_var) (framing exists_intro_same_var));
116121
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+
117128theorem exists_appCtx {x: EVar} {box: SVar} (ctx: Pattern box) (phi: Pattern x):
118129 $ (app[ exists x phi / box ] ctx) <-> exists x (app[ phi / box ] ctx) $ =
119130 '(ibii propag_exists_disjoint prop_43_exists);
@@ -246,6 +257,16 @@ theorem var_subst {x y: EVar} (phi: Pattern x y):
246257theorem var_subst_same_var {x: EVar} (phi: Pattern x):
247258 $ (forall x phi) -> phi $ = '(con1 exists_intro_same_var);
248259
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+
249270theorem lemma_46 (phi: Pattern) {box: SVar} (ctx: Pattern box)
250271 (p : $ phi $):
251272 $ ~ (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)
555576 (imim2 @ norm (norm_imp_l @ norm_trans appCtxNested_disjoint @ norm_ctxApp_pt norm_refl defNorm) (! lemma_56 box2))
556577 );
557578
558- theorem appCtx_pointwise {box: SVar} (ctx: Pattern box) (phi: Pattern):
579+ theorem appCtx_pointwise {box: SVar} {x: EVar} (ctx: Pattern box) (phi: Pattern):
559580 $ app[ phi / box ] ctx <-> exists x ((app[ eVar x / box ] ctx) /\ x in phi) $ =
560581 '(bitr (cong_of_equiv_appCtx (bicom lemma_62)) @
561582 bitr exists_appCtx @
@@ -1027,6 +1048,12 @@ do {
10271048 (def (func_subst x phi1 phi1_pf func_phi2) '(
10281049 exists_generalization_disjoint (mp (com12 @ syl anl ,(func_subst_explicit_helper x phi1)) ,phi1_pf) ,func_phi2
10291050 ))
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+ ))
10301057 (def (func_subst_thm func_phi2 x phi1) '(
10311058 exists_generalization_disjoint (mp (com12 @ syl anl ,(func_subst_explicit_helper x (nth 4 @ get-decl phi1))) ,phi1) ,func_phi2
10321059 ))
@@ -1101,6 +1128,12 @@ theorem propag_mem_test_12 {x y z: EVar}:
11011128 (propag_mem 'x $~(app (sym defSym) (bot -> eVar y))$);
11021129
11031130
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+
11041137theorem lemma_14_subset {box: SVar} (ctx psi phi1 phi2: Pattern box)
11051138 (h: $ |_ psi _| -> (phi1 C= phi2) $):
11061139 $ |_ 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
12081241
12091242do {
12101243 (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