]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/relocation/tr_minus_pap.ma
wip ....
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / relocation / tr_minus_pap.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 "delayed_updating/relocation/tr_minus_pn.ma".
16 include "ground/relocation/tr_pap_pn.ma".
17 include "ground/relocation/tr_pap_lt.ma".
18 include "ground/arith/nat_rplus_succ.ma".
19 include "ground/arith/nat_minus_pminus.ma".
20 include "ground/arith/pnat_le.ma".
21
22 (* RIGHT SUBTRACTION FOR TOTAL RELOCATION MAPS ******************************)
23
24 (* Constructions with tr_pap ************************************************)
25
26 lemma tr_pap_minus_le (n) (p) (f):
27       f@⧣❨p❩ ≤ p + n →
28       p = (f-n)@⧣❨p❩.
29 #n @(nat_ind_succ … n) -n [| #n #IHn ]
30 [ #p #f #H1f
31   lapply (tr_pap_increasing f p) #H2f
32   >(ple_antisym … H2f H1f) in ⊢ (??%?); -H1f -H2f //
33 | #p elim p -p [| #p #IHp ]
34   #f elim (tr_map_split f) * #g #H0 destruct
35   [ //
36   |2,4:
37     <tr_pap_next <nrplus_succ_dx #Hf
38     lapply (ple_inv_succ_bi … Hf) -Hf #Hf
39     <tr_minus_next_succ /2 width=1 by/
40   | <tr_minus_push_succ <tr_pap_push <tr_pap_push <nrplus_succ_sn #Hf
41     lapply (ple_inv_succ_bi … Hf) -Hf #Hf
42     <IHp -IHp //
43   ]
44 ]
45 qed-.
46
47 lemma tr_pap_minus_ge (n:nat) (p:pnat) (f):
48       p + n ≤ f@⧣❨p❩ →
49       f@⧣❨p❩-n = (f-n)@⧣❨p❩.
50 #n @(nat_ind_succ … n) -n [| #n #IHn ]
51 [ #p #f #_ //
52 | #p elim p -p [| #p #IHp ]
53   #f elim (tr_map_split f) * #g #H0 destruct
54   [ <tr_cons_pap_unit <nrplus_unit_sn #H0
55     elim (ple_inv_succ_unit … H0)
56   |2,4:
57     <tr_pap_next <nrplus_succ_dx #Hf
58     lapply (ple_inv_succ_bi … Hf) -Hf #Hf
59     <tr_minus_next_succ >nsucc_inj /2 width=1 by/
60   | <tr_minus_push_succ <tr_pap_push <tr_pap_push <nrplus_succ_sn #Hf
61     lapply (ple_inv_succ_bi … Hf) -Hf #Hf
62     >nsucc_inj >nsucc_inj <IHp -IHp //
63     <nminus_inj_bi
64     [ <nminus_inj_bi 
65       [ <nsucc_inj @eq_f
66 (*
67     <nminus_succ_sn //
68 *)