0
|
1 |
(* Title: CCL/set.thy
|
|
2 |
ID: $Id$
|
|
3 |
|
|
4 |
Modified version of HOL/set.thy that extends FOL
|
|
5 |
|
|
6 |
*)
|
|
7 |
|
|
8 |
Set = FOL +
|
|
9 |
|
3935
|
10 |
global
|
|
11 |
|
0
|
12 |
types
|
278
|
13 |
'a set
|
0
|
14 |
|
|
15 |
arities
|
|
16 |
set :: (term) term
|
|
17 |
|
|
18 |
consts
|
|
19 |
Collect :: "['a => o] => 'a set" (*comprehension*)
|
|
20 |
Compl :: "('a set) => 'a set" (*complement*)
|
|
21 |
Int :: "['a set, 'a set] => 'a set" (infixl 70)
|
|
22 |
Un :: "['a set, 'a set] => 'a set" (infixl 65)
|
|
23 |
Union, Inter :: "(('a set)set) => 'a set" (*...of a set*)
|
|
24 |
UNION, INTER :: "['a set, 'a => 'b set] => 'b set" (*general*)
|
|
25 |
Ball, Bex :: "['a set, 'a => o] => o" (*bounded quants*)
|
|
26 |
mono :: "['a set => 'b set] => o" (*monotonicity*)
|
|
27 |
":" :: "['a, 'a set] => o" (infixl 50) (*membership*)
|
|
28 |
"<=" :: "['a set, 'a set] => o" (infixl 50)
|
|
29 |
singleton :: "'a => 'a set" ("{_}")
|
|
30 |
empty :: "'a set" ("{}")
|
|
31 |
"oo" :: "['b => 'c, 'a => 'b, 'a] => 'c" (infixr 50) (*composition*)
|
|
32 |
|
3935
|
33 |
syntax
|
0
|
34 |
"@Coll" :: "[idt, o] => 'a set" ("(1{_./ _})") (*collection*)
|
|
35 |
|
|
36 |
(* Big Intersection / Union *)
|
|
37 |
|
|
38 |
"@INTER" :: "[idt, 'a set, 'b set] => 'b set" ("(INT _:_./ _)" [0, 0, 0] 10)
|
|
39 |
"@UNION" :: "[idt, 'a set, 'b set] => 'b set" ("(UN _:_./ _)" [0, 0, 0] 10)
|
|
40 |
|
|
41 |
(* Bounded Quantifiers *)
|
|
42 |
|
|
43 |
"@Ball" :: "[idt, 'a set, o] => o" ("(ALL _:_./ _)" [0, 0, 0] 10)
|
|
44 |
"@Bex" :: "[idt, 'a set, o] => o" ("(EX _:_./ _)" [0, 0, 0] 10)
|
|
45 |
|
|
46 |
|
|
47 |
translations
|
|
48 |
"{x. P}" == "Collect(%x. P)"
|
|
49 |
"INT x:A. B" == "INTER(A, %x. B)"
|
|
50 |
"UN x:A. B" == "UNION(A, %x. B)"
|
|
51 |
"ALL x:A. P" == "Ball(A, %x. P)"
|
|
52 |
"EX x:A. P" == "Bex(A, %x. P)"
|
|
53 |
|
3935
|
54 |
local
|
0
|
55 |
|
|
56 |
rules
|
3837
|
57 |
mem_Collect_iff "(a : {x. P(x)}) <-> P(a)"
|
|
58 |
set_extension "A=B <-> (ALL x. x:A <-> x:B)"
|
0
|
59 |
|
|
60 |
Ball_def "Ball(A, P) == ALL x. x:A --> P(x)"
|
|
61 |
Bex_def "Bex(A, P) == EX x. x:A & P(x)"
|
|
62 |
mono_def "mono(f) == (ALL A B. A <= B --> f(A) <= f(B))"
|
|
63 |
subset_def "A <= B == ALL x:A. x:B"
|
3837
|
64 |
singleton_def "{a} == {x. x=a}"
|
|
65 |
empty_def "{} == {x. False}"
|
|
66 |
Un_def "A Un B == {x. x:A | x:B}"
|
|
67 |
Int_def "A Int B == {x. x:A & x:B}"
|
0
|
68 |
Compl_def "Compl(A) == {x. ~x:A}"
|
|
69 |
INTER_def "INTER(A, B) == {y. ALL x:A. y: B(x)}"
|
|
70 |
UNION_def "UNION(A, B) == {y. EX x:A. y: B(x)}"
|
|
71 |
Inter_def "Inter(S) == (INT x:S. x)"
|
|
72 |
Union_def "Union(S) == (UN x:S. x)"
|
|
73 |
|
|
74 |
end
|
|
75 |
|