--- /dev/null
+lemma lift_path_inv_d_sn (f) (p) (q) (k):
+ (𝗱k◗q) = ↑[f]p →
+ ∃∃r,h. k = f@⧣❨h❩ & q = ↑[⇂*[h]f]r & 𝗱h◗r = p.
+#f * [| * [ #n ] #p ] #q #k
+[ <lift_path_empty
+| <lift_path_d_sn
+| <lift_path_m_sn
+| <lift_path_L_sn
+| <lift_path_A_sn
+| <lift_path_S_sn
+] #H destruct
+/2 width=5 by ex3_2_intro/
+qed-.
+
+lemma lift_path_inv_m_sn (f) (p) (q):
+ (𝗺◗q) = ↑[f]p →
+ ∃∃r. q = ↑[f]r & 𝗺◗r = p.
+#f * [| * [ #n ] #p ] #q
+[ <lift_path_empty
+| <lift_path_d_sn
+| <lift_path_m_sn
+| <lift_path_L_sn
+| <lift_path_A_sn
+| <lift_path_S_sn
+] #H destruct
+/2 width=3 by ex2_intro/
+qed-.
+
+lemma lift_path_inv_L_sn (f) (p) (q):
+ (𝗟◗q) = ↑[f]p →
+ ∃∃r. q = ↑[⫯f]r & 𝗟◗r = p.
+#f * [| * [ #n ] #p ] #q
+[ <lift_path_empty
+| <lift_path_d_sn
+| <lift_path_m_sn
+| <lift_path_L_sn
+| <lift_path_A_sn
+| <lift_path_S_sn
+] #H destruct
+/2 width=3 by ex2_intro/
+qed-.
+
+lemma lift_path_inv_A_sn (f) (p) (q):
+ (𝗔◗q) = ↑[f]p →
+ ∃∃r. q = ↑[f]r & 𝗔◗r = p.
+#f * [| * [ #n ] #p ] #q
+[ <lift_path_empty
+| <lift_path_d_sn
+| <lift_path_m_sn
+| <lift_path_L_sn
+| <lift_path_A_sn
+| <lift_path_S_sn
+] #H destruct
+/2 width=3 by ex2_intro/
+qed-.
+
+lemma lift_path_inv_S_sn (f) (p) (q):
+ (𝗦◗q) = ↑[f]p →
+ ∃∃r. q = ↑[f]r & 𝗦◗r = p.
+#f * [| * [ #n ] #p ] #q
+[ <lift_path_empty
+| <lift_path_d_sn
+| <lift_path_m_sn
+| <lift_path_L_sn
+| <lift_path_A_sn
+| <lift_path_S_sn
+] #H destruct
+/2 width=3 by ex2_intro/
+qed-.
(* LIFT FOR PROTOTERM *******************************************************)
-lemma lift_term_iref_sn (f) (t:prototerm) (n:pnat):
- (𝛕f@⧣❨n❩.↑[⇂*[n]f]t) ⊆ ↑[f](𝛕n.t).
-#f #t #n #p * #q * #r #Hr #H1 #H2 destruct
-@(ex2_intro … (𝗱n◗𝗺◗r))
+lemma lift_term_iref_sn (f) (t:prototerm) (k:pnat):
+ (𝛕f@⧣❨k❩.↑[⇂*[k]f]t) ⊆ ↑[f](𝛕k.t).
+#f #t #k #p * #q * #r #Hr #H1 #H2 destruct
+@(ex2_intro … (𝗱k◗𝗺◗r))
/2 width=1 by in_comp_iref/
qed-.
-lemma lift_term_iref_dx (f) (t) (n:pnat):
- ↑[f](𝛕n.t) ⊆ 𝛕f@⧣❨n❩.↑[⇂*[n]f]t.
-#f #t #n #p * #q #Hq #H0 destruct
+lemma lift_term_iref_dx (f) (t) (k:pnat):
+ ↑[f](𝛕k.t) ⊆ 𝛕f@⧣❨k❩.↑[⇂*[k]f]t.
+#f #t #k #p * #q #Hq #H0 destruct
elim (in_comp_inv_iref … Hq) -Hq #p #H0 #Hp destruct
+<lift_path_d_sn <lift_path_m_sn
/3 width=1 by in_comp_iref, in_comp_lift_path_term/
qed-.
-lemma lift_term_iref (f) (t) (n:pnat):
- (𝛕f@⧣❨n❩.↑[⇂*[n]f]t) ⇔ ↑[f](𝛕n.t).
+lemma lift_term_iref (f) (t) (k:pnat):
+ (𝛕f@⧣❨k❩.↑[⇂*[k]f]t) ⇔ ↑[f](𝛕k.t).
/3 width=1 by conj, lift_term_iref_sn, lift_term_iref_dx/
qed.
-lemma lift_term_iref_uni (t) (m) (n):
- (𝛕(n+m).t) ⇔ ↑[𝐮❨m❩](𝛕n.t).
-#t #m #n
+lemma lift_term_iref_uni (t) (n) (k):
+ (𝛕(k+n).t) ⇔ ↑[𝐮❨n❩](𝛕k.t).
+#t #n #k
@(subset_eq_trans … (lift_term_iref …))
<tr_uni_pap >nsucc_pnpred <tr_tls_succ_uni
/3 width=1 by iref_eq_repl, lift_term_id/
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "delayed_updating/notation/functions/uparrow_4.ma".
-include "delayed_updating/notation/functions/uparrow_2.ma".
-include "delayed_updating/syntax/path.ma".
-include "ground/relocation/tr_uni.ma".
-include "ground/relocation/tr_pap_tls.ma".
-
-(* LIFT FOR PATH ************************************************************)
-
-definition lift_continuation (A:Type[0]) ≝
- tr_map → path → A.
-
-rec definition lift_gen (A:Type[0]) (k:lift_continuation A) (f) (p) on p ≝
-match p with
-[ list_empty ⇒ k f (𝐞)
-| list_lcons l q ⇒
- match l with
- [ label_d n ⇒ lift_gen (A) (λg,p. k g (𝗱(f@⧣❨n❩)◗p)) (⇂*[n]f) q
- | label_m ⇒ lift_gen (A) (λg,p. k g (𝗺◗p)) f q
- | label_L ⇒ lift_gen (A) (λg,p. k g (𝗟◗p)) (⫯f) q
- | label_A ⇒ lift_gen (A) (λg,p. k g (𝗔◗p)) f q
- | label_S ⇒ lift_gen (A) (λg,p. k g (𝗦◗p)) f q
- ]
-].
-
-interpretation
- "lift (gneric)"
- 'UpArrow A k f p = (lift_gen A k f p).
-
-definition proj_path: lift_continuation … ≝
- λf,p.p.
-
-definition proj_rmap: lift_continuation … ≝
- λf,p.f.
-
-interpretation
- "lift (path)"
- 'UpArrow f p = (lift_gen ? proj_path f p).
-
-interpretation
- "lift (relocation map)"
- 'UpArrow p f = (lift_gen ? proj_rmap f p).
-
-(* Basic constructions ******************************************************)
-
-lemma lift_empty (A) (k) (f):
- k f (𝐞) = ↑{A}❨k, f, 𝐞❩.
-// qed.
-
-lemma lift_d_sn (A) (k) (p) (n) (f):
- ↑❨(λg,p. k g (𝗱(f@⧣❨n❩)◗p)), ⇂*[n]f, p❩ = ↑{A}❨k, f, 𝗱n◗p❩.
-// qed.
-
-lemma lift_m_sn (A) (k) (p) (f):
- ↑❨(λg,p. k g (𝗺◗p)), f, p❩ = ↑{A}❨k, f, 𝗺◗p❩.
-// qed.
-
-lemma lift_L_sn (A) (k) (p) (f):
- ↑❨(λg,p. k g (𝗟◗p)), ⫯f, p❩ = ↑{A}❨k, f, 𝗟◗p❩.
-// qed.
-
-lemma lift_A_sn (A) (k) (p) (f):
- ↑❨(λg,p. k g (𝗔◗p)), f, p❩ = ↑{A}❨k, f, 𝗔◗p❩.
-// qed.
-
-lemma lift_S_sn (A) (k) (p) (f):
- ↑❨(λg,p. k g (𝗦◗p)), f, p❩ = ↑{A}❨k, f, 𝗦◗p❩.
-// qed.
-
-(* Basic constructions with proj_path ***************************************)
-
-lemma lift_path_empty (f):
- (𝐞) = ↑[f]𝐞.
-// qed.
-
-(* Basic constructions with proj_rmap ***************************************)
-
-lemma lift_rmap_empty (f):
- f = ↑[𝐞]f.
-// qed.
-
-lemma lift_rmap_d_sn (f) (p) (n):
- ↑[p](⇂*[ninj n]f) = ↑[𝗱n◗p]f.
-// qed.
-
-lemma lift_rmap_m_sn (f) (p):
- ↑[p]f = ↑[𝗺◗p]f.
-// qed.
-
-lemma lift_rmap_L_sn (f) (p):
- ↑[p](⫯f) = ↑[𝗟◗p]f.
-// qed.
-
-lemma lift_rmap_A_sn (f) (p):
- ↑[p]f = ↑[𝗔◗p]f.
-// qed.
-
-lemma lift_rmap_S_sn (f) (p):
- ↑[p]f = ↑[𝗦◗p]f.
-// qed.
-
-(* Advanced constructions with proj_rmap and path_append ********************)
-
-lemma lift_rmap_append (p2) (p1) (f):
- ↑[p2]↑[p1]f = ↑[p1●p2]f.
-#p2 #p1 elim p1 -p1 // * [ #n ] #p1 #IH #f //
-[ <lift_rmap_m_sn <lift_rmap_m_sn //
-| <lift_rmap_A_sn <lift_rmap_A_sn //
-| <lift_rmap_S_sn <lift_rmap_S_sn //
-]
-qed.
-
-(* Advanced constructions with proj_rmap and path_rcons *********************)
-
-lemma lift_rmap_d_dx (f) (p) (n):
- ⇂*[ninj n](↑[p]f) = ↑[p◖𝗱n]f.
-// qed.
-
-lemma lift_rmap_m_dx (f) (p):
- ↑[p]f = ↑[p◖𝗺]f.
-// qed.
-
-lemma lift_rmap_L_dx (f) (p):
- (⫯↑[p]f) = ↑[p◖𝗟]f.
-// qed.
-
-lemma lift_rmap_A_dx (f) (p):
- ↑[p]f = ↑[p◖𝗔]f.
-// qed.
-
-lemma lift_rmap_S_dx (f) (p):
- ↑[p]f = ↑[p◖𝗦]f.
-// qed.
-
-lemma lift_rmap_pap_d_dx (f) (p) (n) (m):
- ↑[p]f@⧣❨m+n❩ = ↑[p◖𝗱n]f@⧣❨m❩+↑[p]f@⧣❨n❩.
-// qed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "delayed_updating/substitution/lift_gen.ma".
-include "ground/relocation/tr_pap_pap.ma".
-include "ground/relocation/tr_pap_eq.ma".
-include "ground/relocation/tr_pn_eq.ma".
-include "ground/lib/stream_tls_plus.ma".
-include "ground/lib/stream_tls_eq.ma".
-include "ground/arith/nat_plus_rplus.ma".
-include "ground/arith/nat_rplus_pplus.ma".
-
-(* LIFT FOR PATH ************************************************************)
-
-definition lift_exteq (A): relation2 (lift_continuation A) (lift_continuation A) ≝
- λk1,k2. ∀f1,f2,p. f1 ≗ f2 → k1 f1 p = k2 f2 p.
-
-interpretation
- "extensional equivalence (lift continuation)"
- 'RingEq A k1 k2 = (lift_exteq A k1 k2).
-
-(* Constructions with lift_exteq ********************************************)
-
-lemma lift_eq_repl (A) (p) (k1) (k2):
- k1 ≗{A} k2 → stream_eq_repl … (λf1,f2. ↑❨k1, f1, p❩ = ↑❨k2, f2, p❩).
-#A #p elim p -p [| * [ #n ] #q #IH ]
-#k1 #k2 #Hk #f1 #f2 #Hf
-[ <lift_empty <lift_empty /2 width=1 by/
-| <lift_d_sn <lift_d_sn <(tr_pap_eq_repl … Hf)
- /3 width=3 by stream_tls_eq_repl, compose_repl_fwd_sn/
-| /3 width=1 by/
-| /3 width=1 by tr_push_eq_repl/
-| /3 width=1 by/
-| /3 width=1 by/
-]
-qed-.
-
-(* Advanced constructions ***************************************************)
-
-lemma lift_lcons_alt (A) (k) (f) (p) (l): k ≗ k →
- ↑❨λg,p2. k g (l◗p2), f, p❩ = ↑{A}❨λg,p2. k g ((l◗𝐞)●p2), f, p❩.
-#A #k #f #p #l #Hk
-@lift_eq_repl // #g1 #g2 #p2 #Hg @Hk -Hk // (**) (* auto fail *)
-qed.
-
-lemma lift_append_rcons_sn (A) (k) (f) (p1) (p) (l): k ≗ k →
- ↑❨λg,p2. k g (p1●l◗p2), f, p❩ = ↑{A}❨λg,p2. k g (p1◖l●p2), f, p❩.
-#A #k #f #p1 #p #l #Hk
-@lift_eq_repl // #g1 #g2 #p2 #Hg
-<list_append_rcons_sn @Hk -Hk // (**) (* auto fail *)
-qed.
-
-(* Advanced constructions with proj_path ************************************)
-
-lemma proj_path_proper:
- proj_path ≗ proj_path.
-// qed.
-
-lemma lift_path_eq_repl (p):
- stream_eq_repl … (λf1,f2. ↑[f1]p = ↑[f2]p).
-/2 width=1 by lift_eq_repl/ qed.
-
-lemma lift_path_append_sn (p) (f) (q):
- q●↑[f]p = ↑❨(λg,p. proj_path g (q●p)), f, p❩.
-#p elim p -p // * [ #n ] #p #IH #f #q
-[ <lift_d_sn <lift_d_sn
-| <lift_m_sn <lift_m_sn
-| <lift_L_sn <lift_L_sn
-| <lift_A_sn <lift_A_sn
-| <lift_S_sn <lift_S_sn
-]
->lift_lcons_alt // >lift_append_rcons_sn //
-<IH <IH -IH <list_append_rcons_sn //
-qed.
-
-lemma lift_path_lcons (f) (p) (l):
- l◗↑[f]p = ↑❨(λg,p. proj_path g (l◗p)), f, p❩.
-#f #p #l
->lift_lcons_alt <lift_path_append_sn //
-qed.
-
-lemma lift_path_d_sn (f) (p) (n):
- (𝗱(f@⧣❨n❩)◗↑[⇂*[n]f]p) = ↑[f](𝗱n◗p).
-// qed.
-
-lemma lift_path_m_sn (f) (p):
- (𝗺◗↑[f]p) = ↑[f](𝗺◗p).
-// qed.
-
-lemma lift_path_L_sn (f) (p):
- (𝗟◗↑[⫯f]p) = ↑[f](𝗟◗p).
-// qed.
-
-lemma lift_path_A_sn (f) (p):
- (𝗔◗↑[f]p) = ↑[f](𝗔◗p).
-// qed.
-
-lemma lift_path_S_sn (f) (p):
- (𝗦◗↑[f]p) = ↑[f](𝗦◗p).
-// qed.
-
-lemma lift_path_append (p2) (p1) (f):
- (↑[f]p1)●(↑[↑[p1]f]p2) = ↑[f](p1●p2).
-#p2 #p1 elim p1 -p1 //
-* [ #n1 ] #p1 #IH #f
-[ <lift_path_d_sn <lift_path_d_sn <IH //
-| <lift_path_m_sn <lift_path_m_sn <IH //
-| <lift_path_L_sn <lift_path_L_sn <IH //
-| <lift_path_A_sn <lift_path_A_sn <IH //
-| <lift_path_S_sn <lift_path_S_sn <IH //
-]
-qed.
-
-lemma lift_path_d_dx (f) (p) (n):
- (↑[f]p)◖𝗱((↑[p]f)@⧣❨n❩) = ↑[f](p◖𝗱n).
-#f #p #n <lift_path_append //
-qed.
-
-lemma lift_path_m_dx (f) (p):
- (↑[f]p)◖𝗺 = ↑[f](p◖𝗺).
-#f #p <lift_path_append //
-qed.
-
-lemma lift_path_L_dx (f) (p):
- (↑[f]p)◖𝗟 = ↑[f](p◖𝗟).
-#f #p <lift_path_append //
-qed.
-
-lemma lift_path_A_dx (f) (p):
- (↑[f]p)◖𝗔 = ↑[f](p◖𝗔).
-#f #p <lift_path_append //
-qed.
-
-lemma lift_path_S_dx (f) (p):
- (↑[f]p)◖𝗦 = ↑[f](p◖𝗦).
-#f #p <lift_path_append //
-qed.
-
-(* Advanced constructions with proj_rmap ************************************)
-
-lemma lift_rmap_eq_repl (p):
- stream_eq_repl … (λf1,f2. ↑[p]f1 ≗ ↑[p]f2).
-#p elim p -p //
-* [ #n ] #p #IH #f1 #f2 #Hf
-[ /3 width=1 by stream_tls_eq_repl/
-| /2 width=1 by/
-| /3 width=1 by tr_push_eq_repl/
-| /2 width=1 by/
-| /2 width=1 by/
-]
-qed.
-
-lemma tls_lift_rmap_d_dx (f) (p) (m) (n):
- ⇂*[m+n]↑[p]f ≗ ⇂*[m]↑[p◖𝗱n]f.
-#f #p #m #n
-<lift_rmap_d_dx >nrplus_inj_dx >nrplus_inj_sn //
-qed.
-
-(* Advanced inversions with proj_path ***************************************)
-
-lemma lift_path_inv_empty (f) (p):
- (𝐞) = ↑[f]p → 𝐞 = p.
-#f * // * [ #n ] #p
-[ <lift_path_d_sn
-| <lift_path_m_sn
-| <lift_path_L_sn
-| <lift_path_A_sn
-| <lift_path_S_sn
-] #H destruct
-qed-.
-
-lemma lift_path_inv_d_sn (f) (p) (q) (k):
- (𝗱k◗q) = ↑[f]p →
- ∃∃r,h. k = f@⧣❨h❩ & q = ↑[⇂*[h]f]r & 𝗱h◗r = p.
-#f * [| * [ #n ] #p ] #q #k
-[ <lift_path_empty
-| <lift_path_d_sn
-| <lift_path_m_sn
-| <lift_path_L_sn
-| <lift_path_A_sn
-| <lift_path_S_sn
-] #H destruct
-/2 width=5 by ex3_2_intro/
-qed-.
-
-lemma lift_path_inv_m_sn (f) (p) (q):
- (𝗺◗q) = ↑[f]p →
- ∃∃r. q = ↑[f]r & 𝗺◗r = p.
-#f * [| * [ #n ] #p ] #q
-[ <lift_path_empty
-| <lift_path_d_sn
-| <lift_path_m_sn
-| <lift_path_L_sn
-| <lift_path_A_sn
-| <lift_path_S_sn
-] #H destruct
-/2 width=3 by ex2_intro/
-qed-.
-
-lemma lift_path_inv_L_sn (f) (p) (q):
- (𝗟◗q) = ↑[f]p →
- ∃∃r. q = ↑[⫯f]r & 𝗟◗r = p.
-#f * [| * [ #n ] #p ] #q
-[ <lift_path_empty
-| <lift_path_d_sn
-| <lift_path_m_sn
-| <lift_path_L_sn
-| <lift_path_A_sn
-| <lift_path_S_sn
-] #H destruct
-/2 width=3 by ex2_intro/
-qed-.
-
-lemma lift_path_inv_A_sn (f) (p) (q):
- (𝗔◗q) = ↑[f]p →
- ∃∃r. q = ↑[f]r & 𝗔◗r = p.
-#f * [| * [ #n ] #p ] #q
-[ <lift_path_empty
-| <lift_path_d_sn
-| <lift_path_m_sn
-| <lift_path_L_sn
-| <lift_path_A_sn
-| <lift_path_S_sn
-] #H destruct
-/2 width=3 by ex2_intro/
-qed-.
-
-lemma lift_path_inv_S_sn (f) (p) (q):
- (𝗦◗q) = ↑[f]p →
- ∃∃r. q = ↑[f]r & 𝗦◗r = p.
-#f * [| * [ #n ] #p ] #q
-[ <lift_path_empty
-| <lift_path_d_sn
-| <lift_path_m_sn
-| <lift_path_L_sn
-| <lift_path_A_sn
-| <lift_path_S_sn
-] #H destruct
-/2 width=3 by ex2_intro/
-qed-.
-
-lemma lift_path_inv_append_sn (q2) (q1) (p) (f):
- q1●q2 = ↑[f]p →
- ∃∃p1,p2. q1 = ↑[f]p1 & q2 = ↑[↑[p1]f]p2 & p1●p2 = p.
-#q2 #q1 elim q1 -q1
-[| * [ #n1 ] #q1 #IH ] #p #f
-[ <list_append_empty_sn #H0 destruct
- /2 width=5 by ex3_2_intro/
-| <list_append_lcons_sn #H0
- elim (lift_path_inv_d_sn … H0) -H0 #r1 #m1 #H1 #H0 #H2 destruct
- elim (IH … H0) -IH -H0 #p1 #p2 #H1 #H2 #H3 destruct
- /2 width=5 by ex3_2_intro/
-| <list_append_lcons_sn #H0
- elim (lift_path_inv_m_sn … H0) -H0 #r1 #H0 #H1 destruct
- elim (IH … H0) -IH -H0 #p1 #p2 #H1 #H2 #H3 destruct
- /2 width=5 by ex3_2_intro/
-| <list_append_lcons_sn #H0
- elim (lift_path_inv_L_sn … H0) -H0 #r1 #H0 #H1 destruct
- elim (IH … H0) -IH -H0 #p1 #p2 #H1 #H2 #H3 destruct
- /2 width=5 by ex3_2_intro/
-| <list_append_lcons_sn #H0
- elim (lift_path_inv_A_sn … H0) -H0 #r1 #H0 #H1 destruct
- elim (IH … H0) -IH -H0 #p1 #p2 #H1 #H2 #H3 destruct
- /2 width=5 by ex3_2_intro/
-| <list_append_lcons_sn #H0
- elim (lift_path_inv_S_sn … H0) -H0 #r1 #H0 #H1 destruct
- elim (IH … H0) -IH -H0 #p1 #p2 #H1 #H2 #H3 destruct
- /2 width=5 by ex3_2_intro/
-]
-qed-.
-
-(* Main inversions with proj_path *******************************************)
-
-theorem lift_path_inj (q:path) (p) (f):
- ↑[f]q = ↑[f]p → q = p.
-#q elim q -q [| * [ #k ] #q #IH ] #p #f
-[ <lift_path_empty #H0
- <(lift_path_inv_empty … H0) -H0 //
-| <lift_path_d_sn #H0
- elim (lift_path_inv_d_sn … H0) -H0 #r #h #H0
- >(tr_pap_inj ???? H0) -k [1,3: // ] #Hr #H0 destruct
-| <lift_path_m_sn #H0
- elim (lift_path_inv_m_sn … H0) -H0 #r #Hr #H0 destruct
-| <lift_path_L_sn #H0
- elim (lift_path_inv_L_sn … H0) -H0 #r #Hr #H0 destruct
-| <lift_path_A_sn #H0
- elim (lift_path_inv_A_sn … H0) -H0 #r #Hr #H0 destruct
-| <lift_path_S_sn #H0
- elim (lift_path_inv_S_sn … H0) -H0 #r #Hr #H0 destruct
-]
-<(IH … Hr) -r -IH //
-qed-.
-
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/prelift_label.ma".
+include "delayed_updating/substitution/lift_rmap.ma".
+include "ground/xoa/ex_3_2.ma".
+
+(* LIFT FOR PATH ************************************************************)
+
+rec definition lift_path (f) (p) on p: path ≝
+match p with
+[ list_empty ⇒ (𝐞)
+| list_lcons l q ⇒ (lift_path f q)◖↑[↑[q]f]l
+].
+
+interpretation
+ "lift (path)"
+ 'UpArrow f l = (lift_path f l).
+
+(* Basic constructions ******************************************************)
+
+lemma lift_path_empty (f):
+ (𝐞) = ↑[f]𝐞.
+// qed.
+
+lemma lift_path_rcons (f) (p) (l):
+ (↑[f]p)◖↑[↑[p]f]l = ↑[f](p◖l).
+// qed.
+
+lemma lift_path_d_dx (f) (p) (k):
+ (↑[f]p)◖𝗱((↑[p]f)@⧣❨k❩) = ↑[f](p◖𝗱k).
+// qed.
+
+lemma lift_path_m_dx (f) (p):
+ (↑[f]p)◖𝗺 = ↑[f](p◖𝗺).
+// qed.
+
+lemma lift_path_L_dx (f) (p):
+ (↑[f]p)◖𝗟 = ↑[f](p◖𝗟).
+// qed.
+
+lemma lift_path_A_dx (f) (p):
+ (↑[f]p)◖𝗔 = ↑[f](p◖𝗔).
+// qed.
+
+lemma lift_path_S_dx (f) (p):
+ (↑[f]p)◖𝗦 = ↑[f](p◖𝗦).
+// qed.
+
+(* Constructions with path_append *******************************************)
+
+lemma lift_path_append (f) (p) (q):
+ (↑[f]p)●(↑[↑[p]f]q) = ↑[f](p●q).
+#f #p #q elim q -q //
+#l #q #IH
+<lift_path_rcons <lift_path_rcons
+<list_append_lcons_sn //
+qed.
+
+(* Constructions with path_lcons ********************************************)
+
+lemma lift_path_lcons (f) (p) (l):
+ (↑[f]l)◗↑[↑[l]f]p = ↑[f](l◗p).
+#f #p #l
+<lift_path_append //
+qed.
+
+lemma lift_path_d_sn (f) (p) (k:pnat):
+ (𝗱(f@⧣❨k❩)◗↑[⇂*[k]f]p) = ↑[f](𝗱k◗p).
+// qed.
+
+lemma lift_path_m_sn (f) (p):
+ (𝗺◗↑[f]p) = ↑[f](𝗺◗p).
+// qed.
+
+lemma lift_path_L_sn (f) (p):
+ (𝗟◗↑[⫯f]p) = ↑[f](𝗟◗p).
+// qed.
+
+lemma lift_path_A_sn (f) (p):
+ (𝗔◗↑[f]p) = ↑[f](𝗔◗p).
+// qed.
+
+lemma lift_path_S_sn (f) (p):
+ (𝗦◗↑[f]p) = ↑[f](𝗦◗p).
+// qed.
+
+(* Basic inversions *********************************************************)
+
+lemma lift_path_inv_empty (f) (p):
+ (𝐞) = ↑[f]p → 𝐞 = p.
+#f * // #p #l
+<lift_path_rcons #H0 destruct
+qed-.
+
+lemma lift_path_inv_rcons (f) (p2) (q1) (l1):
+ q1◖l1 = ↑[f]p2 →
+ ∃∃q2,l2. q1 = ↑[f]q2 & l1 = ↑[↑[q2]f]l2 & q2◖l2 = p2.
+#f * [| #l2 #q2 ] #q1 #l1
+[ <lift_path_empty
+| <lift_path_rcons
+]
+#H0 destruct
+/2 width=5 by ex3_2_intro/
+qed-.
+
+(* Inversions with path_append **********************************************)
+
+lemma lift_path_inv_append_sn (f) (q1) (r1) (p2):
+ q1●r1 = ↑[f]p2 →
+ ∃∃q2,r2. q1 = ↑[f]q2 & r1 = ↑[↑[q2]f]r2 & q2●r2 = p2.
+#f #q1 #r1 elim r1 -r1 [| #l1 #r1 #IH ] #p2
+[ <list_append_empty_sn #H0 destruct
+ /2 width=5 by ex3_2_intro/
+| <list_append_lcons_sn #H0
+ elim (lift_path_inv_rcons … H0) -H0 #x2 #l2 #H0 #H1 #H2 destruct
+ elim (IH … H0) -IH -H0 #q2 #r2 #H1 #H2 #H3 destruct
+ /2 width=5 by ex3_2_intro/
+]
+qed-.
+
+(* Main inversions **********************************************************)
+
+theorem lift_path_inj (f) (p1) (p2):
+ ↑[f]p1 = ↑[f]p2 → p1 = p2.
+#f #p1 elim p1 -p1 [| #l1 #q1 #IH ] #p2
+[ <lift_path_empty #H0
+ <(lift_path_inv_empty … H0) -H0 //
+| <lift_path_rcons #H0
+ elim (lift_path_inv_rcons … H0) -H0 #q2 #l2 #Hq
+ <(IH … Hq) -IH -q2 #Hl #H0 destruct
+ <(prelift_label_inj … Hl) -l2 //
+]
+qed-.
(* *)
(**************************************************************************)
-include "delayed_updating/substitution/lift_gen_eq.ma".
-include "ground/relocation/tr_compose_pap.ma".
-include "ground/relocation/tr_compose_pn.ma".
-include "ground/relocation/tr_compose_tls.ma".
+include "delayed_updating/substitution/lift_rmap_after.ma".
+include "delayed_updating/substitution/prelift_label_after.ma".
(* LIFT FOR PATH ************************************************************)
(* Constructions with tr_after **********************************************)
-lemma lift_path_after (p) (f1) (f2):
- ↑[f2]↑[f1]p = ↑[f2∘f1]p.
-#p elim p -p [| * ] // [ #n ] #p #IH #f1 #f2
-[ <lift_path_d_sn <lift_path_d_sn <lift_path_d_sn //
-| <lift_path_L_sn <lift_path_L_sn <lift_path_L_sn
- >tr_compose_push_bi //
-]
+lemma lift_path_after (g) (f) (p):
+ ↑[g]↑[f]p = ↑[g∘f]p.
+#g #f #p elim p -p //
+#l #p #IH
+<lift_path_rcons <lift_path_rcons <IH -IH //
qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/lift_path.ma".
+include "delayed_updating/substitution/lift_rmap_eq.ma".
+include "delayed_updating/substitution/prelift_label_eq.ma".
+
+(* LIFT FOR PATH ************************************************************)
+
+(* Constructions with path_eq ***********************************************)
+
+lemma lift_path_eq_repl (p):
+ stream_eq_repl … (λf1,f2. ↑[f1]p = ↑[f2]p).
+#p elim p -p //
+#l #p #IH #f1 #f2 #Hf
+<lift_path_rcons <lift_path_rcons
+@eq_f2 (**) (* auto fails *)
+[ /3 width=1 by lift_rmap_eq_repl, prelift_label_eq_repl/
+| @IH -IH //
+]
+qed.
(* *)
(**************************************************************************)
-include "delayed_updating/substitution/lift_gen_eq.ma".
+include "delayed_updating/substitution/lift_path.ma".
include "delayed_updating/syntax/path_head.ma".
-include "delayed_updating/syntax/path_reverse.ma".
include "ground/relocation/xap.ma".
(* LIFT FOR PATH ************************************************************)
(* Constructions with head for path *****************************************)
-lemma lift_path_head (f) (p) (q) (n):
- pᴿ = ↳[n](pᴿ) →
- ↳[↑[q●p]f@❨n❩](↑[↑[q]f]p)ᴿ = (↑[↑[q]f]p)ᴿ.
-#f #p @(list_ind_rcons … p) -p
-[ #q #n #H0
+lemma lift_path_head_closed (f) (p) (q) (n):
+ q = ↳[n]q →
+ ↳[↑[p●q]f@❨n❩]↑[↑[p]f]q = ↑[↑[p]f]q.
+#f #p #q elim q -q
+[ #n #H0
<(eq_inv_path_empty_head … H0) -H0
<path_head_zero //
-| #p #l #IH #q #n @(nat_ind_succ …n) -n [| #m #_ ]
- [ <reverse_rcons <path_head_zero #H0 destruct
- | cases l [ #n ]
- [ <reverse_rcons <path_head_d_sn #H0
+| #l #q #IH #n @(nat_ind_succ …n) -n [| #n #_ ]
+ [ <path_head_zero #H0 destruct
+ | cases l [ #k ]
+ [ <path_head_d_dx #H0
elim (eq_inv_list_lcons_bi ????? H0) -H0 #_ #H0
- <list_append_assoc <lift_rmap_d_dx <lift_path_d_dx <reverse_rcons
- <tr_xap_succ_nap <path_head_d_sn
+ <lift_rmap_d_dx <lift_path_d_dx
+ <tr_xap_succ_nap <path_head_d_dx
<(IH … H0) in ⊢ (???%); -IH -H0 <tr_xap_plus //
- | <reverse_rcons <path_head_m_sn #H0
+ | <path_head_m_dx #H0
elim (eq_inv_list_lcons_bi ????? H0) -H0 #_ #H0
- <list_append_assoc <lift_rmap_m_dx <lift_path_m_dx <reverse_rcons
- <tr_xap_succ_nap <path_head_m_sn
+ <lift_rmap_m_dx <lift_path_m_dx
+ <tr_xap_succ_nap <path_head_m_dx
<(IH … H0) in ⊢ (???%); -IH -H0 //
- | <reverse_rcons <path_head_L_sn #H0
+ | <path_head_L_dx #H0
elim (eq_inv_list_lcons_bi ????? H0) -H0 #_ #H0
- <list_append_assoc <lift_rmap_L_dx <lift_path_L_dx <reverse_rcons
- <tr_xap_succ_nap <path_head_L_sn
+ <lift_rmap_L_dx <lift_path_L_dx
+ <tr_xap_succ_nap <path_head_L_dx
<(IH … H0) in ⊢ (???%); -IH -H0 //
- | <reverse_rcons <path_head_A_sn #H0
+ | <path_head_A_dx #H0
elim (eq_inv_list_lcons_bi ????? H0) -H0 #_ #H0
- <list_append_assoc <lift_rmap_A_dx <lift_path_A_dx <reverse_rcons
- <tr_xap_succ_nap <path_head_A_sn
+ <lift_rmap_A_dx <lift_path_A_dx
+ <tr_xap_succ_nap <path_head_A_dx
<(IH … H0) in ⊢ (???%); -IH -H0 //
- | <reverse_rcons <path_head_S_sn #H0
+ | <path_head_S_dx #H0
elim (eq_inv_list_lcons_bi ????? H0) -H0 #_ #H0
- <list_append_assoc <lift_rmap_S_dx <lift_path_S_dx <reverse_rcons
- <tr_xap_succ_nap <path_head_S_sn
+ <lift_rmap_S_dx <lift_path_S_dx
+ <tr_xap_succ_nap <path_head_S_dx
<(IH … H0) in ⊢ (???%); -IH -H0 //
]
]
(* *)
(**************************************************************************)
-include "delayed_updating/substitution/lift_gen_eq.ma".
-include "ground/relocation/tr_id_pap.ma".
-include "ground/relocation/tr_id_tls.ma".
+include "delayed_updating/substitution/lift_path.ma".
+include "delayed_updating/substitution/lift_rmap_id.ma".
+include "delayed_updating/substitution/prelift_label_id.ma".
(* LIFT FOR PATH ************************************************************)
-(* Constructions with proj_path and tr_id ***********************************)
+(* Constructions with tr_id *************************************************)
lemma lift_path_id (p):
p = ↑[𝐢]p.
#p elim p -p //
-* [ #n ] #p #IH //
-[ <lift_path_d_sn //
-| <lift_path_L_sn //
-]
+#l #p #IH
+<lift_path_rcons //
qed.
(* *)
(**************************************************************************)
-include "delayed_updating/substitution/lift_gen_eq.ma".
+include "delayed_updating/substitution/lift_path.ma".
include "ground/lib/list_length.ma".
(* LIFT FOR PATH ************************************************************)
(* Constructions with list_length *******************************************)
-lemma lift_path_length (p) (f):
+lemma lift_path_length (f) (p):
❘p❘ = ❘↑[f]p❘.
-#p elim p -p // * [ #n ] #p #IH #f
-[ <lift_path_d_sn
-| <lift_path_m_sn
-| <lift_path_L_sn
-| <lift_path_A_sn
-| <lift_path_S_sn
+#f #p elim p -p // * [ #k ] #p #IH
+[ <lift_path_d_dx
+| <lift_path_m_dx
+| <lift_path_L_dx
+| <lift_path_A_dx
+| <lift_path_S_dx
]
>list_length_lcons >list_length_lcons //
qed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "delayed_updating/substitution/lift_gen_eq.ma".
-include "delayed_updating/substitution/prelift_label.ma".
-include "delayed_updating/substitution/prelift_rmap.ma".
-
-(* LIFT FOR PATH ************************************************************)
-
-(* Constructions with prelift_rmap and prelift_path *************************)
-
-lemma lift_path_lcons_prelift (f) (p) (l):
- (↑[f]l)◗↑[↑[l]f]p = ↑[f](l◗p).
-#f #p * [ #n ] //
-qed.
-
-lemma lift_path_rcons_prelift (f) (p) (l):
- (↑[f]p)◖↑[↑[p]f]l = ↑[f](p◖l).
-#f #p * [ #n ] //
-qed.
(* *)
(**************************************************************************)
-include "delayed_updating/substitution/lift_gen_eq.ma".
+include "delayed_updating/substitution/lift_path.ma".
include "delayed_updating/syntax/path_proper.ma".
(* LIFT FOR PATH ************************************************************)
p ϵ 𝐏 → ↑[f]p ϵ 𝐏.
#f *
[ #H0 elim (ppc_inv_empty … H0)
-| * [ #n ] #p #_
- [ <lift_path_d_sn /2 width=3 by ppc_lcons/
- | <lift_path_m_sn /2 width=3 by ppc_lcons/
- | <lift_path_L_sn /2 width=3 by ppc_lcons/
- | <lift_path_A_sn /2 width=3 by ppc_lcons/
- | <lift_path_S_sn /2 width=3 by ppc_lcons/
+| * [ #k ] #p #_
+ [ <lift_path_d_dx
+ | <lift_path_m_dx
+ | <lift_path_L_dx
+ | <lift_path_A_dx
+ | <lift_path_S_dx
]
+ /2 width=3 by ppc_rcons/
]
qed.
(* *)
(**************************************************************************)
-include "delayed_updating/substitution/lift_gen_eq.ma".
+include "delayed_updating/substitution/lift_path.ma".
include "delayed_updating/syntax/path_structure.ma".
(* LIFT FOR PATH ************************************************************)
(* Constructions with structure *********************************************)
-lemma structure_lift_path (p) (f):
+lemma structure_lift_path (f) (p):
⊗p = ⊗↑[f]p.
-#p elim p -p //
-* [ #n ] #p #IH #f //
-[ <lift_path_d_sn <structure_d_sn <structure_d_sn //
-| <lift_path_m_sn <structure_m_sn <structure_m_sn //
-| <lift_path_L_sn <structure_L_sn <structure_L_sn //
+#f #p elim p -p //
+* [ #k ] #p #IH //
+[ <lift_path_d_dx <structure_d_dx <structure_d_dx //
+| <lift_path_m_dx <structure_m_dx <structure_m_dx //
]
qed.
-lemma lift_path_structure (p) (f):
+lemma lift_path_structure (f) (p):
⊗p = ↑[f]⊗p.
-#p elim p -p //
-* [ #n ] #p #IH #f //
+#f #p elim p -p //
+* [ #k ] #p #IH //
qed.
include "delayed_updating/substitution/lift_path_id.ma".
include "ground/relocation/tr_uni_pap.ma".
include "ground/relocation/tr_uni_tls.ma".
+include "ground/arith/nat_pred_succ.ma".
(* LIFT FOR PATH ************************************************************)
(* Constructions with tr_uni ************************************************)
-lemma lift_path_d_sn_uni (p) (m) (n):
- (𝗱(n+m)◗p) = ↑[𝐮❨m❩](𝗱(n)◗p).
-#p #m #n
+lemma lift_path_d_sn_uni (p) (n) (k):
+ (𝗱(k+n)◗p) = ↑[𝐮❨n❩](𝗱k◗p).
+#p #n #k
<lift_path_d_sn <tr_uni_pap >nsucc_pnpred
<tr_tls_succ_uni //
qed.
(* *)
(**************************************************************************)
-include "delayed_updating/substitution/lift_gen.ma".
+include "delayed_updating/substitution/lift_path.ma".
include "delayed_updating/syntax/prototerm.ma".
include "ground/lib/subset_ext.ma".
interpretation
"lift (prototerm)"
- 'UpArrow f t = (subset_ext_f1 ? ? (lift_gen ? proj_path f) t).
+ 'UpArrow f t = (subset_ext_f1 ? ? (lift_path f) t).
(* Basic constructions ******************************************************)
-lemma in_comp_lift_path_term (f) (p) (t):
+lemma in_comp_lift_path_term (f) (t) (p):
p ϵ t → ↑[f]p ϵ ↑[f]t.
/2 width=1 by subset_in_ext_f1_dx/
qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/lift_prototerm_eq.ma".
+include "delayed_updating/substitution/lift_path_after.ma".
+
+(* LIFT FOR PROTOTERM *******************************************************)
+
+(* Constructions with tr_after **********************************************)
+
+lemma lift_term_after (f) (g) (t):
+ ↑[g]↑[f]t ⇔ ↑[g∘f]t.
+#f #g #t @subset_eq_trans
+[
+| @subset_inclusion_ext_f1_compose
+| @subset_equivalence_ext_f1_exteq /2 width=5/
+]
+qed.
(* *)
(**************************************************************************)
+(**) (* reverse include *)
include "ground/lib/subset_ext_equivalence.ma".
-include "delayed_updating/substitution/lift_path_after.ma".
+include "delayed_updating/substitution/lift_path_eq.ma".
include "delayed_updating/substitution/lift_prototerm.ma".
(* LIFT FOR PROTOTERM *******************************************************)
/2 width=1 by subset_equivalence_ext_f1_bi/
qed.
-lemma lift_term_after (f1) (f2) (t):
- ↑[f2]↑[f1]t ⇔ ↑[f2∘f1]t.
-#f1 #f2 #t @subset_eq_trans
-[
-| @subset_inclusion_ext_f1_compose
-| @subset_equivalence_ext_f1_exteq /2 width=5/
-]
-qed.
-
lemma lift_term_grafted_sn (f) (t) (p):
↑[↑[p]f](t⋔p) ⊆ (↑[f]t)⋔(↑[f]p).
#f #t #p #q * #r #Hr #H0 destruct
-@(ex2_intro … Hr) -Hr
-<lift_path_append_sn //
+/2 width=3 by ex2_intro/
qed-.
lemma lift_term_grafted_dx (f) (t) (p):
lemma lift_term_id (t):
t ⇔ ↑[𝐢]t.
-/3 width=2 by lift_term_id_dx, lift_term_id_sn, conj/
+/3 width=2 by lift_term_id_dx, lift_term_id_sn, conj/
qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/prelift_rmap.ma".
+include "delayed_updating/syntax/path.ma".
+
+(* LIFT FOR RELOCATION MAP **************************************************)
+
+rec definition lift_rmap (f) (p) on p: tr_map ≝
+match p with
+[ list_empty ⇒ f
+| list_lcons l q ⇒ ↑[l](lift_rmap f q)
+].
+
+interpretation
+ "lift (relocation map)"
+ 'UpArrow p f = (lift_rmap f p).
+
+(* Basic constructions ******************************************************)
+
+lemma lift_rmap_empty (f):
+ f = ↑[𝐞]f.
+// qed.
+
+lemma lift_rmap_rcons (f) (p) (l):
+ ↑[l]↑[p]f = ↑[p◖l]f.
+// qed.
+
+lemma lift_rmap_d_dx (f) (p) (k:pnat):
+ ⇂*[k](↑[p]f) = ↑[p◖𝗱k]f.
+// qed.
+
+lemma lift_rmap_m_dx (f) (p):
+ ↑[p]f = ↑[p◖𝗺]f.
+// qed.
+
+lemma lift_rmap_L_dx (f) (p):
+ (⫯↑[p]f) = ↑[p◖𝗟]f.
+// qed.
+
+lemma lift_rmap_A_dx (f) (p):
+ ↑[p]f = ↑[p◖𝗔]f.
+// qed.
+
+lemma lift_rmap_S_dx (f) (p):
+ ↑[p]f = ↑[p◖𝗦]f.
+// qed.
+
+(* Constructions with path_append *******************************************)
+
+lemma lift_rmap_append (p) (q) (f):
+ ↑[q]↑[p]f = ↑[p●q]f.
+#p #q elim q -q //
+qed.
+
+(* Constructions with path_lcons ********************************************)
+
+lemma lift_rmap_lcons (f) (p) (l):
+ ↑[p]↑[l]f = ↑[l◗p]f.
+// qed.
+
+lemma lift_rmap_d_sn (f) (p) (k:pnat):
+ ↑[p](⇂*[k]f) = ↑[𝗱k◗p]f.
+// qed.
+
+lemma lift_rmap_m_sn (f) (p):
+ ↑[p]f = ↑[𝗺◗p]f.
+// qed.
+
+lemma lift_rmap_L_sn (f) (p):
+ ↑[p](⫯f) = ↑[𝗟◗p]f.
+// qed.
+
+lemma lift_rmap_A_sn (f) (p):
+ ↑[p]f = ↑[𝗔◗p]f.
+// qed.
+
+lemma lift_rmap_S_sn (f) (p):
+ ↑[p]f = ↑[𝗦◗p]f.
+// qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/prelift_rmap_after.ma".
+include "delayed_updating/substitution/lift_path.ma".
+
+(* LIFT FOR RELOCATION MAP **************************************************)
+
+(* Constructions with tr_after **********************************************)
+
+lemma lift_rmap_after (g) (f) (p:path):
+ ↑[↑[f]p]g∘↑[p]f = ↑[p](g∘f).
+#g #f #p elim p -p //
+#l #p #IH
+<lift_rmap_rcons //
+qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/lift_rmap.ma".
+include "ground/relocation/tr_pn_eq.ma".
+include "ground/lib/stream_tls_plus.ma".
+include "ground/lib/stream_tls_eq.ma".
+include "ground/arith/nat_plus_rplus.ma".
+include "ground/arith/nat_rplus_pplus.ma".
+
+(* LIFT FOR RELOCATION MAP **************************************************)
+
+(* Constructions with lift_eq ***********************************************)
+
+lemma lift_rmap_eq_repl (p):
+ stream_eq_repl … (λf1,f2. ↑[p]f1 ≗ ↑[p]f2).
+#p elim p -p //
+* [ #k ] #p #IH #f1 #f2 #Hf
+[ /3 width=1 by stream_tls_eq_repl/
+| /2 width=1 by/
+| /3 width=1 by tr_push_eq_repl/
+| /2 width=1 by/
+| /2 width=1 by/
+]
+qed.
+
+lemma tls_lift_rmap_d_dx (f) (p) (n) (k):
+ ⇂*[n+k]↑[p]f ≗ ⇂*[n]↑[p◖𝗱k]f.
+#f #p #n #k
+<lift_rmap_d_dx >nrplus_inj_dx >nrplus_inj_sn //
+qed.
(* *)
(**************************************************************************)
-include "delayed_updating/substitution/lift_gen_eq.ma".
+include "delayed_updating/substitution/lift_rmap_eq.ma".
include "delayed_updating/syntax/path_head.ma".
-include "delayed_updating/syntax/path_reverse.ma".
include "ground/lib/stream_eq_eq.ma".
(* LIFT MAP FOR PATH ********************************************************)
(* Constructions with path_head *********************************************)
-lemma tls_plus_lift_rmap_reverse_closed (f) (q) (n) (k):
+lemma tls_plus_lift_rmap_closed (f) (q) (n) (m):
q = ↳[n]q →
- ⇂*[k]f ≗ ⇂*[n+k]↑[qᴿ]f.
+ ⇂*[m]f ≗ ⇂*[n+m]↑[q]f.
#f #q elim q -q
-[ #n #k #Hq
+[ #n #m #Hq
<(eq_inv_path_empty_head … Hq) -n //
| #l #q #IH #n @(nat_ind_succ … n) -n //
- #n #_ #k cases l [ #m ]
- [ <path_head_d_sn #Hq
- elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hp <nrplus_inj_sn
- <reverse_lcons
+ #n #_ #m cases l [ #k ]
+ [ <path_head_d_dx #Hq
+ elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq <nrplus_inj_sn
@(stream_eq_trans … (tls_lift_rmap_d_dx …))
>nrplus_inj_dx >nrplus_inj_sn >nrplus_inj_sn <nplus_plus_comm_23
>nsucc_unfold /2 width=1 by/
- | <path_head_m_sn #Hq
+ | <path_head_m_dx #Hq
elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
- <reverse_lcons <lift_rmap_m_dx /2 width=1 by/
- | <path_head_L_sn #Hq
+ <lift_rmap_m_dx /2 width=1 by/
+ | <path_head_L_dx #Hq
elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
- <reverse_lcons <lift_rmap_L_dx <nplus_succ_sn /2 width=1 by/
- | <path_head_A_sn #Hq
+ <lift_rmap_L_dx <nplus_succ_sn /2 width=1 by/
+ | <path_head_A_dx #Hq
elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
- <reverse_lcons <lift_rmap_A_dx /2 width=2 by/
- | <path_head_S_sn #Hq
+ <lift_rmap_A_dx /2 width=2 by/
+ | <path_head_S_dx #Hq
elim (eq_inv_list_lcons_bi ????? Hq) -Hq #_ #Hq
- <reverse_lcons <lift_rmap_S_dx /2 width=2 by/
+ <lift_rmap_S_dx /2 width=2 by/
]
]
qed-.
lemma tls_lift_rmap_closed (f) (q) (n):
- qᴿ = ↳[n](qᴿ) →
+ q = ↳[n]q →
f ≗ ⇂*[n]↑[q]f.
#f #q #n #H0
->(reverse_reverse q)
-/2 width=1 by tls_plus_lift_rmap_reverse_closed/
+/2 width=1 by tls_plus_lift_rmap_closed/
qed.
(* *)
(**************************************************************************)
-include "delayed_updating/substitution/lift_gen.ma".
-include "ground/relocation/tr_id_tls.ma".
+include "delayed_updating/substitution/lift_rmap.ma".
+include "delayed_updating/substitution/prelift_rmap_id.ma".
(* LIFT FOR RELOCATION MAP **************************************************)
-(* Constructions with proj_rmap and tr_id ***********************************)
+(* Constructions with tr_id *************************************************)
lemma lift_rmap_id (p):
(𝐢) = ↑[p]𝐢.
#p elim p -p //
-* [ #n ] #p #IH //
qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/lift_rmap.ma".
+include "ground/relocation/tr_pap_tls.ma".
+
+(* LIFT FOR RELOCATION MAP **************************************************)
+
+(* Constructions with tr_pap ************************************************)
+
+lemma lift_rmap_pap_d_dx (f) (p) (k) (h):
+ ↑[p]f@⧣❨h+k❩ = ↑[p◖𝗱k]f@⧣❨h❩+↑[p]f@⧣❨k❩.
+// qed.
+++ /dev/null
-(**************************************************************************)
-(* ___ *)
-(* ||M|| *)
-(* ||A|| A project by Andrea Asperti *)
-(* ||T|| *)
-(* ||I|| Developers: *)
-(* ||T|| The HELM team. *)
-(* ||A|| http://helm.cs.unibo.it *)
-(* \ / *)
-(* \ / This file is distributed under the terms of the *)
-(* v GNU General Public License Version 2 *)
-(* *)
-(**************************************************************************)
-
-include "delayed_updating/substitution/lift_gen.ma".
-include "delayed_updating/substitution/prelift_rmap.ma".
-
-(* LIFT FOR RELOCATION MAP **************************************************)
-
-(* Constructions with prelift_rmap ******************************************)
-
-lemma lift_rmap_lcons_prelift (f) (p) (l):
- ↑[p]↑[l]f = ↑[l◗p]f.
-#f #p * [ #n ] //
-qed.
-
-lemma lift_rmap_rcons_prelift (f) (p) (l):
- ↑[l]↑[p]f = ↑[p◖l]f.
-#f #p * [ #n ] //
-qed.
include "delayed_updating/notation/functions/uparrow_2.ma".
include "delayed_updating/syntax/label.ma".
-include "ground/relocation/tr_pap.ma".
+include "ground/relocation/tr_pap_pap.ma".
(* PRELIFT FOR LABEL ********************************************************)
definition prelift_label (f) (l): label ≝
match l with
-[ label_d n ⇒ 𝗱(f@⧣❨n❩)
+[ label_d k ⇒ 𝗱(f@⧣❨k❩)
| label_m ⇒ 𝗺
| label_L ⇒ 𝗟
| label_A ⇒ 𝗔
(* Basic constructions ******************************************************)
-lemma prelift_label_d (f) (n):
- (𝗱(f@⧣❨n❩)) = ↑[f]𝗱n.
+lemma prelift_label_d (f) (k):
+ (𝗱(f@⧣❨k❩)) = ↑[f]𝗱k.
// qed.
lemma prelift_label_m (f):
lemma prelift_label_S (f):
(𝗦) = ↑[f]𝗦.
// qed.
+
+(* Basic inversions *********************************************************)
+
+lemma prelift_label_inv_d_sn (f) (l) (k1):
+ (𝗱k1) = ↑[f]l →
+ ∃∃k2. k1 = f@⧣❨k2❩ & 𝗱k2 = l.
+#f * [ #k ] #k1
+[ <prelift_label_d
+| <prelift_label_m
+| <prelift_label_L
+| <prelift_label_A
+| <prelift_label_S
+] #H0 destruct
+/2 width=3 by ex2_intro/
+qed-.
+
+lemma prelift_label_inv_m_sn (f) (l):
+ (𝗺) = ↑[f]l → 𝗺 = l.
+#f * [ #k ]
+[ <prelift_label_d
+| <prelift_label_m
+| <prelift_label_L
+| <prelift_label_A
+| <prelift_label_S
+] #H0 destruct //
+qed-.
+
+lemma prelift_label_inv_L_sn (f) (l):
+ (𝗟) = ↑[f]l → 𝗟 = l.
+#f * [ #k ]
+[ <prelift_label_d
+| <prelift_label_m
+| <prelift_label_L
+| <prelift_label_A
+| <prelift_label_S
+] #H0 destruct //
+qed-.
+
+lemma prelift_label_inv_A_sn (f) (l):
+ (𝗔) = ↑[f]l → 𝗔 = l.
+#f * [ #k ]
+[ <prelift_label_d
+| <prelift_label_m
+| <prelift_label_L
+| <prelift_label_A
+| <prelift_label_S
+] #H0 destruct //
+qed-.
+
+lemma prelift_label_inv_S_sn (f) (l):
+ (𝗦) = ↑[f]l → 𝗦 = l.
+#f * [ #k ]
+[ <prelift_label_d
+| <prelift_label_m
+| <prelift_label_L
+| <prelift_label_A
+| <prelift_label_S
+] #H0 destruct //
+qed-.
+
+(* Main inversions **********************************************************)
+
+theorem prelift_label_inj (f) (l1) (l2):
+ ↑[f]l1 = ↑[f]l2 → l1 = l2.
+#f * [ #k1 ] #l2 #Hl
+[ elim (prelift_label_inv_d_sn … Hl) -Hl #k2 #Hk #H0 destruct
+ >(tr_pap_inj ???? Hk) -Hk //
+| <(prelift_label_inv_m_sn … Hl) -l2 //
+| <(prelift_label_inv_L_sn … Hl) -l2 //
+| <(prelift_label_inv_A_sn … Hl) -l2 //
+| <(prelift_label_inv_S_sn … Hl) -l2 //
+]
+qed-.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/prelift_label.ma".
+include "ground/relocation/tr_compose_pap.ma".
+
+(* PRELIFT FOR LABEL ********************************************************)
+
+(* Constructions with tr_after **********************************************)
+
+lemma prelift_label_after (g) (f) (l):
+ ↑[g]↑[f]l = ↑[g∘f]l.
+#g #f * [ #k ] //
+qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/prelift_label.ma".
+include "ground/relocation/tr_pap_eq.ma".
+
+(* PRELIFT FOR LABEL ********************************************************)
+
+(* constructions with tr_map_eq *********************************************)
+
+lemma prelift_label_eq_repl (l):
+ stream_eq_repl … (λf1,f2. ↑[f1]l = ↑[f2]l).
+* //
+#k #f1 #f2 #Hf
+<prelift_label_d <prelift_label_d
+/3 width=1 by tr_pap_eq_repl, eq_f/
+qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/prelift_label.ma".
+include "ground/relocation/tr_id_pap.ma".
+
+(* PRELIFT FOR LABEL ********************************************************)
+
+(* Constructions with tr_id *************************************************)
+
+lemma prelift_label_id (l):
+ l = ↑[𝐢]l.
+* [ #k ] //
+qed.
definition prelift_rmap (f) (l): tr_map ≝
match l with
-[ label_d n ⇒ ⇂*[n]f
+[ label_d k ⇒ ⇂*[k]f
| label_m ⇒ f
| label_L ⇒ ⫯f
| label_A ⇒ f
(* Basic constructions ******************************************************)
-lemma prelift_rmap_d (f) (n:pnat):
- ⇂*[n]f = ↑[𝗱n]f.
+lemma prelift_rmap_d (f) (k:pnat):
+ ⇂*[k]f = ↑[𝗱k]f.
// qed.
lemma prelift_rmap_m (f):
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/prelift_rmap.ma".
+include "delayed_updating/substitution/prelift_label.ma".
+include "ground/relocation/tr_compose_pn.ma".
+include "ground/relocation/tr_compose_tls.ma".
+
+(* PRELIFT FOR RELOCATION MAP ***********************************************)
+
+(* Constructions with tr_after **********************************************)
+
+lemma prelift_rmap_after (g) (f) (l):
+ ↑[↑[f]l]g∘↑[l]f = ↑[l](g∘f).
+#g #f * [ #k ] //
+<prelift_rmap_d //
+qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/prelift_rmap.ma".
+include "ground/relocation/tr_pn_eq.ma".
+include "ground/lib/stream_tls_eq.ma".
+
+(* PRELIFT FOR RELOCATION MAP ***********************************************)
+
+(* constructions with tr_map_eq *********************************************)
+
+lemma prelift_rmap_eq_repl (l):
+ stream_eq_repl … (λf1,f2. ↑[l]f1 ≗ ↑[l]f2).
+* //
+qed.
--- /dev/null
+(**************************************************************************)
+(* ___ *)
+(* ||M|| *)
+(* ||A|| A project by Andrea Asperti *)
+(* ||T|| *)
+(* ||I|| Developers: *)
+(* ||T|| The HELM team. *)
+(* ||A|| http://helm.cs.unibo.it *)
+(* \ / *)
+(* \ / This file is distributed under the terms of the *)
+(* v GNU General Public License Version 2 *)
+(* *)
+(**************************************************************************)
+
+include "delayed_updating/substitution/prelift_rmap.ma".
+include "ground/relocation/tr_id_tls.ma".
+
+(* PRELIFT FOR RELOCATION MAP ***********************************************)
+
+(* Constructions with tr_id *************************************************)
+
+lemma prelift_rmap_id (l):
+ (𝐢) = ↑[l]𝐢.
+* [ #k ] //
+qed.