]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/relocation/tr_minus.ma
update from master branch
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / relocation / tr_minus.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/pnat_minus.ma".
16 include "ground/arith/nat_minus.ma".
17 include "ground/relocation/tr_map.ma".
18
19 (* RIGHT SUBTRACTION FOR TOTAL RELOCATION MAPS ******************************)
20
21 corec definition tr_minus: nat → tr_map → tr_map.
22 * [ #f @f ] #q * #p #f
23 @((p-q)⨮(tr_minus (ninj (↑q)-ninj p) f))
24 defined.
25
26 interpretation
27   "right minus (total relocation maps)"
28   'minus f n = (tr_minus n f).
29
30 (* Basic constructions ******************************************************)
31
32 lemma tr_minus_zero_dx (f):
33       f = f - 𝟎 .
34 * #f #p <(stream_unfold … ((f⨮p)-𝟎)) //
35 qed.
36
37 lemma tr_minus_cons_inj (f) (p) (q):
38       (p-q)⨮(f-(ninj (↑q)-ninj p)) = (p⨮f)-(ninj q).
39 #f #p #q <(stream_unfold … ((p⨮f)-(ninj q))) //
40 qed.