]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/etc/lift/lift_eq.etc
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / etc / lift / lift_eq.etc
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.ma".
16 (*
17 include "ground/relocation/tr_uni_compose.ma".
18 include "ground/relocation/tr_compose_compose.ma".
19 include "ground/relocation/tr_compose_eq.ma".
20 *)
21 include "ground/relocation/tr_pap_eq.ma".
22 include "ground/relocation/tr_pn_eq.ma".
23 include "ground/lib/stream_tls_eq.ma".
24
25 (* LIFT FOR PATH ***********************************************************)
26
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.
29
30 interpretation
31   "extensional equivalence (lift continuation)"
32   'RingEq A k1 k2 = (lift_exteq A k1 k2).
33
34 (* Constructions with lift_exteq ********************************************)
35
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/
43 | /3 width=1 by/
44 | /3 width=1 by tr_push_eq_repl/
45 | /3 width=1 by/
46 | /3 width=1 by/
47 ]
48 qed-.
49
50 (* Advanced constructions ***************************************************)
51
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❩.
54 #A #k #f #p #l #Hk
55 @lift_eq_repl // #g1 #g2 #p2 #Hg @Hk -Hk // (**) (* auto fail *)
56 qed.
57
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 *)
63 qed.
64
65 (* Advanced constructions with proj_path ************************************)
66
67 lemma proj_path_proper:
68       proj_path ≗ proj_path.
69 // qed.
70
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.
74
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
83
84 >lift_lcons_alt // >lift_append_rcons_sn //
85 <IH <IH -IH <list_append_rcons_sn //
86 qed.
87
88 lemma lift_path_lcons (f) (p) (l):
89       l◗↑[f]p = ↑❨(λg,p. proj_path g (l◗p)), f, p❩.
90 #f #p #l
91 >lift_lcons_alt <lift_path_append_sn //
92 qed.
93
94 lemma lift_path_d_sn (f) (p) (n):
95       (𝗱(f@❨n❩)◗↑[⇂*[n]f]p) = ↑[f](𝗱n◗p).
96 // qed.
97
98 lemma lift_path_m_sn (f) (p):
99       (𝗺◗↑[f]p) = ↑[f](𝗺◗p).
100 // qed.
101
102 lemma lift_path_L_sn (f) (p):
103       (𝗟◗↑[⫯f]p) = ↑[f](𝗟◗p).
104 // qed.
105
106 lemma lift_path_A_sn (f) (p):
107       (𝗔◗↑[f]p) = ↑[f](𝗔◗p).
108 // qed.
109
110 lemma lift_path_S_sn (f) (p):
111       (𝗦◗↑[f]p) = ↑[f](𝗦◗p).
112 // qed.
113 (* COMMENT 
114
115 (* Advanced constructions with proj_rmap and stream_tls *********************)
116
117 lemma lift_rmap_tls_d_dx (f) (p) (m) (n):
118       ⇂*[m+n]↑[p]f ≗ ⇂*[m]↑[p◖𝗱n]f.
119 #f #p #m #n
120 <lift_rmap_d_dx >nrplus_inj_dx
121 /2 width=1 by tr_tls_compose_uni_dx/
122 qed.
123 *)