]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/ground/relocation/rtmap_nexts.ma
08851ebe6670fcec05738458e018546574846858
[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/relocation/rtmap_eq.ma".
17
18 (* RELOCATION MAP ***********************************************************)
19
20 rec definition nexts (f:rtmap) (n:nat) on n: rtmap ≝ match n with
21 [ O ⇒ f | S m ⇒ ↑(nexts f m) ].
22
23 interpretation "nexts (rtmap)" 'UpArrowStar n f = (nexts f n).
24
25 (* Basic_inversion lemmas *****************************************************)
26
27 lemma eq_inv_nexts_sn: ∀n,f1,g2. ↑*[n] f1 ≡ g2 →
28                        ∃∃f2. f1 ≡ f2 & ↑*[n] f2 = g2.
29 #n elim n -n /2 width=3 by ex2_intro/
30 #n #IH #f1 #g2 #H elim (eq_inv_nx … H) -H [|*: // ]
31 #f0 #Hf10 #H1 elim (IH … Hf10) -IH -Hf10 #f2 #Hf12 #H2 destruct
32 /2 width=3 by ex2_intro/
33 qed-.
34
35 lemma eq_inv_nexts_dx: ∀n,f2,g1. g1 ≡ ↑*[n] f2 →
36                        ∃∃f1. f1 ≡ f2 & ↑*[n] f1 = g1.
37 #n elim n -n /2 width=3 by ex2_intro/
38 #n #IH #f2 #g1 #H elim (eq_inv_xn … H) -H [|*: // ]
39 #f0 #Hf02 #H1 elim (IH … Hf02) -IH -Hf02 #f1 #Hf12 #H2 destruct
40 /2 width=3 by ex2_intro/
41 qed-.
42
43 (* Basic properties *********************************************************)
44
45 lemma nexts_O: ∀f. f = ↑*[0] f.
46 // qed.
47
48 lemma nexts_S: ∀f,n. ↑↑*[n] f = ↑*[↑n] f.
49 // qed.
50
51 lemma nexts_eq_repl: ∀n. eq_repl (λf1,f2. ↑*[n] f1 ≡ ↑*[n] f2).
52 #n elim n -n /3 width=5 by eq_next/
53 qed.
54
55 (* Advanced properties ******************************************************)
56
57 lemma nexts_xn: ∀n,f. ↑*[n] ↑f = ↑*[↑n] f.
58 #n elim n -n //
59 qed.