Skip to content

Commit faf1953

Browse files
committed
Adjust substitution functions
1 parent a5b6b3b commit faf1953

File tree

2 files changed

+187
-36
lines changed

2 files changed

+187
-36
lines changed

Defs.thy

Lines changed: 170 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ nominal_function head_ctor :: "term \<Rightarrow> bool" where
3535
| "head_ctor (TApp e _) = head_ctor e"
3636
| "head_ctor (Ctor _) = True"
3737
| "head_ctor (Let _ _ _ _) = False"
38+
| "head_ctor (Case _ _) = False"
3839
proof goal_cases
3940
case (3 P x)
40-
then show ?case by (cases x rule: term.exhaust)
41+
then show ?case by (cases x rule: term_alt_list_alt.exhaust(1))
4142
qed (auto simp: eqvt_def head_ctor_graph_aux_def)
4243
nominal_termination (eqvt) by lexicographic_order
4344

@@ -170,44 +171,111 @@ nominal_function is_value :: "term => bool" where
170171
| "is_value (TApp e \<tau>) = head_ctor e"
171172
| "is_value (Ctor _) = True"
172173
| "is_value (Let x \<tau> e1 e2) = False"
174+
| "is_value (Case _ _) = False"
173175
proof goal_cases
174176
case (3 P x)
175-
then show ?case by (cases x rule: term.exhaust)
177+
then show ?case by (cases x rule: term_alt_list_alt.exhaust(1))
176178
next
177-
case (17 a k e a' k' e')
179+
case (19 a k e a' k' e')
178180
obtain c::tyvar where c: "atom c \<sharp> (a, e, a', e')" by (rule obtain_fresh)
179181
have 1: "is_value_sumC e' = (a' \<leftrightarrow> c) \<bullet> is_value_sumC e'" using permute_boolE permute_boolI by blast
180182
have 2: "is_value_sumC e = (a \<leftrightarrow> c) \<bullet> is_value_sumC e" using permute_boolE permute_boolI by blast
181-
from c have "(a \<leftrightarrow> c) \<bullet> e = (a' \<leftrightarrow> c) \<bullet> e'" using 17(5) by simp
182-
then show ?case using 1 2 17(1,2) eqvt_at_def by metis
183+
from c have "(a \<leftrightarrow> c) \<bullet> e = (a' \<leftrightarrow> c) \<bullet> e'" using 19(5) by simp
184+
then show ?case using 1 2 19(1,2) eqvt_at_def by metis
183185
qed (auto simp: eqvt_def is_value_graph_aux_def)
184186
nominal_termination (eqvt) by lexicographic_order
185187

186-
nominal_function subst_term :: "term => term \<Rightarrow> var => term" where
188+
nominal_function (default "case_sum (\<lambda>x. Inl undefined) (case_sum (\<lambda>x. Inr (Inl undefined)) (\<lambda>x. Inr (Inr undefined)))")
189+
subst_term :: "term => term \<Rightarrow> var => term" and
190+
subst_alt_list :: "alt_list \<Rightarrow> term \<Rightarrow> var \<Rightarrow> alt_list" and
191+
subst_alt :: "alt \<Rightarrow> term \<Rightarrow> var \<Rightarrow> alt" where
192+
187193
"subst_term (Var y) e x = (if x = y then e else Var y)"
188194
| "subst_term (App e1 e2) e x = App (subst_term e1 e x) (subst_term e2 e x)"
189195
| "subst_term (TApp e1 \<tau>) e x = TApp (subst_term e1 e x) \<tau>"
190196
| "subst_term (Ctor D) _ _ = Ctor D"
197+
| "subst_term (Case t alts) e x = Case (subst_term t e x) (subst_alt_list alts e x)"
191198
| "atom y \<sharp> (e, x) \<Longrightarrow> subst_term (\<lambda> y:\<tau>. e2) e x = (\<lambda> y:\<tau>. subst_term e2 e x)"
192199
| "atom y \<sharp> (e, x) \<Longrightarrow> subst_term (\<Lambda> y:k. e2) e x = (\<Lambda> y:k. subst_term e2 e x)"
193200
| "atom y \<sharp> (e, x) \<Longrightarrow> subst_term (Let y \<tau> e1 e2) e x = Let y \<tau> (subst_term e1 e x) (subst_term e2 e x)"
201+
202+
| "subst_alt_list ANil _ _ = ANil"
203+
| "subst_alt_list (ACons alt alts) e x = ACons (subst_alt alt e x) (subst_alt_list alts e x)"
204+
205+
| "atom y \<sharp> (e, x) \<Longrightarrow> subst_alt (MatchVar y t) e x = MatchVar y (subst_term t e x)"
206+
| "set (map atom tys @ map atom vals) \<sharp>* (e, x) \<Longrightarrow> subst_alt (MatchCtor D tys vals t) e x = MatchCtor D tys vals (subst_term t e x)"
194207
proof (goal_cases)
195-
case (3 P x)
196-
then obtain t e y where P: "x = (t, e, y)" by (metis prod.exhaust)
208+
209+
(* this is adapted and simplified from here: https://www.joachim-breitner.de/thesis/isa/Substitution.thy *)
210+
have eqvt_at_term: "\<And>e y z . eqvt_at subst_term_subst_alt_list_subst_alt_sumC (Inl (e, y, z)) \<Longrightarrow> eqvt_at (\<lambda>(a, b, c). subst_term a b c) (e, y, z)"
211+
apply (simp add: eqvt_at_def subst_term_def)
212+
apply rule
213+
apply (subst Projl_permute)
214+
apply (simp add: subst_term_subst_alt_list_subst_alt_sumC_def)
215+
apply (simp add: THE_default_def)
216+
apply (case_tac "Ex1 (subst_term_subst_alt_list_subst_alt_graph (Inl (e, y, z)))")
217+
apply(auto)[2]
218+
apply (erule_tac x="x" in allE)
219+
apply simp
220+
apply(cases rule: subst_term_subst_alt_list_subst_alt_graph.cases)
221+
apply(assumption)
222+
apply blast+
223+
apply simp
224+
done
225+
226+
{ case (3 P x)
197227
then show ?case
198-
apply (cases t rule: term.strong_exhaust[of _ _ "(e, y)"])
199-
apply (auto simp: 3)
200-
using 3(5-7) P fresh_star_def by blast+
228+
proof (cases x)
229+
case (Inl a)
230+
then obtain t e y where P: "a = (t, e, y)" by (metis prod.exhaust)
231+
then show ?thesis using 3(1-5) Inl
232+
proof (cases t rule: term_alt_list_alt.strong_exhaust(1)[of _ _ "(e, y)"])
233+
case Lam
234+
then show ?thesis using 3(6) Inl P fresh_star_insert by blast
235+
next
236+
case TyLam
237+
then show ?thesis using 3(7) Inl P fresh_star_insert by blast
238+
next
239+
case Let
240+
then show ?thesis using 3(8) Inl P fresh_star_insert by blast
241+
qed auto
242+
next
243+
case outer: (Inr b)
244+
then show ?thesis
245+
proof (cases b)
246+
case (Inl a)
247+
then obtain xs e y where "a = (xs, e, y)" by (metis prod.exhaust)
248+
then show ?thesis using 3(9,10) Inl outer by (cases xs rule: term_alt_list_alt.exhaust(2)) auto
249+
next
250+
case (Inr c)
251+
then obtain m e y where "c = (m, e, y)" by (metis prod.exhaust)
252+
then show ?thesis using 3(11,12) Inr outer fresh_star_insert
253+
apply (cases m rule: term_alt_list_alt.strong_exhaust(3)[of "(e, y)"])
254+
apply auto
255+
by blast
256+
qed
257+
qed
258+
next
259+
case (54 y e x \<tau> e2 y' e' x' \<tau>' e2')
260+
have "(\<lambda> y : \<tau> . subst_term e2 e x) = (\<lambda> y' : \<tau>' . subst_term e2' e' x')" using Abs_sumC[OF 54(5,6) eqvt_at_term[OF 54(1)] eqvt_at_term[OF 54(2)]] 54(7) by fastforce
261+
then show ?case by (auto simp: Abs_fresh_iff meta_eq_to_obj_eq[OF subst_term_def, symmetric, unfolded fun_eq_iff])
201262
next
202-
case (26 y e x \<tau> e2 y' e' x' \<tau>' e2')
203-
then show ?case using Abs_sumC[OF 26(5,6,1,2)] by fastforce
263+
case (61 y e x k e2 y' e' x' k' e2')
264+
have "(\<Lambda> y : k . subst_term e2 e x) = (\<Lambda> y' : k' . subst_term e2' e' x')" using Abs_sumC[OF 61(5,6) eqvt_at_term[OF 61(1)] eqvt_at_term[OF 61(2)]] 61(7) by fastforce
265+
then show ?case by (auto simp: Abs_fresh_iff meta_eq_to_obj_eq[OF subst_term_def, symmetric, unfolded fun_eq_iff])
204266
next
205-
case (29 y e x k e2 y' e' x' k' e2')
206-
then show ?case using Abs_sumC[OF 29(5,6,1,2)] by fastforce
267+
case (67 y e x \<tau> e1 e2 y' e' x' \<tau>' e1' e2')
268+
have "Let y \<tau> (subst_term e1 e x) (subst_term e2 e x) = Let y' \<tau>' (subst_term e1' e' x') (subst_term e2' e' x')" using Abs_sumC[OF 67(9,10) eqvt_at_term[OF 67(2)] eqvt_at_term[OF 67(4)]] 67(11) by fastforce
269+
then show ?case by (auto simp: Abs_fresh_iff meta_eq_to_obj_eq[OF subst_term_def, symmetric, unfolded fun_eq_iff])
207270
next
208-
case (31 y e x \<tau> e1 e2 y' e' x' \<tau>' e1' e2')
209-
then show ?case using Abs_sumC[OF 31(9,10,2,4)] by fastforce
210-
qed (auto simp: eqvt_def subst_term_graph_aux_def)
271+
case (79 y e x t y' e' x' t')
272+
have "MatchVar y (subst_term t e x) = MatchVar y' (subst_term t' e' x')" using Abs_sumC[OF 79(5,6) eqvt_at_term[OF 79(1)] eqvt_at_term[OF 79(2)]] 79(7) by fastforce
273+
then show ?case by (auto simp: Abs_fresh_iff meta_eq_to_obj_eq[OF subst_term_def, symmetric, unfolded fun_eq_iff])
274+
next
275+
case (81 tys vals e x D t tys' vals' e' x' D' t')
276+
have "MatchCtor D tys vals (subst_term t e x) = MatchCtor D' tys' vals' (subst_term t' e' x')" using Abs_sumC_star[OF 81(5,6) eqvt_at_term[OF 81(1)] eqvt_at_term[OF 81(2)]] 81(7) by fastforce
277+
then show ?case by (auto simp: Abs_fresh_iff meta_eq_to_obj_eq[OF subst_term_def, symmetric, unfolded fun_eq_iff])
278+
} qed (auto simp: eqvt_def subst_term_subst_alt_list_subst_alt_graph_aux_def)
211279
nominal_termination (eqvt) by lexicographic_order
212280

213281
nominal_function subst_type :: "\<tau> \<Rightarrow> \<tau> \<Rightarrow> tyvar \<Rightarrow> \<tau>" where
@@ -219,41 +287,107 @@ nominal_function subst_type :: "\<tau> \<Rightarrow> \<tau> \<Rightarrow> tyvar
219287
proof goal_cases
220288
case (3 P x)
221289
then obtain t \<tau> a where P: "x = (t, \<tau>, a)" by (metis prod.exhaust)
222-
then show ?case
223-
apply (cases t rule: \<tau>.strong_exhaust[of _ _ "(\<tau>, a)"])
224-
apply (auto simp: 3)
225-
using 3(5) P fresh_star_def by blast
290+
then show ?case proof(cases t rule: \<tau>.strong_exhaust[of _ _ "(\<tau>, a)"])
291+
case (TyForall x51 x52 x53)
292+
then show ?thesis using 3(5) P fresh_star_def by blast
293+
qed (auto simp: 3)
226294
next
227295
case (18 b \<tau> a k \<sigma> b' \<tau>' a' k' \<sigma>')
228296
then show ?case using Abs_sumC[OF 18(5,6,1,2)] by fastforce
229297
qed (auto simp: eqvt_def subst_type_graph_aux_def)
230298
nominal_termination (eqvt) by lexicographic_order
231299

232-
nominal_function subst_term_type :: "term \<Rightarrow> \<tau> \<Rightarrow> tyvar \<Rightarrow> term" where
300+
nominal_function (default "case_sum (\<lambda>x. Inl undefined) (case_sum (\<lambda>x. Inr (Inl undefined)) (\<lambda>x. Inr (Inr undefined)))")
301+
subst_term_type :: "term \<Rightarrow> \<tau> \<Rightarrow> tyvar \<Rightarrow> term" and
302+
subst_alt_list_type :: "alt_list \<Rightarrow> \<tau> \<Rightarrow> tyvar \<Rightarrow> alt_list" and
303+
subst_alt_type :: "alt \<Rightarrow> \<tau> \<Rightarrow> tyvar \<Rightarrow> alt" where
304+
233305
"subst_term_type (Var x) _ _ = Var x"
234306
| "subst_term_type (Ctor D) _ _ = Ctor D"
235307
| "subst_term_type (App e1 e2) \<tau> a = App (subst_term_type e1 \<tau> a) (subst_term_type e2 \<tau> a)"
236308
| "subst_term_type (TApp e \<tau>2) \<tau> a = TApp (subst_term_type e \<tau> a) (subst_type \<tau>2 \<tau> a)"
309+
| "subst_term_type (Case e alts) \<tau> a = Case (subst_term_type e \<tau> a) (subst_alt_list_type alts \<tau> a)"
237310
| "atom y \<sharp> (\<tau>, a) \<Longrightarrow> subst_term_type (\<lambda> y:\<tau>'. e2) \<tau> a = (\<lambda> y:(subst_type \<tau>' \<tau> a). subst_term_type e2 \<tau> a)"
238311
| "atom b \<sharp> (\<tau>, a) \<Longrightarrow> subst_term_type (\<Lambda> b:k. e2) \<tau> a = (\<Lambda> b:k. subst_term_type e2 \<tau> a)"
239312
| "atom y \<sharp> (\<tau>, a) \<Longrightarrow> subst_term_type (Let y \<tau>' e1 e2) \<tau> a = Let y (subst_type \<tau>' \<tau> a) (subst_term_type e1 \<tau> a) (subst_term_type e2 \<tau> a)"
313+
314+
| "subst_alt_list_type ANil _ _ = ANil"
315+
| "subst_alt_list_type (ACons alt alts) \<tau> a = ACons (subst_alt_type alt \<tau> a) (subst_alt_list_type alts \<tau> a)"
316+
317+
| "atom y \<sharp> (\<tau>, a) \<Longrightarrow> subst_alt_type (MatchVar y e) \<tau> a = MatchVar y (subst_term_type e \<tau> a)"
318+
| "set (map atom tys @ map atom vals) \<sharp>* (\<tau>, a) \<Longrightarrow> subst_alt_type (MatchCtor D tys vals e) \<tau> a = MatchCtor D tys vals (subst_term_type e \<tau> a)"
240319
proof goal_cases
241-
case (3 P x)
242-
then obtain t \<tau> a where P: "x = (t, \<tau>, a)" by (metis prod.exhaust)
320+
321+
(* this is adapted and simplified from here: https://www.joachim-breitner.de/thesis/isa/Substitution.thy *)
322+
have eqvt_at_term: "\<And>e y z . eqvt_at subst_term_type_subst_alt_list_type_subst_alt_type_sumC (Inl (e, y, z)) \<Longrightarrow> eqvt_at (\<lambda>(a, b, c). subst_term_type a b c) (e, y, z)"
323+
apply (simp add: eqvt_at_def subst_term_type_def)
324+
apply rule
325+
apply (subst Projl_permute)
326+
apply (simp add: subst_term_type_subst_alt_list_type_subst_alt_type_sumC_def)
327+
apply (simp add: THE_default_def)
328+
apply (case_tac "Ex1 (subst_term_type_subst_alt_list_type_subst_alt_type_graph (Inl (e, y, z)))")
329+
apply(auto)[2]
330+
apply (erule_tac x="x" in allE)
331+
apply simp
332+
apply(cases rule: subst_term_type_subst_alt_list_type_subst_alt_type_graph.cases)
333+
apply(assumption)
334+
apply blast+
335+
apply simp
336+
done
337+
338+
{ case (3 P x)
243339
then show ?case
244-
apply (cases t rule: term.strong_exhaust[of _ _ "(\<tau>, a)"])
245-
using 3 P apply auto[4]
246-
using 3(5,6,7) P fresh_star_def by blast+
340+
proof (cases x)
341+
case (Inl a)
342+
then obtain t e y where P: "a = (t, e, y)" by (metis prod.exhaust)
343+
then show ?thesis using 3(1-5) Inl
344+
proof (cases t rule: term_alt_list_alt.strong_exhaust(1)[of _ _ "(e, y)"])
345+
case Lam
346+
then show ?thesis using 3(6) Inl P fresh_star_insert by blast
347+
next
348+
case TyLam
349+
then show ?thesis using 3(7) Inl P fresh_star_insert by blast
350+
next
351+
case Let
352+
then show ?thesis using 3(8) Inl P fresh_star_insert by blast
353+
qed auto
354+
next
355+
case outer: (Inr b)
356+
then show ?thesis
357+
proof (cases b)
358+
case (Inl a)
359+
then obtain xs e y where "a = (xs, e, y)" by (metis prod.exhaust)
360+
then show ?thesis using 3(9,10) Inl outer by (cases xs rule: term_alt_list_alt.exhaust(2)) auto
361+
next
362+
case (Inr c)
363+
then obtain m e y where P: "c = (m, e, y)" by (metis prod.exhaust)
364+
then show ?thesis using Inr outer 3(11,12)
365+
apply (cases m rule: term_alt_list_alt.strong_exhaust(3)[of "(e, y)"]) apply simp
366+
using fresh_star_insert by blast
367+
qed
368+
qed
369+
next
370+
case (54 y \<tau> a \<tau>2 e2 y' \<tau>' a' \<tau>2' e2')
371+
have "(\<lambda> y : subst_type \<tau>2 \<tau> a . subst_term_type e2 \<tau> a) = (\<lambda> y' : subst_type \<tau>2' \<tau>' a' . subst_term_type e2' \<tau>' a')" using Abs_sumC[OF 54(5,6) eqvt_at_term[OF 54(1)] eqvt_at_term[OF 54(2)]] 54(7) by fastforce
372+
then show ?case by (auto simp: Abs_fresh_iff meta_eq_to_obj_eq[OF subst_term_type_def, symmetric, unfolded fun_eq_iff])
373+
next
374+
case (61 b \<tau> a k e2 b' \<tau>' a' k' e2')
375+
have "(\<Lambda> b : k . subst_term_type e2 \<tau> a) = (\<Lambda> b' : k' . subst_term_type e2' \<tau>' a')" using Abs_sumC[OF 61(5,6) eqvt_at_term[OF 61(1)] eqvt_at_term[OF 61(2)]] 61(7) by fastforce
376+
then show ?case by (auto simp: Abs_fresh_iff meta_eq_to_obj_eq[OF subst_term_type_def, symmetric, unfolded fun_eq_iff])
247377
next
248-
case (26 y \<tau> a \<tau>1 e2 y' \<tau>' a' \<tau>1' e2')
249-
then show ?case using Abs_sumC[OF 26(5,6,1,2)] by fastforce
378+
case (67 y \<tau> a \<tau>2 e1 e2 y' \<tau>' a' \<tau>2' e1' e2')
379+
have "Let y (subst_type \<tau>2 \<tau> a) (subst_term_type e1 \<tau> a) (subst_term_type e2 \<tau> a) = Let y' (subst_type \<tau>2' \<tau>' a') (subst_term_type e1' \<tau>' a') (subst_term_type e2' \<tau>' a')"
380+
using Abs_sumC[OF 67(9,10) eqvt_at_term[OF 67(2)] eqvt_at_term[OF 67(4)]] 67(11) by fastforce
381+
then show ?case by (auto simp: Abs_fresh_iff meta_eq_to_obj_eq[OF subst_term_type_def, symmetric, unfolded fun_eq_iff])
250382
next
251-
case (29 b \<tau> a k e2 b' \<tau>' a' k' e2')
252-
then show ?case using Abs_sumC[OF 29(5,6,1,2)] by fastforce
383+
case (79 y \<tau> a e y' \<tau>' a' e')
384+
have "MatchVar y (subst_term_type e \<tau> a) = MatchVar y' (subst_term_type e' \<tau>' a')" using Abs_sumC[OF 79(5,6) eqvt_at_term[OF 79(1)] eqvt_at_term[OF 79(2)]] 79(7) by fastforce
385+
then show ?case by (auto simp: Abs_fresh_iff meta_eq_to_obj_eq[OF subst_term_type_def, symmetric, unfolded fun_eq_iff])
253386
next
254-
case (31 y \<tau> a \<tau>1 e1 e2 y' \<tau>' a' \<tau>1' e1' e2')
255-
then show ?case using Abs_sumC[OF 31(9,10,2,4)] by fastforce
256-
qed (auto simp: eqvt_def subst_term_type_graph_aux_def)
387+
case (81 tys vals \<tau> a D e tys' vals' \<tau>' a' D' e')
388+
have "MatchCtor D tys vals (subst_term_type e \<tau> a) = MatchCtor D' tys' vals' (subst_term_type e' \<tau>' a')" using Abs_sumC_star[OF 81(5,6) eqvt_at_term[OF 81(1)] eqvt_at_term[OF 81(2)]] 81(7) by fastforce
389+
then show ?case by (auto simp: Abs_fresh_iff meta_eq_to_obj_eq[OF subst_term_type_def, symmetric, unfolded fun_eq_iff])
390+
} qed (auto simp: eqvt_def subst_term_type_subst_alt_list_type_subst_alt_type_graph_aux_def)
257391
nominal_termination (eqvt) by lexicographic_order
258392

259393
nominal_function subst_context :: "\<Gamma> \<Rightarrow> \<tau> \<Rightarrow> tyvar \<Rightarrow> \<Gamma>" where
@@ -275,6 +409,6 @@ no_notation inverse_divide (infixl "'/" 70)
275409
consts subst :: "'a \<Rightarrow> 'b \<Rightarrow> 'c \<Rightarrow> 'a" ("_[_'/_]" [1000,0,0] 1000)
276410

277411
adhoc_overloading
278-
subst subst_term subst_type subst_term_type subst_context
412+
subst subst_term subst_alt_list subst_alt subst_type subst_term_type subst_alt_list_type subst_alt_type subst_context
279413

280414
end

Nominal2_Lemmas.thy

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,19 @@ proof -
6262
show ?thesis using 1 2 3 equal by argo
6363
qed
6464

65+
lemma Abs_sumC_star:
66+
fixes ys ys'::"atom list" and x x'::"'a::fs" and e e'::"'b::fs" and e2 e2'::"'c::fs" and f::"'c * 'b * 'a \<Rightarrow> 'd::fs"
67+
assumes fresh: "set ys \<sharp>* (e, x)" "set ys' \<sharp>* (e', x')"
68+
and eqvt_at: "eqvt_at f (e2, e, x)" "eqvt_at f (e2', e', x')"
69+
and equal: "[ys]lst. e2 = [ys']lst. e2'" "x = x'" "e = e'"
70+
shows "[ys]lst. f (e2, e, x) = [ys']lst. f (e2', e', x')"
71+
proof -
72+
have 1: "set ys \<sharp>* ([ys]lst. f (e2, e, x))" by (simp add: Abs_fresh_star(3))
73+
have 2: "\<And>p. supp p \<sharp>* (e, x) \<Longrightarrow> p \<bullet> ([ys]lst. f (e2, e, x)) = [p \<bullet> ys]lst. f (p \<bullet> e2, e, x)" using eqvt_at(1) by (simp add: eqvt_at_def, simp add: fresh_star_Pair perm_supp_eq)
74+
have 3: "\<And>p. supp p \<sharp>* (e, x) \<Longrightarrow> p \<bullet> ([ys']lst. f (e2', e, x)) = [p \<bullet> ys']lst. f (p \<bullet> e2', e, x)" using eqvt_at(2) equal(2,3) by (simp add: eqvt_at_def, simp add: fresh_star_Pair perm_supp_eq)
75+
show ?thesis using Abs_lst_fcb2[where f="\<lambda>a b c. [a]lst. f (b, e, x)", OF equal(1) 1 fresh(1) _ 2 3] fresh(2) equal(2,3) by simp
76+
qed
77+
6578
lemma Abs_fresh_var:
6679
fixes y::"'a::at" and e ::"'b::fs"
6780
obtains c::"'a" and e'::"'b" where "([[atom y]]lst. e = [[atom c]]lst. e') \<and> atom y \<sharp> [[atom c]]lst. e'"
@@ -79,7 +92,11 @@ lemma Abs_rename_body:
7992
shows "(a \<leftrightarrow> b) \<bullet> e1 = e2"
8093
by (metis Abs1_eq_iff'(3) Nominal2_Base.swap_self assms flip_commute flip_def fresh_star_zero supp_perm_eq_test)
8194

95+
8296
lemma fresh_filter: "a = b \<or> atom a \<sharp> xs \<Longrightarrow> atom a \<sharp> filter (\<lambda>x. x \<noteq> b) xs"
8397
by (induction xs) (auto simp: fresh_Cons fresh_Nil)
8498

99+
lemma Projl_permute: "\<exists>y. f = Inl y \<Longrightarrow> p \<bullet> projl f = projl (p \<bullet> f)" by auto
100+
lemma Projr_permute: "\<exists>y. f = Inr y \<Longrightarrow> p \<bullet> projr f = projr (p \<bullet> f)" by auto
101+
85102
end

0 commit comments

Comments
 (0)