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 "sets/setoids.ma".
18 definition reflexive1 ≝ λA:Type.λR:A→A→CProp.∀x:A.R x x.
19 definition symmetric1 ≝ λC:Type.λlt:C→C→CProp. ∀x,y:C.lt x y → lt y x.
20 definition transitive1 ≝ λA:Type.λR:A→A→CProp.∀x,y,z:A.R x y → R y z → R x z.
22 record setoid1 : Type ≝
24 eq1: carr1 → carr1 → CProp;
25 refl1: reflexive1 ? eq1;
26 sym1: symmetric1 ? eq1;
27 trans1: transitive1 ? eq1
30 definition proofs1: CProp → setoid1.
44 ndefinition CCProp: setoid1.
57 cases H; cases H1; clear H H1;
64 record function_space1 (A: setoid1) (B: setoid1): Type ≝
66 f1_ok: ∀a,a':A. proofs1 (eq1 ? a a') → proofs1 (eq1 ? (f1 a) (f1 a'))
69 definition function_space_setoid1: setoid1 → setoid1 → setoid1.
72 [ apply (function_space1 A B);
74 apply (∀a:A. proofs1 (eq1 ? (f a) (f1 a)));
75 |*: cases daemon] (* simplify;
78 unfold proofs; simplify;
82 unfold proofs; simplify;
87 unfold carr; unfold proofs; simplify;
88 apply (trans1 B ? (y a));
93 interpretation "function_space_setoid1" 'Imply a b = (function_space_setoid1 a b).
95 definition setoids: setoid1.
102 [1,3: intro; assumption;
103 |*: intros; assumption]
107 unfold proofs; simplify;
112 definition setoid1_of_setoid: setoid → setoid1.
122 coercion setoid1_of_setoid.
124 record forall (A:setoid) (B: A ⇒ CCProp): CProp ≝
125 { fo:> ∀a:A.proofs (B a) }.
127 record subset (A: setoid) : CProp ≝
130 definition ssubset: setoid → setoid1.
134 | apply (λU,V:subset s. ∀a. mem ? U a \liff mem ? V a)
145 definition mmem: ∀A:setoid. (ssubset A) ⇒ A ⇒ CCProp.
149 | unfold function_space_setoid1; simplify;
151 change in ⊢ (? (? (?→? (? %)))) with (mem ? b a \liff mem ? b' a);
152 unfold proofs1; simplify; intros;
153 unfold proofs1 in c; simplify in c;
154 unfold ssubset in c; simplify in c;
155 cases (c a); clear c;
160 definition sand: CCProp ⇒ CCProp.
162 definition intersection: ∀A. ssubset A ⇒ ssubset A ⇒ ssubset A.
171 apply (mem ? c c2 ∧ mem ? c1 c2);