src/HOL/BNF_Cardinal_Order_Relation.thy
changeset 69850 5f993636ac07
parent 69276 3d954183b707
child 75624 22d1c5f2b9f4
equal deleted inserted replaced
69849:09f200c658ed 69850:5f993636ac07
   523      hence "d1 = d2" using 1 unfolding inj_on_def g_def by force
   523      hence "d1 = d2" using 1 unfolding inj_on_def g_def by force
   524     }
   524     }
   525     moreover
   525     moreover
   526     {fix d assume "d \<in> A <+> C"
   526     {fix d assume "d \<in> A <+> C"
   527      hence "g d \<in> B <+> C"  using 1
   527      hence "g d \<in> B <+> C"  using 1
   528      by(case_tac d, auto simp add: g_def)
   528      by(cases d) (auto simp add: g_def)
   529     }
   529     }
   530     ultimately show ?thesis unfolding inj_on_def by auto
   530     ultimately show ?thesis unfolding inj_on_def by auto
   531   qed
   531   qed
   532   thus ?thesis using card_of_ordLeq by blast
   532   thus ?thesis using card_of_ordLeq by blast
   533 qed
   533 qed
   643                                   |Inr a \<Rightarrow> (a,False)"
   643                                   |Inr a \<Rightarrow> (a,False)"
   644   have "bij_betw ?f (A <+> A) (A \<times> (UNIV::bool set))"
   644   have "bij_betw ?f (A <+> A) (A \<times> (UNIV::bool set))"
   645   proof-
   645   proof-
   646     {fix  c1 and c2 assume "?f c1 = ?f c2"
   646     {fix  c1 and c2 assume "?f c1 = ?f c2"
   647      hence "c1 = c2"
   647      hence "c1 = c2"
   648      by(case_tac "c1", case_tac "c2", auto, case_tac "c2", auto)
   648      by(cases c1; cases c2) auto
   649     }
   649     }
   650     moreover
   650     moreover
   651     {fix c assume "c \<in> A <+> A"
   651     {fix c assume "c \<in> A <+> A"
   652      hence "?f c \<in> A \<times> (UNIV::bool set)"
   652      hence "?f c \<in> A \<times> (UNIV::bool set)"
   653      by(case_tac c, auto)
   653      by(cases c) auto
   654     }
   654     }
   655     moreover
   655     moreover
   656     {fix a bl assume *: "(a,bl) \<in> A \<times> (UNIV::bool set)"
   656     {fix a bl assume *: "(a,bl) \<in> A \<times> (UNIV::bool set)"
   657      have "(a,bl) \<in> ?f ` ( A <+> A)"
   657      have "(a,bl) \<in> ?f ` ( A <+> A)"
   658      proof(cases bl)
   658      proof(cases bl)
   724 proof-
   724 proof-
   725   let ?f = "\<lambda> bl. case bl of True \<Rightarrow> a1 | False \<Rightarrow> a2"
   725   let ?f = "\<lambda> bl. case bl of True \<Rightarrow> a1 | False \<Rightarrow> a2"
   726   have "bij_betw ?f UNIV {a1,a2}"
   726   have "bij_betw ?f UNIV {a1,a2}"
   727   proof-
   727   proof-
   728     {fix bl1 and bl2 assume "?f  bl1 = ?f bl2"
   728     {fix bl1 and bl2 assume "?f  bl1 = ?f bl2"
   729      hence "bl1 = bl2" using assms by (case_tac bl1, case_tac bl2, auto)
   729      hence "bl1 = bl2" using assms by (cases bl1, cases bl2) auto
   730     }
   730     }
   731     moreover
   731     moreover
   732     {fix bl have "?f bl \<in> {a1,a2}" by (case_tac bl, auto)
   732     {fix bl have "?f bl \<in> {a1,a2}" by (cases bl) auto
   733     }
   733     }
   734     moreover
   734     moreover
   735     {fix a assume *: "a \<in> {a1,a2}"
   735     {fix a assume *: "a \<in> {a1,a2}"
   736      have "a \<in> ?f ` UNIV"
   736      have "a \<in> ?f ` UNIV"
   737      proof(cases "a = a1")
   737      proof(cases "a = a1")
  1676   proof (intro conjI impI ballI equalityI subsetI)
  1676   proof (intro conjI impI ballI equalityI subsetI)
  1677     fix f g assume *: "f \<in> Func A (B \<times> C)" "g \<in> Func A (B \<times> C)" "?F f = ?F g"
  1677     fix f g assume *: "f \<in> Func A (B \<times> C)" "g \<in> Func A (B \<times> C)" "?F f = ?F g"
  1678     show "f = g"
  1678     show "f = g"
  1679     proof
  1679     proof
  1680       fix x from * have "fst (f x) = fst (g x) \<and> snd (f x) = snd (g x)"
  1680       fix x from * have "fst (f x) = fst (g x) \<and> snd (f x) = snd (g x)"
  1681         by (case_tac "x \<in> A") (auto simp: Func_def fun_eq_iff split: if_splits)
  1681         by (cases "x \<in> A") (auto simp: Func_def fun_eq_iff split: if_splits)
  1682       then show "f x = g x" by (subst (1 2) surjective_pairing) simp
  1682       then show "f x = g x" by (subst (1 2) surjective_pairing) simp
  1683     qed
  1683     qed
  1684   next
  1684   next
  1685     fix fg assume "fg \<in> Func A B \<times> Func A C"
  1685     fix fg assume "fg \<in> Func A B \<times> Func A C"
  1686     thus "fg \<in> ?F ` Func A (B \<times> C)"
  1686     thus "fg \<in> ?F ` Func A (B \<times> C)"