src/HOL/List.thy
changeset 40365 a1456f2e1c9d
parent 40304 62bdd1bfcd90
child 40593 1e57b18d27b1
equal deleted inserted replaced
40364:55a1693affb6 40365:a1456f2e1c9d
  1296 by (induct xs) auto
  1296 by (induct xs) auto
  1297 
  1297 
  1298 lemma rev_concat: "rev (concat xs) = concat (map rev (rev xs))"
  1298 lemma rev_concat: "rev (concat xs) = concat (map rev (rev xs))"
  1299 by (induct xs) auto
  1299 by (induct xs) auto
  1300 
  1300 
       
  1301 lemma concat_eq_concat_iff: "\<forall>(x, y) \<in> set (zip xs ys). length x = length y ==> length xs = length ys ==> (concat xs = concat ys) = (xs = ys)"
       
  1302 proof (induct xs arbitrary: ys)
       
  1303   case (Cons x xs ys)
       
  1304   thus ?case by (cases ys) auto
       
  1305 qed (auto)
       
  1306 
       
  1307 lemma concat_injective: "concat xs = concat ys ==> length xs = length ys ==> \<forall>(x, y) \<in> set (zip xs ys). length x = length y ==> xs = ys"
       
  1308 by (simp add: concat_eq_concat_iff)
       
  1309 
  1301 
  1310 
  1302 subsubsection {* @{text nth} *}
  1311 subsubsection {* @{text nth} *}
  1303 
  1312 
  1304 lemma nth_Cons_0 [simp, code]: "(x # xs)!0 = x"
  1313 lemma nth_Cons_0 [simp, code]: "(x # xs)!0 = x"
  1305 by auto
  1314 by auto