From 62292f3226b7703df008085db4114ae689faa892 Mon Sep 17 00:00:00 2001 From: Michael McInerney Date: Fri, 13 Dec 2024 10:29:45 +1030 Subject: [PATCH] lib: add set_map_fst_filter_zip to Lib Signed-off-by: Michael McInerney --- lib/Lib.thy | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Lib.thy b/lib/Lib.thy index e78997d520..1d677b7eba 100644 --- a/lib/Lib.thy +++ b/lib/Lib.thy @@ -2272,6 +2272,12 @@ lemma in_set_zipD: "t \ set (zip xs ys) \ fst t \ set xs \ snd t \ set ys" by (clarsimp simp add: set_zip) +lemma set_map_fst_filter_zip: + "set (map fst (filter P (zip xs ys))) \ 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 (\(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)