]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/relocation/pr_compose.ma
update in ground
[helm.git] / matita / matita / contribs / lambdadelta / ground / relocation / pr_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/relocation/pr_after.ma".
16
17 (* RELATIONAL COMPOSITION FOR PARTIAL RELOCATION MAPS ***********************)
18
19 corec definition pr_compose: pr_map → pr_map → pr_map.
20 * * #g2 [ #f1 | * * #g1 ]
21 [ @pr_next @(pr_compose g2 f1)
22 | @pr_next @(pr_compose g2 g1)
23 | @pr_push @(pr_compose g2 g1)
24 ]
25 defined.
26
27 interpretation
28   "functional composition (partial relocation maps)"
29   'compose f2 f1 = (pr_compose f2 f1).
30
31 (* Basic constructions (specific) *******************************************)
32
33 lemma pr_compose_unfold_refl (f2) (f1): ⫯(f2∘f1) = (⫯f2)∘(⫯f1).
34 #f2 #f1
35 <(stream_unfold … ((⫯f2)∘(⫯f1))) in ⊢ (???%); //
36 qed.
37
38 lemma pr_compose_unfold_push (f2) (f1): ↑(f2∘f1) = (⫯f2)∘(↑f1).
39 #f2 #f1
40 <(stream_unfold … ((⫯f2)∘(↑f1))) in ⊢ (???%); //
41 qed.
42
43 lemma pr_compose_unfold_next (f2) (f1):
44       ↑(f2∘f1) = (↑f2)∘f1.
45 #f2 #f1
46 <(stream_unfold … ((↑f2)∘f1)) in ⊢ (???%); //
47 qed.
48
49 (* Main constructions *******************************************************)
50
51 corec theorem pr_after_compose (f2) (f1):
52               f2 ⊚ f1 ≘ f2∘f1.
53 cases (pr_map_split_tl f2)*
54 [ cases (pr_map_split_tl f1) * ]
55 [ @pr_after_refl /2 width=7 by/
56 | @pr_after_push /2 width=7 by/
57 | @pr_after_next /2 width=5 by/
58 ]
59 qed.