13 |
13 |
14 lemma apply_inverse: |
14 lemma apply_inverse: |
15 "f x = u \<Longrightarrow> (\<And>x. P x \<Longrightarrow> g (f x) = x) \<Longrightarrow> P x \<Longrightarrow> x = g u" |
15 "f x = u \<Longrightarrow> (\<And>x. P x \<Longrightarrow> g (f x) = x) \<Longrightarrow> P x \<Longrightarrow> x = g u" |
16 by auto |
16 by auto |
17 |
17 |
|
18 text{*Uniqueness, so NOT the axiom of choice.*} |
|
19 lemma uniq_choice: "\<forall>x. \<exists>!y. Q x y \<Longrightarrow> \<exists>f. \<forall>x. Q x (f x)" |
|
20 by (force intro: theI') |
|
21 |
|
22 lemma b_uniq_choice: "\<forall>x\<in>S. \<exists>!y. Q x y \<Longrightarrow> \<exists>f. \<forall>x\<in>S. Q x (f x)" |
|
23 by (force intro: theI') |
18 |
24 |
19 subsection {* The Identity Function @{text id} *} |
25 subsection {* The Identity Function @{text id} *} |
20 |
26 |
21 definition id :: "'a \<Rightarrow> 'a" where |
27 definition id :: "'a \<Rightarrow> 'a" where |
22 "id = (\<lambda>x. x)" |
28 "id = (\<lambda>x. x)" |
475 by (simp add: inj_on_def, blast) |
484 by (simp add: inj_on_def, blast) |
476 |
485 |
477 lemma image_set_diff: "inj f ==> f`(A-B) = f`A - f`B" |
486 lemma image_set_diff: "inj f ==> f`(A-B) = f`A - f`B" |
478 by (simp add: inj_on_def, blast) |
487 by (simp add: inj_on_def, blast) |
479 |
488 |
480 lemma inj_image_mem_iff: "inj f ==> (f a : f`A) = (a : A)" |
489 lemma inj_on_image_mem_iff: "\<lbrakk>inj_on f B; a \<in> B; A \<subseteq> B\<rbrakk> \<Longrightarrow> f a \<in> f`A \<longleftrightarrow> a \<in> A" |
481 by (blast dest: injD) |
490 by (auto simp: inj_on_def) |
|
491 |
|
492 lemma inj_image_mem_iff: "inj f \<Longrightarrow> f a \<in> f`A \<longleftrightarrow> a \<in> A" |
|
493 by (blast dest: injD) |
482 |
494 |
483 lemma inj_image_subset_iff: "inj f ==> (f`A <= f`B) = (A<=B)" |
495 lemma inj_image_subset_iff: "inj f ==> (f`A <= f`B) = (A<=B)" |
484 by (simp add: inj_on_def, blast) |
496 by (blast dest: injD) |
485 |
497 |
486 lemma inj_image_eq_iff: "inj f ==> (f`A = f`B) = (A = B)" |
498 lemma inj_image_eq_iff: "inj f ==> (f`A = f`B) = (A = B)" |
487 by (blast dest: injD) |
499 by (blast dest: injD) |
488 |
500 |
489 lemma surj_Compl_image_subset: "surj f ==> -(f`A) <= f`(-A)" |
501 lemma surj_Compl_image_subset: "surj f ==> -(f`A) <= f`(-A)" |
490 by auto |
502 by auto |
491 |
503 |
492 lemma inj_image_Compl_subset: "inj f ==> f`(-A) <= -(f`A)" |
504 lemma inj_image_Compl_subset: "inj f ==> f`(-A) <= -(f`A)" |