]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/contribs/PREDICATIVE-TOPOLOGY/class_defs.ma
some renaming
[helm.git] / helm / matita / contribs / PREDICATIVE-TOPOLOGY / class_defs.ma
diff --git a/helm/matita/contribs/PREDICATIVE-TOPOLOGY/class_defs.ma b/helm/matita/contribs/PREDICATIVE-TOPOLOGY/class_defs.ma
new file mode 100644 (file)
index 0000000..10a5ae3
--- /dev/null
@@ -0,0 +1,86 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+(* Project started Wed Oct 12, 2005 ***************************************)
+
+set "baseuri" "cic:/matita/PREDICATIVE-TOPOLOGY/class_defs".
+
+include "../../library/logic/connectives.ma".
+
+(* ACZEL CATEGORIES:
+   - We use typoids with a compatible membership relation
+   - The category is intended to be the domain of the membership relation
+   - The membership relation is necessary because we need to regard the
+     domain of a propositional function (ie a predicative subset) as a
+     quantification domain and therefore as a category, but there is no
+     type in CIC representing the domain of a propositional function
+   - We set up a single equality predicate, parametric on the category,
+     defined as the reflexive, symmetic, transitive and compatible closure
+     of the csub1 predicate given inside the category. Then we prove the 
+     properties of the equality that usually are axiomatized inside the 
+     category structure. This makes categories easier to use
+*) 
+
+record Class: Type \def {
+   class: Type;
+   cin  : class \to Prop;
+   csub1: class \to class \to Prop
+}.
+
+coercion class. 
+
+inductive eq (C:Class) (c1:C): C \to Prop \def
+   | eq_refl:   cin ? c1 \to eq ? c1 c1
+   | eq_sing_r: \forall c2,c3. 
+                eq ? c1 c2 \to cin ? c3 \to csub1 ? c2 c3 \to eq ? c1 c3
+   | eq_sing_l: \forall c2,c3. 
+                eq ? c1 c2 \to cin ? c3 \to csub1 ? c3 c2 \to eq ? c1 c3.
+
+theorem eq_cl: \forall C,c1,c2. eq ? c1 c2 \to cin C c1 \land cin C c2.
+intros; elim H; clear H; clear c2; 
+   [ auto | decompose H2; auto | decompose H2; auto ].
+qed.
+
+theorem eq_trans: \forall C,c2,c1,c3.
+                  eq C c2 c3 \to eq ? c1 c2 \to eq ? c1 c3.
+intros 5; elim H; clear H; clear c3;
+   [ auto 
+   | apply eq_sing_r; [||| apply H4 ]; auto
+   | apply eq_sing_l; [||| apply H4 ]; auto
+   ].
+qed.
+
+theorem eq_conf_rev: \forall C,c2,c1,c3.
+                     eq C c3 c2 \to eq ? c1 c2 \to eq ? c1 c3.
+intros 5; elim H; clear H; clear c2;
+   [ auto 
+   | lapply eq_cl; [ decompose Hletin |||| apply H1 ].
+     apply H2; apply eq_sing_l; [||| apply H4 ]; auto
+   | lapply eq_cl; [ decompose Hletin |||| apply H1 ].
+     apply H2; apply eq_sing_r; [||| apply H4 ]; auto
+   ].
+qed.
+
+theorem eq_sym: \forall C,c1,c2. eq C c1 c2 \to eq C c2 c1.
+intros;
+lapply eq_cl; [ decompose Hletin |||| apply H ].
+auto.
+qed.
+
+theorem eq_conf: \forall C,c2,c1,c3.
+                 eq C c1 c2 \to eq ? c1 c3 \to eq ? c2 c3.
+intros.
+lapply eq_sym; [|||| apply H ].
+apply eq_trans; [| auto | auto ].
+qed.