189 (*Anti-symmetry of the subset relation*) |
189 (*Anti-symmetry of the subset relation*) |
190 Goal "[| A <= B; B <= A |] ==> A = (B::'a set)"; |
190 Goal "[| A <= B; B <= A |] ==> A = (B::'a set)"; |
191 by (rtac set_ext 1); |
191 by (rtac set_ext 1); |
192 by (blast_tac (claset() addIs [subsetD]) 1); |
192 by (blast_tac (claset() addIs [subsetD]) 1); |
193 qed "subset_antisym"; |
193 qed "subset_antisym"; |
194 val equalityI = subset_antisym; |
194 bind_thm ("equalityI", subset_antisym); |
195 |
195 |
196 AddSIs [equalityI]; |
196 AddSIs [equalityI]; |
197 |
197 |
198 (* Equality rules from ZF set theory -- are they appropriate here? *) |
198 (* Equality rules from ZF set theory -- are they appropriate here? *) |
199 Goal "A = B ==> A<=(B::'a set)"; |
199 Goal "A = B ==> A<=(B::'a set)"; |
323 Goalw [Pow_def] "A : Pow(B) ==> A<=B"; |
323 Goalw [Pow_def] "A : Pow(B) ==> A<=B"; |
324 by (etac CollectD 1); |
324 by (etac CollectD 1); |
325 qed "PowD"; |
325 qed "PowD"; |
326 |
326 |
327 |
327 |
328 val Pow_bottom = empty_subsetI RS PowI; (* {}: Pow(B) *) |
328 bind_thm ("Pow_bottom", empty_subsetI RS PowI); (* {}: Pow(B) *) |
329 val Pow_top = subset_refl RS PowI; (* A : Pow(A) *) |
329 bind_thm ("Pow_top", subset_refl RS PowI); (* A : Pow(A) *) |
330 |
330 |
331 |
331 |
332 section "Set complement"; |
332 section "Set complement"; |
333 |
333 |
334 Goalw [Compl_def] "(c : -A) = (c~:A)"; |
334 Goalw [Compl_def] "(c : -A) = (c~:A)"; |
718 bind_thm ("split_if_mem1", |
718 bind_thm ("split_if_mem1", |
719 read_instantiate_sg (Theory.sign_of Set.thy) [("P", "%x. x : ?b")] split_if); |
719 read_instantiate_sg (Theory.sign_of Set.thy) [("P", "%x. x : ?b")] split_if); |
720 bind_thm ("split_if_mem2", |
720 bind_thm ("split_if_mem2", |
721 read_instantiate_sg (Theory.sign_of Set.thy) [("P", "%x. ?a : x")] split_if); |
721 read_instantiate_sg (Theory.sign_of Set.thy) [("P", "%x. ?a : x")] split_if); |
722 |
722 |
723 val split_ifs = [if_bool_eq_conj, split_if_eq1, split_if_eq2, |
723 bind_thms ("split_ifs", [if_bool_eq_conj, split_if_eq1, split_if_eq2, |
724 split_if_mem1, split_if_mem2]; |
724 split_if_mem1, split_if_mem2]); |
725 |
725 |
726 |
726 |
727 (*Each of these has ALREADY been added to simpset() above.*) |
727 (*Each of these has ALREADY been added to simpset() above.*) |
728 val mem_simps = [insert_iff, empty_iff, Un_iff, Int_iff, Compl_iff, Diff_iff, |
728 bind_thms ("mem_simps", [insert_iff, empty_iff, Un_iff, Int_iff, Compl_iff, Diff_iff, |
729 mem_Collect_eq, UN_iff, Union_iff, INT_iff, Inter_iff]; |
729 mem_Collect_eq, UN_iff, Union_iff, INT_iff, Inter_iff]); |
730 |
730 |
731 (*Would like to add these, but the existing code only searches for the |
731 (*Would like to add these, but the existing code only searches for the |
732 outer-level constant, which in this case is just "op :"; we instead need |
732 outer-level constant, which in this case is just "op :"; we instead need |
733 to use term-nets to associate patterns with rules. Also, if a rule fails to |
733 to use term-nets to associate patterns with rules. Also, if a rule fails to |
734 apply, then the formula should be kept. |
734 apply, then the formula should be kept. |