src/HOL/BNF_Cardinal_Arithmetic.thy
changeset 80932 261cd8722677
parent 80760 be8c0e039a5e
child 80934 8e72f55295fd
equal deleted inserted replaced
80931:f6e595e4f608 80932:261cd8722677
   137   shows "|\<Union>i \<in> I. A i| <o r"
   137   shows "|\<Union>i \<in> I. A i| <o r"
   138   using card_of_UNION_ordLess_infinite_Field regularCard_stable assms cinfinite_def by blast
   138   using card_of_UNION_ordLess_infinite_Field regularCard_stable assms cinfinite_def by blast
   139 
   139 
   140 subsection \<open>Binary sum\<close>
   140 subsection \<open>Binary sum\<close>
   141 
   141 
   142 definition csum (infixr "+c" 65) 
   142 definition csum (infixr \<open>+c\<close> 65) 
   143     where "r1 +c r2 \<equiv> |Field r1 <+> Field r2|"
   143     where "r1 +c r2 \<equiv> |Field r1 <+> Field r2|"
   144 
   144 
   145 lemma Field_csum: "Field (r +c s) = Inl ` Field r \<union> Inr ` Field s"
   145 lemma Field_csum: "Field (r +c s) = Inl ` Field r \<union> Inr ` Field s"
   146   unfolding csum_def Field_card_of by auto
   146   unfolding csum_def Field_card_of by auto
   147 
   147 
   271   "Csum r rs \<equiv> |SIGMA i : Field r. Field (rs i)|"
   271   "Csum r rs \<equiv> |SIGMA i : Field r. Field (rs i)|"
   272 
   272 
   273 (* Similar setup to the one for SIGMA from theory Big_Operators: *)
   273 (* Similar setup to the one for SIGMA from theory Big_Operators: *)
   274 syntax "_Csum" ::
   274 syntax "_Csum" ::
   275   "pttrn => ('a * 'a) set => 'b * 'b set => (('a * 'b) * ('a * 'b)) set"
   275   "pttrn => ('a * 'a) set => 'b * 'b set => (('a * 'b) * ('a * 'b)) set"
   276   ("(3CSUM _:_. _)" [0, 51, 10] 10)
   276   (\<open>(3CSUM _:_. _)\<close> [0, 51, 10] 10)
   277 
   277 
   278 syntax_consts
   278 syntax_consts
   279   "_Csum" == Csum
   279   "_Csum" == Csum
   280 
   280 
   281 translations
   281 translations
   289 This should make cardinal reasoning more direct and natural.  *)
   289 This should make cardinal reasoning more direct and natural.  *)
   290 
   290 
   291 
   291 
   292 subsection \<open>Product\<close>
   292 subsection \<open>Product\<close>
   293 
   293 
   294 definition cprod (infixr "*c" 80) where
   294 definition cprod (infixr \<open>*c\<close> 80) where
   295   "r1 *c r2 = |Field r1 \<times> Field r2|"
   295   "r1 *c r2 = |Field r1 \<times> Field r2|"
   296 
   296 
   297 lemma card_order_cprod:
   297 lemma card_order_cprod:
   298   assumes "card_order r1" "card_order r2"
   298   assumes "card_order r1" "card_order r2"
   299   shows "card_order (r1 *c r2)"
   299   shows "card_order (r1 *c r2)"
   448   qed
   448   qed
   449 qed
   449 qed
   450 
   450 
   451 subsection \<open>Exponentiation\<close>
   451 subsection \<open>Exponentiation\<close>
   452 
   452 
   453 definition cexp (infixr "^c" 90) where
   453 definition cexp (infixr \<open>^c\<close> 90) where
   454   "r1 ^c r2 \<equiv> |Func (Field r2) (Field r1)|"
   454   "r1 ^c r2 \<equiv> |Func (Field r2) (Field r1)|"
   455 
   455 
   456 lemma Card_order_cexp: "Card_order (r1 ^c r2)"
   456 lemma Card_order_cexp: "Card_order (r1 ^c r2)"
   457   unfolding cexp_def by (rule card_of_Card_order)
   457   unfolding cexp_def by (rule card_of_Card_order)
   458 
   458