X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcontribs%2FRELATIONAL%2FNPlus%2Fprops.ma;h=5e7cc1b7f592c8bca10f3516ad9d1398cf4fb5c3;hb=45d71beffd253ffd767a9afbfcec5c4f44afd8a8;hp=56146a3bf602d702fe969329930a23f70db6588d;hpb=c86f1a6c4d00f66a81c576589f215cb667595710;p=helm.git diff --git a/matita/contribs/RELATIONAL/NPlus/props.ma b/matita/contribs/RELATIONAL/NPlus/props.ma index 56146a3bf..5e7cc1b7f 100644 --- a/matita/contribs/RELATIONAL/NPlus/props.ma +++ b/matita/contribs/RELATIONAL/NPlus/props.ma @@ -16,92 +16,83 @@ set "baseuri" "cic:/matita/RELATIONAL/NPlus/props". include "NPlus/fwd.ma". -theorem nplus_zero_1: \forall q. NPlus zero q q. +theorem nplus_zero_1: \forall q. zero + q == q. intros. elim q; clear q; auto. qed. -theorem nplus_succ_1: \forall p,q,r. NPlus p q r \to NPlus (succ p) q (succ r). +theorem nplus_succ_1: \forall p,q,r. NPlus p q r \to + (succ p) + q == (succ r). intros 2. elim q; clear q; [ lapply linear nplus_gen_zero_2 to H as H0. - rewrite > H0. clear H0 p + subst | lapply linear nplus_gen_succ_2 to H1 as H0. decompose. - rewrite > H2. clear H2 r + subst ]; auto. qed. -theorem nplus_sym: \forall p,q,r. NPlus p q r \to NPlus q p r. +theorem nplus_sym: \forall p,q,r. (p + q == r) \to q + p == r. intros 2. elim q; clear q; [ lapply linear nplus_gen_zero_2 to H as H0. - rewrite > H0. clear H0 p + subst | lapply linear nplus_gen_succ_2 to H1 as H0. decompose. - rewrite > H2. clear H2 r + subst ]; auto. qed. theorem nplus_shift_succ_sx: \forall p,q,r. - NPlus p (succ q) r \to NPlus (succ p) q r. + (p + (succ q) == r) \to (succ p) + q == r. intros. lapply linear nplus_gen_succ_2 to H as H0. - decompose. - rewrite > H1. clear H1 r. - auto. + decompose. subst. auto. qed. theorem nplus_shift_succ_dx: \forall p,q,r. - NPlus (succ p) q r \to NPlus p (succ q) r. + ((succ p) + q == r) \to p + (succ q) == r. intros. lapply linear nplus_gen_succ_1 to H as H0. - decompose. - rewrite > H1. clear H1 r. - auto. + decompose. subst. auto. qed. -theorem nplus_trans_1: \forall p,q1,r1. NPlus p q1 r1 \to - \forall q2,r2. NPlus r1 q2 r2 \to - \exists q. NPlus q1 q2 q \land NPlus p q r2. +theorem nplus_trans_1: \forall p,q1,r1. (p + q1 == r1) \to + \forall q2,r2. (r1 + q2 == r2) \to + \exists q. (q1 + q2 == q) \land p + q == r2. intros 2; elim q1; clear q1; intros; [ lapply linear nplus_gen_zero_2 to H as H0. - rewrite > H0. clear H0 p + subst. | lapply linear nplus_gen_succ_2 to H1 as H0. - decompose. - rewrite > H3. rewrite > H3 in H2. clear H3 r1. + decompose. subst. lapply linear nplus_gen_succ_1 to H2 as H0. - decompose. - rewrite > H2. clear H2 r2. + decompose. subst. lapply linear H to H4, H3 as H0. decompose. ]; apply ex_intro; [| auto || auto ]. (**) qed. -theorem nplus_trans_2: \forall p1,q,r1. NPlus p1 q r1 \to - \forall p2,r2. NPlus p2 r1 r2 \to - \exists p. NPlus p1 p2 p \land NPlus p q r2. +theorem nplus_trans_2: \forall p1,q,r1. (p1 + q == r1) \to + \forall p2,r2. (p2 + r1 == r2) \to + \exists p. (p1 + p2 == p) \land p + q == r2. intros 2; elim q; clear q; intros; [ lapply linear nplus_gen_zero_2 to H as H0. - rewrite > H0. clear H0 p1 + subst | lapply linear nplus_gen_succ_2 to H1 as H0. - decompose. - rewrite > H3. rewrite > H3 in H2. clear H3 r1. + decompose. subst. lapply linear nplus_gen_succ_2 to H2 as H0. - decompose. - rewrite > H2. clear H2 r2. + decompose. subst. lapply linear H to H4, H3 as H0. decompose. ]; apply ex_intro; [| auto || auto ]. (**) qed. -theorem nplus_conf: \forall p,q,r1. NPlus p q r1 \to - \forall r2. NPlus p q r2 \to r1 = r2. +theorem nplus_conf: \forall p,q,r1. (p + q == r1) \to + \forall r2. (p + q == r2) \to r1 = r2. intros 2. elim q; clear q; intros; [ lapply linear nplus_gen_zero_2 to H as H0. - rewrite > H0 in H1. clear H0 p + subst | lapply linear nplus_gen_succ_2 to H1 as H0. - decompose. - rewrite > H3. clear H3 r1. + decompose. subst. lapply linear nplus_gen_succ_2 to H2 as H0. - decompose. - rewrite > H2. clear H2 r2. + decompose. subst. ]; auto. qed.