129 by (rtac singletonI 1); |
129 by (rtac singletonI 1); |
130 by (REPEAT (eresolve_tac [imageE, Abs_Node_inject RS apfstE, |
130 by (REPEAT (eresolve_tac [imageE, Abs_Node_inject RS apfstE, |
131 Pair_inject, sym RS Push_neq_K0] 1 |
131 Pair_inject, sym RS Push_neq_K0] 1 |
132 ORELSE resolve_tac [Node_K0_I, Rep_Node RS Node_Push_I] 1)); |
132 ORELSE resolve_tac [Node_K0_I, Rep_Node RS Node_Push_I] 1)); |
133 qed "Scons_not_Atom"; |
133 qed "Scons_not_Atom"; |
134 val Atom_not_Scons = standard (Scons_not_Atom RS not_sym); |
134 bind_thm ("Atom_not_Scons", (Scons_not_Atom RS not_sym)); |
135 |
135 |
136 val Scons_neq_Atom = standard (Scons_not_Atom RS notE); |
136 bind_thm ("Scons_neq_Atom", (Scons_not_Atom RS notE)); |
137 val Atom_neq_Scons = sym RS Scons_neq_Atom; |
137 val Atom_neq_Scons = sym RS Scons_neq_Atom; |
138 |
138 |
139 (*** Injectiveness ***) |
139 (*** Injectiveness ***) |
140 |
140 |
141 (** Atomic nodes **) |
141 (** Atomic nodes **) |
222 (** Scons vs Leaf **) |
222 (** Scons vs Leaf **) |
223 |
223 |
224 goalw Univ.thy [Leaf_def,o_def] "(M$N) ~= Leaf(a)"; |
224 goalw Univ.thy [Leaf_def,o_def] "(M$N) ~= Leaf(a)"; |
225 by (rtac Scons_not_Atom 1); |
225 by (rtac Scons_not_Atom 1); |
226 qed "Scons_not_Leaf"; |
226 qed "Scons_not_Leaf"; |
227 val Leaf_not_Scons = standard (Scons_not_Leaf RS not_sym); |
227 bind_thm ("Leaf_not_Scons", (Scons_not_Leaf RS not_sym)); |
228 |
228 |
229 val Scons_neq_Leaf = standard (Scons_not_Leaf RS notE); |
229 bind_thm ("Scons_neq_Leaf", (Scons_not_Leaf RS notE)); |
230 val Leaf_neq_Scons = sym RS Scons_neq_Leaf; |
230 val Leaf_neq_Scons = sym RS Scons_neq_Leaf; |
231 |
231 |
232 (** Scons vs Numb **) |
232 (** Scons vs Numb **) |
233 |
233 |
234 goalw Univ.thy [Numb_def,o_def] "(M$N) ~= Numb(k)"; |
234 goalw Univ.thy [Numb_def,o_def] "(M$N) ~= Numb(k)"; |
235 by (rtac Scons_not_Atom 1); |
235 by (rtac Scons_not_Atom 1); |
236 qed "Scons_not_Numb"; |
236 qed "Scons_not_Numb"; |
237 val Numb_not_Scons = standard (Scons_not_Numb RS not_sym); |
237 bind_thm ("Numb_not_Scons", (Scons_not_Numb RS not_sym)); |
238 |
238 |
239 val Scons_neq_Numb = standard (Scons_not_Numb RS notE); |
239 bind_thm ("Scons_neq_Numb", (Scons_not_Numb RS notE)); |
240 val Numb_neq_Scons = sym RS Scons_neq_Numb; |
240 val Numb_neq_Scons = sym RS Scons_neq_Numb; |
241 |
241 |
242 (** Leaf vs Numb **) |
242 (** Leaf vs Numb **) |
243 |
243 |
244 goalw Univ.thy [Leaf_def,Numb_def] "Leaf(a) ~= Numb(k)"; |
244 goalw Univ.thy [Leaf_def,Numb_def] "Leaf(a) ~= Numb(k)"; |
245 by (simp_tac (HOL_ss addsimps [Atom_Atom_eq,Inl_not_Inr]) 1); |
245 by (simp_tac (HOL_ss addsimps [Atom_Atom_eq,Inl_not_Inr]) 1); |
246 qed "Leaf_not_Numb"; |
246 qed "Leaf_not_Numb"; |
247 val Numb_not_Leaf = standard (Leaf_not_Numb RS not_sym); |
247 bind_thm ("Numb_not_Leaf", (Leaf_not_Numb RS not_sym)); |
248 |
248 |
249 val Leaf_neq_Numb = standard (Leaf_not_Numb RS notE); |
249 bind_thm ("Leaf_neq_Numb", (Leaf_not_Numb RS notE)); |
250 val Numb_neq_Leaf = sym RS Leaf_neq_Numb; |
250 val Numb_neq_Leaf = sym RS Leaf_neq_Numb; |
251 |
251 |
252 |
252 |
253 (*** ndepth -- the depth of a node ***) |
253 (*** ndepth -- the depth of a node ***) |
254 |
254 |
390 goalw Univ.thy [In0_def,In1_def] "In0(M) ~= In1(N)"; |
390 goalw Univ.thy [In0_def,In1_def] "In0(M) ~= In1(N)"; |
391 by (rtac notI 1); |
391 by (rtac notI 1); |
392 by (etac (Scons_inject1 RS Numb_inject RS Zero_neq_Suc) 1); |
392 by (etac (Scons_inject1 RS Numb_inject RS Zero_neq_Suc) 1); |
393 qed "In0_not_In1"; |
393 qed "In0_not_In1"; |
394 |
394 |
395 val In1_not_In0 = standard (In0_not_In1 RS not_sym); |
395 bind_thm ("In1_not_In0", (In0_not_In1 RS not_sym)); |
396 val In0_neq_In1 = standard (In0_not_In1 RS notE); |
396 bind_thm ("In0_neq_In1", (In0_not_In1 RS notE)); |
397 val In1_neq_In0 = sym RS In0_neq_In1; |
397 val In1_neq_In0 = sym RS In0_neq_In1; |
398 |
398 |
399 val [major] = goalw Univ.thy [In0_def] "In0(M) = In0(N) ==> M=N"; |
399 val [major] = goalw Univ.thy [In0_def] "In0(M) = In0(N) ==> M=N"; |
400 by (rtac (major RS Scons_inject2) 1); |
400 by (rtac (major RS Scons_inject2) 1); |
401 qed "In0_inject"; |
401 qed "In0_inject"; |