]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/substitution/lift_prototerm_constructors.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / substitution / lift_prototerm_constructors.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 "delayed_updating/substitution/lift_prototerm_id.ma".
16 include "delayed_updating/substitution/lift_path_uni.ma".
17 include "delayed_updating/syntax/prototerm_constructors_eq.ma".
18 include "ground/relocation/nap.ma".
19
20 (* LIFT FOR PROTOTERM *******************************************************)
21
22 (* Constructions with constructors for prototerm ****************************)
23
24 lemma lift_term_oref_pap (f) (k):
25       (⧣(f@⧣❨k❩)) ⇔ 🠡[f]⧣k.
26 #f #k @conj #p *
27 [ /2 width=1 by in_comp_lift_path_term/
28 | #q * #H0 destruct //
29 ]
30 qed.
31
32 lemma lift_term_iref_pap_sn (f) (t:prototerm) (k:pnat):
33       (𝛕f@⧣❨k❩.🠡[⇂*[k]f]t) ⊆ 🠡[f](𝛕k.t).
34 #f #t #k #p * #q * #r #Hr #H1 #H2 destruct
35 @(ex2_intro … (𝗱k◗𝗺◗r))
36 /2 width=1 by in_comp_iref_hd/
37 qed-.
38
39 lemma lift_term_iref_pap_dx (f) (t) (k:pnat):
40       🠡[f](𝛕k.t) ⊆ 𝛕f@⧣❨k❩.🠡[⇂*[k]f]t.
41 #f #t #k #p * #q #Hq #H0 destruct
42 elim (in_comp_inv_iref … Hq) -Hq #p #H0 #Hp destruct
43 <lift_path_d_sn <lift_path_m_sn
44 /3 width=1 by in_comp_iref_hd, in_comp_lift_path_term/
45 qed-.
46
47 lemma lift_term_iref_pap (f) (t) (k:pnat):
48       (𝛕f@⧣❨k❩.🠡[⇂*[k]f]t) ⇔ 🠡[f](𝛕k.t).
49 /3 width=1 by conj, lift_term_iref_pap_sn, lift_term_iref_pap_dx/
50 qed.
51
52 lemma lift_term_iref_nap (f) (t) (n):
53       (𝛕↑(f@§❨n❩).🠡[⇂*[↑n]f]t) ⇔ 🠡[f](𝛕↑n.t).
54 #f #t #n
55 >tr_pap_succ_nap //
56 qed.
57
58 lemma lift_term_iref_uni (t) (n) (k):
59       (𝛕(k+n).t) ⇔ 🠡[𝐮❨n❩](𝛕k.t).
60 #t #n #k
61 @(subset_eq_trans … (lift_term_iref_pap …))
62 <tr_uni_pap >nsucc_pnpred <tr_tls_succ_uni
63 /3 width=1 by iref_eq_repl, lift_term_id/
64 qed.
65
66 lemma lift_term_abst (f) (t):
67       (𝛌.🠡[⫯f]t) ⇔ 🠡[f]𝛌.t.
68 #f #t @conj #p #Hp
69 [ elim (in_comp_inv_abst … Hp) -Hp #q #H1 * #r #Hr #H2 destruct
70   /3 width=1 by in_comp_lift_path_term, in_comp_abst_hd/
71 | elim Hp -Hp #q #Hq #H0 destruct
72   elim (in_comp_inv_abst … Hq) -Hq #r #H0 #Hr destruct 
73   /3 width=1 by in_comp_lift_path_term, in_comp_abst_hd/
74 ]
75 qed.
76
77 lemma lift_term_appl (f) (v) (t):
78       @🠡[f]v.🠡[f]t ⇔ 🠡[f]@v.t.
79 #f #v #t @conj #p #Hp
80 [ elim (in_comp_inv_appl … Hp) -Hp * #q #H1 * #r #Hr #H2 destruct
81   /3 width=1 by in_comp_lift_path_term, in_comp_appl_sd, in_comp_appl_hd/
82 | elim Hp -Hp #q #Hq #H0 destruct
83   elim (in_comp_inv_appl … Hq) -Hq * #r #H0 #Hr destruct 
84   /3 width=1 by in_comp_lift_path_term, in_comp_appl_sd, in_comp_appl_hd/
85 ]
86 qed.