1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "ground/arith/nat_lt_plus.ma".
16 include "ground/relocation/rtmap_basic_at.ma".
17 include "ground/relocation/pstream_after.ma".
19 (* RELOCATION P-STREAM ******************************************************)
21 (* Properties on basic relocation (specific) **********************************)
23 lemma apply_basic_lt: ∀m,n,i. ninj i ≤ m → 𝐛❨m,n❩@❨i❩ = i.
24 /3 width=1 by at_inv_total, gr_pat_basic_lt/ qed-.
26 lemma apply_basic_ge: ∀m,n,i. m < ninj i → 𝐛❨m,n❩@❨i❩ = i+n.
27 /3 width=1 by at_inv_total, gr_pat_basic_ge/ qed-.
29 (* Main properties on basic relocation (specific) *****************************)
31 theorem basic_swap: ∀d1,d2. d2 ≤ d1 →
32 ∀h1,h2. 𝐛❨d2,h2❩∘𝐛❨d1,h1❩ ≡ 𝐛❨d1+h2,h1❩∘𝐛❨d2,h2❩.
35 @nstream_eq_inv_ext #i
36 <compose_apply <compose_apply
37 elim (nat_split_lt_ge d2 i) #Hd2
38 [ elim (nat_split_lt_ge d1 i) -Hd21 #Hd1
39 [ >(apply_basic_ge … Hd1) >(apply_basic_ge … Hd2) >apply_basic_ge
40 [ >apply_basic_ge // >nrplus_inj_sn /2 width=1 by nlt_plus_bi_sn/
41 | >nrplus_inj_sn /2 width=2 by nlt_plus_dx_dx/
43 | >(apply_basic_lt … Hd1) >(apply_basic_ge … Hd2)
44 >apply_basic_lt // >nrplus_inj_sn /2 width=1 by nle_plus_bi_dx/
46 | lapply (nle_trans … Hd2 … Hd21) -Hd21 #Hd1
47 >(apply_basic_lt … Hd1) >(apply_basic_lt … Hd2)
48 >apply_basic_lt /2 width=1 by nle_plus_dx_dx/