1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
18 include "logic/connectives.ma".
21 definition set ≝ λX:Type.X → Prop.
23 definition member_of : ∀X.set X → X → Prop≝ λX.λA:set X.λx.A x.
25 notation "hvbox(x break ∈ A)" with precedence 60
26 for @{ 'member_of $x $A }.
28 interpretation "Member of" 'member_of x A = (mk_member_of ? A x).
30 notation "hvbox(x break ∉ A)" with precedence 60
31 for @{ 'not_member_of $x $A }.
33 interpretation "Not member of" 'not_member_of x A = (Not (member_of ? A x)).
35 definition emptyset : ∀X.set X ≝ λX:Type.λx:X.False.
37 notation "∅︀" with precedence 100 for @{ 'emptyset }.
39 interpretation "Emptyset" 'emptyset = (emptyset ?).
41 definition subset: ∀X. set X → set X → Prop≝ λX.λA,B:set X.∀x. x ∈ A → x ∈ B.
43 notation "hvbox(A break ⊆ B)" with precedence 60
44 for @{ 'subset $A $B }.
46 interpretation "Subset" 'subset A B = (subset ? A B).
48 definition intersection: ∀X. set X → set X → set X ≝
49 λX.λA,B:set X.λx. x ∈ A ∧ x ∈ B.
51 notation "hvbox(A break ∩ B)" with precedence 70
52 for @{ 'intersection $A $B }.
54 interpretation "Intersection" 'intersection A B = (intersection ? A B).
56 definition union: ∀X. set X → set X → set X ≝ λX.λA,B:set X.λx. x ∈ A ∨ x ∈ B.
58 notation "hvbox(A break ∪ B)" with precedence 65
59 for @{ 'union $A $B }.
61 interpretation "Union" 'union A B = (union ? A B).
63 definition seq ≝ λX:Type.nat → X.
65 definition nth ≝ λX.λA:seq X.λi.A i.
67 notation "hvbox(A \sub i)" with precedence 100
70 interpretation "nth" 'nth A i = (nth ? A i).
72 definition countable_union: ∀X. seq (set X) → set X ≝
73 λX.λA:seq (set X).λx.∃j.x ∈ A \sub j.
75 notation "∪ \sub (ident i opt (: ty)) B" with precedence 65
76 for @{ 'big_union ${default @{(λ${ident i}:$ty.$B)} @{(λ${ident i}.$B)}}}.
78 interpretation "countable_union" 'big_union η.t = (countable_union ? t).
80 definition complement: ∀X. set X \to set X ≝ λX.λA:set X.λx. x ∉ A.
82 notation "A \sup 'c'" with precedence 100
83 for @{ 'complement $A }.
85 interpretation "Complement" 'complement A = (complement ? A).
87 definition inverse_image: ∀X,Y.∀f: X → Y.set Y → set X ≝
90 notation "hvbox(f \sup (-1))" with precedence 100
91 for @{ 'finverse $f }.
93 interpretation "Inverse image" 'finverse f = (inverse_image ? ? f).