src/HOL/Transfer.thy
changeset 47523 1bf0e92c1ca0
parent 47503 cb44d09d9d22
child 47612 bc9c7b5c26fd
equal deleted inserted replaced
47522:f74da4658bd1 47523:1bf0e92c1ca0
    82   unfolding Rel_def by simp
    82   unfolding Rel_def by simp
    83 
    83 
    84 lemma Rel_eq_refl: "Rel (op =) x x"
    84 lemma Rel_eq_refl: "Rel (op =) x x"
    85   unfolding Rel_def ..
    85   unfolding Rel_def ..
    86 
    86 
    87 use "Tools/transfer.ML"
    87 lemma Rel_App:
    88 
       
    89 setup Transfer.setup
       
    90 
       
    91 declare fun_rel_eq [relator_eq]
       
    92 
       
    93 lemma Rel_App [transfer_raw]:
       
    94   assumes "Rel (A ===> B) f g" and "Rel A x y"
    88   assumes "Rel (A ===> B) f g" and "Rel A x y"
    95   shows "Rel B (App f x) (App g y)"
    89   shows "Rel B (App f x) (App g y)"
    96   using assms unfolding Rel_def App_def fun_rel_def by fast
    90   using assms unfolding Rel_def App_def fun_rel_def by fast
    97 
    91 
    98 lemma Rel_Abs [transfer_raw]:
    92 lemma Rel_Abs:
    99   assumes "\<And>x y. Rel A x y \<Longrightarrow> Rel B (f x) (g y)"
    93   assumes "\<And>x y. Rel A x y \<Longrightarrow> Rel B (f x) (g y)"
   100   shows "Rel (A ===> B) (Abs (\<lambda>x. f x)) (Abs (\<lambda>y. g y))"
    94   shows "Rel (A ===> B) (Abs (\<lambda>x. f x)) (Abs (\<lambda>y. g y))"
   101   using assms unfolding Rel_def Abs_def fun_rel_def by fast
    95   using assms unfolding Rel_def Abs_def fun_rel_def by fast
       
    96 
       
    97 use "Tools/transfer.ML"
       
    98 
       
    99 setup Transfer.setup
       
   100 
       
   101 declare fun_rel_eq [relator_eq]
   102 
   102 
   103 hide_const (open) App Abs Rel
   103 hide_const (open) App Abs Rel
   104 
   104 
   105 
   105 
   106 subsection {* Predicates on relations, i.e. ``class constraints'' *}
   106 subsection {* Predicates on relations, i.e. ``class constraints'' *}