src/HOL/Word/Word_Miscellaneous.thy
changeset 54871 51612b889361
parent 53062 3af1a6020014
child 54872 af81b2357e08
equal deleted inserted replaced
54870:1b5f2485757b 54871:51612b889361
   250   done
   250   done
   251 
   251 
   252 lemma mod_nat_sub: 
   252 lemma mod_nat_sub: 
   253   "(x :: nat) < z ==> (x - y) mod z = x - y"
   253   "(x :: nat) < z ==> (x - y) mod z = x - y"
   254   by (rule nat_mod_eq') arith
   254   by (rule nat_mod_eq') arith
   255 
       
   256 lemma int_mod_lem: 
       
   257   "(0 :: int) < n ==> (0 <= b & b < n) = (b mod n = b)"
       
   258   apply safe
       
   259     apply (erule (1) mod_pos_pos_trivial)
       
   260    apply (erule_tac [!] subst)
       
   261    apply auto
       
   262   done
       
   263 
   255 
   264 lemma int_mod_eq:
   256 lemma int_mod_eq:
   265   "(0 :: int) <= b ==> b < n ==> a mod n = b mod n ==> a mod n = b"
   257   "(0 :: int) <= b ==> b < n ==> a mod n = b mod n ==> a mod n = b"
   266   by clarsimp (rule mod_pos_pos_trivial)
   258   by clarsimp (rule mod_pos_pos_trivial)
   267 
   259