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 "delayed_updating/substitution/lift.ma".
17 include "ground/relocation/tr_uni_compose.ma".
18 include "ground/relocation/tr_compose_compose.ma".
19 include "ground/relocation/tr_compose_eq.ma".
21 include "ground/relocation/tr_pap_eq.ma".
22 include "ground/relocation/tr_pn_eq.ma".
23 include "ground/lib/stream_tls_eq.ma".
25 (* LIFT FOR PATH ***********************************************************)
27 definition lift_exteq (A): relation2 (lift_continuation A) (lift_continuation A) ≝
28 λk1,k2. ∀f1,f2,p. f1 ≗ f2 → k1 f1 p = k2 f2 p.
31 "extensional equivalence (lift continuation)"
32 'RingEq A k1 k2 = (lift_exteq A k1 k2).
34 (* Constructions with lift_exteq ********************************************)
36 lemma lift_eq_repl (A) (p) (k1) (k2):
37 k1 ≗{A} k2 → stream_eq_repl … (λf1,f2. ↑❨k1, f1, p❩ = ↑❨k2, f2, p❩).
38 #A #p elim p -p [| * [ #n ] #q #IH ]
39 #k1 #k2 #Hk #f1 #f2 #Hf
40 [ <lift_empty <lift_empty /2 width=1 by/
41 | <lift_d_sn <lift_d_sn <(tr_pap_eq_repl … Hf)
42 /3 width=3 by stream_tls_eq_repl, compose_repl_fwd_sn/
44 | /3 width=1 by tr_push_eq_repl/
50 (* Advanced constructions ***************************************************)
52 lemma lift_lcons_alt (A) (k) (f) (p) (l): k ≗ k →
53 ↑❨λg,p2. k g (l◗p2), f, p❩ = ↑{A}❨λg,p2. k g ((l◗𝐞)●p2), f, p❩.
55 @lift_eq_repl // #g1 #g2 #p2 #Hg @Hk -Hk // (**) (* auto fail *)
58 lemma lift_append_rcons_sn (A) (k) (f) (p1) (p) (l): k ≗ k →
59 ↑❨λg,p2. k g (p1●l◗p2), f, p❩ = ↑{A}❨λg,p2. k g (p1◖l●p2), f, p❩.
60 #A #k #f #p1 #p #l #Hk
61 @lift_eq_repl // #g1 #g2 #p2 #Hg
62 <list_append_rcons_sn @Hk -Hk // (**) (* auto fail *)
65 (* Advanced constructions with proj_path ************************************)
67 lemma proj_path_proper:
68 proj_path ≗ proj_path.
71 lemma lift_path_eq_repl (p):
72 stream_eq_repl … (λf1,f2. ↑[f1]p = ↑[f2]p).
73 /2 width=1 by lift_eq_repl/ qed.
75 lemma lift_path_append_sn (p) (f) (q):
76 q●↑[f]p = ↑❨(λg,p. proj_path g (q●p)), f, p❩.
77 #p elim p -p // * [ #n ] #p #IH #f #q
78 [ <lift_d_sn <lift_d_sn
79 | <lift_m_sn <lift_m_sn
80 | <lift_L_sn <lift_L_sn
81 | <lift_A_sn <lift_A_sn
82 | <lift_S_sn <lift_S_sn
84 >lift_lcons_alt // >lift_append_rcons_sn //
85 <IH <IH -IH <list_append_rcons_sn //
88 lemma lift_path_lcons (f) (p) (l):
89 l◗↑[f]p = ↑❨(λg,p. proj_path g (l◗p)), f, p❩.
91 >lift_lcons_alt <lift_path_append_sn //
94 lemma lift_path_d_sn (f) (p) (n):
95 (𝗱(f@❨n❩)◗↑[⇂*[n]f]p) = ↑[f](𝗱n◗p).
98 lemma lift_path_m_sn (f) (p):
99 (𝗺◗↑[f]p) = ↑[f](𝗺◗p).
102 lemma lift_path_L_sn (f) (p):
103 (𝗟◗↑[⫯f]p) = ↑[f](𝗟◗p).
106 lemma lift_path_A_sn (f) (p):
107 (𝗔◗↑[f]p) = ↑[f](𝗔◗p).
110 lemma lift_path_S_sn (f) (p):
111 (𝗦◗↑[f]p) = ↑[f](𝗦◗p).
115 (* Advanced constructions with proj_rmap and stream_tls *********************)
117 lemma lift_rmap_tls_d_dx (f) (p) (m) (n):
118 ⇂*[m+n]↑[p]f ≗ ⇂*[m]↑[p◖𝗱n]f.
120 <lift_rmap_d_dx >nrplus_inj_dx
121 /2 width=1 by tr_tls_compose_uni_dx/