Skip to content

Commit 6555d60

Browse files
committed
wip
1 parent 0876c3f commit 6555d60

File tree

1 file changed

+33
-15
lines changed

1 file changed

+33
-15
lines changed

nominal/lambda.mm1

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -199,22 +199,14 @@ axiom subst_lam {a b: EVar} (plug phi: Pattern a b):
199199
(fresh_for (eVar a) plug) ->
200200
((subst (eVar b) (lc_lam_a a phi) plug) == (lc_lam_a a (subst (eVar b) phi plug))) $;
201201

202-
-- phi[a / plug1][b / plug2] == phi[b / plug2][a / plug1[b / plug2]]
203-
204-
-- (app x y)[a / plug1][b / plug2] == (app x y)[b / plug2][a / plug1[b / plug2]]
205-
-- (app (x[a / plug1]) (y[a / plug1]))[b / plug2] == (app (x[b / plug2]) (y[b / plug2]))[a / plug1[b / plug2]]
206-
-- app (x[a / plug1][b / plug2]) (y[a / plug1][b / plug2]) == app (x[b / plug2][a / plug1[b / plug2]]) (y[b / plug2][a / plug1[b / plug2]])
207-
208202
def subst_induction_pred (a b phi plug1 plug2: Pattern): Pattern = $ (subst b (subst a phi plug1) plug2) == (subst a (subst b phi plug2) (subst b plug1 plug2)) $;
209203
def satisfying_exps {.x: EVar} (a b plug1 plug2: Pattern): Pattern = $ s_exists Exp x ((eVar x) /\ subst_induction_pred a b (eVar x) plug1 plug2) $;
210204

211-
theorem subst_induction_app_lemma {x y: EVar} (a b plug1 plug2: Pattern)
212-
(diff_atoms: $ a != b $)
205+
theorem subst_induction_app_lemma
213206
(a_var: $ is_sorted_func Var a $)
214207
(b_var: $ is_sorted_func Var b $)
215208
(plug1_exp: $ is_exp plug1 $)
216-
(plug2_exp: $ is_exp plug2 $)
217-
(a_fresh: $ fresh_for a phi3 $):
209+
(plug2_exp: $ is_exp plug2 $):
218210
$ (is_exp (eVar x) /\ subst_induction_pred a b (eVar x) plug1 plug2) /\ (is_exp (eVar y) /\ subst_induction_pred a b (eVar y) plug1 plug2) -> subst_induction_pred a b (lc_app (eVar x) (eVar y)) plug1 plug2 $ =
219211
'(rsyl (anl an4) @ rsyl (anim2 @
220212
syl (curry eq_trans) @
@@ -228,7 +220,23 @@ theorem subst_induction_app_lemma {x y: EVar} (a b plug1 plug2: Pattern)
228220
(mp (com12 @ mp ,(function_sorting 3 'function_subst) (domain_func_sorting a_var)) plug1_exp)
229221
(mp (com12 @ mp ,(function_sorting 3 'function_subst) (domain_func_sorting a_var)) plug1_exp)
230222
)) @
231-
_);
223+
rsyl (anim2 @ curry eq_trans) @
224+
rsyl (anim1 @ iand id id) @
225+
rsyl (anl anass) @
226+
rsyl (anim2 @ anim1 @ syl ,(eq_imp_eq_framing_subst 'appCtxLRVar) @ curry @ subst_app a_var plug1_exp) @
227+
rsyl (anim2 @ curry eq_trans) @
228+
rsyl (anim1 @ iand id id) @
229+
rsyl (anl anass) @
230+
rsyl (anim2 @ anim1 @ syl eq_sym @ syl (curry @ subst_app a_var (mp (mp (mp ,(function_sorting 3 'function_subst) (domain_func_sorting b_var)) plug1_exp) plug2_exp)) (anim
231+
(mp (com12 @ mp ,(function_sorting 3 'function_subst) (domain_func_sorting b_var)) plug2_exp)
232+
(mp (com12 @ mp ,(function_sorting 3 'function_subst) (domain_func_sorting b_var)) plug2_exp)
233+
)) @
234+
rsyl (anim2 @ impcom eq_trans) @
235+
rsyl (anim1 @ iand id id) @
236+
rsyl (anl anass) @
237+
rsyl (anim2 @ anim1 @ syl eq_sym @ syl ,(eq_imp_eq_framing_subst 'appCtxLRVar) @ curry @ subst_app b_var plug2_exp) @
238+
rsyl (anim2 @ impcom eq_trans) @
239+
anr);
232240

233241
theorem subst_induction_app (a b plug1 plug2: Pattern)
234242
(lemma: $ (is_exp (eVar x) /\ subst_induction_pred a b (eVar x) plug1 plug2) /\ (is_exp (eVar y) /\ subst_induction_pred a b (eVar y) plug1 plug2) -> subst_induction_pred a b (lc_app (eVar x) (eVar y)) plug1 plug2 $):
@@ -263,16 +271,26 @@ theorem subst_induction_app (a b plug1 plug2: Pattern)
263271
rsyl (anim1 @ curry @ mp ,(inst_foralls 2) function_lc_app) @
264272
curry ,(func_subst_alt_thm_sorted 'x $(eVar x) /\ ((app (app _ (app (app _ (eVar x)) _)) _) == (app (app _ (app (app _ (eVar x)) _)) _))$)));
265273

274+
theorem subst_induction_lemma (a b phi plug1 plug2: Pattern)
275+
(diff_atoms: $ a != b $)
276+
(a_var: $ is_sorted_func Var a $)
277+
(b_var: $ is_sorted_func Var b $)
278+
(phi_exp: $ is_exp phi $)
279+
(plug1_exp: $ is_exp plug1 $)
280+
(plug2_exp: $ is_exp plug2 $)
281+
(a_fresh: $ fresh_for a plug2 $):
282+
$ Exps == (satisfying_exps a b plug1 plug2) $ =
283+
'(induction_principle _ _ _ _ _ (subst_induction_app @ subst_induction_app_lemma a_var b_var plug1_exp plug2_exp) _);
266284

267-
theorem subst_induction (a b phi1 plug1 plug2: Pattern)
285+
theorem subst_induction (a b phi plug1 plug2: Pattern)
268286
(diff_atoms: $ a != b $)
269287
(a_var: $ is_sorted_func Var a $)
270288
(b_var: $ is_sorted_func Var b $)
271-
(phi1_exp: $ is_exp phi1 $)
289+
(phi_exp: $ is_exp phi $)
272290
(plug1_exp: $ is_exp plug1 $)
273291
(plug2_exp: $ is_exp plug2 $)
274-
(a_fresh: $ fresh_for a phi3 $):
275-
$ (subst b (subst a phi1 plug1) plug2) == (subst a (subst b phi1 plug2) (subst b plug1 plug2)) $ =
292+
(a_fresh: $ fresh_for a plug2 $):
293+
$ (subst b (subst a phi plug1) plug2) == (subst a (subst b phi plug2) (subst b plug1 plug2)) $ =
276294
'();
277295

278296

0 commit comments

Comments
 (0)