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