src/HOL/Fun.ML
changeset 10076 2683ff181047
parent 10066 2f5686cf8c9a
child 10826 f3b7201dda27
equal deleted inserted replaced
10075:6f07d9850141 10076:2683ff181047
   111 by (etac arg_cong 2);
   111 by (etac arg_cong 2);
   112 by (etac injD 1);
   112 by (etac injD 1);
   113 by (assume_tac 1);
   113 by (assume_tac 1);
   114 qed "inj_eq";
   114 qed "inj_eq";
   115 
   115 
   116 Goal "inj(f) ==> (@x. f(x)=f(y)) = y";
       
   117 by (etac injD 1);
       
   118 by (rtac someI 1);
       
   119 by (rtac refl 1);
       
   120 qed "inj_select";
       
   121 
       
   122 (*A one-to-one function has an inverse (given using select).*)
   116 (*A one-to-one function has an inverse (given using select).*)
   123 Goalw [inv_def] "inj(f) ==> inv f (f x) = x";
   117 Goalw [inv_def] "inj(f) ==> inv f (f x) = x";
   124 by (etac inj_select 1);
   118 by (asm_simp_tac (simpset() addsimps [inj_eq]) 1); 
   125 qed "inv_f_f";
   119 qed "inv_f_f";
   126 Addsimps [inv_f_f];
   120 Addsimps [inv_f_f];
   127 
   121 
   128 Goal "[| inj(f);  f x = y |] ==> inv f y = x";
   122 Goal "[| inj(f);  f x = y |] ==> inv f y = x";
   129 by (etac subst 1);
   123 by (etac subst 1);
   423 Goal "bij f ==> f -`` A = inv f `` A";
   417 Goal "bij f ==> f -`` A = inv f `` A";
   424 by Safe_tac;
   418 by Safe_tac;
   425 by (asm_simp_tac (simpset() addsimps [bij_is_surj RS surj_f_inv_f]) 2);
   419 by (asm_simp_tac (simpset() addsimps [bij_is_surj RS surj_f_inv_f]) 2);
   426 by (blast_tac (claset() addIs [bij_is_inj RS inv_f_f RS sym]) 1);
   420 by (blast_tac (claset() addIs [bij_is_inj RS inv_f_f RS sym]) 1);
   427 qed "bij_vimage_eq_inv_image";
   421 qed "bij_vimage_eq_inv_image";
       
   422 
       
   423 Goal "surj f ==> -(f``A) <= f``(-A)";
       
   424 by (auto_tac (claset(), simpset() addsimps [surj_def]));  
       
   425 qed "surj_Compl_image_subset";
       
   426 
       
   427 Goal "inj f ==> f``(-A) <= -(f``A)";
       
   428 by (auto_tac (claset(), simpset() addsimps [inj_on_def]));  
       
   429 qed "inj_image_Compl_subset";
       
   430 
       
   431 Goalw [bij_def] "bij f ==> f``(-A) = -(f``A)";
       
   432 by (rtac equalityI 1); 
       
   433 by (ALLGOALS (asm_simp_tac (simpset() addsimps [inj_image_Compl_subset, 
       
   434                                                 surj_Compl_image_subset]))); 
       
   435 qed "bij_image_Compl_eq";
   428 
   436 
   429 val set_cs = claset() delrules [equalityI];
   437 val set_cs = claset() delrules [equalityI];
   430 
   438 
   431 
   439 
   432 section "fun_upd";
   440 section "fun_upd";