src/HOL/Code_Numeral.thy
changeset 66190 a41435469559
parent 64994 6e4c05e8edbb
child 66801 f3fda9777f9a
     1.1 --- a/src/HOL/Code_Numeral.thy	Sat Jun 24 09:17:33 2017 +0200
     1.2 +++ b/src/HOL/Code_Numeral.thy	Sat Jun 24 09:17:35 2017 +0200
     1.3 @@ -149,24 +149,19 @@
     1.4    "int_of_integer (Num.sub k l) = Num.sub k l"
     1.5    by transfer rule
     1.6  
     1.7 -lift_definition integer_of_num :: "num \<Rightarrow> integer"
     1.8 -  is "numeral :: num \<Rightarrow> int"
     1.9 -  .
    1.10 +definition integer_of_num :: "num \<Rightarrow> integer"
    1.11 +  where [simp]: "integer_of_num = numeral"
    1.12  
    1.13  lemma integer_of_num [code]:
    1.14 -  "integer_of_num num.One = 1"
    1.15 -  "integer_of_num (num.Bit0 n) = (let k = integer_of_num n in k + k)"
    1.16 -  "integer_of_num (num.Bit1 n) = (let k = integer_of_num n in k + k + 1)"
    1.17 -  by (transfer, simp only: numeral.simps Let_def)+
    1.18 -
    1.19 -lemma numeral_unfold_integer_of_num:
    1.20 -  "numeral = integer_of_num"
    1.21 -  by (simp add: integer_of_num_def map_fun_def fun_eq_iff)
    1.22 +  "integer_of_num Num.One = 1"
    1.23 +  "integer_of_num (Num.Bit0 n) = (let k = integer_of_num n in k + k)"
    1.24 +  "integer_of_num (Num.Bit1 n) = (let k = integer_of_num n in k + k + 1)"
    1.25 +  by (simp_all only: integer_of_num_def numeral.simps Let_def)
    1.26  
    1.27  lemma integer_of_num_triv:
    1.28    "integer_of_num Num.One = 1"
    1.29    "integer_of_num (Num.Bit0 Num.One) = 2"
    1.30 -  by (transfer, simp)+
    1.31 +  by simp_all
    1.32  
    1.33  instantiation integer :: "{linordered_idom, equal}"
    1.34  begin
    1.35 @@ -301,7 +296,7 @@
    1.36  end
    1.37  
    1.38  declare divmod_algorithm_code [where ?'a = integer,
    1.39 -  unfolded numeral_unfold_integer_of_num, unfolded integer_of_num_triv, 
    1.40 +  folded integer_of_num_def, unfolded integer_of_num_triv, 
    1.41    code]
    1.42  
    1.43  lemma integer_of_nat_0: "integer_of_nat 0 = 0"