]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/relocation/gr_nat_basic.ma
λδ site update
[helm.git] / matita / matita / contribs / lambdadelta / ground / relocation / gr_nat_basic.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/relocation/gr_basic.ma".
16 include "ground/relocation/gr_nat_uni.ma".
17
18 (* NON-NEGATIVE APPLICATION FOR GENERIC RELOCATION MAPS *****************************)
19
20 (* Properties with gr_basic **********************************************)
21
22 lemma gr_nat_basic_lt (m) (n) (l):
23       l < m → @↑❪l, 𝐛❨m,n❩❫ ≘ l.
24 #m @(nat_ind_succ … m) -m
25 [ #n #i #H elim (nlt_inv_zero_dx … H)
26 | #m #IH #n #l @(nat_ind_succ … l) -l
27   [ #_ /2 width=2 by refl, gr_pat_refl/
28   | #l #_ #H
29     lapply (nlt_inv_succ_bi … H) -H #Hlm
30     /3 width=7 by refl, gr_pat_push/
31   ]
32 ]
33 qed.
34
35 lemma gr_nat_basic_ge (m) (n) (l):
36       m ≤ l → @↑❪l, 𝐛❨m,n❩❫ ≘ l+n.
37 #m @(nat_ind_succ … m) -m //
38 #m #IH #n #l #H
39 elim (nle_inv_succ_sn … H) -H #Hml #H >H -H
40 /3 width=7 by gr_nat_push/
41 qed.
42
43 (* Inversion lemmas with gr_basic ****************************************)
44
45 lemma gr_nat_basic_inv_lt (m) (n) (l) (k):
46       l < m → @↑❪l, 𝐛❨m,n❩❫ ≘ k → l = k.
47 /3 width=4 by gr_nat_basic_lt, gr_nat_mono/ qed-.
48
49 lemma gr_nat_basic_inv_ge (m) (n) (l) (k):
50       m ≤ l → @↑❪l, 𝐛❨m,n❩❫ ≘ k → l+n = k.
51 /3 width=4 by gr_nat_basic_ge, gr_nat_mono/ qed-.