equal
deleted
inserted
replaced
14 definition subset :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool" where |
14 definition subset :: "'a set \<Rightarrow> 'a set \<Rightarrow> bool" where |
15 "subset = op \<le>" |
15 "subset = op \<le>" |
16 |
16 |
17 declare subset_def [symmetric, code unfold] |
17 declare subset_def [symmetric, code unfold] |
18 |
18 |
19 lemma "subset A B \<longleftrightarrow> (\<forall>x\<in>A. x \<in> B)" |
19 lemma [code]: "subset A B \<longleftrightarrow> (\<forall>x\<in>A. x \<in> B)" |
20 unfolding subset_def subset_eq .. |
20 unfolding subset_def subset_eq .. |
21 |
21 |
22 definition is_empty :: "'a set \<Rightarrow> bool" where |
22 definition is_empty :: "'a set \<Rightarrow> bool" where |
23 "is_empty A \<longleftrightarrow> A = {}" |
23 "is_empty A \<longleftrightarrow> A = {}" |
24 |
24 |
30 |
30 |
31 lemma [code]: |
31 lemma [code]: |
32 "a \<in> A \<longleftrightarrow> (\<exists>x\<in>A. x = a)" |
32 "a \<in> A \<longleftrightarrow> (\<exists>x\<in>A. x = a)" |
33 unfolding bex_triv_one_point1 .. |
33 unfolding bex_triv_one_point1 .. |
34 |
34 |
35 definition |
35 definition filter_set :: "('a \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> 'a set" where |
36 filter_set :: "('a \<Rightarrow> bool) \<Rightarrow> 'a set \<Rightarrow> 'a set" where |
|
37 "filter_set P xs = {x\<in>xs. P x}" |
36 "filter_set P xs = {x\<in>xs. P x}" |
38 |
37 |
39 |
38 |
40 subsection {* Operations on lists *} |
39 subsection {* Operations on lists *} |
41 |
40 |