]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground_2/relocation/nstream_basic.ma
update in ground_2
[helm.git] / matita / matita / contribs / lambdadelta / ground_2 / relocation / nstream_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_2/relocation/rtmap_basic.ma".
16 include "ground_2/relocation/nstream_after.ma".
17
18 (* RELOCATION N-STREAM ******************************************************)
19
20 (* Specific properties on basic relocation **********************************)
21
22 lemma apply_basic_lt: āˆ€m,n,i. i < m ā†’ šā“m,nāµ@ā“iāµ = i.
23 /3 width=1 by at_inv_total, at_basic_lt/ qed-.
24
25 lemma apply_basic_ge: āˆ€m,n,i. m ā‰¤ i ā†’ šā“m,nāµ@ā“iāµ = n+i.
26 /3 width=1 by at_inv_total, at_basic_ge/ qed-.
27
28 (* Specific main properties on basic relocation *****************************)
29
30 theorem basic_swap: āˆ€d1,d2. d2 ā‰¤ d1 ā†’
31                     āˆ€h1,h2. šā“d2,h2āµāˆ˜šā“d1,h1āµ ā‰” šā“h2+d1,h1āµāˆ˜šā“d2,h2āµ.
32 #d1 #d2 #Hd21 #h1 #h2
33 @nstream_inv_eq
34 @nstream_eq_inv_ext #i
35 <compose_apply <compose_apply
36 elim (lt_or_ge i d2) #Hd2
37 [ lapply (lt_to_le_to_lt ā€¦ Hd2 Hd21) -Hd21 #Hd1
38   >(apply_basic_lt ā€¦ Hd1) >(apply_basic_lt ā€¦ Hd2) >apply_basic_lt
39   /2 width=1 by le_plus_a/
40 | elim (lt_or_ge i d1) -Hd21 #Hd1
41   [ >(apply_basic_lt ā€¦ Hd1) >(apply_basic_ge ā€¦ Hd2) >apply_basic_lt
42     /2 width=1 by monotonic_lt_plus_r/
43   | >(apply_basic_ge ā€¦ Hd1) >(apply_basic_ge ā€¦ Hd2)
44     >apply_basic_ge [2: /2 width=1 by le_plus_a/ ]
45     >apply_basic_ge /2 width=1 by monotonic_le_plus_r/
46   ]
47 ]
48 qed-.