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 ************************************************************)
#f #p <lift_path_append //
qed.
-(* Advanced inversions ******************************************************)
+(* 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.
/2 width=3 by ex2_intro/
qed-.
-lemma lift_path_inv_append_dx (q2) (q1) (p) (f):
+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
[ <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 #_ #_ #H0 #_ -IH
- elim (eq_inv_list_empty_append … H0) -H0 #_ #H0 destruct
- elim Hq2 -Hq2 //
- | elim (lift_path_inv_m_sn … H)
- | elim (lift_path_inv_L_sn … H) -H #r1 #s1 #Hr1 #Hs1 #H0 destruct
- elim (IH … Hs1) -IH -Hs1 // -Hq2 #p1 #p2 #H1 #H2 #H3 destruct
- @(ex3_2_intro … (r1●𝗟◗p1)) //
- <structure_append <Hr1 -Hr1 //
- | elim (lift_path_inv_A_sn … H) -H #r1 #s1 #Hr1 #Hs1 #H0 destruct
- elim (IH … Hs1) -IH -Hs1 // -Hq2 #p1 #p2 #H1 #H2 #H3 destruct
- @(ex3_2_intro … (r1●𝗔◗p1)) //
- <structure_append <Hr1 -Hr1 //
- | elim (lift_path_inv_S_sn … H) -H #r1 #s1 #Hr1 #Hs1 #H0 destruct
- elim (IH … Hs1) -IH -Hs1 // -Hq2 #p1 #p2 #H1 #H2 #H3 destruct
- @(ex3_2_intro … (r1●𝗦◗p1)) //
- <structure_append <Hr1 -Hr1 //
- ]
+ 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 **********************************************************)
+(* Main inversions with proj_path *******************************************)
theorem lift_path_inj (q:path) (p) (f):
↑[f]q = ↑[f]p → q = p.
<(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) -h [1,3: // ] #Hr #H0 destruct
+ >(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
<(IH … Hr) -r -IH //
qed-.
-(* COMMENT
-
-(* Advanced constructions with proj_rmap and stream_tls *********************)
-
-lemma lift_rmap_tls_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
-/2 width=1 by tr_tls_compose_uni_dx/
-qed.
-
-*)