Skip to content

Commit 2b4c74b

Browse files
committed
wip
1 parent 1ba6ea0 commit 2b4c74b

File tree

4 files changed

+48
-21
lines changed

4 files changed

+48
-21
lines changed

12-proof-system-p.mm1

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ theorem prop_43_exists {box: SVar} {x: EVar} (ctx: Pattern box) (phi: Pattern bo
119119
$ (exists x (app[ phi / box ] ctx)) -> app[ exists x phi / box ] ctx $ =
120120
'(exists_generalization (eFresh_appCtx eFresh_disjoint eFresh_exists_same_var) (framing exists_intro_same_var));
121121

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+
122128
theorem exists_appCtx {x: EVar} {box: SVar} (ctx: Pattern box) (phi: Pattern x):
123129
$ (app[ exists x phi / box ] ctx) <-> exists x (app[ phi / box ] ctx) $ =
124130
'(ibii propag_exists_disjoint prop_43_exists);
@@ -1038,6 +1044,9 @@ do {
10381044
(def (func_subst x phi1 phi1_pf func_phi2) '(
10391045
exists_generalization_disjoint (mp (com12 @ syl anl ,(func_subst_explicit_helper x phi1)) ,phi1_pf) ,func_phi2
10401046
))
1047+
(def (func_subst_alt x phi1 func_phi2) '(
1048+
anr imp_exists_disjoint (mp (exists_framing @ syl anr ,(func_subst_explicit_helper x phi1)) ,func_phi2)
1049+
))
10411050
(def (func_subst_thm func_phi2 x phi1) '(
10421051
exists_generalization_disjoint (mp (com12 @ syl anl ,(func_subst_explicit_helper x (nth 4 @ get-decl phi1))) ,phi1) ,func_phi2
10431052
))
@@ -1231,7 +1240,3 @@ theorem in_exists_lemma {x: EVar} (phi: Pattern x): $ (x in exists x (eVar x /\
12311240
theorem in_exists_to_forall_domain {x: EVar} (pred: Pattern x) (phi: Pattern):
12321241
$ (phi C= exists x (eVar x /\ pred)) -> forall x (x in phi -> x in pred)$ =
12331242
'(rsyl (subset_mem_disjoint_lemma eFresh_exists_same_var) @ forall_framing @ imim2 in_exists_lemma);
1234-
1235-
theorem eq_pred_pointwise {box1 box2: SVar} {x: EVar} (phi: Pattern x box1 box2) (ctx1 ctx2: Pattern x box1 box2):
1236-
$ (phi C= exists x (eVar x /\ ((app[ eVar x / box1 ] ctx1) == (app[ eVar x / box2 ] ctx2)))) ->
1237-
((app[ phi / box1 ] ctx1) == (app[ phi / box2 ] ctx2)) $ = '();

nominal/core.mm1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ term abstraction_sym: Symbol;
2727
def abstraction (phi rho: Pattern): Pattern = $ (sym abstraction_sym) @@ phi @@ rho $;
2828
term supp_sym: Symbol;
2929
def supp (phi: Pattern): Pattern = $ (sym supp_sym) @@ phi $;
30-
def fresh_for {a: EVar} (phi: Pattern a): Pattern a = $ ~ (a in supp phi) $;
30+
def fresh_for (phi psi: Pattern): Pattern = $ ~ (phi C= supp psi) $;
3131

3232
def EV_pattern {.a .b: EVar} (alpha phi: Pattern): Pattern =
3333
$ s_forall alpha a (s_forall alpha b ((swap a b phi) == phi)) $;
@@ -88,7 +88,7 @@ axiom F1 (alpha tau: Pattern) {a b: EVar} (phi: Pattern a b):
8888
$ (is_atom a alpha) ->
8989
(is_atom b alpha) ->
9090
(is_of_sort phi tau) ->
91-
((fresh_for a phi) /\ (fresh_for b phi) -> ((swap a b phi) == phi)) $;
91+
((fresh_for (eVar a) phi) /\ (fresh_for (eVar b) phi) -> ((swap a b phi) == phi)) $;
9292
axiom F2 (alpha: Pattern) {a b: EVar}:
9393
$ is_atom_sort alpha $ >
9494
$ (is_atom a alpha) ->
@@ -100,12 +100,12 @@ axiom F3 (alpha1 alpha2: Pattern) {a b: EVar}:
100100
$ (is_atom a alpha1) ->
101101
(is_atom b alpha2) ->
102102
(alpha1 != alpha2) ->
103-
(fresh_for a (eVar b)) $;
103+
((eVar a) != (eVar b)) $;
104104
axiom F4 (alpha tau phi: Pattern) {a: EVar}:
105105
$ is_atom_sort alpha $ >
106106
$ is_nominal_sort tau $ >
107107
$ (is_of_sort phi tau) ->
108-
(s_exists alpha a (fresh_for a phi)) $;
108+
(s_exists alpha a (fresh_for (eVar a) phi)) $;
109109
axiom A1 (alpha tau: Pattern) {a b: EVar} (phi rho: Pattern a b):
110110
$ is_atom_sort alpha $ >
111111
$ is_nominal_sort tau $ >

nominal/lambda.mm1

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ axiom subst_same_var {a: EVar} (plug: Pattern a):
182182
axiom subst_diff_var {a b: EVar} (plug: Pattern a b):
183183
$ (is_var (eVar a)) ->
184184
(is_var (eVar b)) ->
185+
((eVar a) != (eVar b)) ->
185186
(is_exp plug) ->
186187
((subst b (lc_var (eVar a)) plug) == (lc_var (eVar a))) $;
187188
axiom subst_app {a: EVar} (plug phi1 phi2: Pattern a):
@@ -195,21 +196,40 @@ axiom subst_lam {a b: EVar} (plug phi: Pattern a b):
195196
(is_var (eVar b)) ->
196197
(is_exp plug) ->
197198
(is_exp phi) ->
198-
(fresh_for a plug) ->
199+
(fresh_for (eVar a) plug) ->
199200
((subst b (lc_lam_a a phi) plug) == (lc_lam_a a (subst b phi plug))) $;
200201

201-
202-
203-
204-
theorem subst_induction {a b: EVar} (phi1 plug1 plug2: Pattern):
205-
$ (is_var (eVar a)) ->
206-
(is_var (eVar b)) ->
207-
(is_exp phi1) ->
208-
(is_exp plug1) ->
209-
(is_exp plug2) ->
210-
(fresh_for a phi3) ->
211-
((subst b (subst a phi1 plug1) plug2) == (subst a (subst b phi1 plug2) (subst b plug1 plug2))) $ =
212-
'();
202+
def subst_induction_pred (a b phi plug1 plug2: Pattern) = $ (subst b (subst a phi plug1) plug2) == (subst a (subst b phi plug2) (subst b plug1 plug2)) $;
203+
def satisfying_exps {.x: EVar} (a b plug1 plug2: Pattern) = $ exists x ((eVar x) /\ subst_induction_pred a b (eVar x) plug1 plug2) $;
204+
205+
theorem subst_induction_app_lemma {x y: EVar} (a b phi1 plug1 plug2: Pattern)
206+
(a_var: $ is_sorted_func Var a $)
207+
(b_var: $ is_sorted_func Var b $)
208+
(plug1_exp: $ is_exp plug1 $)
209+
(plug2_exp: $ is_exp plug2 $)
210+
(a_fresh: $ fresh_for a phi3 $):
211+
$ (subst_induction_pred a b x plug1 plug2 /\ subst_induction_pred a b y plug1 plug2) -> subst_induction_pred a b (lc_app x y) plug1 plug2 $ =
212+
'();
213+
214+
theorem subst_induction_app (a b phi1 plug1 plug2: Pattern)
215+
(a_var: $ is_sorted_func Var a $)
216+
(b_var: $ is_sorted_func Var b $)
217+
(plug1_exp: $ is_exp plug1 $)
218+
(plug2_exp: $ is_exp plug2 $)
219+
(a_fresh: $ fresh_for a phi3 $):
220+
$ (lc_app (satisfying_exps a b plug1 plug2) (satisfying_exps a b plug1 plug2)) C= (satisfying_exps a b plug1 plug2) $ =
221+
'();
222+
223+
224+
theorem subst_induction (a b phi1 plug1 plug2: Pattern)
225+
(a_var: $ is_sorted_func Var a $)
226+
(b_var: $ is_sorted_func Var b $)
227+
(phi1_exp: $ is_exp phi1 $)
228+
(plug1_exp: $ is_exp plug1 $)
229+
(plug2_exp: $ is_exp plug2 $)
230+
(a_fresh: $ fresh_for a phi3 $):
231+
$ (subst b (subst a phi1 plug1) plug2) == (subst a (subst b phi1 plug2) (subst b plug1 plug2)) $ =
232+
'(induction_principle);
213233

214234

215235

sorts.mm0

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def s_forall (s: Pattern) {x: EVar} (phi: Pattern x): Pattern = $ forall x ((eVa
1919

2020
def is_sorted_pred (s: Pattern) (phi: Pattern): Pattern = $ (phi == bot) \/ (phi == dom s) $;
2121

22+
def is_sorted_func {.x: EVar} (s: Pattern) (phi: Pattern): Pattern = $ s_exists s x (eVar x == phi) $;
23+
2224
-- Singleton sort
2325
term pred_sym: Symbol;
2426
def pred: Pattern = $ sym pred_sym $;

0 commit comments

Comments
 (0)