Skip to content

Commit

Permalink
lib: add set_map_fst_filter_zip to Lib
Browse files Browse the repository at this point in the history
Signed-off-by: Michael McInerney <[email protected]>
  • Loading branch information
michaelmcinerney committed Dec 20, 2024
1 parent 0e9d73c commit 62292f3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Lib.thy
Original file line number Diff line number Diff line change
Expand Up @@ -2272,6 +2272,12 @@ lemma in_set_zipD:
"t \<in> set (zip xs ys) \<Longrightarrow> fst t \<in> set xs \<and> snd t \<in> set ys"
by (clarsimp simp add: set_zip)

lemma set_map_fst_filter_zip:
"set (map fst (filter P (zip xs ys))) \<subseteq> set xs"
apply (induct xs, simp)
apply (case_tac ys; simp)
by (metis (mono_tags, lifting) image_Collect_subsetI insertI2 in_set_zipD)

lemma map_zip_snd_take:
"map (\<lambda>(x, y). f y) (zip xs ys) = map f (take (length xs) ys)"
apply (subst map_zip_snd' [symmetric, where xs=xs and ys="take (length xs) ys"], simp)
Expand Down

0 comments on commit 62292f3

Please sign in to comment.