src/HOL/Word/BinGeneral.thy
changeset 30240 5b25fee0362c
parent 29631 3aa049e5f156
child 30940 663af91c0720
equal deleted inserted replaced
30239:179ff9cb160b 30240:5b25fee0362c
   431 
   431 
   432 lemma sbintrunc_mod2p:
   432 lemma sbintrunc_mod2p:
   433   "!!w. sbintrunc n w = ((w + 2 ^ n) mod 2 ^ (Suc n) - 2 ^ n :: int)"
   433   "!!w. sbintrunc n w = ((w + 2 ^ n) mod 2 ^ (Suc n) - 2 ^ n :: int)"
   434   apply (induct n)
   434   apply (induct n)
   435    apply clarsimp
   435    apply clarsimp
   436    apply (subst zmod_zadd_left_eq)
   436    apply (subst mod_add_left_eq)
   437    apply (simp add: bin_last_mod)
   437    apply (simp add: bin_last_mod)
   438    apply (simp add: number_of_eq)
   438    apply (simp add: number_of_eq)
   439   apply clarsimp
   439   apply clarsimp
   440   apply (simp add: bin_last_mod bin_rest_div Bit_def 
   440   apply (simp add: bin_last_mod bin_rest_div Bit_def 
   441               cong: number_of_False_cong)
   441               cong: number_of_False_cong)
   765 
   765 
   766 lemmas zmod_uminus' = zmod_uminus [where b="c", standard]
   766 lemmas zmod_uminus' = zmod_uminus [where b="c", standard]
   767 lemmas zpower_zmod' = zpower_zmod [where m="c" and y="k", standard]
   767 lemmas zpower_zmod' = zpower_zmod [where m="c" and y="k", standard]
   768 
   768 
   769 lemmas brdmod1s' [symmetric] = 
   769 lemmas brdmod1s' [symmetric] = 
   770   zmod_zadd_left_eq zmod_zadd_right_eq 
   770   mod_add_left_eq mod_add_right_eq 
   771   zmod_zsub_left_eq zmod_zsub_right_eq 
   771   zmod_zsub_left_eq zmod_zsub_right_eq 
   772   zmod_zmult1_eq zmod_zmult1_eq_rev 
   772   zmod_zmult1_eq zmod_zmult1_eq_rev 
   773 
   773 
   774 lemmas brdmods' [symmetric] = 
   774 lemmas brdmods' [symmetric] = 
   775   zpower_zmod' [symmetric]
   775   zpower_zmod' [symmetric]
   776   trans [OF zmod_zadd_left_eq zmod_zadd_right_eq] 
   776   trans [OF mod_add_left_eq mod_add_right_eq] 
   777   trans [OF zmod_zsub_left_eq zmod_zsub_right_eq] 
   777   trans [OF zmod_zsub_left_eq zmod_zsub_right_eq] 
   778   trans [OF zmod_zmult1_eq zmod_zmult1_eq_rev] 
   778   trans [OF zmod_zmult1_eq zmod_zmult1_eq_rev] 
   779   zmod_uminus' [symmetric]
   779   zmod_uminus' [symmetric]
   780   zmod_zadd_left_eq [where b = "1"]
   780   mod_add_left_eq [where b = "1::int"]
   781   zmod_zsub_left_eq [where b = "1"]
   781   zmod_zsub_left_eq [where b = "1"]
   782 
   782 
   783 lemmas bintr_arith1s =
   783 lemmas bintr_arith1s =
   784   brdmod1s' [where c="2^n", folded pred_def succ_def bintrunc_mod2p, standard]
   784   brdmod1s' [where c="2^n::int", folded pred_def succ_def bintrunc_mod2p, standard]
   785 lemmas bintr_ariths =
   785 lemmas bintr_ariths =
   786   brdmods' [where c="2^n", folded pred_def succ_def bintrunc_mod2p, standard]
   786   brdmods' [where c="2^n::int", folded pred_def succ_def bintrunc_mod2p, standard]
   787 
   787 
   788 lemmas m2pths = pos_mod_sign pos_mod_bound [OF zless2p, standard] 
   788 lemmas m2pths = pos_mod_sign pos_mod_bound [OF zless2p, standard] 
   789 
   789 
   790 lemma bintr_ge0: "(0 :: int) <= number_of (bintrunc n w)"
   790 lemma bintr_ge0: "(0 :: int) <= number_of (bintrunc n w)"
   791   by (simp add : no_bintr m2pths)
   791   by (simp add : no_bintr m2pths)