doc-src/TutorialI/Sets/Examples.thy
author bulwahn
Mon, 22 Mar 2010 08:30:12 +0100
changeset 35876 ac44e2312f0a
parent 35416 d8d7d1b785af
child 36745 403585a89772
permissions -rw-r--r--
only adding lifted arguments to item net in the function flattening; correcting indentation; removing dead code
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10341
6eb91805a012 added the $Id:$ line
paulson
parents: 10294
diff changeset
     1
(* ID:         $Id$ *)
21262
a2bd14226f9a imports Binimial;
wenzelm
parents: 16417
diff changeset
     2
theory Examples imports Main Binomial begin
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
     3
32833
f3716d1a2e48 explicitly Unsynchronized;
wenzelm
parents: 21262
diff changeset
     4
ML "Unsynchronized.reset eta_contract"
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
     5
ML "Pretty.setmargin 64"
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
     6
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
     7
text{*membership, intersection *}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
     8
text{*difference and empty set*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
     9
text{*complement, union and universal set*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    10
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    11
lemma "(x \<in> A \<inter> B) = (x \<in> A \<and> x \<in> B)"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
    12
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    13
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    14
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    15
@{thm[display] IntI[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    16
\rulename{IntI}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    17
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    18
@{thm[display] IntD1[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    19
\rulename{IntD1}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    20
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    21
@{thm[display] IntD2[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    22
\rulename{IntD2}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    23
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    24
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    25
lemma "(x \<in> -A) = (x \<notin> A)"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
    26
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    27
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    28
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    29
@{thm[display] Compl_iff[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    30
\rulename{Compl_iff}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    31
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    32
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    33
lemma "- (A \<union> B) = -A \<inter> -B"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
    34
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    35
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    36
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    37
@{thm[display] Compl_Un[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    38
\rulename{Compl_Un}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    39
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    40
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    41
lemma "A-A = {}"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
    42
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    43
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    44
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    45
@{thm[display] Diff_disjoint[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    46
\rulename{Diff_disjoint}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    47
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    48
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    49
  
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    50
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    51
lemma "A \<union> -A = UNIV"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
    52
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    53
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    54
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    55
@{thm[display] Compl_partition[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    56
\rulename{Compl_partition}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    57
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    58
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    59
text{*subset relation*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    60
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    61
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    62
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    63
@{thm[display] subsetI[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    64
\rulename{subsetI}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    65
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    66
@{thm[display] subsetD[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    67
\rulename{subsetD}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    68
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    69
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    70
lemma "((A \<union> B) \<subseteq> C) = (A \<subseteq> C \<and> B \<subseteq> C)"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
    71
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    72
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    73
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    74
@{thm[display] Un_subset_iff[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    75
\rulename{Un_subset_iff}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    76
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    77
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    78
lemma "(A \<subseteq> -B) = (B \<subseteq> -A)"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
    79
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    80
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    81
lemma "(A <= -B) = (B <= -A)"
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    82
  oops
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    83
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    84
text{*ASCII version: blast fails because of overloading because
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    85
 it doesn't have to be sets*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    86
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    87
lemma "((A:: 'a set) <= -B) = (B <= -A)"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
    88
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    89
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    90
text{*A type constraint lets it work*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    91
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    92
text{*An issue here: how do we discuss the distinction between ASCII and
12815
wenzelm
parents: 10864
diff changeset
    93
symbol notation?  Here the latter disambiguates.*}
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    94
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    95
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    96
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    97
set extensionality
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    98
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
    99
@{thm[display] set_ext[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   100
\rulename{set_ext}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   101
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   102
@{thm[display] equalityI[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   103
\rulename{equalityI}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   104
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   105
@{thm[display] equalityE[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   106
\rulename{equalityE}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   107
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   108
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   109
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   110
text{*finite sets: insertion and membership relation*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   111
text{*finite set notation*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   112
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   113
lemma "insert x A = {x} \<union> A"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   114
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   115
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   116
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   117
@{thm[display] insert_is_Un[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   118
\rulename{insert_is_Un}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   119
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   120
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   121
lemma "{a,b} \<union> {c,d} = {a,b,c,d}"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   122
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   123
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   124
lemma "{a,b} \<inter> {b,c} = {b}"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   125
apply auto
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   126
oops
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   127
text{*fails because it isn't valid*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   128
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   129
lemma "{a,b} \<inter> {b,c} = (if a=c then {a,b} else {b})"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   130
apply simp
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   131
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   132
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   133
text{*or just force or auto.  blast alone can't handle the if-then-else*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   134
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   135
text{*next: some comprehension examples*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   136
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   137
lemma "(a \<in> {z. P z}) = P a"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   138
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   139
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   140
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   141
@{thm[display] mem_Collect_eq[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   142
\rulename{mem_Collect_eq}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   143
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   144
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   145
lemma "{x. x \<in> A} = A"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   146
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   147
  
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   148
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   149
@{thm[display] Collect_mem_eq[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   150
\rulename{Collect_mem_eq}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   151
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   152
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   153
lemma "{x. P x \<or> x \<in> A} = {x. P x} \<union> A"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   154
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   155
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   156
lemma "{x. P x \<longrightarrow> Q x} = -{x. P x} \<union> {x. Q x}"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   157
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   158
35416
d8d7d1b785af replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents: 32833
diff changeset
   159
definition prime :: "nat set" where
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   160
    "prime == {p. 1<p & (ALL m. m dvd p --> m=1 | m=p)}"
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   161
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   162
lemma "{p*q | p q. p\<in>prime \<and> q\<in>prime} = 
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   163
       {z. \<exists>p q. z = p*q \<and> p\<in>prime \<and> q\<in>prime}"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   164
by (rule refl)
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   165
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   166
text{*binders*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   167
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   168
text{*bounded quantifiers*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   169
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   170
lemma "(\<exists>x\<in>A. P x) = (\<exists>x. x\<in>A \<and> P x)"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   171
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   172
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   173
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   174
@{thm[display] bexI[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   175
\rulename{bexI}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   176
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   177
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   178
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   179
@{thm[display] bexE[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   180
\rulename{bexE}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   181
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   182
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   183
lemma "(\<forall>x\<in>A. P x) = (\<forall>x. x\<in>A \<longrightarrow> P x)"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   184
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   185
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   186
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   187
@{thm[display] ballI[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   188
\rulename{ballI}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   189
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   190
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   191
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   192
@{thm[display] bspec[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   193
\rulename{bspec}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   194
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   195
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   196
text{*indexed unions and variations*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   197
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   198
lemma "(\<Union>x. B x) = (\<Union>x\<in>UNIV. B x)"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   199
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   200
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   201
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   202
@{thm[display] UN_iff[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   203
\rulename{UN_iff}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   204
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   205
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   206
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   207
@{thm[display] Union_iff[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   208
\rulename{Union_iff}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   209
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   210
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   211
lemma "(\<Union>x\<in>A. B x) = {y. \<exists>x\<in>A. y \<in> B x}"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   212
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   213
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   214
lemma "\<Union>S = (\<Union>x\<in>S. x)"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   215
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   216
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   217
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   218
@{thm[display] UN_I[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   219
\rulename{UN_I}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   220
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   221
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   222
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   223
@{thm[display] UN_E[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   224
\rulename{UN_E}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   225
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   226
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   227
text{*indexed intersections*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   228
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   229
lemma "(\<Inter>x. B x) = {y. \<forall>x. y \<in> B x}"
10864
f0b0a125ae4b revisions corresponding to the new version of sets.tex
paulson
parents: 10341
diff changeset
   230
by blast
10294
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   231
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   232
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   233
@{thm[display] INT_iff[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   234
\rulename{INT_iff}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   235
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   236
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   237
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   238
@{thm[display] Inter_iff[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   239
\rulename{Inter_iff}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   240
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   241
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   242
text{*mention also card, Pow, etc.*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   243
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   244
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   245
text{*
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   246
@{thm[display] card_Un_Int[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   247
\rulename{card_Un_Int}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   248
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   249
@{thm[display] card_Pow[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   250
\rulename{card_Pow}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   251
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   252
@{thm[display] n_subsets[no_vars]}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   253
\rulename{n_subsets}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   254
*}
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   255
2ec9c808a8a7 the Sets chapter and theories
paulson
parents:
diff changeset
   256
end