X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Flibrary%2Fnat%2Fplus.ma;h=d595dad19113cb6626ec4e58cc1e8a2d389be2b1;hb=97c2d258a5c524eb5c4b85208899d80751a2c82f;hp=39e48f21e58a85811b1eb99e4666cb0c89dcaea3;hpb=633474751ddf1074947ff0d324fb1aca2293eff8;p=helm.git diff --git a/helm/matita/library/nat/plus.ma b/helm/matita/library/nat/plus.ma index 39e48f21e..d595dad19 100644 --- a/helm/matita/library/nat/plus.ma +++ b/helm/matita/library/nat/plus.ma @@ -21,55 +21,52 @@ let rec plus n m \def [ O \Rightarrow m | (S p) \Rightarrow S (plus p m) ]. -theorem plus_n_O: \forall n:nat. n = plus n O. +(*CSC: the URI must disappear: there is a bug now *) +interpretation "natural plus" 'plus x y = (cic:/matita/nat/plus/plus.con x y). + +theorem plus_n_O: \forall n:nat. n = n+O. intros.elim n. simplify.reflexivity. simplify.apply eq_f.assumption. qed. -theorem plus_n_Sm : \forall n,m:nat. S (plus n m) = plus n (S m). +theorem plus_n_Sm : \forall n,m:nat. S (n+m) = n+(S m). intros.elim n. simplify.reflexivity. simplify.apply eq_f.assumption. qed. -(* some problem here: confusion between relations/symmetric -and functions/symmetric; functions symmetric is not in -functions.moo why? -theorem symmetric_plus: symmetric nat plus. *) - -theorem sym_plus: \forall n,m:nat. plus n m = plus m n. +theorem sym_plus: \forall n,m:nat. n+m = m+n. intros.elim n. simplify.apply plus_n_O. simplify.rewrite > H.apply plus_n_Sm. qed. theorem associative_plus : associative nat plus. -simplify.intros.elim x. +unfold associative.intros.elim x. simplify.reflexivity. simplify.apply eq_f.assumption. qed. -theorem assoc_plus : \forall n,m,p:nat. plus (plus n m) p = plus n (plus m p) +theorem assoc_plus : \forall n,m,p:nat. (n+m)+p = n+(m+p) \def associative_plus. -theorem injective_plus_r: \forall n:nat.injective nat nat (\lambda m.plus n m). +theorem injective_plus_r: \forall n:nat.injective nat nat (\lambda m.n+m). intro.simplify.intros 2.elim n. exact H. apply H.apply inj_S.apply H1. qed. -theorem inj_plus_r: \forall p,n,m:nat. plus p n = plus p m \to n=m +theorem inj_plus_r: \forall p,n,m:nat. p+n = p+m \to n=m \def injective_plus_r. -theorem injective_plus_l: \forall m:nat.injective nat nat (\lambda n.plus n m). +theorem injective_plus_l: \forall m:nat.injective nat nat (\lambda n.n+m). intro.simplify.intros. -(* qui vorrei applicare injective_plus_r *) -apply inj_plus_r m. +apply (injective_plus_r m). rewrite < sym_plus. -rewrite < sym_plus y. +rewrite < (sym_plus y). assumption. qed. -theorem inj_plus_l: \forall p,n,m:nat. plus n p = plus m p \to n=m +theorem inj_plus_l: \forall p,n,m:nat. n+p = m+p \to n=m \def injective_plus_l.