20809
|
1 |
(* Title: HOL/Infnite_Set.thy
|
|
2 |
ID: $Id$
|
|
3 |
Author: Stephan Merz
|
|
4 |
*)
|
|
5 |
|
|
6 |
header {* Infinite Sets and Related Concepts *}
|
|
7 |
|
|
8 |
theory Infinite_Set
|
|
9 |
imports Hilbert_Choice Binomial
|
|
10 |
begin
|
|
11 |
|
|
12 |
subsection "Infinite Sets"
|
|
13 |
|
|
14 |
text {*
|
|
15 |
Some elementary facts about infinite sets, mostly by Stefan Merz.
|
|
16 |
Beware! Because "infinite" merely abbreviates a negation, these
|
|
17 |
lemmas may not work well with @{text "blast"}.
|
|
18 |
*}
|
|
19 |
|
|
20 |
abbreviation
|
|
21 |
infinite :: "'a set \<Rightarrow> bool"
|
|
22 |
"infinite S == \<not> finite S"
|
|
23 |
|
|
24 |
text {*
|
|
25 |
Infinite sets are non-empty, and if we remove some elements from an
|
|
26 |
infinite set, the result is still infinite.
|
|
27 |
*}
|
|
28 |
|
|
29 |
lemma infinite_imp_nonempty: "infinite S ==> S \<noteq> {}"
|
|
30 |
by auto
|
|
31 |
|
|
32 |
lemma infinite_remove:
|
|
33 |
"infinite S \<Longrightarrow> infinite (S - {a})"
|
|
34 |
by simp
|
|
35 |
|
|
36 |
lemma Diff_infinite_finite:
|
|
37 |
assumes T: "finite T" and S: "infinite S"
|
|
38 |
shows "infinite (S - T)"
|
|
39 |
using T
|
|
40 |
proof induct
|
|
41 |
from S
|
|
42 |
show "infinite (S - {})" by auto
|
|
43 |
next
|
|
44 |
fix T x
|
|
45 |
assume ih: "infinite (S - T)"
|
|
46 |
have "S - (insert x T) = (S - T) - {x}"
|
|
47 |
by (rule Diff_insert)
|
|
48 |
with ih
|
|
49 |
show "infinite (S - (insert x T))"
|
|
50 |
by (simp add: infinite_remove)
|
|
51 |
qed
|
|
52 |
|
|
53 |
lemma Un_infinite: "infinite S \<Longrightarrow> infinite (S \<union> T)"
|
|
54 |
by simp
|
|
55 |
|
|
56 |
lemma infinite_super:
|
|
57 |
assumes T: "S \<subseteq> T" and S: "infinite S"
|
|
58 |
shows "infinite T"
|
|
59 |
proof
|
|
60 |
assume "finite T"
|
|
61 |
with T have "finite S" by (simp add: finite_subset)
|
|
62 |
with S show False by simp
|
|
63 |
qed
|
|
64 |
|
|
65 |
text {*
|
|
66 |
As a concrete example, we prove that the set of natural numbers is
|
|
67 |
infinite.
|
|
68 |
*}
|
|
69 |
|
|
70 |
lemma finite_nat_bounded:
|
|
71 |
assumes S: "finite (S::nat set)"
|
|
72 |
shows "\<exists>k. S \<subseteq> {..<k}" (is "\<exists>k. ?bounded S k")
|
|
73 |
using S
|
|
74 |
proof induct
|
|
75 |
have "?bounded {} 0" by simp
|
|
76 |
then show "\<exists>k. ?bounded {} k" ..
|
|
77 |
next
|
|
78 |
fix S x
|
|
79 |
assume "\<exists>k. ?bounded S k"
|
|
80 |
then obtain k where k: "?bounded S k" ..
|
|
81 |
show "\<exists>k. ?bounded (insert x S) k"
|
|
82 |
proof (cases "x < k")
|
|
83 |
case True
|
|
84 |
with k show ?thesis by auto
|
|
85 |
next
|
|
86 |
case False
|
|
87 |
with k have "?bounded S (Suc x)" by auto
|
|
88 |
then show ?thesis by auto
|
|
89 |
qed
|
|
90 |
qed
|
|
91 |
|
|
92 |
lemma finite_nat_iff_bounded:
|
|
93 |
"finite (S::nat set) = (\<exists>k. S \<subseteq> {..<k})" (is "?lhs = ?rhs")
|
|
94 |
proof
|
|
95 |
assume ?lhs
|
|
96 |
then show ?rhs by (rule finite_nat_bounded)
|
|
97 |
next
|
|
98 |
assume ?rhs
|
|
99 |
then obtain k where "S \<subseteq> {..<k}" ..
|
|
100 |
then show "finite S"
|
|
101 |
by (rule finite_subset) simp
|
|
102 |
qed
|
|
103 |
|
|
104 |
lemma finite_nat_iff_bounded_le:
|
|
105 |
"finite (S::nat set) = (\<exists>k. S \<subseteq> {..k})" (is "?lhs = ?rhs")
|
|
106 |
proof
|
|
107 |
assume ?lhs
|
|
108 |
then obtain k where "S \<subseteq> {..<k}"
|
|
109 |
by (blast dest: finite_nat_bounded)
|
|
110 |
then have "S \<subseteq> {..k}" by auto
|
|
111 |
then show ?rhs ..
|
|
112 |
next
|
|
113 |
assume ?rhs
|
|
114 |
then obtain k where "S \<subseteq> {..k}" ..
|
|
115 |
then show "finite S"
|
|
116 |
by (rule finite_subset) simp
|
|
117 |
qed
|
|
118 |
|
|
119 |
lemma infinite_nat_iff_unbounded:
|
|
120 |
"infinite (S::nat set) = (\<forall>m. \<exists>n. m<n \<and> n\<in>S)"
|
|
121 |
(is "?lhs = ?rhs")
|
|
122 |
proof
|
|
123 |
assume ?lhs
|
|
124 |
show ?rhs
|
|
125 |
proof (rule ccontr)
|
|
126 |
assume "\<not> ?rhs"
|
|
127 |
then obtain m where m: "\<forall>n. m<n \<longrightarrow> n\<notin>S" by blast
|
|
128 |
then have "S \<subseteq> {..m}"
|
|
129 |
by (auto simp add: sym [OF linorder_not_less])
|
|
130 |
with `?lhs` show False
|
|
131 |
by (simp add: finite_nat_iff_bounded_le)
|
|
132 |
qed
|
|
133 |
next
|
|
134 |
assume ?rhs
|
|
135 |
show ?lhs
|
|
136 |
proof
|
|
137 |
assume "finite S"
|
|
138 |
then obtain m where "S \<subseteq> {..m}"
|
|
139 |
by (auto simp add: finite_nat_iff_bounded_le)
|
|
140 |
then have "\<forall>n. m<n \<longrightarrow> n\<notin>S" by auto
|
|
141 |
with `?rhs` show False by blast
|
|
142 |
qed
|
|
143 |
qed
|
|
144 |
|
|
145 |
lemma infinite_nat_iff_unbounded_le:
|
|
146 |
"infinite (S::nat set) = (\<forall>m. \<exists>n. m\<le>n \<and> n\<in>S)"
|
|
147 |
(is "?lhs = ?rhs")
|
|
148 |
proof
|
|
149 |
assume ?lhs
|
|
150 |
show ?rhs
|
|
151 |
proof
|
|
152 |
fix m
|
|
153 |
from `?lhs` obtain n where "m<n \<and> n\<in>S"
|
|
154 |
by (auto simp add: infinite_nat_iff_unbounded)
|
|
155 |
then have "m\<le>n \<and> n\<in>S" by simp
|
|
156 |
then show "\<exists>n. m \<le> n \<and> n \<in> S" ..
|
|
157 |
qed
|
|
158 |
next
|
|
159 |
assume ?rhs
|
|
160 |
show ?lhs
|
|
161 |
proof (auto simp add: infinite_nat_iff_unbounded)
|
|
162 |
fix m
|
|
163 |
from `?rhs` obtain n where "Suc m \<le> n \<and> n\<in>S"
|
|
164 |
by blast
|
|
165 |
then have "m<n \<and> n\<in>S" by simp
|
|
166 |
then show "\<exists>n. m < n \<and> n \<in> S" ..
|
|
167 |
qed
|
|
168 |
qed
|
|
169 |
|
|
170 |
text {*
|
|
171 |
For a set of natural numbers to be infinite, it is enough to know
|
|
172 |
that for any number larger than some @{text k}, there is some larger
|
|
173 |
number that is an element of the set.
|
|
174 |
*}
|
|
175 |
|
|
176 |
lemma unbounded_k_infinite:
|
|
177 |
assumes k: "\<forall>m. k<m \<longrightarrow> (\<exists>n. m<n \<and> n\<in>S)"
|
|
178 |
shows "infinite (S::nat set)"
|
|
179 |
proof -
|
|
180 |
{
|
|
181 |
fix m have "\<exists>n. m<n \<and> n\<in>S"
|
|
182 |
proof (cases "k<m")
|
|
183 |
case True
|
|
184 |
with k show ?thesis by blast
|
|
185 |
next
|
|
186 |
case False
|
|
187 |
from k obtain n where "Suc k < n \<and> n\<in>S" by auto
|
|
188 |
with False have "m<n \<and> n\<in>S" by auto
|
|
189 |
then show ?thesis ..
|
|
190 |
qed
|
|
191 |
}
|
|
192 |
then show ?thesis
|
|
193 |
by (auto simp add: infinite_nat_iff_unbounded)
|
|
194 |
qed
|
|
195 |
|
|
196 |
lemma nat_infinite [simp]: "infinite (UNIV :: nat set)"
|
|
197 |
by (auto simp add: infinite_nat_iff_unbounded)
|
|
198 |
|
|
199 |
lemma nat_not_finite [elim]: "finite (UNIV::nat set) \<Longrightarrow> R"
|
|
200 |
by simp
|
|
201 |
|
|
202 |
text {*
|
|
203 |
Every infinite set contains a countable subset. More precisely we
|
|
204 |
show that a set @{text S} is infinite if and only if there exists an
|
|
205 |
injective function from the naturals into @{text S}.
|
|
206 |
*}
|
|
207 |
|
|
208 |
lemma range_inj_infinite:
|
|
209 |
"inj (f::nat \<Rightarrow> 'a) \<Longrightarrow> infinite (range f)"
|
|
210 |
proof
|
|
211 |
assume "inj f"
|
|
212 |
and "finite (range f)"
|
|
213 |
then have "finite (UNIV::nat set)"
|
|
214 |
by (auto intro: finite_imageD simp del: nat_infinite)
|
|
215 |
then show False by simp
|
|
216 |
qed
|
|
217 |
|
|
218 |
text {*
|
|
219 |
The ``only if'' direction is harder because it requires the
|
|
220 |
construction of a sequence of pairwise different elements of an
|
|
221 |
infinite set @{text S}. The idea is to construct a sequence of
|
|
222 |
non-empty and infinite subsets of @{text S} obtained by successively
|
|
223 |
removing elements of @{text S}.
|
|
224 |
*}
|
|
225 |
|
|
226 |
lemma linorder_injI:
|
|
227 |
assumes hyp: "!!x y. x < (y::'a::linorder) ==> f x \<noteq> f y"
|
|
228 |
shows "inj f"
|
|
229 |
proof (rule inj_onI)
|
|
230 |
fix x y
|
|
231 |
assume f_eq: "f x = f y"
|
|
232 |
show "x = y"
|
|
233 |
proof (rule linorder_cases)
|
|
234 |
assume "x < y"
|
|
235 |
with hyp have "f x \<noteq> f y" by blast
|
|
236 |
with f_eq show ?thesis by simp
|
|
237 |
next
|
|
238 |
assume "x = y"
|
|
239 |
then show ?thesis .
|
|
240 |
next
|
|
241 |
assume "y < x"
|
|
242 |
with hyp have "f y \<noteq> f x" by blast
|
|
243 |
with f_eq show ?thesis by simp
|
|
244 |
qed
|
|
245 |
qed
|
|
246 |
|
|
247 |
lemma infinite_countable_subset:
|
|
248 |
assumes inf: "infinite (S::'a set)"
|
|
249 |
shows "\<exists>f. inj (f::nat \<Rightarrow> 'a) \<and> range f \<subseteq> S"
|
|
250 |
proof -
|
|
251 |
def Sseq \<equiv> "nat_rec S (\<lambda>n T. T - {SOME e. e \<in> T})"
|
|
252 |
def pick \<equiv> "\<lambda>n. (SOME e. e \<in> Sseq n)"
|
|
253 |
have Sseq_inf: "\<And>n. infinite (Sseq n)"
|
|
254 |
proof -
|
|
255 |
fix n
|
|
256 |
show "infinite (Sseq n)"
|
|
257 |
proof (induct n)
|
|
258 |
from inf show "infinite (Sseq 0)"
|
|
259 |
by (simp add: Sseq_def)
|
|
260 |
next
|
|
261 |
fix n
|
|
262 |
assume "infinite (Sseq n)" then show "infinite (Sseq (Suc n))"
|
|
263 |
by (simp add: Sseq_def infinite_remove)
|
|
264 |
qed
|
|
265 |
qed
|
|
266 |
have Sseq_S: "\<And>n. Sseq n \<subseteq> S"
|
|
267 |
proof -
|
|
268 |
fix n
|
|
269 |
show "Sseq n \<subseteq> S"
|
|
270 |
by (induct n) (auto simp add: Sseq_def)
|
|
271 |
qed
|
|
272 |
have Sseq_pick: "\<And>n. pick n \<in> Sseq n"
|
|
273 |
proof -
|
|
274 |
fix n
|
|
275 |
show "pick n \<in> Sseq n"
|
|
276 |
proof (unfold pick_def, rule someI_ex)
|
|
277 |
from Sseq_inf have "infinite (Sseq n)" .
|
|
278 |
then have "Sseq n \<noteq> {}" by auto
|
|
279 |
then show "\<exists>x. x \<in> Sseq n" by auto
|
|
280 |
qed
|
|
281 |
qed
|
|
282 |
with Sseq_S have rng: "range pick \<subseteq> S"
|
|
283 |
by auto
|
|
284 |
have pick_Sseq_gt: "\<And>n m. pick n \<notin> Sseq (n + Suc m)"
|
|
285 |
proof -
|
|
286 |
fix n m
|
|
287 |
show "pick n \<notin> Sseq (n + Suc m)"
|
|
288 |
by (induct m) (auto simp add: Sseq_def pick_def)
|
|
289 |
qed
|
|
290 |
have pick_pick: "\<And>n m. pick n \<noteq> pick (n + Suc m)"
|
|
291 |
proof -
|
|
292 |
fix n m
|
|
293 |
from Sseq_pick have "pick (n + Suc m) \<in> Sseq (n + Suc m)" .
|
|
294 |
moreover from pick_Sseq_gt
|
|
295 |
have "pick n \<notin> Sseq (n + Suc m)" .
|
|
296 |
ultimately show "pick n \<noteq> pick (n + Suc m)"
|
|
297 |
by auto
|
|
298 |
qed
|
|
299 |
have inj: "inj pick"
|
|
300 |
proof (rule linorder_injI)
|
|
301 |
fix i j :: nat
|
|
302 |
assume "i < j"
|
|
303 |
show "pick i \<noteq> pick j"
|
|
304 |
proof
|
|
305 |
assume eq: "pick i = pick j"
|
|
306 |
from `i < j` obtain k where "j = i + Suc k"
|
|
307 |
by (auto simp add: less_iff_Suc_add)
|
|
308 |
with pick_pick have "pick i \<noteq> pick j" by simp
|
|
309 |
with eq show False by simp
|
|
310 |
qed
|
|
311 |
qed
|
|
312 |
from rng inj show ?thesis by auto
|
|
313 |
qed
|
|
314 |
|
|
315 |
lemma infinite_iff_countable_subset:
|
|
316 |
"infinite S = (\<exists>f. inj (f::nat \<Rightarrow> 'a) \<and> range f \<subseteq> S)"
|
|
317 |
by (auto simp add: infinite_countable_subset range_inj_infinite infinite_super)
|
|
318 |
|
|
319 |
text {*
|
|
320 |
For any function with infinite domain and finite range there is some
|
|
321 |
element that is the image of infinitely many domain elements. In
|
|
322 |
particular, any infinite sequence of elements from a finite set
|
|
323 |
contains some element that occurs infinitely often.
|
|
324 |
*}
|
|
325 |
|
|
326 |
lemma inf_img_fin_dom:
|
|
327 |
assumes img: "finite (f`A)" and dom: "infinite A"
|
|
328 |
shows "\<exists>y \<in> f`A. infinite (f -` {y})"
|
|
329 |
proof (rule ccontr)
|
|
330 |
assume "\<not> ?thesis"
|
|
331 |
with img have "finite (UN y:f`A. f -` {y})" by (blast intro: finite_UN_I)
|
|
332 |
moreover have "A \<subseteq> (UN y:f`A. f -` {y})" by auto
|
|
333 |
moreover note dom
|
|
334 |
ultimately show False by (simp add: infinite_super)
|
|
335 |
qed
|
|
336 |
|
|
337 |
lemma inf_img_fin_domE:
|
|
338 |
assumes "finite (f`A)" and "infinite A"
|
|
339 |
obtains y where "y \<in> f`A" and "infinite (f -` {y})"
|
|
340 |
using prems by (blast dest: inf_img_fin_dom)
|
|
341 |
|
|
342 |
|
|
343 |
subsection "Infinitely Many and Almost All"
|
|
344 |
|
|
345 |
text {*
|
|
346 |
We often need to reason about the existence of infinitely many
|
|
347 |
(resp., all but finitely many) objects satisfying some predicate, so
|
|
348 |
we introduce corresponding binders and their proof rules.
|
|
349 |
*}
|
|
350 |
|
|
351 |
definition
|
|
352 |
Inf_many :: "('a \<Rightarrow> bool) \<Rightarrow> bool" (binder "INF " 10)
|
|
353 |
"Inf_many P = infinite {x. P x}"
|
|
354 |
Alm_all :: "('a \<Rightarrow> bool) \<Rightarrow> bool" (binder "MOST " 10)
|
|
355 |
"Alm_all P = (\<not> (INF x. \<not> P x))"
|
|
356 |
|
|
357 |
const_syntax (xsymbols)
|
|
358 |
Inf_many (binder "\<exists>\<^sub>\<infinity>" 10)
|
|
359 |
Alm_all (binder "\<forall>\<^sub>\<infinity>" 10)
|
|
360 |
|
|
361 |
const_syntax (HTML output)
|
|
362 |
Inf_many (binder "\<exists>\<^sub>\<infinity>" 10)
|
|
363 |
Alm_all (binder "\<forall>\<^sub>\<infinity>" 10)
|
|
364 |
|
|
365 |
lemma INF_EX:
|
|
366 |
"(\<exists>\<^sub>\<infinity>x. P x) \<Longrightarrow> (\<exists>x. P x)"
|
|
367 |
unfolding Inf_many_def
|
|
368 |
proof (rule ccontr)
|
|
369 |
assume inf: "infinite {x. P x}"
|
|
370 |
assume "\<not> ?thesis" then have "{x. P x} = {}" by simp
|
|
371 |
then have "finite {x. P x}" by simp
|
|
372 |
with inf show False by simp
|
|
373 |
qed
|
|
374 |
|
|
375 |
lemma MOST_iff_finiteNeg: "(\<forall>\<^sub>\<infinity>x. P x) = finite {x. \<not> P x}"
|
|
376 |
by (simp add: Alm_all_def Inf_many_def)
|
|
377 |
|
|
378 |
lemma ALL_MOST: "\<forall>x. P x \<Longrightarrow> \<forall>\<^sub>\<infinity>x. P x"
|
|
379 |
by (simp add: MOST_iff_finiteNeg)
|
|
380 |
|
|
381 |
lemma INF_mono:
|
|
382 |
assumes inf: "\<exists>\<^sub>\<infinity>x. P x" and q: "\<And>x. P x \<Longrightarrow> Q x"
|
|
383 |
shows "\<exists>\<^sub>\<infinity>x. Q x"
|
|
384 |
proof -
|
|
385 |
from inf have "infinite {x. P x}" unfolding Inf_many_def .
|
|
386 |
moreover from q have "{x. P x} \<subseteq> {x. Q x}" by auto
|
|
387 |
ultimately show ?thesis
|
|
388 |
by (simp add: Inf_many_def infinite_super)
|
|
389 |
qed
|
|
390 |
|
|
391 |
lemma MOST_mono: "\<forall>\<^sub>\<infinity>x. P x \<Longrightarrow> (\<And>x. P x \<Longrightarrow> Q x) \<Longrightarrow> \<forall>\<^sub>\<infinity>x. Q x"
|
|
392 |
unfolding Alm_all_def by (blast intro: INF_mono)
|
|
393 |
|
|
394 |
lemma INF_nat: "(\<exists>\<^sub>\<infinity>n. P (n::nat)) = (\<forall>m. \<exists>n. m<n \<and> P n)"
|
|
395 |
by (simp add: Inf_many_def infinite_nat_iff_unbounded)
|
|
396 |
|
|
397 |
lemma INF_nat_le: "(\<exists>\<^sub>\<infinity>n. P (n::nat)) = (\<forall>m. \<exists>n. m\<le>n \<and> P n)"
|
|
398 |
by (simp add: Inf_many_def infinite_nat_iff_unbounded_le)
|
|
399 |
|
|
400 |
lemma MOST_nat: "(\<forall>\<^sub>\<infinity>n. P (n::nat)) = (\<exists>m. \<forall>n. m<n \<longrightarrow> P n)"
|
|
401 |
by (simp add: Alm_all_def INF_nat)
|
|
402 |
|
|
403 |
lemma MOST_nat_le: "(\<forall>\<^sub>\<infinity>n. P (n::nat)) = (\<exists>m. \<forall>n. m\<le>n \<longrightarrow> P n)"
|
|
404 |
by (simp add: Alm_all_def INF_nat_le)
|
|
405 |
|
|
406 |
|
|
407 |
subsection "Enumeration of an Infinite Set"
|
|
408 |
|
|
409 |
text {*
|
|
410 |
The set's element type must be wellordered (e.g. the natural numbers).
|
|
411 |
*}
|
|
412 |
|
|
413 |
consts
|
|
414 |
enumerate :: "'a::wellorder set => (nat => 'a::wellorder)"
|
|
415 |
primrec
|
|
416 |
enumerate_0: "enumerate S 0 = (LEAST n. n \<in> S)"
|
|
417 |
enumerate_Suc: "enumerate S (Suc n) = enumerate (S - {LEAST n. n \<in> S}) n"
|
|
418 |
|
|
419 |
lemma enumerate_Suc':
|
|
420 |
"enumerate S (Suc n) = enumerate (S - {enumerate S 0}) n"
|
|
421 |
by simp
|
|
422 |
|
|
423 |
lemma enumerate_in_set: "infinite S \<Longrightarrow> enumerate S n : S"
|
|
424 |
apply (induct n arbitrary: S)
|
|
425 |
apply (fastsimp intro: LeastI dest!: infinite_imp_nonempty)
|
|
426 |
apply (fastsimp iff: finite_Diff_singleton)
|
|
427 |
done
|
|
428 |
|
|
429 |
declare enumerate_0 [simp del] enumerate_Suc [simp del]
|
|
430 |
|
|
431 |
lemma enumerate_step: "infinite S \<Longrightarrow> enumerate S n < enumerate S (Suc n)"
|
|
432 |
apply (induct n arbitrary: S)
|
|
433 |
apply (rule order_le_neq_trans)
|
|
434 |
apply (simp add: enumerate_0 Least_le enumerate_in_set)
|
|
435 |
apply (simp only: enumerate_Suc')
|
|
436 |
apply (subgoal_tac "enumerate (S - {enumerate S 0}) 0 : S - {enumerate S 0}")
|
|
437 |
apply (blast intro: sym)
|
|
438 |
apply (simp add: enumerate_in_set del: Diff_iff)
|
|
439 |
apply (simp add: enumerate_Suc')
|
|
440 |
done
|
|
441 |
|
|
442 |
lemma enumerate_mono: "m<n \<Longrightarrow> infinite S \<Longrightarrow> enumerate S m < enumerate S n"
|
|
443 |
apply (erule less_Suc_induct)
|
|
444 |
apply (auto intro: enumerate_step)
|
|
445 |
done
|
|
446 |
|
|
447 |
|
|
448 |
subsection "Miscellaneous"
|
|
449 |
|
|
450 |
text {*
|
|
451 |
A few trivial lemmas about sets that contain at most one element.
|
|
452 |
These simplify the reasoning about deterministic automata.
|
|
453 |
*}
|
|
454 |
|
|
455 |
definition
|
|
456 |
atmost_one :: "'a set \<Rightarrow> bool"
|
|
457 |
"atmost_one S = (\<forall>x y. x\<in>S \<and> y\<in>S \<longrightarrow> x=y)"
|
|
458 |
|
|
459 |
lemma atmost_one_empty: "S = {} \<Longrightarrow> atmost_one S"
|
|
460 |
by (simp add: atmost_one_def)
|
|
461 |
|
|
462 |
lemma atmost_one_singleton: "S = {x} \<Longrightarrow> atmost_one S"
|
|
463 |
by (simp add: atmost_one_def)
|
|
464 |
|
|
465 |
lemma atmost_one_unique [elim]: "atmost_one S \<Longrightarrow> x \<in> S \<Longrightarrow> y \<in> S \<Longrightarrow> y = x"
|
|
466 |
by (simp add: atmost_one_def)
|
|
467 |
|
|
468 |
end
|