]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/relocation/tr_compose.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / ground / relocation / tr_compose.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/lib/stream_tls.ma".
16 include "ground/relocation/tr_pap.ma".
17
18 (* COMPOSITION FOR PARTIAL RELOCATION MAPS **********************************)
19
20 corec definition tr_compose: tr_map → tr_map → tr_map.
21 #f2 * #p1 #f1
22 @(stream_cons … (f2@❨p1❩))
23 @(tr_compose ? f1) -tr_compose -f1
24 @(⇂*[p1]f2)
25 defined.
26
27 interpretation
28   "composition (total relocation maps)"
29   'compose f2 f1 = (tr_compose f2 f1).
30
31 (* Basic constructions ******************************************************)
32
33 (*** compose_rew *)
34 lemma tr_compose_unfold (f2) (f1):
35       ∀p1. f2@❨p1❩⨮(⇂*[p1]f2)∘f1 = f2∘(p1⨮f1).
36 #f2 #f1 #p1 <(stream_unfold … (f2∘(p1⨮f1))) //
37 qed.
38
39 (* Basic inversions *********************************************************)
40
41 (*** compose_inv_rew *)
42 lemma tr_compose_inv_unfold (f2) (f1):
43       ∀f,p1,p. f2∘(p1⨮f1) = p⨮f →
44       ∧∧ f2@❨p1❩ = p & (⇂*[p1]f2)∘f1 = f.
45 #f2 #f1 #f #p1 #p
46 <tr_compose_unfold #H destruct
47 /2 width=1 by conj/
48 qed-.
49
50 (*** compose_inv_S2 *)
51 lemma tr_compose_inv_succ_dx (f2) (f1):
52       ∀f,p2,p1,p. (p2⨮f2)∘(↑p1⨮f1) = p⨮f →
53       ∧∧ f2@❨p1❩+p2 = p & f2∘(p1⨮f1) = f2@❨p1❩⨮f.
54 #f2 #f1 #f #p2 #p1 #p
55 <tr_compose_unfold #H destruct
56 >nsucc_inj <stream_tls_swap
57 /2 width=1 by conj/
58 qed-.