src/HOL/Set.ML
changeset 9108 9fff97d29837
parent 9088 453996655ac2
child 9161 cee6d5aee7c8
equal deleted inserted replaced
9107:67202a50ee6d 9108:9fff97d29837
    29 
    29 
    30 val [prem] = Goal "[| !!x. P(x)=Q(x) |] ==> {x. P(x)} = {x. Q(x)}";
    30 val [prem] = Goal "[| !!x. P(x)=Q(x) |] ==> {x. P(x)} = {x. Q(x)}";
    31 by (rtac (prem RS ext RS arg_cong) 1);
    31 by (rtac (prem RS ext RS arg_cong) 1);
    32 qed "Collect_cong";
    32 qed "Collect_cong";
    33 
    33 
    34 val CollectE = make_elim CollectD;
    34 bind_thm ("CollectE", make_elim CollectD);
    35 
    35 
    36 AddSIs [CollectI];
    36 AddSIs [CollectI];
    37 AddSEs [CollectE];
    37 AddSEs [CollectE];
    38 
    38 
    39 
    39 
   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)";
   346   turnstile...*)
   346   turnstile...*)
   347 Goalw [Compl_def] "c : -A ==> c~:A";
   347 Goalw [Compl_def] "c : -A ==> c~:A";
   348 by (etac CollectD 1);
   348 by (etac CollectD 1);
   349 qed "ComplD";
   349 qed "ComplD";
   350 
   350 
   351 val ComplE = make_elim ComplD;
   351 bind_thm ("ComplE", make_elim ComplD);
   352 
   352 
   353 AddSIs [ComplI];
   353 AddSIs [ComplI];
   354 AddSEs [ComplE];
   354 AddSEs [ComplE];
   355 
   355 
   356 
   356 
   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.