src/HOL/Set.thy
changeset 3820 46b255e140dc
parent 3370 5c5fdce3a4e4
child 3842 b55686a7b22c
equal deleted inserted replaced
3819:5a6a6f18b109 3820:46b255e140dc
    15 arities
    15 arities
    16   set :: (term) term
    16   set :: (term) term
    17 
    17 
    18 instance
    18 instance
    19   set :: (term) {ord, minus, power}
    19   set :: (term) {ord, minus, power}
       
    20 
       
    21 syntax
       
    22   "op :"        :: ['a, 'a set] => bool             ("op :")
    20 
    23 
    21 consts
    24 consts
    22   "{}"          :: 'a set                           ("{}")
    25   "{}"          :: 'a set                           ("{}")
    23   insert        :: ['a, 'a set] => 'a set
    26   insert        :: ['a, 'a set] => 'a set
    24   Collect       :: ('a => bool) => 'a set               (*comprehension*)
    27   Collect       :: ('a => bool) => 'a set               (*comprehension*)
    40 
    43 
    41 (** Additional concrete syntax **)
    44 (** Additional concrete syntax **)
    42 
    45 
    43 syntax
    46 syntax
    44 
    47 
    45   "op :"        :: ['a, 'a set] => bool               ("op :")
       
    46 
       
    47   UNIV          :: 'a set
    48   UNIV          :: 'a set
    48 
    49 
    49   (* Infix syntax for non-membership *)
    50   (* Infix syntax for non-membership *)
    50 
    51 
       
    52   "op ~:"       :: ['a, 'a set] => bool               ("op ~:")
    51   "op ~:"       :: ['a, 'a set] => bool               ("(_/ ~: _)" [50, 51] 50)
    53   "op ~:"       :: ['a, 'a set] => bool               ("(_/ ~: _)" [50, 51] 50)
    52   "op ~:"       :: ['a, 'a set] => bool               ("op ~:")
       
    53 
    54 
    54   "@Finset"     :: args => 'a set                     ("{(_)}")
    55   "@Finset"     :: args => 'a set                     ("{(_)}")
    55 
    56 
    56   "@Coll"       :: [pttrn, bool] => 'a set            ("(1{_./ _})")
    57   "@Coll"       :: [pttrn, bool] => 'a set            ("(1{_./ _})")
    57   "@SetCompr"   :: ['a, idts, bool] => 'a set         ("(1{_ |/_./ _})")
    58   "@SetCompr"   :: ['a, idts, bool] => 'a set         ("(1{_ |/_./ _})")
    81   "? x:A. P"    == "Bex A (%x. P)"
    82   "? x:A. P"    == "Bex A (%x. P)"
    82   "ALL x:A. P"  => "Ball A (%x. P)"
    83   "ALL x:A. P"  => "Ball A (%x. P)"
    83   "EX x:A. P"   => "Bex A (%x. P)"
    84   "EX x:A. P"   => "Bex A (%x. P)"
    84 
    85 
    85 syntax ("" output)
    86 syntax ("" output)
       
    87   "_setle"      :: ['a set, 'a set] => bool           ("op <=")
    86   "_setle"      :: ['a set, 'a set] => bool           ("(_/ <= _)" [50, 51] 50)
    88   "_setle"      :: ['a set, 'a set] => bool           ("(_/ <= _)" [50, 51] 50)
    87   "_setle"      :: ['a set, 'a set] => bool           ("op <=")
    89   "_setless"    :: ['a set, 'a set] => bool           ("op <")
    88   "_setless"    :: ['a set, 'a set] => bool           ("(_/ < _)" [50, 51] 50)
    90   "_setless"    :: ['a set, 'a set] => bool           ("(_/ < _)" [50, 51] 50)
    89   "_setless"    :: ['a set, 'a set] => bool           ("op <")
       
    90 
    91 
    91 syntax (symbols)
    92 syntax (symbols)
       
    93   "_setle"      :: ['a set, 'a set] => bool           ("op \\<subseteq>")
    92   "_setle"      :: ['a set, 'a set] => bool           ("(_/ \\<subseteq> _)" [50, 51] 50)
    94   "_setle"      :: ['a set, 'a set] => bool           ("(_/ \\<subseteq> _)" [50, 51] 50)
    93   "_setle"      :: ['a set, 'a set] => bool           ("op \\<subseteq>")
    95   "_setless"    :: ['a set, 'a set] => bool           ("op \\<subset>")
    94   "_setless"    :: ['a set, 'a set] => bool           ("(_/ \\<subset> _)" [50, 51] 50)
    96   "_setless"    :: ['a set, 'a set] => bool           ("(_/ \\<subset> _)" [50, 51] 50)
    95   "_setless"    :: ['a set, 'a set] => bool           ("op \\<subset>")
       
    96   "op Int"      :: ['a set, 'a set] => 'a set         (infixl "\\<inter>" 70)
    97   "op Int"      :: ['a set, 'a set] => 'a set         (infixl "\\<inter>" 70)
    97   "op Un"       :: ['a set, 'a set] => 'a set         (infixl "\\<union>" 65)
    98   "op Un"       :: ['a set, 'a set] => 'a set         (infixl "\\<union>" 65)
       
    99   "op :"        :: ['a, 'a set] => bool               ("op \\<in>")
    98   "op :"        :: ['a, 'a set] => bool               ("(_/ \\<in> _)" [50, 51] 50)
   100   "op :"        :: ['a, 'a set] => bool               ("(_/ \\<in> _)" [50, 51] 50)
    99   "op :"        :: ['a, 'a set] => bool               ("op \\<in>")
   101   "op ~:"       :: ['a, 'a set] => bool               ("op \\<notin>")
   100   "op ~:"       :: ['a, 'a set] => bool               ("(_/ \\<notin> _)" [50, 51] 50)
   102   "op ~:"       :: ['a, 'a set] => bool               ("(_/ \\<notin> _)" [50, 51] 50)
   101   "op ~:"       :: ['a, 'a set] => bool               ("op \\<notin>")
       
   102   "UN "         :: [idts, bool] => bool               ("(3\\<Union> _./ _)" 10)
   103   "UN "         :: [idts, bool] => bool               ("(3\\<Union> _./ _)" 10)
   103   "INT "        :: [idts, bool] => bool               ("(3\\<Inter> _./ _)" 10)
   104   "INT "        :: [idts, bool] => bool               ("(3\\<Inter> _./ _)" 10)
   104   "@UNION"      :: [pttrn, 'a set, 'b set] => 'b set  ("(3\\<Union> _\\<in>_./ _)" 10)
   105   "@UNION"      :: [pttrn, 'a set, 'b set] => 'b set  ("(3\\<Union> _\\<in>_./ _)" 10)
   105   "@INTER"      :: [pttrn, 'a set, 'b set] => 'b set  ("(3\\<Inter> _\\<in>_./ _)" 10)
   106   "@INTER"      :: [pttrn, 'a set, 'b set] => 'b set  ("(3\\<Inter> _\\<in>_./ _)" 10)
   106   Union         :: (('a set) set) => 'a set           ("\\<Union> _" [90] 90)
   107   Union         :: (('a set) set) => 'a set           ("\\<Union> _" [90] 90)