16 Beware! Because "infinite" merely abbreviates a negation, these |
16 Beware! Because "infinite" merely abbreviates a negation, these |
17 lemmas may not work well with @{text "blast"}. |
17 lemmas may not work well with @{text "blast"}. |
18 *} |
18 *} |
19 |
19 |
20 abbreviation |
20 abbreviation |
21 infinite :: "'a set \<Rightarrow> bool" |
21 infinite :: "'a set \<Rightarrow> bool" where |
22 "infinite S == \<not> finite S" |
22 "infinite S == \<not> finite S" |
23 |
23 |
24 text {* |
24 text {* |
25 Infinite sets are non-empty, and if we remove some elements from an |
25 Infinite sets are non-empty, and if we remove some elements from an |
26 infinite set, the result is still infinite. |
26 infinite set, the result is still infinite. |
347 (resp., all but finitely many) objects satisfying some predicate, so |
347 (resp., all but finitely many) objects satisfying some predicate, so |
348 we introduce corresponding binders and their proof rules. |
348 we introduce corresponding binders and their proof rules. |
349 *} |
349 *} |
350 |
350 |
351 definition |
351 definition |
352 Inf_many :: "('a \<Rightarrow> bool) \<Rightarrow> bool" (binder "INF " 10) |
352 Inf_many :: "('a \<Rightarrow> bool) \<Rightarrow> bool" (binder "INF " 10) where |
353 "Inf_many P = infinite {x. P x}" |
353 "Inf_many P = infinite {x. P x}" |
354 Alm_all :: "('a \<Rightarrow> bool) \<Rightarrow> bool" (binder "MOST " 10) |
354 |
|
355 definition |
|
356 Alm_all :: "('a \<Rightarrow> bool) \<Rightarrow> bool" (binder "MOST " 10) where |
355 "Alm_all P = (\<not> (INF x. \<not> P x))" |
357 "Alm_all P = (\<not> (INF x. \<not> P x))" |
356 |
358 |
357 notation (xsymbols) |
359 notation (xsymbols) |
358 Inf_many (binder "\<exists>\<^sub>\<infinity>" 10) |
360 Inf_many (binder "\<exists>\<^sub>\<infinity>" 10) and |
359 Alm_all (binder "\<forall>\<^sub>\<infinity>" 10) |
361 Alm_all (binder "\<forall>\<^sub>\<infinity>" 10) |
360 |
362 |
361 notation (HTML output) |
363 notation (HTML output) |
362 Inf_many (binder "\<exists>\<^sub>\<infinity>" 10) |
364 Inf_many (binder "\<exists>\<^sub>\<infinity>" 10) and |
363 Alm_all (binder "\<forall>\<^sub>\<infinity>" 10) |
365 Alm_all (binder "\<forall>\<^sub>\<infinity>" 10) |
364 |
366 |
365 lemma INF_EX: |
367 lemma INF_EX: |
366 "(\<exists>\<^sub>\<infinity>x. P x) \<Longrightarrow> (\<exists>x. P x)" |
368 "(\<exists>\<^sub>\<infinity>x. P x) \<Longrightarrow> (\<exists>x. P x)" |
367 unfolding Inf_many_def |
369 unfolding Inf_many_def |
451 A few trivial lemmas about sets that contain at most one element. |
453 A few trivial lemmas about sets that contain at most one element. |
452 These simplify the reasoning about deterministic automata. |
454 These simplify the reasoning about deterministic automata. |
453 *} |
455 *} |
454 |
456 |
455 definition |
457 definition |
456 atmost_one :: "'a set \<Rightarrow> bool" |
458 atmost_one :: "'a set \<Rightarrow> bool" where |
457 "atmost_one S = (\<forall>x y. x\<in>S \<and> y\<in>S \<longrightarrow> x=y)" |
459 "atmost_one S = (\<forall>x y. x\<in>S \<and> y\<in>S \<longrightarrow> x=y)" |
458 |
460 |
459 lemma atmost_one_empty: "S = {} \<Longrightarrow> atmost_one S" |
461 lemma atmost_one_empty: "S = {} \<Longrightarrow> atmost_one S" |
460 by (simp add: atmost_one_def) |
462 by (simp add: atmost_one_def) |
461 |
463 |