diff -r 1d43f86f48be -r e96292f32c3c src/HOL/Set.thy --- a/src/HOL/Set.thy Mon Dec 28 19:23:15 2015 +0100 +++ b/src/HOL/Set.thy Mon Dec 28 21:47:32 2015 +0100 @@ -12,41 +12,39 @@ axiomatization Collect :: "('a \ bool) \ 'a set" \ "comprehension" and member :: "'a \ 'a set \ bool" \ "membership" -where - mem_Collect_eq [iff, code_unfold]: "member a (Collect P) = P a" +where mem_Collect_eq [iff, code_unfold]: "member a (Collect P) = P a" and Collect_mem_eq [simp]: "Collect (\x. member x A) = A" notation + member ("op \") and + member ("(_/ \ _)" [51, 51] 50) + +abbreviation not_member + where "not_member x A \ \ (x \ A)" \ "non-membership" +notation + not_member ("op \") and + not_member ("(_/ \ _)" [51, 51] 50) + +notation (ASCII) member ("op :") and - member ("(_/ : _)" [51, 51] 50) - -abbreviation not_member where - "not_member x A \ ~ (x : A)" \ "non-membership" - -notation + member ("(_/ : _)" [51, 51] 50) and not_member ("op ~:") and not_member ("(_/ ~: _)" [51, 51] 50) -notation (xsymbols) - member ("op \") and - member ("(_/ \ _)" [51, 51] 50) and - not_member ("op \") and - not_member ("(_/ \ _)" [51, 51] 50) - text \Set comprehensions\ syntax "_Coll" :: "pttrn => bool => 'a set" ("(1{_./ _})") translations - "{x. P}" == "CONST Collect (%x. P)" - + "{x. P}" \ "CONST Collect (\x. P)" + +syntax (ASCII) + "_Collect" :: "pttrn \ 'a set \ bool \ 'a set" ("(1{_ :/ _./ _})") syntax - "_Collect" :: "pttrn => 'a set => bool => 'a set" ("(1{_ :/ _./ _})") -syntax (xsymbols) - "_Collect" :: "pttrn => 'a set => bool => 'a set" ("(1{_ \/ _./ _})") + "_Collect" :: "pttrn \ 'a set \ bool \ 'a set" ("(1{_ \/ _./ _})") translations - "{p:A. P}" => "CONST Collect (%p. p:A & P)" + "{p:A. P}" \ "CONST Collect (\p. p \ A \ P)" lemma CollectI: "P a \ a \ {x. P x}" by simp @@ -141,21 +139,13 @@ subsection \Subsets and bounded quantifiers\ -abbreviation - subset :: "'a set \ 'a set \ bool" where - "subset \ less" - -abbreviation - subset_eq :: "'a set \ 'a set \ bool" where - "subset_eq \ less_eq" - -notation (output) - subset ("op <") and - subset ("(_/ < _)" [51, 51] 50) and - subset_eq ("op <=") and - subset_eq ("(_/ <= _)" [51, 51] 50) - -notation (xsymbols) +abbreviation subset :: "'a set \ 'a set \ bool" + where "subset \ less" + +abbreviation subset_eq :: "'a set \ 'a set \ bool" + where "subset_eq \ less_eq" + +notation subset ("op \") and subset ("(_/ \ _)" [51, 51] 50) and subset_eq ("op \") and @@ -169,19 +159,25 @@ supset_eq :: "'a set \ 'a set \ bool" where "supset_eq \ greater_eq" -notation (xsymbols) +notation supset ("op \") and supset ("(_/ \ _)" [51, 51] 50) and supset_eq ("op \") and supset_eq ("(_/ \ _)" [51, 51] 50) +notation (ASCII output) + subset ("op <") and + subset ("(_/ < _)" [51, 51] 50) and + subset_eq ("op <=") and + subset_eq ("(_/ <= _)" [51, 51] 50) + definition Ball :: "'a set \ ('a \ bool) \ bool" where "Ball A P \ (\x. x \ A \ P x)" \ "bounded universal quantifiers" definition Bex :: "'a set \ ('a \ bool) \ bool" where "Bex A P \ (\x. x \ A \ P x)" \ "bounded existential quantifiers" -syntax +syntax (ASCII) "_Ball" :: "pttrn => 'a set => bool => bool" ("(3ALL _:_./ _)" [0, 0, 10] 10) "_Bex" :: "pttrn => 'a set => bool => bool" ("(3EX _:_./ _)" [0, 0, 10] 10) "_Bex1" :: "pttrn => 'a set => bool => bool" ("(3EX! _:_./ _)" [0, 0, 10] 10) @@ -192,32 +188,25 @@ "_Bex" :: "pttrn => 'a set => bool => bool" ("(3? _:_./ _)" [0, 0, 10] 10) "_Bex1" :: "pttrn => 'a set => bool => bool" ("(3?! _:_./ _)" [0, 0, 10] 10) -syntax (xsymbols) +syntax "_Ball" :: "pttrn => 'a set => bool => bool" ("(3\_\_./ _)" [0, 0, 10] 10) "_Bex" :: "pttrn => 'a set => bool => bool" ("(3\_\_./ _)" [0, 0, 10] 10) "_Bex1" :: "pttrn => 'a set => bool => bool" ("(3\!_\_./ _)" [0, 0, 10] 10) "_Bleast" :: "id => 'a set => bool => 'a" ("(3LEAST_\_./ _)" [0, 0, 10] 10) translations - "ALL x:A. P" == "CONST Ball A (%x. P)" - "EX x:A. P" == "CONST Bex A (%x. P)" - "EX! x:A. P" => "EX! x. x:A & P" - "LEAST x:A. P" => "LEAST x. x:A & P" - -syntax (output) + "\x\A. P" \ "CONST Ball A (\x. P)" + "\x\A. P" \ "CONST Bex A (\x. P)" + "\!x\A. P" \ "\!x. x \ A \ P" + "LEAST x:A. P" \ "LEAST x. x \ A \ P" + +syntax (ASCII output) "_setlessAll" :: "[idt, 'a, bool] => bool" ("(3ALL _<_./ _)" [0, 0, 10] 10) "_setlessEx" :: "[idt, 'a, bool] => bool" ("(3EX _<_./ _)" [0, 0, 10] 10) "_setleAll" :: "[idt, 'a, bool] => bool" ("(3ALL _<=_./ _)" [0, 0, 10] 10) "_setleEx" :: "[idt, 'a, bool] => bool" ("(3EX _<=_./ _)" [0, 0, 10] 10) "_setleEx1" :: "[idt, 'a, bool] => bool" ("(3EX! _<=_./ _)" [0, 0, 10] 10) -syntax (xsymbols) - "_setlessAll" :: "[idt, 'a, bool] => bool" ("(3\_\_./ _)" [0, 0, 10] 10) - "_setlessEx" :: "[idt, 'a, bool] => bool" ("(3\_\_./ _)" [0, 0, 10] 10) - "_setleAll" :: "[idt, 'a, bool] => bool" ("(3\_\_./ _)" [0, 0, 10] 10) - "_setleEx" :: "[idt, 'a, bool] => bool" ("(3\_\_./ _)" [0, 0, 10] 10) - "_setleEx1" :: "[idt, 'a, bool] => bool" ("(3\!_\_./ _)" [0, 0, 10] 10) - syntax (HOL output) "_setlessAll" :: "[idt, 'a, bool] => bool" ("(3! _<_./ _)" [0, 0, 10] 10) "_setlessEx" :: "[idt, 'a, bool] => bool" ("(3? _<_./ _)" [0, 0, 10] 10) @@ -225,12 +214,19 @@ "_setleEx" :: "[idt, 'a, bool] => bool" ("(3? _<=_./ _)" [0, 0, 10] 10) "_setleEx1" :: "[idt, 'a, bool] => bool" ("(3?! _<=_./ _)" [0, 0, 10] 10) +syntax + "_setlessAll" :: "[idt, 'a, bool] => bool" ("(3\_\_./ _)" [0, 0, 10] 10) + "_setlessEx" :: "[idt, 'a, bool] => bool" ("(3\_\_./ _)" [0, 0, 10] 10) + "_setleAll" :: "[idt, 'a, bool] => bool" ("(3\_\_./ _)" [0, 0, 10] 10) + "_setleEx" :: "[idt, 'a, bool] => bool" ("(3\_\_./ _)" [0, 0, 10] 10) + "_setleEx1" :: "[idt, 'a, bool] => bool" ("(3\!_\_./ _)" [0, 0, 10] 10) + translations - "\A\B. P" => "ALL A. A \ B --> P" - "\A\B. P" => "EX A. A \ B & P" - "\A\B. P" => "ALL A. A \ B --> P" - "\A\B. P" => "EX A. A \ B & P" - "\!A\B. P" => "EX! A. A \ B & P" + "\A\B. P" \ "\A. A \ B \ P" + "\A\B. P" \ "\A. A \ B \ P" + "\A\B. P" \ "\A. A \ B \ P" + "\A\B. P" \ "\A. A \ B \ P" + "\!A\B. P" \ "\!A. A \ B \ P" print_translation \ let @@ -669,11 +665,11 @@ subsubsection \Binary intersection\ -abbreviation inter :: "'a set \ 'a set \ 'a set" (infixl "Int" 70) where - "op Int \ inf" - -notation (xsymbols) - inter (infixl "\" 70) +abbreviation inter :: "'a set \ 'a set \ 'a set" (infixl "\" 70) + where "op \ \ inf" + +notation (ASCII) + inter (infixl "Int" 70) lemma Int_def: "A \ B = {x. x \ A \ x \ B}" @@ -700,11 +696,11 @@ subsubsection \Binary union\ -abbreviation union :: "'a set \ 'a set \ 'a set" (infixl "Un" 65) where - "union \ sup" - -notation (xsymbols) - union (infixl "\" 65) +abbreviation union :: "'a set \ 'a set \ 'a set" (infixl "\" 65) + where "union \ sup" + +notation (ASCII) + union (infixl "Un" 65) lemma Un_def: "A \ B = {x. x \ A \ x \ B}"