# HG changeset patch # User nipkow # Date 1585308485 -3600 # Node ID 71579bd59cd495bedb176d8f2ba649b0cfe4c08c # Parent 0c6d29145881dd83320353a06571afe8c1cf7e82 added lemma diff -r 0c6d29145881 -r 71579bd59cd4 src/HOL/List.thy --- a/src/HOL/List.thy Wed Mar 25 14:00:23 2020 +0000 +++ b/src/HOL/List.thy Fri Mar 27 12:28:05 2020 +0100 @@ -3550,8 +3550,9 @@ \ \ distinct (concat xs)" by (induct xs) auto -text \It is best to avoid this indexed version of distinct, but -sometimes it is useful.\ +text \An iff-version of @{thm distinct_concat} is available further down as \distinct_concat_iff\.\ + +text \It is best to avoid the following indexed version of distinct, but sometimes it is useful.\ lemma distinct_conv_nth: "distinct xs = (\i < size xs. \j < size xs. i \ j \ xs!i \ xs!j)" proof (induct xs) @@ -4179,6 +4180,14 @@ "x \ set xs \ length (removeAll x xs) < length xs" by (auto dest: length_filter_less simp add: removeAll_filter_not_eq) +lemma distinct_concat_iff: "distinct (concat xs) \ + distinct (removeAll [] xs) \ + (\ys. ys \ set xs \ distinct ys) \ + (\ys zs. ys \ set xs \ zs \ set xs \ ys \ zs \ set ys \ set zs = {})" +apply (induct xs) + apply(simp_all, safe, auto) +by (metis Int_iff UN_I empty_iff equals0I set_empty) + subsubsection \\<^const>\replicate\\