src/HOL/List.thy
changeset 15303 eedbb8d22ca2
parent 15302 a643fcbc3468
child 15304 3514ca74ac54
equal deleted inserted replaced
15302:a643fcbc3468 15303:eedbb8d22ca2
   504 apply blast
   504 apply blast
   505 done
   505 done
   506 
   506 
   507 lemma inj_map[iff]: "inj (map f) = inj f"
   507 lemma inj_map[iff]: "inj (map f) = inj f"
   508 by (blast dest: inj_mapD intro: inj_mapI)
   508 by (blast dest: inj_mapD intro: inj_mapI)
       
   509 
       
   510 lemma inj_on_mapI: "inj_on f (\<Union>(set ` A)) \<Longrightarrow> inj_on (map f) A"
       
   511 apply(rule inj_onI)
       
   512 apply(erule map_inj_on)
       
   513 apply(blast intro:inj_onI dest:inj_onD)
       
   514 done
   509 
   515 
   510 lemma map_idI: "(\<And>x. x \<in> set xs \<Longrightarrow> f x = x) \<Longrightarrow> map f xs = xs"
   516 lemma map_idI: "(\<And>x. x \<in> set xs \<Longrightarrow> f x = x) \<Longrightarrow> map f xs = xs"
   511 by (induct xs, auto)
   517 by (induct xs, auto)
   512 
   518 
   513 lemma map_fun_upd [simp]: "y \<notin> set xs \<Longrightarrow> map (f(y:=v)) xs = map f xs"
   519 lemma map_fun_upd [simp]: "y \<notin> set xs \<Longrightarrow> map (f(y:=v)) xs = map f xs"