src/HOL/Word/Word.thy
changeset 47521 69f95ac85c3d
parent 47387 a0f257197741
child 47566 c201a1fe0a81
equal deleted inserted replaced
47520:ef2d04520337 47521:69f95ac85c3d
   242 lemma reflp_word:
   242 lemma reflp_word:
   243   "reflp (\<lambda>x y. bintrunc (len_of TYPE('a::len0)) x = bintrunc (len_of TYPE('a)) y)"
   243   "reflp (\<lambda>x y. bintrunc (len_of TYPE('a::len0)) x = bintrunc (len_of TYPE('a)) y)"
   244   by (simp add: reflp_def)
   244   by (simp add: reflp_def)
   245 
   245 
   246 local_setup {*
   246 local_setup {*
   247   Lifting_Setup.setup_lifting_infr @{thm Quotient_word} @{thm reflp_word}
   247   Lifting_Setup.setup_by_quotient @{thm Quotient_word} (SOME @{thm reflp_word})
   248 *}
   248 *}
   249 
   249 
   250 text {* TODO: The next several lemmas could be generated automatically. *}
   250 text {* TODO: The next lemma could be generated automatically. *}
   251 
       
   252 lemma bi_total_cr_word [transfer_rule]: "bi_total cr_word"
       
   253   using Quotient_word reflp_word by (rule Quotient_bi_total)
       
   254 
       
   255 lemma right_unique_cr_word [transfer_rule]: "right_unique cr_word"
       
   256   using Quotient_word by (rule Quotient_right_unique)
       
   257 
       
   258 lemma word_eq_transfer [transfer_rule]:
       
   259   "(fun_rel cr_word (fun_rel cr_word op =))
       
   260     (\<lambda>x y. bintrunc (len_of TYPE('a)) x = bintrunc (len_of TYPE('a)) y)
       
   261     (op = :: 'a::len0 word \<Rightarrow> 'a word \<Rightarrow> bool)"
       
   262   using Quotient_word by (rule Quotient_rel_eq_transfer)
       
   263 
       
   264 lemma word_of_int_transfer [transfer_rule]:
       
   265   "(fun_rel op = cr_word) (\<lambda>x. x) word_of_int"
       
   266   using Quotient_word reflp_word by (rule Quotient_id_abs_transfer)
       
   267 
   251 
   268 lemma uint_transfer [transfer_rule]:
   252 lemma uint_transfer [transfer_rule]:
   269   "(fun_rel cr_word op =) (bintrunc (len_of TYPE('a)))
   253   "(fun_rel cr_word op =) (bintrunc (len_of TYPE('a)))
   270     (uint :: 'a::len0 word \<Rightarrow> int)"
   254     (uint :: 'a::len0 word \<Rightarrow> int)"
   271   unfolding fun_rel_def cr_word_def by (simp add: word_ubin.eq_norm)
   255   unfolding fun_rel_def cr_word_def by (simp add: word_ubin.eq_norm)