]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/arith/nat_plus_pred.ma
arithmetics for λδ
[helm.git] / matita / matita / contribs / lambdadelta / ground / arith / nat_plus_pred.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "ground/arith/nat_pred_succ.ma".
16 include "ground/arith/nat_plus.ma".
17
18 (* ADDITION FOR NON-NEGATIVE INTEGERS ***************************************)
19
20 (* Inversions with npred ****************************************************)
21
22 (*** plus_inv_S3_sn *)
23 lemma eq_inv_succ_nplus_sn (o) (m) (n):
24       ↑o = m + n →
25       ∨∨ ∧∧ 𝟎 = m & n = ↑o
26        | ∧∧ m = ↑↓m & o = ↓m + n.
27 #o #m @(nat_ind_succ … m) -m
28 [ /3 width=1 by or_introl, conj/
29 | #m #_ #n <nplus_succ_sn
30   /4 width=1 by eq_inv_nsucc_bi, or_intror, conj/
31 ]
32 qed-.
33
34 (*** plus_inv_S3_dx *)
35 lemma eq_inv_succ_nplus_dx (o) (m) (n):
36       ↑o = m + n →
37       ∨∨ ∧∧ 𝟎 = n & m = ↑o
38        | ∧∧ n = ↑↓n & o = m + ↓n.
39 #o #m #n @(nat_ind_succ … n) -n
40 [ /3 width=1 by or_introl, conj/
41 | #n #_ <nplus_succ_sn
42   /4 width=1 by eq_inv_nsucc_bi, or_intror, conj/
43 ]
44 qed-.