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 }.
18 (* This is a projection! *)
19 ndefinition mem ≝ λA.λr:powerset A.match r with [mk_powerset f ⇒ f].
21 interpretation "powerset" 'powerset A = (powerset A).
23 interpretation "subset construction" 'subset \eta.x = (mk_powerset ? x).
25 interpretation "mem" 'mem a S = (mem ? S a).
27 ndefinition subseteq ≝ λA.λU,V.∀a:A. a ∈ U → a ∈ V.
29 interpretation "subseteq" 'subseteq U V = (subseteq ? U V).
31 ntheorem subseteq_refl: ∀A.∀S:Ω \sup A.S ⊆ S.
32 #A; #S; #x; #H; nassumption;
35 ntheorem subseteq_trans: ∀A.∀S1,S2,S3: Ω \sup A. S1 ⊆ S2 → S2 ⊆ S3 → S1 ⊆ S3.
36 #A; #S1; #S2; #S3; #H12; #H23; #x; #H;
37 napply (H23 ??); napply (H12 ??); nassumption;
40 ndefinition overlaps ≝ λA.λU,V:Ω \sup A.∃x:A.x ∈ U ∧ x ∈ V.
42 interpretation "overlaps" 'overlaps U V = (overlaps ? U V).
44 ndefinition intersects ≝ λA.λU,V:Ω \sup A. {x | x ∈ U ∧ x ∈ V }.
46 interpretation "intersects" 'intersects U V = (intersects ? U V).
48 ndefinition union ≝ λA.λU,V:Ω \sup A. {x | x ∈ U ∨ x ∈ V }.
50 interpretation "union" 'union U V = (union ? U V).
52 ndefinition singleton ≝ λA.λa:A.{b | a=b}.
54 interpretation "singleton" 'singl a = (singleton ? a).