97 |
97 |
98 Addsimps [ball_triv, bex_triv]; |
98 Addsimps [ball_triv, bex_triv]; |
99 |
99 |
100 (** Congruence rules **) |
100 (** Congruence rules **) |
101 |
101 |
102 val prems = Goal |
102 val prems = Goalw [Ball_def] |
103 "[| A=B; !!x. x:B ==> P(x) = Q(x) |] ==> \ |
103 "[| A=B; !!x. x:B ==> P(x) = Q(x) |] ==> \ |
104 \ (! x:A. P(x)) = (! x:B. Q(x))"; |
104 \ (! x:A. P(x)) = (! x:B. Q(x))"; |
105 by (resolve_tac (prems RL [ssubst]) 1); |
105 by (asm_simp_tac (simpset() addsimps prems) 1); |
106 by (REPEAT (ares_tac [ballI,iffI] 1 |
|
107 ORELSE eresolve_tac ([make_elim bspec, mp] @ (prems RL [iffE])) 1)); |
|
108 qed "ball_cong"; |
106 qed "ball_cong"; |
109 |
107 |
110 val prems = Goal |
108 val prems = Goalw [Bex_def] |
111 "[| A=B; !!x. x:B ==> P(x) = Q(x) |] ==> \ |
109 "[| A=B; !!x. x:B ==> P(x) = Q(x) |] ==> \ |
112 \ (? x:A. P(x)) = (? x:B. Q(x))"; |
110 \ (? x:A. P(x)) = (? x:B. Q(x))"; |
113 by (resolve_tac (prems RL [ssubst]) 1); |
111 by (asm_simp_tac (simpset() addcongs [conj_cong] addsimps prems) 1); |
114 by (REPEAT (etac bexE 1 |
|
115 ORELSE ares_tac ([bexI,iffI] @ (prems RL [iffD1,iffD2])) 1)); |
|
116 qed "bex_cong"; |
112 qed "bex_cong"; |
|
113 |
|
114 Addcongs [ball_cong,bex_cong]; |
117 |
115 |
118 section "Subsets"; |
116 section "Subsets"; |
119 |
117 |
120 val prems = Goalw [subset_def] "(!!x. x:A ==> x:B) ==> A <= B"; |
118 val prems = Goalw [subset_def] "(!!x. x:A ==> x:B) ==> A <= B"; |
121 by (REPEAT (ares_tac (prems @ [ballI]) 1)); |
119 by (REPEAT (ares_tac (prems @ [ballI]) 1)); |
494 qed "UN_E"; |
492 qed "UN_E"; |
495 |
493 |
496 AddIs [UN_I]; |
494 AddIs [UN_I]; |
497 AddSEs [UN_E]; |
495 AddSEs [UN_E]; |
498 |
496 |
499 val prems = Goal |
497 val prems = Goalw [UNION_def] |
500 "[| A=B; !!x. x:B ==> C(x) = D(x) |] ==> \ |
498 "[| A=B; !!x. x:B ==> C(x) = D(x) |] ==> \ |
501 \ (UN x:A. C(x)) = (UN x:B. D(x))"; |
499 \ (UN x:A. C(x)) = (UN x:B. D(x))"; |
502 by (REPEAT (etac UN_E 1 |
500 by (asm_simp_tac (simpset() addsimps prems) 1); |
503 ORELSE ares_tac ([UN_I,equalityI,subsetI] @ |
|
504 (prems RL [equalityD1,equalityD2] RL [subsetD])) 1)); |
|
505 qed "UN_cong"; |
501 qed "UN_cong"; |
506 |
502 |
507 |
503 |
508 section "Intersections of families -- INTER x:A. B(x) is Inter(B``A)"; |
504 section "Intersections of families -- INTER x:A. B(x) is Inter(B``A)"; |
509 |
505 |
530 qed "INT_E"; |
526 qed "INT_E"; |
531 |
527 |
532 AddSIs [INT_I]; |
528 AddSIs [INT_I]; |
533 AddEs [INT_D, INT_E]; |
529 AddEs [INT_D, INT_E]; |
534 |
530 |
535 val prems = Goal |
531 val prems = Goalw [INTER_def] |
536 "[| A=B; !!x. x:B ==> C(x) = D(x) |] ==> \ |
532 "[| A=B; !!x. x:B ==> C(x) = D(x) |] ==> \ |
537 \ (INT x:A. C(x)) = (INT x:B. D(x))"; |
533 \ (INT x:A. C(x)) = (INT x:B. D(x))"; |
538 by (REPEAT_FIRST (resolve_tac [INT_I,equalityI,subsetI])); |
534 by (asm_simp_tac (simpset() addsimps prems) 1); |
539 by (REPEAT (dtac INT_D 1 |
|
540 ORELSE ares_tac (prems RL [equalityD1,equalityD2] RL [subsetD]) 1)); |
|
541 qed "INT_cong"; |
535 qed "INT_cong"; |
542 |
536 |
543 |
537 |
544 section "Union"; |
538 section "Union"; |
545 |
539 |
674 val mem_simps = [insert_iff, empty_iff, Un_iff, Int_iff, Compl_iff, Diff_iff, |
668 val mem_simps = [insert_iff, empty_iff, Un_iff, Int_iff, Compl_iff, Diff_iff, |
675 mem_Collect_eq, UN_iff, Union_iff, INT_iff, Inter_iff]; |
669 mem_Collect_eq, UN_iff, Union_iff, INT_iff, Inter_iff]; |
676 |
670 |
677 val mksimps_pairs = ("Ball",[bspec]) :: mksimps_pairs; |
671 val mksimps_pairs = ("Ball",[bspec]) :: mksimps_pairs; |
678 |
672 |
679 simpset_ref() := simpset() addcongs [ball_cong,bex_cong] |
673 simpset_ref() := simpset() setmksimps (mksimps mksimps_pairs); |
680 setmksimps (mksimps mksimps_pairs); |
|
681 |
674 |
682 Addsimps[subset_UNIV, subset_refl]; |
675 Addsimps[subset_UNIV, subset_refl]; |
683 |
676 |
684 |
677 |
685 (*** < ***) |
678 (*** < ***) |