author | Christian Urban <urbanc@in.tum.de> |
Thu, 16 Dec 2010 08:42:48 +0000 | |
changeset 2611 | 3d101f2f817c |
parent 2566 | a59d8e1e3a17 |
child 2617 | e44551d067e6 |
permissions | -rw-r--r-- |
1795 | 1 |
theory TypeSchemes |
2454
9ffee4eb1ae1
renamed NewParser to Nominal2
Christian Urban <urbanc@in.tum.de>
parents:
2451
diff
changeset
|
2 |
imports "../Nominal2" |
1795 | 3 |
begin |
4 |
||
5 |
section {*** Type Schemes ***} |
|
6 |
||
2556
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
7 |
atom_decl name |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
8 |
|
2337
b151399bd2c3
fixed according to changes in quotient
Christian Urban <urbanc@in.tum.de>
parents:
2308
diff
changeset
|
9 |
|
2486
b4ea19604b0b
cleaned up two examples
Christian Urban <urbanc@in.tum.de>
parents:
2480
diff
changeset
|
10 |
(* defined as a single nominal datatype *) |
1795 | 11 |
|
2611
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2566
diff
changeset
|
12 |
thm finite_set |
3d101f2f817c
simple cases for strong inducts done; infrastructure for the difficult ones is there
Christian Urban <urbanc@in.tum.de>
parents:
2566
diff
changeset
|
13 |
|
1795 | 14 |
nominal_datatype ty = |
15 |
Var "name" |
|
16 |
| Fun "ty" "ty" |
|
17 |
and tys = |
|
2434 | 18 |
All xs::"name fset" ty::"ty" bind (res) xs in ty |
19 |
||
2468 | 20 |
thm ty_tys.distinct |
21 |
thm ty_tys.induct |
|
22 |
thm ty_tys.exhaust |
|
23 |
thm ty_tys.fv_defs |
|
24 |
thm ty_tys.bn_defs |
|
25 |
thm ty_tys.perm_simps |
|
26 |
thm ty_tys.eq_iff |
|
27 |
thm ty_tys.fv_bn_eqvt |
|
28 |
thm ty_tys.size_eqvt |
|
29 |
thm ty_tys.supports |
|
2493
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2486
diff
changeset
|
30 |
thm ty_tys.supp |
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
31 |
thm ty_tys.fresh |
1795 | 32 |
|
2486
b4ea19604b0b
cleaned up two examples
Christian Urban <urbanc@in.tum.de>
parents:
2480
diff
changeset
|
33 |
(* defined as two separate nominal datatypes *) |
b4ea19604b0b
cleaned up two examples
Christian Urban <urbanc@in.tum.de>
parents:
2480
diff
changeset
|
34 |
|
2308
387fcbd33820
fixed problem with bn_info
Christian Urban <urbanc@in.tum.de>
parents:
2181
diff
changeset
|
35 |
nominal_datatype ty2 = |
387fcbd33820
fixed problem with bn_info
Christian Urban <urbanc@in.tum.de>
parents:
2181
diff
changeset
|
36 |
Var2 "name" |
387fcbd33820
fixed problem with bn_info
Christian Urban <urbanc@in.tum.de>
parents:
2181
diff
changeset
|
37 |
| Fun2 "ty2" "ty2" |
387fcbd33820
fixed problem with bn_info
Christian Urban <urbanc@in.tum.de>
parents:
2181
diff
changeset
|
38 |
|
387fcbd33820
fixed problem with bn_info
Christian Urban <urbanc@in.tum.de>
parents:
2181
diff
changeset
|
39 |
nominal_datatype tys2 = |
2434 | 40 |
All2 xs::"name fset" ty::"ty2" bind (res) xs in ty |
2337
b151399bd2c3
fixed according to changes in quotient
Christian Urban <urbanc@in.tum.de>
parents:
2308
diff
changeset
|
41 |
|
2468 | 42 |
thm tys2.distinct |
43 |
thm tys2.induct |
|
44 |
thm tys2.exhaust |
|
45 |
thm tys2.fv_defs |
|
46 |
thm tys2.bn_defs |
|
47 |
thm tys2.perm_simps |
|
48 |
thm tys2.eq_iff |
|
49 |
thm tys2.fv_bn_eqvt |
|
50 |
thm tys2.size_eqvt |
|
51 |
thm tys2.supports |
|
2493
2e174807c891
added postprocessed fresh-lemmas for constructors
Christian Urban <urbanc@in.tum.de>
parents:
2486
diff
changeset
|
52 |
thm tys2.supp |
2494
11133eb76f61
added Foo1 to explore a contrived example
Christian Urban <urbanc@in.tum.de>
parents:
2493
diff
changeset
|
53 |
thm tys2.fresh |
2468 | 54 |
|
2480
ac7dff1194e8
introduced a general procedure for structural inductions; simplified reflexivity proof
Christian Urban <urbanc@in.tum.de>
parents:
2468
diff
changeset
|
55 |
|
2556
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
56 |
lemma strong_exhaust: |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
57 |
fixes c::"'a::fs" |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
58 |
assumes "\<And>names ty. \<lbrakk>fset (map_fset atom names) \<sharp>* c; y = All2 names ty\<rbrakk> \<Longrightarrow> P" |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
59 |
shows "P" |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
60 |
apply(rule_tac y="y" in tys2.exhaust) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
61 |
apply(rename_tac names ty2) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
62 |
apply(subgoal_tac "\<exists>q. (q \<bullet> (fset (map_fset atom names))) \<sharp>* c \<and> supp (All2 names ty2) \<sharp>* q") |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
63 |
apply(erule exE) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
64 |
apply(perm_simp) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
65 |
apply(erule conjE) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
66 |
apply(rule assms(1)) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
67 |
apply(assumption) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
68 |
apply(clarify) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
69 |
apply(drule supp_perm_eq[symmetric]) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
70 |
apply(simp) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
71 |
apply(rule at_set_avoiding2) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
72 |
apply(simp add: finite_supp) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
73 |
apply(simp add: finite_supp) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
74 |
apply(simp add: finite_supp) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
75 |
apply(simp) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
76 |
apply(simp add: fresh_star_def) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
77 |
apply(simp add: tys2.fresh) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
78 |
done |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
79 |
|
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
80 |
|
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
81 |
lemma strong_induct: |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
82 |
fixes c::"'a::fs" |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
83 |
assumes "\<And>names ty2 c. fset (map_fset atom names) \<sharp>* c \<Longrightarrow> P c (All2 names ty2)" |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
84 |
shows "P c tys" |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
85 |
using assms |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
86 |
apply(induction_schema) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
87 |
apply(rule_tac y="tys" in strong_exhaust) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
88 |
apply(blast) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
89 |
apply(relation "measure (\<lambda>(x,y). size y)") |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
90 |
apply(simp_all add: tys2.size) |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
91 |
done |
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
92 |
|
8ed62410236e
added a test about subtyping; disabled two tests, because of problem with function package
Christian Urban <urbanc@in.tum.de>
parents:
2524
diff
changeset
|
93 |
|
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
94 |
text {* Some Tests *} |
1795 | 95 |
|
96 |
lemma |
|
97 |
shows "All {|a, b|} (Fun (Var a) (Var b)) = All {|b, a|} (Fun (Var a) (Var b))" |
|
98 |
apply(simp add: ty_tys.eq_iff) |
|
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
99 |
apply(simp add: Abs_eq_iff) |
1795 | 100 |
apply(rule_tac x="0::perm" in exI) |
101 |
apply(simp add: alphas) |
|
2040
94e24da9ae75
Move TypeSchemes to NewParser
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
1933
diff
changeset
|
102 |
apply(simp add: fresh_star_def fresh_zero_perm supp_at_base) |
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
103 |
apply(simp add: ty_tys.supp supp_at_base) |
1795 | 104 |
done |
105 |
||
106 |
lemma |
|
107 |
shows "All {|a, b|} (Fun (Var a) (Var b)) = All {|a, b|} (Fun (Var b) (Var a))" |
|
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
108 |
apply(simp add: ty_tys.eq_iff Abs_eq_iff) |
1795 | 109 |
apply(rule_tac x="(atom a \<rightleftharpoons> atom b)" in exI) |
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
110 |
apply(simp add: alphas fresh_star_def supp_at_base ty_tys.supp) |
1795 | 111 |
done |
112 |
||
113 |
lemma |
|
114 |
shows "All {|a, b, c|} (Fun (Var a) (Var b)) = All {|a, b|} (Fun (Var a) (Var b))" |
|
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
115 |
apply(simp add: ty_tys.eq_iff Abs_eq_iff) |
1795 | 116 |
apply(rule_tac x="0::perm" in exI) |
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
117 |
apply(simp add: alphas fresh_star_def ty_tys.supp supp_at_base) |
1795 | 118 |
done |
119 |
||
120 |
lemma |
|
121 |
assumes a: "a \<noteq> b" |
|
122 |
shows "\<not>(All {|a, b|} (Fun (Var a) (Var b)) = All {|c|} (Fun (Var c) (Var c)))" |
|
123 |
using a |
|
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
124 |
apply(simp add: ty_tys.eq_iff Abs_eq_iff) |
1795 | 125 |
apply(clarify) |
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
126 |
apply(simp add: alphas fresh_star_def ty_tys.eq_iff ty_tys.supp supp_at_base) |
1795 | 127 |
apply auto |
128 |
done |
|
129 |
||
2566
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
130 |
|
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
131 |
text {* Some lemmas about fsets *} |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
132 |
|
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
133 |
lemma atom_map_fset_cong: |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
134 |
shows "map_fset atom x = map_fset atom y \<longleftrightarrow> x = y" |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
135 |
apply(rule inj_map_fset_cong) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
136 |
apply(simp add: inj_on_def) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
137 |
done |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
138 |
|
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
139 |
lemma supp_map_fset_atom: |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
140 |
shows "supp (map_fset atom S) = supp S" |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
141 |
unfolding supp_def |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
142 |
apply(perm_simp) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
143 |
apply(simp add: atom_map_fset_cong) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
144 |
done |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
145 |
|
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
146 |
lemma supp_at_fset: |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
147 |
fixes S::"('a::at_base) fset" |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
148 |
shows "supp S = fset (map_fset atom S)" |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
149 |
apply (induct S) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
150 |
apply (simp add: supp_empty_fset) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
151 |
apply (simp add: supp_insert_fset) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
152 |
apply (simp add: supp_at_base) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
153 |
done |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
154 |
|
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
155 |
lemma fresh_star_atom: |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
156 |
fixes a::"'a::at_base" |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
157 |
shows "fset S \<sharp>* a \<Longrightarrow> atom a \<sharp> fset S" |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
158 |
apply (induct S) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
159 |
apply (simp add: fresh_set_empty) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
160 |
apply simp |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
161 |
apply (unfold fresh_def) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
162 |
apply (simp add: supp_of_finite_insert) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
163 |
apply (rule conjI) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
164 |
apply (unfold fresh_star_def) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
165 |
apply simp |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
166 |
apply (unfold fresh_def) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
167 |
apply (simp add: supp_at_base supp_atom) |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
168 |
apply clarify |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
169 |
apply auto |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
170 |
done |
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
171 |
|
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
172 |
|
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
173 |
|
a59d8e1e3a17
moved rest of the lemmas from Nominal2_FSet to the TypeScheme example
Christian Urban <urbanc@in.tum.de>
parents:
2556
diff
changeset
|
174 |
(* |
2179
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
175 |
fun |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
176 |
lookup :: "(name \<times> ty) list \<Rightarrow> name \<Rightarrow> ty" |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
177 |
where |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
178 |
"lookup [] n = Var n" |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
179 |
| "lookup ((p, s) # t) n = (if p = n then s else lookup t n)" |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
180 |
|
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
181 |
locale subst_loc = |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
182 |
fixes |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
183 |
subst :: "(name \<times> ty) list \<Rightarrow> ty \<Rightarrow> ty" |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
184 |
and substs :: "(name \<times> ty) list \<Rightarrow> tys \<Rightarrow> tys" |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
185 |
assumes |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
186 |
s1: "subst \<theta> (Var n) = lookup \<theta> n" |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
187 |
and s2: "subst \<theta> (Fun l r) = Fun (subst \<theta> l) (subst \<theta> r)" |
2524
693562f03eee
major reorganisation of fset (renamed fset_to_set to fset, changed the definition of list_eq and fcard_raw)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
188 |
and s3: "fset (fmap atom xs) \<sharp>* \<theta> \<Longrightarrow> substs \<theta> (All xs t) = All xs (subst \<theta> t)" |
2179
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
189 |
begin |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
190 |
|
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
191 |
lemma subst_ty: |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
192 |
assumes x: "atom x \<sharp> t" |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
193 |
shows "subst [(x, S)] t = t" |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
194 |
using x |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
195 |
apply (induct t rule: ty_tys.induct[of _ "\<lambda>t. True" _ , simplified]) |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
196 |
by (simp_all add: s1 s2 fresh_def ty_tys.fv[simplified ty_tys.supp] supp_at_base) |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
197 |
|
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
198 |
lemma subst_tyS: |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
199 |
shows "atom x \<sharp> T \<longrightarrow> substs [(x, S)] T = T" |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
200 |
apply (rule strong_induct[of |
2180 | 201 |
"\<lambda>a t. True" "\<lambda>(x, S) T. (atom x \<sharp> T \<longrightarrow> substs [(x, S)] T = T)" _ "t" "(x, S)", simplified]) |
202 |
apply clarify |
|
2179
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
203 |
apply (subst s3) |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
204 |
apply (simp add: fresh_star_def fresh_Cons fresh_Nil) |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
205 |
apply (subst subst_ty) |
2180 | 206 |
apply (simp_all add: fresh_star_prod_elim) |
2179
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
207 |
apply (drule fresh_star_atom) |
2180 | 208 |
apply (simp add: fresh_def ty_tys.fv[simplified ty_tys.supp]) |
2524
693562f03eee
major reorganisation of fset (renamed fset_to_set to fset, changed the definition of list_eq and fcard_raw)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
209 |
apply (subgoal_tac "atom a \<notin> fset (fmap atom fset)") |
2179
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
210 |
apply blast |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
211 |
apply (metis supp_finite_atom_set finite_fset) |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
212 |
done |
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
213 |
|
2181
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
214 |
lemma subst_lemma_pre: |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
215 |
"z \<sharp> (N,L) \<longrightarrow> z \<sharp> (subst [(y, L)] N)" |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
216 |
apply (induct N rule: ty_tys.induct[of _ "\<lambda>t. True" _ , simplified]) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
217 |
apply (simp add: s1) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
218 |
apply (auto simp add: fresh_Pair) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
219 |
apply (auto simp add: fresh_def ty_tys.fv[simplified ty_tys.supp])[3] |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
220 |
apply (simp add: s2) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
221 |
apply (auto simp add: fresh_def ty_tys.fv[simplified ty_tys.supp]) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
222 |
done |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
223 |
|
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
224 |
lemma substs_lemma_pre: |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
225 |
"atom z \<sharp> (N,L) \<longrightarrow> atom z \<sharp> (substs [(y, L)] N)" |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
226 |
apply (rule strong_induct[of |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
227 |
"\<lambda>a t. True" "\<lambda>(z, y, L) N. (atom z \<sharp> (N, L) \<longrightarrow> atom z \<sharp> (substs [(y, L)] N))" _ _ "(z, y, L)", simplified]) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
228 |
apply clarify |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
229 |
apply (subst s3) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
230 |
apply (simp add: fresh_star_def fresh_Cons fresh_Nil fresh_Pair) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
231 |
apply (simp_all add: fresh_star_prod_elim fresh_Pair) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
232 |
apply clarify |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
233 |
apply (drule fresh_star_atom) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
234 |
apply (drule fresh_star_atom) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
235 |
apply (simp add: fresh_def) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
236 |
apply (simp only: ty_tys.fv[simplified ty_tys.supp]) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
237 |
apply (subgoal_tac "atom a \<notin> supp (subst [(aa, b)] t)") |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
238 |
apply blast |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
239 |
apply (subgoal_tac "atom a \<notin> supp t") |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
240 |
apply (fold fresh_def)[1] |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
241 |
apply (rule mp[OF subst_lemma_pre]) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
242 |
apply (simp add: fresh_Pair) |
2524
693562f03eee
major reorganisation of fset (renamed fset_to_set to fset, changed the definition of list_eq and fcard_raw)
Christian Urban <urbanc@in.tum.de>
parents:
2494
diff
changeset
|
243 |
apply (subgoal_tac "atom a \<notin> (fset (fmap atom fset))") |
2181
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
244 |
apply blast |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
245 |
apply (metis supp_finite_atom_set finite_fset) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
246 |
done |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
247 |
|
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
248 |
lemma subst_lemma: |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
249 |
shows "x \<noteq> y \<and> atom x \<sharp> L \<longrightarrow> |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
250 |
subst [(y, L)] (subst [(x, N)] M) = |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
251 |
subst [(x, (subst [(y, L)] N))] (subst [(y, L)] M)" |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
252 |
apply (induct M rule: ty_tys.induct[of _ "\<lambda>t. True" _ , simplified]) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
253 |
apply (simp_all add: s1 s2) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
254 |
apply clarify |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
255 |
apply (subst (2) subst_ty) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
256 |
apply simp_all |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
257 |
done |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
258 |
|
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
259 |
lemma substs_lemma: |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
260 |
shows "x \<noteq> y \<and> atom x \<sharp> L \<longrightarrow> |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
261 |
substs [(y, L)] (substs [(x, N)] M) = |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
262 |
substs [(x, (subst [(y, L)] N))] (substs [(y, L)] M)" |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
263 |
apply (rule strong_induct[of |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
264 |
"\<lambda>a t. True" "\<lambda>(x, y, N, L) M. x \<noteq> y \<and> atom x \<sharp> L \<longrightarrow> |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
265 |
substs [(y, L)] (substs [(x, N)] M) = |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
266 |
substs [(x, (subst [(y, L)] N))] (substs [(y, L)] M)" _ _ "(x, y, N, L)", simplified]) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
267 |
apply clarify |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
268 |
apply (simp_all add: fresh_star_prod_elim fresh_Pair) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
269 |
apply (subst s3) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
270 |
apply (unfold fresh_star_def)[1] |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
271 |
apply (simp add: fresh_Cons fresh_Nil fresh_Pair) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
272 |
apply (subst s3) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
273 |
apply (unfold fresh_star_def)[1] |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
274 |
apply (simp add: fresh_Cons fresh_Nil fresh_Pair) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
275 |
apply (subst s3) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
276 |
apply (unfold fresh_star_def)[1] |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
277 |
apply (simp add: fresh_Cons fresh_Nil fresh_Pair) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
278 |
apply (subst s3) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
279 |
apply (unfold fresh_star_def)[1] |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
280 |
apply (simp add: fresh_Cons fresh_Nil fresh_Pair) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
281 |
apply (rule ballI) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
282 |
apply (rule mp[OF subst_lemma_pre]) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
283 |
apply (simp add: fresh_Pair) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
284 |
apply (subst subst_lemma) |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
285 |
apply simp_all |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
286 |
done |
b997c22805ae
Substitution Lemma for TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2180
diff
changeset
|
287 |
|
2179
7687f97eca53
A lemma about substitution in TypeSchemes.
Cezary Kaliszyk <kaliszyk@in.tum.de>
parents:
2120
diff
changeset
|
288 |
end |
1795 | 289 |
*) |
290 |
||
291 |
||
292 |
end |