src/HOL/List.thy
changeset 47108 2a1953f0d20d
parent 46898 1570b30ee040
child 47122 790fb5eb5969
     1.1 --- a/src/HOL/List.thy	Sat Mar 24 16:27:04 2012 +0100
     1.2 +++ b/src/HOL/List.thy	Sun Mar 25 20:15:39 2012 +0200
     1.3 @@ -2676,7 +2676,7 @@
     1.4  -- {* simp does not terminate! *}
     1.5  by (induct j) auto
     1.6  
     1.7 -lemmas upt_rec_number_of[simp] = upt_rec[of "number_of m" "number_of n"] for m n
     1.8 +lemmas upt_rec_numeral[simp] = upt_rec[of "numeral m" "numeral n"] for m n
     1.9  
    1.10  lemma upt_conv_Nil [simp]: "j <= i ==> [i..<j] = []"
    1.11  by (subst upt_rec) simp
    1.12 @@ -2791,13 +2791,17 @@
    1.13  lemma nth_Cons': "(x # xs)!n = (if n = 0 then x else xs!(n - 1))"
    1.14  by (cases n) simp_all
    1.15  
    1.16 -lemmas take_Cons_number_of = take_Cons'[of "number_of v"] for v
    1.17 -lemmas drop_Cons_number_of = drop_Cons'[of "number_of v"] for v
    1.18 -lemmas nth_Cons_number_of = nth_Cons'[of _ _ "number_of v"] for v
    1.19 -
    1.20 -declare take_Cons_number_of [simp] 
    1.21 -        drop_Cons_number_of [simp] 
    1.22 -        nth_Cons_number_of [simp] 
    1.23 +lemma take_Cons_numeral [simp]:
    1.24 +  "take (numeral v) (x # xs) = x # take (numeral v - 1) xs"
    1.25 +by (simp add: take_Cons')
    1.26 +
    1.27 +lemma drop_Cons_numeral [simp]:
    1.28 +  "drop (numeral v) (x # xs) = drop (numeral v - 1) xs"
    1.29 +by (simp add: drop_Cons')
    1.30 +
    1.31 +lemma nth_Cons_numeral [simp]:
    1.32 +  "(x # xs) ! numeral v = xs ! (numeral v - 1)"
    1.33 +by (simp add: nth_Cons')
    1.34  
    1.35  
    1.36  subsubsection {* @{text upto}: interval-list on @{typ int} *}
    1.37 @@ -2812,7 +2816,11 @@
    1.38  
    1.39  declare upto.simps[code, simp del]
    1.40  
    1.41 -lemmas upto_rec_number_of[simp] = upto.simps[of "number_of m" "number_of n"] for m n
    1.42 +lemmas upto_rec_numeral [simp] =
    1.43 +  upto.simps[of "numeral m" "numeral n"]
    1.44 +  upto.simps[of "numeral m" "neg_numeral n"]
    1.45 +  upto.simps[of "neg_numeral m" "numeral n"]
    1.46 +  upto.simps[of "neg_numeral m" "neg_numeral n"] for m n
    1.47  
    1.48  lemma upto_empty[simp]: "j < i \<Longrightarrow> [i..j] = []"
    1.49  by(simp add: upto.simps)