src/HOL/Isar_Examples/Schroeder_Bernstein.thy
 changeset 63980 f8e556c8ad6f parent 63979 95c3ae4baba8 child 63981 6f7db4f8df4c
```     1.1 --- a/src/HOL/Isar_Examples/Schroeder_Bernstein.thy	Sat Oct 01 17:16:35 2016 +0200
1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,56 +0,0 @@
1.4 -(*  Title:      HOL/Isar_Examples/Schroeder_Bernstein.thy
1.5 -    Author:     Makarius
1.6 -*)
1.7 -
1.8 -section \<open>SchrÃ¶der-Bernstein Theorem\<close>
1.9 -
1.10 -theory Schroeder_Bernstein
1.11 -  imports Main
1.12 -begin
1.13 -
1.14 -text \<open>
1.16 -  \<^item> \<^file>\<open>\$ISABELLE_HOME/src/HOL/ex/Set_Theory.thy\<close>
1.17 -  \<^item> \<^url>\<open>http://planetmath.org/proofofschroederbernsteintheoremusingtarskiknastertheorem\<close>
1.18 -  \<^item> Springer LNCS 828 (cover page)
1.19 -\<close>
1.20 -
1.21 -theorem Schroeder_Bernstein: \<open>\<exists>h :: 'a \<Rightarrow> 'b. inj h \<and> surj h\<close> if \<open>inj f\<close> and \<open>inj g\<close>
1.22 -  for f :: \<open>'a \<Rightarrow> 'b\<close> and g :: \<open>'b \<Rightarrow> 'a\<close>
1.23 -proof
1.24 -  define A where \<open>A = lfp (\<lambda>X. - (g ` (- (f ` X))))\<close>
1.25 -  define g' where \<open>g' = inv g\<close>
1.26 -  let \<open>?h\<close> = \<open>\<lambda>z. if z \<in> A then f z else g' z\<close>
1.27 -
1.28 -  have \<open>A = - (g ` (- (f ` A)))\<close>
1.29 -    unfolding A_def by (rule lfp_unfold) (blast intro: monoI)
1.30 -  then have A_compl: \<open>- A = g ` (- (f ` A))\<close> by blast
1.31 -  then have *: \<open>g' ` (- A) = - (f ` A)\<close>
1.32 -    using g'_def \<open>inj g\<close> by auto
1.33 -
1.34 -  show \<open>inj ?h \<and> surj ?h\<close>
1.35 -  proof
1.36 -    from * show \<open>surj ?h\<close> by auto
1.37 -    have \<open>inj_on f A\<close>
1.38 -      using \<open>inj f\<close> by (rule subset_inj_on) blast
1.39 -    moreover
1.40 -    have \<open>inj_on g' (- A)\<close>
1.41 -      unfolding g'_def
1.42 -    proof (rule inj_on_inv_into)
1.43 -      have \<open>g ` (- (f ` A)) \<subseteq> range g\<close> by blast
1.44 -      then show \<open>- A \<subseteq> range g\<close> by (simp only: A_compl)
1.45 -    qed
1.46 -    moreover
1.47 -    have \<open>False\<close> if eq: \<open>f a = g' b\<close> and a: \<open>a \<in> A\<close> and b: \<open>b \<in> - A\<close> for a b
1.48 -    proof -
1.49 -      from a have fa: \<open>f a \<in> f ` A\<close> by (rule imageI)
1.50 -      from b have \<open>g' b \<in> g' ` (- A)\<close> by (rule imageI)
1.51 -      with * have \<open>g' b \<in> - (f ` A)\<close> by simp
1.52 -      with eq fa show \<open>False\<close> by simp
1.53 -    qed
1.54 -    ultimately show \<open>inj ?h\<close>
1.55 -      unfolding inj_on_def by (metis ComplI)
1.56 -  qed
1.57 -qed
1.58 -
1.59 -end
```