@@ -2,10 +2,12 @@ import "core.mm1";
2
2
3
3
term Var_sym: Symbol;
4
4
def Var: Pattern = $ sym Var_sym $;
5
+ def Vars: Pattern = $ dom Var $;
5
6
axiom Var_atom: $ is_atom_sort Var $;
6
7
7
8
term Exp_sym: Symbol;
8
9
def Exp: Pattern = $ sym Exp_sym $;
10
+ def Exps: Pattern = $ dom Exp $;
9
11
axiom Exp_sort: $ is_nominal_sort Exp $;
10
12
11
13
term lc_var_sym: Symbol;
@@ -19,15 +21,79 @@ axiom function_lc_app: $ ,(is_function '(sym lc_var_app) '[Exp Exp] 'Exp) $;
19
21
term lc_lam_sym: Symbol;
20
22
def lc_lam (phi: Pattern): Pattern = $ (sym lc_lam_sym) @@ phi $;
21
23
axiom function_lc_lam: $ ,(is_function '(sym lc_lam_sym) '[(sort_abstraction Var Exp)] 'Exp) $;
24
+ axiom EV_lc_lam (phi: Pattern) {a b: EVar}:
25
+ $ s_forall Var a (s_forall Var b ((swap a b (lc_lam phi)) == lc_lam (swap a b phi))) $;
22
26
23
27
axiom no_junk {X: SVar}:
24
- $ (dom Exp) == mu X ( (lc_var (dom Var) )
25
- \/ (lc_app (sVar X) (sVar X))
26
- \/ (lc_lam (abstraction (dom Var) (sVar X)))) $;
28
+ $ Exps == mu X ( (lc_var Vars )
29
+ \/ (lc_app (sVar X) (sVar X))
30
+ \/ (lc_lam (abstraction Vars (sVar X)))) $;
27
31
28
32
--- no_confusion
29
33
30
34
35
+ theorem exp_pred_ev_unquantified {x y: EVar} (exp_pred: Pattern)
36
+ (exp_pred_ev: $ EV_pattern Var exp_pred $):
37
+ $ (is_of_sort (eVar x) Var) /\ (is_of_sort (eVar y) Var) -> ((swap x y exp_pred) == exp_pred) $ =
38
+ '(curry @ syl var_subst_same_var @ var_subst_same_var exp_pred_ev);
39
+
40
+ theorem lc_lemma_1 {x: EVar} (exp_pred exp_suff_fresh: Pattern)
41
+ (exp_suff_fresh_sorting: $ is_of_sort exp_suff_fresh Var $)
42
+ (exp_suff_fresh_nonempty: $ |^ exp_suff_fresh ^| $)
43
+ (h_abs: $ (lc_lam (abstraction exp_suff_fresh exp_pred)) C= exp_pred $):
44
+ $ s_exists Var x ((lc_lam (abstraction (eVar x) exp_pred)) C= exp_pred) $ =
45
+ (named '(exists_framing (rsyl (anl eVar_in_subset) @ iand
46
+ (com12 subset_trans exp_suff_fresh_sorting)
47
+ (rsyl (syl
48
+ ,(subset_imp_subset_framing_subst 'appCtxRVar)
49
+ ,(subset_imp_subset_framing_subst 'appCtxLRVar)
50
+ ) @ com12 subset_trans h_abs))
51
+ @ anl lemma_ceil_exists_membership exp_suff_fresh_nonempty));
52
+
53
+ theorem lc_lemma_2 {x y: EVar} (exp_pred: Pattern)
54
+ (ev_unquant: $ (is_of_sort (eVar x) Var) /\ (is_of_sort (eVar y) Var) -> ((swap x y exp_pred) == exp_pred) $):
55
+ $ (((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) $ =
56
+ '();
57
+
58
+ theorem lc_lemma_3 {y: EVar} (exp_pred: Pattern)
59
+ (exp_suff_fresh_sorting: $ is_of_sort exp_suff_fresh Var $)
60
+ (exp_suff_fresh_nonempty: $ |^ exp_suff_fresh ^| $)
61
+ (exp_pred_ev: $ EV_pattern Var exp_pred $)
62
+ (h_abs: $ (lc_lam (abstraction exp_suff_fresh exp_pred)) C= exp_pred $):
63
+ $ is_of_sort (eVar y) Var -> ((lc_lam (abstraction (eVar y) exp_pred)) C= exp_pred) $ =
64
+ (named '(
65
+ rsyl (ian2 @ lc_lemma_1 exp_suff_fresh_sorting exp_suff_fresh_nonempty h_abs) @
66
+ rsyl and_exists_disjoint_reverse @
67
+ exists_generalization_disjoint @
68
+ rsyl (anr anass) @
69
+ lc_lemma_2 @ exp_pred_ev_unquantified exp_pred_ev));
70
+
71
+
72
+ theorem freshness_irrelevance (exp_pred exp_suff_fresh: Pattern)
73
+ (exp_suff_fresh_sorting: $ is_of_sort exp_suff_fresh Var $)
74
+ (exp_suff_fresh_nonempty: $ |^ exp_suff_fresh ^| $)
75
+ (exp_pred_ev: $ EV_pattern Var exp_pred $)
76
+ (h_abs: $ (lc_lam (abstraction exp_suff_fresh exp_pred)) C= exp_pred $):
77
+ $ (lc_lam (abstraction Vars exp_pred)) C= exp_pred $ = (named
78
+ '(norm (norm_subset appCtxRLRVar norm_refl) @
79
+ pointwise_decomposition @
80
+ norm (norm_sym @ norm_imp_r @ norm_subset appCtxRLRVar norm_refl) @
81
+ rsyl (anl eVar_in_subset) @
82
+ lc_lemma_3 exp_suff_fresh_sorting exp_suff_fresh_nonempty exp_pred_ev h_abs));
83
+
84
+
85
+
86
+
87
+ theorem prototype_induction_principle (exp_pred exp_suff_fresh: Pattern)
88
+ (exp_suff_fresh_sorting: $ is_of_sort exp_suff_fresh Var $)
89
+ (exp_suff_fresh_nonempty: $ |^ exp_suff_fresh ^| $)
90
+ (exp_pred_sorting: $ is_of_sort exp_pred Exp $)
91
+ (exp_pred_ev: $ EV_pattern Var exp_pred $)
92
+ (h_var: $ (lc_var Vars) C= exp_pred $)
93
+ (h_app: $ (lc_app exp_pred exp_pred) C= exp_pred $)
94
+ (h_abs: $ (lc_lam (abstraction exp_suff_fresh exp_pred)) C= exp_pred $):
95
+ $ Exps == exp_pred $ = '();
96
+
31
97
32
98
33
99
do {
@@ -160,6 +226,7 @@ theorem induction_lemma_abs (pred freshness_arg: Pattern)
160
226
-- @ rsyl (anim2 @ anim1 @ curry @ syl (rsyl (exists_framing imancom) (anr imp_exists_disjoint)) @ anr imp_exists_disjoint @ exists_framing imancom @ exists_framing (iand id @ curry (com23 @ syl var_subst_same_var @ var_subst_same_var h_abs)) (F4 Var_atom Exp_sort freshness_arg_Exp))
161
227
-- @ rsyl (anim2 @ anim1 @ exists_framing @ anim1 anl)
162
228
-- @ syl (curry @ syl anr ,(func_subst_explicit_helper 'z $(eVar z C= dom Exp) /\ (eVar z /\ (pred @@ eVar z @@ freshness_arg))$))
229
+
163
230
_);
164
231
165
232
theorem induction_principle (pred freshness_arg: Pattern)
0 commit comments