X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Flogic%2Fequality.ma;h=510f0c5c6fe3144b395840770c1f8dbe15084163;hb=8cb8fcda1725576ee90f6b3538bd00ebc61d7ca8;hp=129b00189f1e61523c1b446bcd1c01ce0981d531;hpb=68a2f8d0a8c34cb7ea0438c7db9222a853a38826;p=helm.git diff --git a/helm/software/matita/library/logic/equality.ma b/helm/software/matita/library/logic/equality.ma index 129b00189..510f0c5c6 100644 --- a/helm/software/matita/library/logic/equality.ma +++ b/helm/software/matita/library/logic/equality.ma @@ -1,5 +1,5 @@ (**************************************************************************) -(* ___ *) +(* ___ *) (* ||M|| *) (* ||A|| A project by Andrea Asperti *) (* ||T|| *) @@ -27,31 +27,31 @@ interpretation "leibnitz's non-equality" 'neq x y = (cic:/matita/logic/connectives/Not.con (cic:/matita/logic/equality/eq.ind#xpointer(1/1) _ x y)). -theorem eq_ind': - \forall A. \forall x:A. \forall P: \forall y:A. x=y \to Prop. +theorem eq_rect': + \forall A. \forall x:A. \forall P: \forall y:A. x=y \to Type. P ? (refl_eq ? x) \to \forall y:A. \forall p:x=y. P y p. intros. exact - (match p return \lambda y. \lambda p.P y p with - [refl_eq \Rightarrow H]). + (match p1 return \lambda y. \lambda p.P y p with + [refl_eq \Rightarrow p]). qed. -theorem reflexive_eq : \forall A:Type. reflexive A (eq A). -simplify.intros.apply refl_eq. -qed. +variant reflexive_eq : \forall A:Type. reflexive A (eq A) +\def refl_eq. +(* simplify.intros.apply refl_eq. *) theorem symmetric_eq: \forall A:Type. symmetric A (eq A). unfold symmetric.intros.elim H. apply refl_eq. qed. -theorem sym_eq : \forall A:Type.\forall x,y:A. x=y \to y=x +variant sym_eq : \forall A:Type.\forall x,y:A. x=y \to y=x \def symmetric_eq. theorem transitive_eq : \forall A:Type. transitive A (eq A). unfold transitive.intros.elim H1.assumption. qed. -theorem trans_eq : \forall A:Type.\forall x,y,z:A. x=y \to y=z \to x=z +variant trans_eq : \forall A:Type.\forall x,y,z:A. x=y \to y=z \to x=z \def transitive_eq. theorem eq_elim_r: @@ -60,26 +60,35 @@ theorem eq_elim_r: intros. elim (sym_eq ? ? ? H1).assumption. qed. -default "equality" - cic:/matita/logic/equality/eq.ind - cic:/matita/logic/equality/sym_eq.con - cic:/matita/logic/equality/trans_eq.con - cic:/matita/logic/equality/eq_ind.con - cic:/matita/logic/equality/eq_elim_r.con - cic:/matita/logic/equality/eq_f.con - cic:/matita/logic/equality/eq_f1.con. (* \x.sym (eq_f x) *) - - theorem eq_f: \forall A,B:Type.\forall f:A\to B. \forall x,y:A. x=y \to f x = f y. -intros.elim H.reflexivity. +intros.elim H.apply refl_eq. qed. -theorem eq_f1: \forall A,B:Type.\forall f:A\to B. +theorem eq_f': \forall A,B:Type.\forall f:A\to B. \forall x,y:A. x=y \to f y = f x. -intros.elim H.reflexivity. +intros.elim H.apply refl_eq. qed. +(* *) +coercion cic:/matita/logic/equality/sym_eq.con. +coercion cic:/matita/logic/equality/eq_f.con. +(* *) + +default "equality" + cic:/matita/logic/equality/eq.ind + cic:/matita/logic/equality/sym_eq.con + cic:/matita/logic/equality/transitive_eq.con + cic:/matita/logic/equality/eq_ind.con + cic:/matita/logic/equality/eq_elim_r.con + cic:/matita/logic/equality/eq_f.con +(* *) + cic:/matita/logic/equality/eq_OF_eq.con. +(* *) +(* + cic:/matita/logic/equality/eq_f'.con. (* \x.sym (eq_f x) *) + *) + theorem eq_f2: \forall A,B,C:Type.\forall f:A\to B \to C. \forall x1,x2:A. \forall y1,y2:B. x1=x2 \to y1=y2 \to f x1 y1 = f x2 y2. @@ -99,7 +108,7 @@ lemma trans_sym_eq: \forall u:x=y. comp ? ? ? ? u u = refl_eq ? y. intros. - apply (eq_ind' ? ? ? ? ? u). + apply (eq_rect' ? ? ? ? ? u). reflexivity. qed. @@ -139,7 +148,7 @@ theorem nu_left_inv: \forall u:x=y. nu_inv ? H ? ? (nu ? H ? ? u) = u. intros. - apply (eq_ind' ? ? ? ? ? u). + apply (eq_rect' ? ? ? ? ? u). unfold nu_inv. apply trans_sym_eq. qed. @@ -175,11 +184,11 @@ cut focus 8. clear q; clear p. intro. - apply (eq_ind' ? ? ? ? ? q); + apply (eq_rect' ? ? ? ? ? q); fold simplify (nu ? ? (refl_eq ? x)). generalize in match (nu ? ? (refl_eq ? x)); intro. apply - (eq_ind' A x + (eq_rect' A x (\lambda y. \lambda u. eq_ind A x (\lambda a.a=y) u y u = refl_eq ? y) ? x H1).