equal
deleted
inserted
replaced
401 by Auto_tac; |
401 by Auto_tac; |
402 bind_thm ("rev_exhaust", |
402 bind_thm ("rev_exhaust", |
403 impI RSN (2,allI RSN (2,allI RSN (2,impI RS (result() RS mp RS mp))))); |
403 impI RSN (2,allI RSN (2,allI RSN (2,impI RS (result() RS mp RS mp))))); |
404 |
404 |
405 |
405 |
406 (** mem **) |
|
407 |
|
408 section "mem"; |
|
409 |
|
410 Goal "x mem (xs@ys) = (x mem xs | x mem ys)"; |
|
411 by (induct_tac "xs" 1); |
|
412 by Auto_tac; |
|
413 qed "mem_append"; |
|
414 Addsimps[mem_append]; |
|
415 |
|
416 Goal "x mem [x:xs. P(x)] = (x mem xs & P(x))"; |
|
417 by (induct_tac "xs" 1); |
|
418 by Auto_tac; |
|
419 qed "mem_filter"; |
|
420 Addsimps[mem_filter]; |
|
421 |
|
422 (** set **) |
406 (** set **) |
423 |
407 |
424 section "set"; |
408 section "set"; |
425 |
409 |
426 qed_goal "finite_set" thy "finite (set xs)" |
410 qed_goal "finite_set" thy "finite (set xs)" |
432 by (induct_tac "xs" 1); |
416 by (induct_tac "xs" 1); |
433 by Auto_tac; |
417 by Auto_tac; |
434 qed "set_append"; |
418 qed "set_append"; |
435 Addsimps[set_append]; |
419 Addsimps[set_append]; |
436 |
420 |
437 Goal "(x mem xs) = (x: set xs)"; |
|
438 by (induct_tac "xs" 1); |
|
439 by Auto_tac; |
|
440 qed "set_mem_eq"; |
|
441 |
|
442 Goal "set l <= set (x#l)"; |
421 Goal "set l <= set (x#l)"; |
443 by Auto_tac; |
422 by Auto_tac; |
444 qed "set_subset_Cons"; |
423 qed "set_subset_Cons"; |
445 |
424 |
446 Goal "(set xs = {}) = (xs = [])"; |
425 Goal "(set xs = {}) = (xs = [])"; |
459 by (induct_tac "xs" 1); |
438 by (induct_tac "xs" 1); |
460 by Auto_tac; |
439 by Auto_tac; |
461 qed "set_map"; |
440 qed "set_map"; |
462 Addsimps [set_map]; |
441 Addsimps [set_map]; |
463 |
442 |
464 Goal "(x : set(filter P xs)) = (x : set xs & P x)"; |
443 Goal "(x : set (filter P xs)) = (x : set xs & P x)"; |
465 by (induct_tac "xs" 1); |
444 by (induct_tac "xs" 1); |
466 by Auto_tac; |
445 by Auto_tac; |
467 qed "in_set_filter"; |
446 qed "in_set_filter"; |
468 Addsimps [in_set_filter]; |
447 Addsimps [in_set_filter]; |
469 |
448 |
492 |
471 |
493 (** list_all **) |
472 (** list_all **) |
494 |
473 |
495 section "list_all"; |
474 section "list_all"; |
496 |
475 |
497 Goal "list_all (%x. True) xs = True"; |
476 Goal "list_all P (xs@ys) = (list_all P xs & list_all P ys)"; |
498 by (induct_tac "xs" 1); |
|
499 by Auto_tac; |
|
500 qed "list_all_True"; |
|
501 Addsimps [list_all_True]; |
|
502 |
|
503 Goal "list_all p (xs@ys) = (list_all p xs & list_all p ys)"; |
|
504 by (induct_tac "xs" 1); |
477 by (induct_tac "xs" 1); |
505 by Auto_tac; |
478 by Auto_tac; |
506 qed "list_all_append"; |
479 qed "list_all_append"; |
507 Addsimps [list_all_append]; |
480 Addsimps [list_all_append]; |
508 |
481 |
509 Goal "list_all P xs = (!x. x mem xs --> P(x))"; |
482 Goal "list_all P xs = (!x. x mem xs --> P x)"; |
510 by (induct_tac "xs" 1); |
483 by (induct_tac "xs" 1); |
511 by Auto_tac; |
484 by Auto_tac; |
512 qed "list_all_mem_conv"; |
485 qed "list_all_conv"; |
513 |
486 |
514 |
487 |
515 (** filter **) |
488 (** filter **) |
516 |
489 |
517 section "filter"; |
490 section "filter"; |
536 |
509 |
537 Goal "length (filter P xs) <= length xs"; |
510 Goal "length (filter P xs) <= length xs"; |
538 by (induct_tac "xs" 1); |
511 by (induct_tac "xs" 1); |
539 by Auto_tac; |
512 by Auto_tac; |
540 qed "length_filter"; |
513 qed "length_filter"; |
541 |
514 Addsimps[length_filter]; |
542 |
515 |
543 (** concat **) |
516 Goal "set (filter P xs) <= set xs"; |
|
517 by Auto_tac; |
|
518 qed "filter_is_subset"; |
|
519 Addsimps [filter_is_subset]; |
|
520 |
544 |
521 |
545 section "concat"; |
522 section "concat"; |
546 |
523 |
547 Goal "concat(xs@ys) = concat(xs)@concat(ys)"; |
524 Goal "concat(xs@ys) = concat(xs)@concat(ys)"; |
548 by (induct_tac "xs" 1); |
525 by (induct_tac "xs" 1); |