src/HOL/Library/Numeral_Type.thy
changeset 51175 9f472d5f112c
parent 51153 b14ee572cc7b
child 51288 be7e9a675ec9
equal deleted inserted replaced
51174:071674018df9 51175:9f472d5f112c
   445 instance by intro_classes (simp_all add: finite_UNIV_bit0_def finite_UNIV_bit1_def)
   445 instance by intro_classes (simp_all add: finite_UNIV_bit0_def finite_UNIV_bit1_def)
   446 end
   446 end
   447 
   447 
   448 instantiation bit0 and bit1 :: ("{finite,card_UNIV}") card_UNIV begin
   448 instantiation bit0 and bit1 :: ("{finite,card_UNIV}") card_UNIV begin
   449 definition "card_UNIV = Phantom('a bit0) (2 * of_phantom (card_UNIV :: 'a card_UNIV))"
   449 definition "card_UNIV = Phantom('a bit0) (2 * of_phantom (card_UNIV :: 'a card_UNIV))"
   450 definition
   450 definition "card_UNIV = Phantom('a bit1) (1 + 2 * of_phantom (card_UNIV :: 'a card_UNIV))"
   451   "card_UNIV = Phantom('a bit1) (let ca = of_phantom (card_UNIV :: 'a card_UNIV)
       
   452   in if ca \<noteq> 0 then 1 + 2 * ca else 2 * ca)"
       
   453 instance by intro_classes (simp_all add: card_UNIV_bit0_def card_UNIV_bit1_def card_UNIV)
   451 instance by intro_classes (simp_all add: card_UNIV_bit0_def card_UNIV_bit1_def card_UNIV)
   454 end
   452 end
   455 
   453 
   456 subsection {* Syntax *}
   454 subsection {* Syntax *}
   457 
   455