src/HOL/Relation.ML
changeset 11451 8abfb4f7bd02
parent 11136 e34e7f6d9b57
child 11655 923e4d0d36d5
equal deleted inserted replaced
11450:1b02a6c4032f 11451:8abfb4f7bd02
   331 
   331 
   332 (*** Image of a set under a relation ***)
   332 (*** Image of a set under a relation ***)
   333 
   333 
   334 overload_1st_set "Relation.Image";
   334 overload_1st_set "Relation.Image";
   335 
   335 
   336 Goalw [Image_def] "b : r``A = (? x:A. (x,b):r)";
   336 Goalw [Image_def] "b : r``A = (EX x:A. (x,b):r)";
   337 by (Blast_tac 1);
   337 by (Blast_tac 1);
   338 qed "Image_iff";
   338 qed "Image_iff";
   339 
   339 
   340 Goalw [Image_def] "r``{a} = {b. (a,b):r}";
   340 Goalw [Image_def] "r``{a} = {b. (a,b):r}";
   341 by (Blast_tac 1);
   341 by (Blast_tac 1);
   420 qed "Image_subset_eq";
   420 qed "Image_subset_eq";
   421 
   421 
   422 section "single_valued";
   422 section "single_valued";
   423 
   423 
   424 Goalw [single_valued_def]
   424 Goalw [single_valued_def]
   425      "!x y. (x,y):r --> (!z. (x,z):r --> y=z) ==> single_valued r";
   425      "ALL x y. (x,y):r --> (ALL z. (x,z):r --> y=z) ==> single_valued r";
   426 by (assume_tac 1);
   426 by (assume_tac 1);
   427 qed "single_valuedI";
   427 qed "single_valuedI";
   428 
   428 
   429 Goalw [single_valued_def]
   429 Goalw [single_valued_def]
   430      "[| single_valued r;  (x,y):r;  (x,z):r|] ==> y=z";
   430      "[| single_valued r;  (x,y):r;  (x,z):r|] ==> y=z";
   452 
   452 
   453 Goalw [fun_rel_comp_def] "A <= B ==> fun_rel_comp f A <= fun_rel_comp f B";
   453 Goalw [fun_rel_comp_def] "A <= B ==> fun_rel_comp f A <= fun_rel_comp f B";
   454 by (Fast_tac 1);
   454 by (Fast_tac 1);
   455 qed "fun_rel_comp_mono";
   455 qed "fun_rel_comp_mono";
   456 
   456 
   457 Goalw [fun_rel_comp_def] "! x. ?! y. (f x, y) : R ==> ?! g. g : fun_rel_comp f R";
   457 Goalw [fun_rel_comp_def]
   458 by (res_inst_tac [("a","%x. @y. (f x, y) : R")] ex1I 1);
   458      "ALL x. EX! y. (f x, y) : R ==> EX! g. g : fun_rel_comp f R";
   459 by (rtac CollectI 1);
   459 by (res_inst_tac [("a","%x. THE y. (f x, y) : R")] ex1I 1);
   460 by (rtac allI 1);
   460 by (fast_tac (claset() addSDs [theI']) 1); 
   461 by (etac allE 1);
   461 by (fast_tac (claset() addIs [ext, the1_equality RS sym]) 1);
   462 by (rtac (some_eq_ex RS iffD2) 1);
       
   463 by (etac ex1_implies_ex 1);
       
   464 by (rtac ext 1);
       
   465 by (etac CollectE 1);
       
   466 by (REPEAT (etac allE 1));
       
   467 by (rtac (some1_equality RS sym) 1);
       
   468 by (atac 1);
       
   469 by (atac 1);
       
   470 qed "fun_rel_comp_unique";
   462 qed "fun_rel_comp_unique";
   471 
   463 
   472 
   464 
   473 section "inverse image";
   465 section "inverse image";
   474 
   466 
   475 Goalw [trans_def,inv_image_def]
   467 Goalw [trans_def,inv_image_def]
   476     "!!r. trans r ==> trans (inv_image r f)";
   468     "trans r ==> trans (inv_image r f)";
   477 by (Simp_tac 1);
   469 by (Simp_tac 1);
   478 by (Blast_tac 1);
   470 by (Blast_tac 1);
   479 qed "trans_inv_image";
   471 qed "trans_inv_image";
   480 
   472