src/HOL/Word/Bit_Representation.thy
changeset 58645 94bef115c08f
parent 58410 6d46ad54a2ab
child 58834 773b378d9313
equal deleted inserted replaced
58644:8171ef293634 58645:94bef115c08f
    32 where
    32 where
    33   "bin_last w \<longleftrightarrow> w mod 2 = 1"
    33   "bin_last w \<longleftrightarrow> w mod 2 = 1"
    34 
    34 
    35 lemma bin_last_odd:
    35 lemma bin_last_odd:
    36   "bin_last = odd"
    36   "bin_last = odd"
    37   by (rule ext) (simp add: bin_last_def even_def)
    37   by (rule ext) (simp add: bin_last_def even_iff_mod_2_eq_zero)
    38 
    38 
    39 definition bin_rest :: "int \<Rightarrow> int"
    39 definition bin_rest :: "int \<Rightarrow> int"
    40 where
    40 where
    41   "bin_rest w = w div 2"
    41   "bin_rest w = w div 2"
    42 
    42 
   315   apply (simp add: bin_last_def bin_rest_def Bit_def)
   315   apply (simp add: bin_last_def bin_rest_def Bit_def)
   316   apply (clarsimp simp: mod_mult_mult1 [symmetric] 
   316   apply (clarsimp simp: mod_mult_mult1 [symmetric] 
   317          zmod_zdiv_equality [THEN diff_eq_eq [THEN iffD2 [THEN sym]]])
   317          zmod_zdiv_equality [THEN diff_eq_eq [THEN iffD2 [THEN sym]]])
   318   apply (rule trans [symmetric, OF _ emep1])
   318   apply (rule trans [symmetric, OF _ emep1])
   319      apply auto
   319      apply auto
   320   apply (auto simp: even_def)
   320   apply (auto simp: even_iff_mod_2_eq_zero)
   321   done
   321   done
   322 
   322 
   323 subsection "Simplifications for (s)bintrunc"
   323 subsection "Simplifications for (s)bintrunc"
   324 
   324 
   325 lemma bintrunc_n_0 [simp]: "bintrunc n 0 = 0"
   325 lemma bintrunc_n_0 [simp]: "bintrunc n 0 = 0"