src/HOL/Equiv_Relations.thy
changeset 19979 a0846edbe8b0
parent 19363 667b5ea637dd
child 21404 eb85850d3eb7
equal deleted inserted replaced
19978:df19a7876183 19979:a0846edbe8b0
   219   fixes r1 and r2 and f
   219   fixes r1 and r2 and f
   220   assumes congruent2:
   220   assumes congruent2:
   221     "(y1,z1) \<in> r1 ==> (y2,z2) \<in> r2 ==> f y1 y2 = f z1 z2"
   221     "(y1,z1) \<in> r1 ==> (y2,z2) \<in> r2 ==> f y1 y2 = f z1 z2"
   222 
   222 
   223 text{*Abbreviation for the common case where the relations are identical*}
   223 text{*Abbreviation for the common case where the relations are identical*}
   224 syntax
   224 abbreviation
   225   RESPECTS2 ::"['a => 'b, ('a * 'a) set] => bool"  (infixr "respects2 " 80)
   225   RESPECTS2:: "['a => 'a => 'b, ('a * 'a)set] => bool" (infixr "respects2 " 80)
   226 translations
   226   "f respects2 r == congruent2 r r f"
   227   "f respects2 r" => "congruent2 r r f"
   227 
   228 (*
       
   229 Warning: cannot use "abbreviation" here because the two occurrences of
       
   230 r may need to be of different type (see Hyperreal/StarDef).
       
   231 *)
       
   232 
   228 
   233 lemma congruent2_implies_congruent:
   229 lemma congruent2_implies_congruent:
   234     "equiv A r1 ==> congruent2 r1 r2 f ==> a \<in> A ==> congruent r2 (f a)"
   230     "equiv A r1 ==> congruent2 r1 r2 f ==> a \<in> A ==> congruent r2 (f a)"
   235   by (unfold congruent_def congruent2_def equiv_def refl_def) blast
   231   by (unfold congruent_def congruent2_def equiv_def refl_def) blast
   236 
   232