equal
deleted
inserted
replaced
172 "(!x. x : set xs --> f x = g x) --> map f xs = map g xs"; |
172 "(!x. x : set xs --> f x = g x) --> map f xs = map g xs"; |
173 by (induct_tac "xs" 1); |
173 by (induct_tac "xs" 1); |
174 by (ALLGOALS Asm_simp_tac); |
174 by (ALLGOALS Asm_simp_tac); |
175 bind_thm("map_ext", impI RS (allI RS (result() RS mp))); |
175 bind_thm("map_ext", impI RS (allI RS (result() RS mp))); |
176 |
176 |
177 goal thy "map (%x.x) = (%xs.xs)"; |
177 goal thy "map (%x. x) = (%xs. xs)"; |
178 by (rtac ext 1); |
178 by (rtac ext 1); |
179 by (induct_tac "xs" 1); |
179 by (induct_tac "xs" 1); |
180 by (ALLGOALS Asm_simp_tac); |
180 by (ALLGOALS Asm_simp_tac); |
181 qed "map_ident"; |
181 qed "map_ident"; |
182 Addsimps[map_ident]; |
182 Addsimps[map_ident]; |
233 by (induct_tac "xs" 1); |
233 by (induct_tac "xs" 1); |
234 by (ALLGOALS (asm_simp_tac (!simpset setloop (split_tac [expand_if])))); |
234 by (ALLGOALS (asm_simp_tac (!simpset setloop (split_tac [expand_if])))); |
235 qed "mem_append"; |
235 qed "mem_append"; |
236 Addsimps[mem_append]; |
236 Addsimps[mem_append]; |
237 |
237 |
238 goal thy "x mem [x:xs.P(x)] = (x mem xs & P(x))"; |
238 goal thy "x mem [x:xs. P(x)] = (x mem xs & P(x))"; |
239 by (induct_tac "xs" 1); |
239 by (induct_tac "xs" 1); |
240 by (ALLGOALS (asm_simp_tac (!simpset setloop (split_tac [expand_if])))); |
240 by (ALLGOALS (asm_simp_tac (!simpset setloop (split_tac [expand_if])))); |
241 qed "mem_filter"; |
241 qed "mem_filter"; |
242 Addsimps[mem_filter]; |
242 Addsimps[mem_filter]; |
243 |
243 |
283 |
283 |
284 (** list_all **) |
284 (** list_all **) |
285 |
285 |
286 section "list_all"; |
286 section "list_all"; |
287 |
287 |
288 goal thy "list_all (%x.True) xs = True"; |
288 goal thy "list_all (%x. True) xs = True"; |
289 by (induct_tac "xs" 1); |
289 by (induct_tac "xs" 1); |
290 by (ALLGOALS Asm_simp_tac); |
290 by (ALLGOALS Asm_simp_tac); |
291 qed "list_all_True"; |
291 qed "list_all_True"; |
292 Addsimps [list_all_True]; |
292 Addsimps [list_all_True]; |
293 |
293 |
597 by (Blast_tac 1); |
597 by (Blast_tac 1); |
598 bind_thm("takeWhile_append1", conjI RS (result() RS mp)); |
598 bind_thm("takeWhile_append1", conjI RS (result() RS mp)); |
599 Addsimps [takeWhile_append1]; |
599 Addsimps [takeWhile_append1]; |
600 |
600 |
601 goal thy |
601 goal thy |
602 "(!x:set xs.P(x)) --> takeWhile P (xs @ ys) = xs @ takeWhile P ys"; |
602 "(!x:set xs. P(x)) --> takeWhile P (xs @ ys) = xs @ takeWhile P ys"; |
603 by (induct_tac "xs" 1); |
603 by (induct_tac "xs" 1); |
604 by (Simp_tac 1); |
604 by (Simp_tac 1); |
605 by (asm_full_simp_tac (!simpset setloop (split_tac[expand_if])) 1); |
605 by (asm_full_simp_tac (!simpset setloop (split_tac[expand_if])) 1); |
606 bind_thm("takeWhile_append2", ballI RS (result() RS mp)); |
606 bind_thm("takeWhile_append2", ballI RS (result() RS mp)); |
607 Addsimps [takeWhile_append2]; |
607 Addsimps [takeWhile_append2]; |
614 by (Blast_tac 1); |
614 by (Blast_tac 1); |
615 bind_thm("dropWhile_append1", conjI RS (result() RS mp)); |
615 bind_thm("dropWhile_append1", conjI RS (result() RS mp)); |
616 Addsimps [dropWhile_append1]; |
616 Addsimps [dropWhile_append1]; |
617 |
617 |
618 goal thy |
618 goal thy |
619 "(!x:set xs.P(x)) --> dropWhile P (xs @ ys) = dropWhile P ys"; |
619 "(!x:set xs. P(x)) --> dropWhile P (xs @ ys) = dropWhile P ys"; |
620 by (induct_tac "xs" 1); |
620 by (induct_tac "xs" 1); |
621 by (Simp_tac 1); |
621 by (Simp_tac 1); |
622 by (asm_full_simp_tac (!simpset setloop (split_tac[expand_if])) 1); |
622 by (asm_full_simp_tac (!simpset setloop (split_tac[expand_if])) 1); |
623 bind_thm("dropWhile_append2", ballI RS (result() RS mp)); |
623 bind_thm("dropWhile_append2", ballI RS (result() RS mp)); |
624 Addsimps [dropWhile_append2]; |
624 Addsimps [dropWhile_append2]; |