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/inv".
17 include "NPlus/defs.ma".
19 (* Inversion lemmas *********************************************************)
21 theorem nplus_inv_zero_1: \forall q,r. (zero + q == r) \to q = r.
22 intros. elim H; clear H q r; autobatch.
25 theorem nplus_inv_succ_1: \forall p,q,r. ((succ p) + q == r) \to
26 \exists s. r = (succ s) \land p + q == s.
27 intros. elim H; clear H q r; intros;
29 | clear H1. decompose. subst. autobatch depth = 4
33 theorem nplus_inv_zero_2: \forall p,r. (p + zero == r) \to p = r.
34 intros. inversion H; clear H; intros; subst. autobatch.
37 theorem nplus_inv_succ_2: \forall p,q,r. (p + (succ q) == r) \to
38 \exists s. r = (succ s) \land p + q == s.
39 intros. inversion H; clear H; intros; subst.
43 theorem nplus_inv_zero_3: \forall p,q. (p + q == zero) \to
44 p = zero \land q = zero.
45 intros. inversion H; clear H; intros; subst. autobatch.
48 theorem nplus_inv_succ_3: \forall p,q,r. (p + q == (succ r)) \to
49 \exists s. p = succ s \land (s + q == r) \lor
50 q = succ s \land p + s == r.
51 intros. inversion H; clear H; intros; subst;
55 (* Corollaries to inversion lemmas ******************************************)
57 theorem nplus_inv_succ_2_3: \forall p,q,r.
58 (p + (succ q) == (succ r)) \to p + q == r.
60 lapply linear nplus_inv_succ_2 to H. decompose. subst. autobatch.
63 theorem nplus_inv_succ_1_3: \forall p,q,r.
64 ((succ p) + q == (succ r)) \to p + q == r.
66 lapply linear nplus_inv_succ_1 to H. decompose. subst. autobatch.
69 theorem nplus_inv_eq_2_3: \forall p,q. (p + q == q) \to p = zero.
70 intros 2. elim q; clear q;
71 [ lapply linear nplus_inv_zero_2 to H
72 | lapply linear nplus_inv_succ_2_3 to H1
76 theorem nplus_inv_eq_1_3: \forall p,q. (p + q == p) \to q = zero.
77 intros 1. elim p; clear p;
78 [ lapply linear nplus_inv_zero_1 to H
79 | lapply linear nplus_inv_succ_1_3 to H1.