]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nexts.ma
propagating the arithmetics library, partial commit
[helm.git] / matita / matita / contribs / lambdadelta / ground / relocation / rtmap_nexts.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/notation/functions/uparrowstar_2.ma".
16 include "ground/arith/nat_succ_iter.ma".
17 include "ground/relocation/rtmap_eq.ma".
18
19 (* RELOCATION MAP ***********************************************************)
20
21 definition nexts (f:rtmap) (n:nat) ≝ next^n f.
22
23 interpretation "nexts (rtmap)" 'UpArrowStar n f = (nexts f n).
24
25 (* Basic properties *********************************************************)
26
27 lemma nexts_O: ∀f. f = ↑*[𝟎] f.
28 // qed.
29
30 lemma nexts_S: ∀f,n. ↑↑*[n] f = ↑*[↑n] f.
31 #f #n @(niter_succ … next)
32 qed.
33
34 lemma nexts_eq_repl: ∀n. eq_repl (λf1,f2. ↑*[n] f1 ≡ ↑*[n] f2).
35 #n @(nat_ind_succ … n) -n /3 width=5 by eq_next/
36 qed.
37
38 (* Advanced properties ******************************************************)
39
40 lemma nexts_swap: ∀f,n. ↑↑*[n] f = ↑*[n] ↑f.
41 #f #n @(niter_appl … next)
42 qed.
43
44 lemma nexts_xn: ∀n,f. ↑*[n] ↑f = ↑*[↑n] f.
45 // qed.
46
47 (* Basic_inversion lemmas *****************************************************)
48
49 lemma eq_inv_nexts_sn: ∀n,f1,g2. ↑*[n] f1 ≡ g2 →
50                        ∃∃f2. f1 ≡ f2 & ↑*[n] f2 = g2.
51 #n @(nat_ind_succ … n) -n /2 width=3 by ex2_intro/
52 #n #IH #f1 #g2 #H elim (eq_inv_nx … H) -H [|*: // ]
53 #f0 #Hf10 #H1 elim (IH … Hf10) -IH -Hf10 #f2 #Hf12 #H2 destruct
54 /2 width=3 by ex2_intro/
55 qed-.
56
57 lemma eq_inv_nexts_dx: ∀n,f2,g1. g1 ≡ ↑*[n] f2 →
58                        ∃∃f1. f1 ≡ f2 & ↑*[n] f1 = g1.
59 #n @(nat_ind_succ … n) -n /2 width=3 by ex2_intro/
60 #n #IH #f2 #g1 #H elim (eq_inv_xn … H) -H [|*: // ]
61 #f0 #Hf02 #H1 elim (IH … Hf02) -IH -Hf02 #f1 #Hf12 #H2 destruct
62 /2 width=3 by ex2_intro/
63 qed-.