@@ -3,12 +3,12 @@ theory Lemmas
33begin
44
55(* atom x \<sharp> t' \<Longrightarrow> atom x \<sharp> subst t' x t *)
6- lemma fresh_after_subst_term : "atom x \<sharp> e' \<Longrightarrow> atom x \<sharp> subst_term e' x e"
6+ lemma fresh_subst_term : "atom x \<sharp> e' \<Longrightarrow> atom x \<sharp> subst_term e' x e"
77 by ( nominal_induct e avoiding : x e' rule : term . strong_induct ) auto
8- lemma fresh_after_subst_type : "atom a \<sharp> \<tau> \<Longrightarrow> atom a \<sharp> subst_type \<tau> a \<sigma>"
8+ lemma fresh_subst_type : "atom a \<sharp> \<tau> \<Longrightarrow> atom a \<sharp> subst_type \<tau> a \<sigma>"
99 by ( nominal_induct \<sigma> avoiding : a \<tau> rule : \<tau>.strong_induct ) auto
10- lemma fresh_after_subst_term_type : "atom a \<sharp> \<tau> \<Longrightarrow> atom a \<sharp> subst_term_type \<tau> a e"
11- by ( nominal_induct e avoiding : a \<tau> rule : term . strong_induct ) ( auto simp : fresh_after_subst_type )
10+ lemma fresh_subst_term_type : "atom a \<sharp> \<tau> \<Longrightarrow> atom a \<sharp> subst_term_type \<tau> a e"
11+ by ( nominal_induct e avoiding : a \<tau> rule : term . strong_induct ) ( auto simp : fresh_subst_type )
1212
1313(* atom c \<sharp> t \<Longrightarrow> subst t' x t = subst t' c ((x \<leftrightarrow> c) \<bullet> t) *)
1414lemma subst_term_var_name : "atom c \<sharp> e \<Longrightarrow> subst_term e' x e = subst_term e' c ((x \<leftrightarrow> c) \<bullet> e)"
@@ -26,7 +26,7 @@ proof (nominal_induct e avoiding: c a \<tau> rule: term.strong_induct)
2626next
2727 case ( Let x \<tau>1 e1 e2 )
2828 then show ?case
29- by ( smt flip_def fresh_Pair fresh_at_base ( 2 ) list.set ( 1 ) list.set ( 2 ) singletonD subst_term_type.simps ( 7 ) subst_type_var_name swap_fresh_fresh term . fresh ( 7 ) term . perm_simps ( 7 ))
29+ by ( smt flip_def fresh_Pair fresh_at_base ( 2 ) list.set ( 1 ) list.set ( 2 ) singletonD subst_term_type.simps ( 7 ) subst_type_var_name swap_fresh_fresh term . fresh ( 7 ) term . perm_simps ( 7 ))
3030qed ( auto simp : flip_fresh_fresh fresh_at_base subst_type_var_name )
3131
3232(* [[atom a]]lst. t = [[atom a2]]lst. t2 \<Longrightarrow> subst t' a t = subst t' a2 t2 *)
@@ -45,4 +45,42 @@ lemma fresh_not_isin_var: "atom x \<sharp> \<Gamma> \<Longrightarrow> \<not>isin
4545 apply ( induction \<Gamma> ) apply simp
4646 by ( metis ( mono_tags , lifting ) binder . fresh ( 1 ) binder . strong_exhaust fresh_Cons fresh_at_base ( 2 ) isin.simps ( 2 ) isin.simps ( 3 ))
4747
48- end
48+ (* atom x \<sharp> t \<Longrightarrow> subst t' x t = t *)
49+ lemma fresh_subst_term_same : "atom x \<sharp> e \<Longrightarrow> subst_term e' x e = e"
50+ proof ( induction e' x e rule : subst_term.induct )
51+ case ( 2 y e x \<tau> e2 )
52+ then show ?case using fresh_PairD ( 2 ) fresh_at_base ( 2 ) by fastforce
53+ next
54+ case ( 7 y e x \<tau> e1 e2 )
55+ then show ?case using fresh_PairD ( 2 ) fresh_at_base ( 2 ) by fastforce
56+ qed auto
57+
58+ lemma fresh_subst_type_same : "atom a \<sharp> \<sigma> \<Longrightarrow> subst_type \<tau> a \<sigma> = \<sigma>"
59+ proof ( induction \<tau> a \<sigma> rule : subst_type.induct )
60+ case ( 4 b \<tau> a \<sigma> )
61+ then show ?case
62+ using fresh_Pair fresh_at_base ( 2 ) fresh_def list.set ( 1 ) list.set ( 2 ) subst_type.simps ( 4 ) by fastforce
63+ qed auto
64+
65+ lemma fresh_subst_term_type_same : "atom a \<sharp> e \<Longrightarrow> subst_term_type \<tau> a e = e"
66+ proof ( induction \<tau> a e rule : subst_term_type.induct )
67+ case ( 4 b \<tau> a e2 )
68+ then show ?case
69+ by ( simp add : "4.hyps" fresh_Pair fresh_at_base ( 2 ))
70+ qed ( auto simp : fresh_subst_type_same )
71+
72+ (* misc *)
73+ lemma fv_supp_subset : "fv_\<tau> \<tau> \<subseteq> supp \<tau>"
74+ by ( induction \<tau> rule : \<tau>.induct ) ( auto simp : \<tau>.supp \<tau>.fv_defs )
75+
76+ lemma subst_type_order : "\<lbrakk> atom b \<sharp> \<tau>' ; atom b \<sharp> a \<rbrakk> \<Longrightarrow> subst_type \<tau>' a (subst_type \<tau> b \<sigma>') = subst_type (subst_type \<tau>' a \<tau>) b (subst_type \<tau>' a \<sigma>')"
77+ proof ( nominal_induct \<sigma>' avoiding : a b \<tau> \<tau>' rule : \<tau>.strong_induct )
78+ case ( TyVar x )
79+ then show ?case using fresh_at_base ( 2 ) fresh_subst_type_same by auto
80+ next
81+ case ( TyForall x1 x2a )
82+ then show ?case
83+ by ( smt flip_at_simps ( 1 ) flip_at_simps ( 2 ) flip_commute fresh_Pair fresh_subst_type fresh_subst_type_same subst_type.eqvt subst_type.simps ( 4 ) subst_type_var_name )
84+ qed ( auto simp : fresh_subst_type )
85+
86+ end
0 commit comments