src/HOL/Cardinals/Cardinal_Arithmetic.thy
changeset 52545 d2ad6eae514f
parent 51806 5c53d40a8eed
child 52634 7c4b56bac189
equal deleted inserted replaced
52544:0c4b140cff00 52545:d2ad6eae514f
   367 subsection {* Exponentiation *}
   367 subsection {* Exponentiation *}
   368 
   368 
   369 definition cexp (infixr "^c" 90) where
   369 definition cexp (infixr "^c" 90) where
   370   "r1 ^c r2 \<equiv> |Func (Field r2) (Field r1)|"
   370   "r1 ^c r2 \<equiv> |Func (Field r2) (Field r1)|"
   371 
   371 
   372 definition ccexp (infixr "^^c" 90) where
   372 lemma card_order_cexp:
   373   "r1 ^^c r2 \<equiv> |Pfunc (Field r2) (Field r1)|"
       
   374 
       
   375 lemma cexp_ordLeq_ccexp: "r1 ^c r2 \<le>o r1 ^^c r2"
       
   376 unfolding cexp_def ccexp_def by (rule card_of_mono1) (rule Func_Pfunc)
       
   377 
       
   378 lemma card_order_ccexp:
       
   379   assumes "card_order r1" "card_order r2"
   373   assumes "card_order r1" "card_order r2"
   380   shows "card_order (r1 ^^c r2)"
   374   shows "card_order (r1 ^c r2)"
   381 proof -
   375 proof -
   382   have "Field r1 = UNIV" "Field r2 = UNIV" using assms card_order_on_Card_order by auto
   376   have "Field r1 = UNIV" "Field r2 = UNIV" using assms card_order_on_Card_order by auto
   383   thus ?thesis unfolding ccexp_def Pfunc_def
   377   thus ?thesis unfolding cexp_def Func_def by (simp add: card_of_card_order_on)
   384     by (auto simp: card_of_card_order_on split: option.split)
       
   385 qed
   378 qed
   386 
   379 
   387 lemma Card_order_cexp: "Card_order (r1 ^c r2)"
   380 lemma Card_order_cexp: "Card_order (r1 ^c r2)"
   388 unfolding cexp_def by (rule card_of_Card_order)
   381 unfolding cexp_def by (rule card_of_Card_order)
   389 
   382 
   391   assumes 1: "p1 \<le>o r1" and 2: "p2 \<le>o r2"
   384   assumes 1: "p1 \<le>o r1" and 2: "p2 \<le>o r2"
   392   and n: "Field p2 = {} \<Longrightarrow> Field r2 = {}"
   385   and n: "Field p2 = {} \<Longrightarrow> Field r2 = {}"
   393   shows "p1 ^c p2 \<le>o r1 ^c r2"
   386   shows "p1 ^c p2 \<le>o r1 ^c r2"
   394 proof(cases "Field p1 = {}")
   387 proof(cases "Field p1 = {}")
   395   case True
   388   case True
   396   hence "|Field (p1 ^c p2)| \<le>o cone"
   389   hence "|Field |Func (Field p2) (Field p1)|| \<le>o cone"
   397     unfolding czero_def cone_def cexp_def Field_card_of
   390     unfolding cone_def Field_card_of
   398     by (cases "Field p2 = {}", auto intro: card_of_ordLeqI2 simp: Func_empty)
   391     by (cases "Field p2 = {}", auto intro: card_of_ordLeqI2 simp: Func_empty)
   399        (metis Func_is_emp card_of_empty ex_in_conv)
   392        (metis Func_is_emp card_of_empty ex_in_conv)
   400   hence "p1 ^c p2 \<le>o cone" by (simp add: Field_card_of cexp_def)
   393   hence "|Func (Field p2) (Field p1)| \<le>o cone" by (simp add: Field_card_of cexp_def)
       
   394   hence "p1 ^c p2 \<le>o cone" unfolding cexp_def .
   401   thus ?thesis
   395   thus ?thesis
   402   proof (cases "Field p2 = {}")
   396   proof (cases "Field p2 = {}")
   403     case True
   397     case True
   404     with n have "Field r2 = {}" .
   398     with n have "Field r2 = {}" .
   405     hence "cone \<le>o r1 ^c r2" unfolding cone_def cexp_def Func_def by (auto intro: card_of_ordLeqI)
   399     hence "cone \<le>o r1 ^c r2" unfolding cone_def cexp_def Func_def by (auto intro: card_of_ordLeqI)
   406     thus ?thesis using `p1 ^c p2 \<le>o cone` ordLeq_transitive by auto
   400     thus ?thesis using `p1 ^c p2 \<le>o cone` ordLeq_transitive by auto
   407   next
   401   next
   408     case False with True have "|Field (p1 ^c p2)| =o czero"
   402     case False with True have "|Field (p1 ^c p2)| =o czero"
   409       unfolding card_of_ordIso_czero_iff_empty cexp_def Func_is_emp Field_card_of by blast
   403       unfolding card_of_ordIso_czero_iff_empty cexp_def Field_card_of Func_def by auto
   410     thus ?thesis unfolding cexp_def card_of_ordIso_czero_iff_empty Field_card_of
   404     thus ?thesis unfolding cexp_def card_of_ordIso_czero_iff_empty Field_card_of
   411       by (simp add: card_of_empty)
   405       by (simp add: card_of_empty)
   412   qed
   406   qed
   413 next
   407 next
   414   case False
   408   case False
   488   shows "r ^c cone =o r"
   482   shows "r ^c cone =o r"
   489 proof -
   483 proof -
   490   have "r ^c cone =o |Field r|"
   484   have "r ^c cone =o |Field r|"
   491     unfolding cexp_def cone_def Field_card_of Func_empty
   485     unfolding cexp_def cone_def Field_card_of Func_empty
   492       card_of_ordIso[symmetric] bij_betw_def Func_def inj_on_def image_def
   486       card_of_ordIso[symmetric] bij_betw_def Func_def inj_on_def image_def
   493     by (rule exI[of _ "\<lambda>f. case f () of Some a \<Rightarrow> a"]) auto
   487     by (rule exI[of _ "\<lambda>f. f ()"]) auto
   494   also have "|Field r| =o r" by (rule card_of_Field_ordIso[OF assms])
   488   also have "|Field r| =o r" by (rule card_of_Field_ordIso[OF assms])
   495   finally show ?thesis .
   489   finally show ?thesis .
   496 qed
   490 qed
   497 
   491 
   498 lemma cexp_cprod:
   492 lemma cexp_cprod:
   622 by (rule conjI, rule infinite_Func, auto, rule card_of_card_order_on)
   616 by (rule conjI, rule infinite_Func, auto, rule card_of_card_order_on)
   623 
   617 
   624 lemma cinfinite_cexp: "\<lbrakk>ctwo \<le>o q; Cinfinite r\<rbrakk> \<Longrightarrow> cinfinite (q ^c r)"
   618 lemma cinfinite_cexp: "\<lbrakk>ctwo \<le>o q; Cinfinite r\<rbrakk> \<Longrightarrow> cinfinite (q ^c r)"
   625 by (metis assms cinfinite_mono ordLeq_cexp2)
   619 by (metis assms cinfinite_mono ordLeq_cexp2)
   626 
   620 
   627 lemma cinfinite_ccexp: "\<lbrakk>ctwo \<le>o q; Cinfinite r\<rbrakk> \<Longrightarrow> cinfinite (q ^^c r)"
       
   628 by (rule cinfinite_mono[OF cexp_ordLeq_ccexp cinfinite_cexp])
       
   629 
       
   630 lemma Cinfinite_cexp:
   621 lemma Cinfinite_cexp:
   631   "\<lbrakk>ctwo \<le>o q; Cinfinite r\<rbrakk> \<Longrightarrow> Cinfinite (q ^c r)"
   622   "\<lbrakk>ctwo \<le>o q; Cinfinite r\<rbrakk> \<Longrightarrow> Cinfinite (q ^c r)"
   632 by (simp add: cinfinite_cexp Card_order_cexp)
   623 by (simp add: cinfinite_cexp Card_order_cexp)
   633 
   624 
   634 lemma ctwo_ordLess_natLeq:
   625 lemma ctwo_ordLess_natLeq:
   752 
   743 
   753 lemma cprod_csum_cexp:
   744 lemma cprod_csum_cexp:
   754   "r1 *c r2 \<le>o (r1 +c r2) ^c ctwo"
   745   "r1 *c r2 \<le>o (r1 +c r2) ^c ctwo"
   755 unfolding cprod_def csum_def cexp_def ctwo_def Field_card_of
   746 unfolding cprod_def csum_def cexp_def ctwo_def Field_card_of
   756 proof -
   747 proof -
   757   let ?f = "\<lambda>(a, b). %x. if x then Some (Inl a) else Some (Inr b)"
   748   let ?f = "\<lambda>(a, b). %x. if x then Inl a else Inr b"
   758   have "inj_on ?f (Field r1 \<times> Field r2)" (is "inj_on _ ?LHS")
   749   have "inj_on ?f (Field r1 \<times> Field r2)" (is "inj_on _ ?LHS")
   759     by (auto simp: inj_on_def fun_eq_iff split: bool.split)
   750     by (auto simp: inj_on_def fun_eq_iff split: bool.split)
   760   moreover
   751   moreover
   761   have "?f ` ?LHS \<subseteq> Func (UNIV :: bool set) (Field r1 <+> Field r2)" (is "_ \<subseteq> ?RHS")
   752   have "?f ` ?LHS \<subseteq> Func (UNIV :: bool set) (Field r1 <+> Field r2)" (is "_ \<subseteq> ?RHS")
   762     by (auto simp: Func_def)
   753     by (auto simp: Func_def)