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 (**************************************************************************)
15 include "logic/equality.ma".
17 nrecord powerset (A: Type) : Type[1] ≝ { mem: A → CProp }.
19 interpretation "powerset" 'powerset A = (powerset A).
21 interpretation "subset construction" 'subset \eta.x = (mk_powerset ? x).
23 interpretation "mem" 'mem a S = (mem ? S a).
25 ndefinition subseteq ≝ λA.λU,V.∀a:A. a ∈ U → a ∈ V.
27 interpretation "subseteq" 'subseteq U V = (subseteq ? U V).
29 ntheorem subseteq_refl: ∀A.∀S:Ω \sup A.S ⊆ S.
30 #A; #S; #x; #H; nassumption;
33 ntheorem subseteq_trans: ∀A.∀S1,S2,S3: Ω \sup A. S1 ⊆ S2 → S2 ⊆ S3 → S1 ⊆ S3.
34 #A; #S1; #S2; #S3; #H12; #H23; #x; #H;
35 napply (H23 ??); napply (H12 ??); nassumption;
38 ndefinition overlaps ≝ λA.λU,V:Ω \sup A.∃x:A.x ∈ U ∧ x ∈ V.
40 interpretation "overlaps" 'overlaps U V = (overlaps ? U V).
42 ndefinition intersects ≝ λA.λU,V:Ω \sup A. {x | x ∈ U ∧ x ∈ V }.
44 interpretation "intersects" 'intersects U V = (intersects ? U V).
46 ndefinition union ≝ λA.λU,V:Ω \sup A. {x | x ∈ U ∨ x ∈ V }.
48 interpretation "union" 'union U V = (union ? U V).
50 ndefinition singleton ≝ λA.λa:A.{b | a=b}.
52 interpretation "singleton" 'singl a = (singleton ? a).