|
1 |
|
2 |
|
3 theory Equ = Main + Terms + Fresh + PreEqu: |
|
4 |
|
5 lemma equ_refl: |
|
6 "nabla\<turnstile>t\<approx>t" |
|
7 apply(induct_tac t) |
|
8 apply(auto simp add: ds_def) |
|
9 done |
|
10 |
|
11 |
|
12 lemma |
|
13 equ_sym: "nabla\<turnstile>t1\<approx>t2 \<Longrightarrow> nabla\<turnstile>t2\<approx>t1" and |
|
14 equ_trans: "\<lbrakk>nabla\<turnstile>t1\<approx>t2;nabla\<turnstile>t2\<approx>t3\<rbrakk> \<Longrightarrow> nabla\<turnstile>t1\<approx>t3" and |
|
15 equ_add_pi: "nabla\<turnstile>t1\<approx>t2 \<Longrightarrow> nabla\<turnstile>swap pi t1\<approx>swap pi t2" |
|
16 apply(insert big) |
|
17 apply(best)+ |
|
18 done |
|
19 |
|
20 |
|
21 lemma equ_dec_pi: |
|
22 "nabla\<turnstile>swap pi t1\<approx>swap pi t2\<Longrightarrow>nabla\<turnstile>t1\<approx>t2" |
|
23 apply(drule_tac pi="(rev pi)" in equ_add_pi) |
|
24 apply(subgoal_tac "nabla\<turnstile>swap (rev pi) (swap pi t2)\<approx>t2") |
|
25 apply(drule_tac "t1.0"="swap (rev pi) (swap pi t1)" and |
|
26 "t2.0"="swap (rev pi) (swap pi t2)" and |
|
27 "t3.0"="t2" in equ_trans) |
|
28 apply(assumption) |
|
29 apply(subgoal_tac "nabla\<turnstile>t1\<approx>swap (rev pi) (swap pi t1)") |
|
30 apply(drule_tac "t1.0"="t1" and |
|
31 "t2.0"="swap (rev pi) (swap pi t1)" and |
|
32 "t3.0"="t2" in equ_trans) |
|
33 apply(assumption)+ |
|
34 apply(rule equ_sym) |
|
35 apply(rule rev_pi_pi_equ) |
|
36 apply(rule rev_pi_pi_equ) |
|
37 done |
|
38 |
|
39 lemma equ_involutive_left: |
|
40 "nabla\<turnstile>swap (rev pi) (swap pi t1)\<approx>t2 = nabla\<turnstile>t1\<approx>t2" |
|
41 apply(auto) |
|
42 apply(subgoal_tac "nabla \<turnstile> t1\<approx> swap (rev pi) (swap pi t1)") |
|
43 apply(drule_tac "t2.0"="swap (rev pi) (swap pi t1)" and |
|
44 "t1.0"="t1" and "t3.0"="t2" in equ_trans) |
|
45 apply(assumption)+ |
|
46 apply(rule equ_sym) |
|
47 apply(rule rev_pi_pi_equ) |
|
48 apply(subgoal_tac "nabla \<turnstile> swap (rev pi) (swap pi t1)\<approx>t1") |
|
49 apply(drule_tac "t1.0"="swap (rev pi) (swap pi t1)" and |
|
50 "t2.0"="t1" and "t3.0"="t2" in equ_trans) |
|
51 apply(assumption)+ |
|
52 apply(rule rev_pi_pi_equ) |
|
53 done |
|
54 |
|
55 lemma equ_pi_to_left: |
|
56 "nabla\<turnstile>swap (rev pi) t1\<approx>t2 = nabla\<turnstile>t1\<approx> swap pi t2" |
|
57 apply(auto) |
|
58 apply(rule_tac pi="rev pi" in equ_dec_pi) |
|
59 apply(rule equ_sym) |
|
60 apply(simp only: equ_involutive_left) |
|
61 apply(rule equ_sym) |
|
62 apply(assumption) |
|
63 apply(drule_tac pi="rev pi" in equ_add_pi) |
|
64 apply(drule equ_sym) |
|
65 apply(simp only: equ_involutive_left) |
|
66 apply(drule equ_sym) |
|
67 apply(assumption) |
|
68 done |
|
69 |
|
70 lemma equ_pi_to_right: |
|
71 "nabla\<turnstile>t1\<approx>swap (rev pi) t2 = nabla\<turnstile>swap pi t1\<approx>t2" |
|
72 apply(auto) |
|
73 apply(rule_tac pi="rev pi" in equ_dec_pi) |
|
74 apply(simp only: equ_involutive_left) |
|
75 apply(drule_tac pi="rev pi" in equ_add_pi) |
|
76 apply(simp only: equ_involutive_left) |
|
77 done |
|
78 |
|
79 lemma equ_involutive_right: |
|
80 "nabla\<turnstile>t1\<approx>swap (rev pi) (swap pi t2) = nabla\<turnstile>t1\<approx>t2" |
|
81 apply(simp only: swap_append[THEN sym]) |
|
82 apply(simp only: equ_pi_to_left[THEN sym]) |
|
83 apply(simp) |
|
84 apply(simp only: swap_append) |
|
85 apply(simp only: equ_involutive_left) |
|
86 done |
|
87 |
|
88 lemma equ_pi1_pi2_add: |
|
89 "(\<forall>a\<in> ds pi1 pi2. nabla\<turnstile>a\<sharp>t)\<longrightarrow>(nabla\<turnstile>swap pi1 t \<approx> swap pi2 t)" |
|
90 apply(rule impI) |
|
91 apply(simp only: equ_pi_to_right[THEN sym]) |
|
92 apply(simp only: swap_append[THEN sym]) |
|
93 apply(rule equ_pi_right[THEN spec, THEN mp]) |
|
94 apply(auto) |
|
95 apply(simp only: ds_rev) |
|
96 done |
|
97 |
|
98 lemma pi_right_equ: "(nabla\<turnstile>t \<approx> swap pi t)\<longrightarrow>(\<forall>a\<in> ds [] pi. nabla\<turnstile>a\<sharp>t)" |
|
99 apply(insert pi_right_equ_help) |
|
100 apply(best) |
|
101 done |
|
102 |
|
103 lemma equ_pi1_pi2_dec: |
|
104 "(nabla\<turnstile>swap pi1 t \<approx> swap pi2 t)\<longrightarrow>(\<forall>a\<in> ds pi1 pi2. nabla\<turnstile>a\<sharp>t)" |
|
105 apply(rule impI) |
|
106 apply(simp only: equ_pi_to_right[THEN sym]) |
|
107 apply(simp only: swap_append[THEN sym]) |
|
108 apply(drule pi_right_equ[THEN mp]) |
|
109 apply(simp only: ds_rev) |
|
110 done |
|
111 |
|
112 lemma equ_weak: |
|
113 "nabla1\<turnstile>t1\<approx>t2\<longrightarrow>(nabla1\<union>nabla2)\<turnstile>t1\<approx>t2" |
|
114 apply(rule impI) |
|
115 apply(erule equ.induct) |
|
116 apply(auto simp add: fresh_weak) |
|
117 done |
|
118 |
|
119 (* no term can be equal to one of its proper subterm *) |
|
120 lemma psub_trm_not_equ: |
|
121 "\<forall> t2\<in>psub_trms t1. (\<not>(\<exists> pi. (nabla\<turnstile>t1\<approx>swap pi t2)))" |
|
122 apply(induct t1) |
|
123 apply(auto) |
|
124 apply(simp add: equ_pi_to_left[THEN sym]) |
|
125 apply(ind_cases "nabla \<turnstile> Abst (swapas (rev pi) list) (swap (rev pi) trm) \<approx> t2") |
|
126 apply(simp_all) |
|
127 apply(drule abst_psub_trms) |
|
128 apply(drule_tac x="t2a" in bspec) |
|
129 apply(simp) |
|
130 apply(simp add: equ_pi_to_left[THEN sym] swap_append[THEN sym]) |
|
131 apply(drule_tac x="rev (((swapas (rev pi) list, b) # rev pi))" in spec) |
|
132 apply(simp) |
|
133 apply(drule abst_psub_trms) |
|
134 apply(drule_tac x="t2a" in bspec) |
|
135 apply(simp) |
|
136 apply(simp) |
|
137 apply(simp add: equ_pi_to_left[THEN sym]) |
|
138 apply(ind_cases "nabla \<turnstile> Paar (swap (rev pi) trm1) (swap (rev pi) trm2) \<approx> t2") |
|
139 apply(simp) |
|
140 apply(drule paar_psub_trms) |
|
141 apply(best) |
|
142 apply(simp add: equ_pi_to_left[THEN sym]) |
|
143 apply(ind_cases "nabla \<turnstile> Paar (swap (rev pi) trm1) (swap (rev pi) trm2) \<approx> t2") |
|
144 apply(simp) |
|
145 apply(drule paar_psub_trms) |
|
146 apply(best) |
|
147 apply(simp add: equ_pi_to_left[THEN sym]) |
|
148 apply(ind_cases "nabla \<turnstile> Func list (swap (rev pi) trm) \<approx> t2") |
|
149 apply(simp_all) |
|
150 apply(drule func_psub_trms) |
|
151 apply(best) |
|
152 done |
|
153 |
|
154 |
|
155 |
|
156 end |