@@ -22,8 +22,8 @@ term lc_lam_sym: Symbol;
22
22
def lc_lam (phi: Pattern): Pattern = $ (sym lc_lam_sym) @@ phi $;
23
23
axiom function_lc_lam: $ ,(is_function '(sym lc_lam_sym) '[(sort_abstraction Var Exp)] 'Exp) $;
24
24
axiom EV_lc_lam {a b: EVar} (phi: Pattern a b):
25
- $ is_of_sort phi (sort_abstraction Var Exp) $ >
26
- $ s_forall Var a (s_forall Var b ((swap a b (lc_lam phi)) == lc_lam (swap a b phi))) $;
25
+ $ ( is_of_sort phi (sort_abstraction Var Exp)) - >
26
+ ( s_forall Var a (s_forall Var b ((swap a b (lc_lam phi)) == lc_lam (swap a b phi) ))) $;
27
27
28
28
axiom no_junk {X: SVar}:
29
29
$ Exps == mu X ( (lc_var Vars)
@@ -32,6 +32,60 @@ axiom no_junk {X: SVar}:
32
32
33
33
--- no_confusion
34
34
35
+ theorem abstraction_sorting_lemma:
36
+ $ is_of_sort (abstraction Vars Exps) (sort_abstraction Var Exp) $ =
37
+ (named '(
38
+ under_domain_forall
39
+ ,(pointwise_decomposition_imp_subst 'appCtxRVar)
40
+ ,(pointwise_decomposition_imp_subst 'appCtxLRVar) @
41
+ under_domain_forall (
42
+ under_domain_forall domain_func_sorting id
43
+ ) id @
44
+ function_abstraction Var_atom Exp_sort));
45
+
46
+ theorem abstraction_sorting (phi rho: Pattern):
47
+ $ is_of_sort phi Var -> is_of_sort rho Exp -> is_of_sort (abstraction phi rho) (sort_abstraction Var Exp) $ =
48
+ (named '(
49
+ rsyl ,(framing_imp_subst 'appCtxLRVar) @
50
+ rsyl subset_trans @
51
+ imim ,(framing_imp_subst 'appCtxRVar) @
52
+ com12 subset_trans abstraction_sorting_lemma));
53
+
54
+ theorem EV_lc_lam_abstraction {a b: EVar} (phi: Pattern a b):
55
+ $ is_of_sort phi Exp ->
56
+ ((is_of_sort (eVar a) Var) /\ (is_of_sort (eVar b) Var)) ->
57
+ ((swap a b (lc_lam (abstraction (eVar a) phi))) == lc_lam (abstraction (eVar b) (swap a b phi))) $ =
58
+ (named '(exp @
59
+ sylc eq_trans (
60
+ rsyl (anr anass) @
61
+ curry @
62
+ rsyl (iand (impcom abstraction_sorting) anr) @
63
+ curry @
64
+ --- unquantification of EV_lc_lam
65
+ rsyl EV_lc_lam @
66
+ rsyl var_subst_same_var @
67
+ imim2i var_subst_same_var
68
+ ) ( sylc eq_trans (
69
+ syl ,(eq_imp_eq_framing_subst 'appCtxRVar) @
70
+ rsyl (anr anass) @
71
+ curry @
72
+ rsyl (iand anr id) @
73
+ rsyl (anr anass) @
74
+ curry @
75
+ curry @
76
+ --- unquantification of EV_abstraction
77
+ rsyl (EV_abstraction Var_atom Exp_sort) @
78
+ imim2 @
79
+ rsyl var_subst_same_var @
80
+ imim2 var_subst_same_var
81
+ ) (
82
+ rsyl anr @
83
+ syl ,(eq_imp_eq_framing_subst 'appCtxRLRVar) @
84
+ curry @
85
+ S3 Var_atom
86
+ ))
87
+ ));
88
+
35
89
36
90
theorem exp_pred_ev_unquantified {x y: EVar} (exp_pred: Pattern)
37
91
(exp_pred_ev: $ EV_pattern Var exp_pred $):
@@ -52,12 +106,23 @@ theorem lc_lemma_1 {x: EVar} (exp_pred exp_suff_fresh: Pattern)
52
106
@ anl lemma_ceil_exists_membership exp_suff_fresh_nonempty));
53
107
54
108
theorem lc_lemma_2 {x y: EVar} (exp_pred: Pattern)
55
- (ev_unquant: $ (is_of_sort (eVar x) Var) /\ (is_of_sort (eVar y) Var) -> ((swap x y exp_pred) == exp_pred) $):
109
+ (exp_pred_sorting: $ is_of_sort exp_pred Exp $)
110
+ (exp_pred_ev: $ EV_pattern Var exp_pred $):
56
111
$ (((is_of_sort (eVar x) Var) /\ (is_of_sort (eVar y) Var)) /\ ((lc_lam (abstraction (eVar y) exp_pred)) C= exp_pred)) -> ((lc_lam (abstraction (eVar x) exp_pred)) C= exp_pred) $ =
57
- '(rsyl (anim2 ,(subset_imp_subset_framing_subst 'appCtxRVar)) @
58
- _);
112
+ (named '(
113
+ rsyl (anim2 ,(subset_imp_subset_framing_subst 'appCtxRVar)) @
114
+ rsyl (iand anl @
115
+ rsyl (anim1 @
116
+ rsyl ancom @
117
+ rsyl (EV_lc_lam_abstraction exp_pred_sorting) @
118
+ syl eq_imp_subset eq_sym) @
119
+ curry subset_trans) @
120
+ rsyl (anim1 @ rsyl ancom @ exp_pred_ev_unquantified exp_pred_ev) @
121
+ curry @
122
+ syl anl ,(func_subst_explicit_helper 'hole $(_ @@ (_ @@ (eVar hole))) C= (eVar hole)$)));
59
123
60
124
theorem lc_lemma_3 {y: EVar} (exp_pred: Pattern)
125
+ (exp_pred_sorting: $ is_of_sort exp_pred Exp $)
61
126
(exp_suff_fresh_sorting: $ is_of_sort exp_suff_fresh Var $)
62
127
(exp_suff_fresh_nonempty: $ |^ exp_suff_fresh ^| $)
63
128
(exp_pred_ev: $ EV_pattern Var exp_pred $)
@@ -68,9 +133,10 @@ theorem lc_lemma_3 {y: EVar} (exp_pred: Pattern)
68
133
rsyl and_exists_disjoint_reverse @
69
134
exists_generalization_disjoint @
70
135
rsyl (anr anass) @
71
- lc_lemma_2 @ exp_pred_ev_unquantified exp_pred_ev));
136
+ lc_lemma_2 exp_pred_sorting exp_pred_ev));
72
137
73
138
theorem freshness_irrelevance (exp_pred exp_suff_fresh: Pattern)
139
+ (exp_pred_sorting: $ is_of_sort exp_pred Exp $)
74
140
(exp_suff_fresh_sorting: $ is_of_sort exp_suff_fresh Var $)
75
141
(exp_suff_fresh_nonempty: $ |^ exp_suff_fresh ^| $)
76
142
(exp_pred_ev: $ EV_pattern Var exp_pred $)
@@ -80,7 +146,7 @@ theorem freshness_irrelevance (exp_pred exp_suff_fresh: Pattern)
80
146
pointwise_decomposition @
81
147
norm (norm_sym @ norm_imp_r @ norm_subset appCtxRLRVar norm_refl) @
82
148
rsyl (anl eVar_in_subset) @
83
- lc_lemma_3 exp_suff_fresh_sorting exp_suff_fresh_nonempty exp_pred_ev h_abs));
149
+ lc_lemma_3 exp_pred_sorting exp_suff_fresh_sorting exp_suff_fresh_nonempty exp_pred_ev h_abs));
84
150
85
151
theorem prototype_induction_principle (exp_pred exp_suff_fresh: Pattern)
86
152
(exp_suff_fresh_sorting: $ is_of_sort exp_suff_fresh Var $)
@@ -98,5 +164,5 @@ theorem prototype_induction_principle (exp_pred exp_suff_fresh: Pattern)
98
164
eori (eori
99
165
(corollary_57_floor h_var)
100
166
(corollary_57_floor h_app))
101
- @ corollary_57_floor @ freshness_irrelevance exp_suff_fresh_sorting exp_suff_fresh_nonempty exp_pred_ev h_abs
167
+ @ corollary_57_floor @ freshness_irrelevance exp_pred_sorting exp_suff_fresh_sorting exp_suff_fresh_nonempty exp_pred_ev h_abs
102
168
) exp_pred_sorting));
0 commit comments