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 set "baseuri" "cic:/matita/RELATIONAL-ARITHMETICsucc/Plus_props".
17 include "Plus_fwd.ma".
19 theorem Plus_zero_1: \forall q. Plus zero q q.
20 intros. elim q; clear q; auto.
23 theorem Plus_succ_1: \forall p,q,r. Plus p q r \to Plus (succ p) q (succ r).
24 intros 2. elim q; clear q;
25 [ lapply linear Plus_gen_zero_2 to H as H0.
26 rewrite > H0. clear H0 p
27 | lapply linear Plus_gen_succ_2 to H1 as H0.
29 rewrite > H2. clear H2 r
33 theorem Plus_sym: \forall p,q,r. Plus p q r \to Plus q p r.
34 intros 2. elim q; clear q;
35 [ lapply linear Plus_gen_zero_2 to H as H0.
36 rewrite > H0. clear H0 p
37 | lapply linear Plus_gen_succ_2 to H1 as H0.
39 rewrite > H2. clear H2 r
43 theorem Plus_shift_succ_sx: \forall p,q,r.
44 Plus p (succ q) r \to Plus (succ p) q r.
46 lapply linear Plus_gen_succ_2 to H as H0.
48 rewrite > H1. clear H1 r.
52 theorem Plus_shift_succ_dx: \forall p,q,r.
53 Plus (succ p) q r \to Plus p (succ q) r.
55 lapply linear Plus_gen_succ_1 to H as H0.
57 rewrite > H1. clear H1 r.
61 theorem Plus_trans_1: \forall p,q1,r1. Plus p q1 r1 \to
62 \forall q2,r2. Plus r1 q2 r2 \to
63 \exists q. Plus q1 q2 q \land Plus p q r2.
64 intros 2; elim q1; clear q1; intros;
65 [ lapply linear Plus_gen_zero_2 to H as H0.
66 rewrite > H0. clear H0 p
67 | lapply linear Plus_gen_succ_2 to H1 as H0.
69 rewrite > H3. rewrite > H3 in H2. clear H3 r1.
70 lapply linear Plus_gen_succ_1 to H2 as H0.
72 rewrite > H2. clear H2 r2.
73 lapply linear H to H4, H3 as H0.
75 ]; apply ex_intro; [| auto || auto ]. (**)
78 theorem Plus_trans_2: \forall p1,q,r1. Plus p1 q r1 \to
79 \forall p2,r2. Plus p2 r1 r2 \to
80 \exists p. Plus p1 p2 p \land Plus p q r2.
81 intros 2; elim q; clear q; intros;
82 [ lapply linear Plus_gen_zero_2 to H as H0.
83 rewrite > H0. clear H0 p1
84 | lapply linear Plus_gen_succ_2 to H1 as H0.
86 rewrite > H3. rewrite > H3 in H2. clear H3 r1.
87 lapply linear Plus_gen_succ_2 to H2 as H0.
89 rewrite > H2. clear H2 r2.
90 lapply linear H to H4, H3 as H0.
92 ]; apply ex_intro; [| auto || auto ]. (**)
95 theorem Plus_conf: \forall p,q,r1. Plus p q r1 \to
96 \forall r2. Plus p q r2 \to r1 = r2.
97 intros 2. elim q; clear q; intros;
98 [ lapply linear Plus_gen_zero_2 to H as H0.
99 rewrite > H0 in H1. clear H0 p
100 | lapply linear Plus_gen_succ_2 to H1 as H0.
102 rewrite > H3. clear H3 r1.
103 lapply linear Plus_gen_succ_2 to H2 as H0.
105 rewrite > H2. clear H2 r2.