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/NPlus/props".
17 include "NPlus/fwd.ma".
19 theorem nplus_zero_1: \forall q. NPlus zero q q.
20 intros. elim q; clear q; auto.
23 theorem nplus_succ_1: \forall p,q,r. NPlus p q r \to NPlus (succ p) q (succ r).
24 intros 2. elim q; clear q;
25 [ lapply linear nplus_gen_zero_2 to H as H0.
26 rewrite > H0. clear H0 p
27 | lapply linear nplus_gen_succ_2 to H1 as H0.
29 rewrite > H2. clear H2 r
33 theorem nplus_sym: \forall p,q,r. NPlus p q r \to NPlus q p r.
34 intros 2. elim q; clear q;
35 [ lapply linear nplus_gen_zero_2 to H as H0.
36 rewrite > H0. clear H0 p
37 | lapply linear nplus_gen_succ_2 to H1 as H0.
39 rewrite > H2. clear H2 r
43 theorem nplus_shift_succ_sx: \forall p,q,r.
44 NPlus p (succ q) r \to NPlus (succ p) q r.
46 lapply linear nplus_gen_succ_2 to H as H0.
48 rewrite > H1. clear H1 r.
52 theorem nplus_shift_succ_dx: \forall p,q,r.
53 NPlus (succ p) q r \to NPlus p (succ q) r.
55 lapply linear nplus_gen_succ_1 to H as H0.
57 rewrite > H1. clear H1 r.
61 theorem nplus_trans_1: \forall p,q1,r1. NPlus p q1 r1 \to
62 \forall q2,r2. NPlus r1 q2 r2 \to
63 \exists q. NPlus q1 q2 q \land NPlus p q r2.
64 intros 2; elim q1; clear q1; intros;
65 [ lapply linear nplus_gen_zero_2 to H as H0.
66 rewrite > H0. clear H0 p
67 | lapply linear nplus_gen_succ_2 to H1 as H0.
69 rewrite > H3. rewrite > H3 in H2. clear H3 r1.
70 lapply linear nplus_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 nplus_trans_2: \forall p1,q,r1. NPlus p1 q r1 \to
79 \forall p2,r2. NPlus p2 r1 r2 \to
80 \exists p. NPlus p1 p2 p \land NPlus p q r2.
81 intros 2; elim q; clear q; intros;
82 [ lapply linear nplus_gen_zero_2 to H as H0.
83 rewrite > H0. clear H0 p1
84 | lapply linear nplus_gen_succ_2 to H1 as H0.
86 rewrite > H3. rewrite > H3 in H2. clear H3 r1.
87 lapply linear nplus_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 nplus_conf: \forall p,q,r1. NPlus p q r1 \to
96 \forall r2. NPlus p q r2 \to r1 = r2.
97 intros 2. elim q; clear q; intros;
98 [ lapply linear nplus_gen_zero_2 to H as H0.
99 rewrite > H0 in H1. clear H0 p
100 | lapply linear nplus_gen_succ_2 to H1 as H0.
102 rewrite > H3. clear H3 r1.
103 lapply linear nplus_gen_succ_2 to H2 as H0.
105 rewrite > H2. clear H2 r2.