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 (* Project started Wed Oct 12, 2005 ***************************************)
17 set "baseuri" "cic:/matita/PREDICATIVE-TOPOLOGY/class_defs".
19 include "logic/connectives.ma".
22 - We use typoids with a compatible membership relation
23 - The category is intended to be the domain of the membership relation
24 - The membership relation is necessary because we need to regard the
25 domain of a propositional function (ie a predicative subset) as a
26 quantification domain and therefore as a category, but there is no
27 type in CIC representing the domain of a propositional function
28 - We set up a single equality predicate, parametric on the category,
29 defined as the reflexive, symmetic, transitive and compatible closure
30 of the cle1 predicate given inside the category. Then we prove the
31 properties of the equality that usually are axiomatized inside the
32 category structure. This makes categories easier to use
35 definition true_f \def \lambda (X:Type). \lambda (_:X). True.
37 definition false_f \def \lambda (X:Type). \lambda (_:X). False.
39 record Class: Type \def {
42 ceq: class \to class \to Prop;
43 cin_repl: \forall c1,c2. cin c1 \to ceq c1 c2 \to cin c2;
44 ceq_repl: \forall c1,c2,d1,d2. cin c1 \to
45 ceq c1 c2 \to ceq c1 d1 \to ceq c2 d2 \to ceq d1 d2;
46 ceq_refl: \forall c. cin c \to ceq c c
49 (* external universal quantification *)
50 inductive call (C:Class) (P:C \to Prop) : Prop \def
51 | call_intro: (\forall c. cin ? c \to P c) \to call C P.
53 inductive call2 (C1,C2:Class) (P:C1 \to C2 \to Prop) : Prop \def
55 (\forall c1,c2. cin ? c1 \to cin ? c2 \to P c1 c2) \to call2 C1 C2 P.
57 (* notations **************************************************************)
59 (*CSC: the URI must disappear: there is a bug now *)
60 interpretation "external for all" 'xforall \eta.x =
61 (cic:/matita/PREDICATIVE-TOPOLOGY/class_defs/call.ind#xpointer(1/1) _ x).
63 notation > "hvbox(\xforall ident i opt (: ty) break . p)"
64 right associative with precedence 20
65 for @{ 'xforall ${default
66 @{\lambda ${ident i} : $ty. $p}
67 @{\lambda ${ident i} . $p}}}.
69 (*CSC: the URI must disappear: there is a bug now *)
70 interpretation "external for all 2" 'xforall2 \eta.x \eta.y =
71 (cic:/matita/PREDICATIVE-TOPOLOGY/class_defs/call2.ind#xpointer(1/1) _ _ x y).
73 notation > "hvbox(\xforall ident i1 opt (: ty1) ident i2 opt (: ty2) break . p)"
74 right associative with precedence 20
75 for @{ 'xforall2 ${default
76 @{\lambda ${ident i1} : $ty1. \lambda ${ident i2} : $ty2. $p}
77 @{\lambda ${ident i1}, ${ident i2}. $p}}}.