1 include "ground/arith/nat_le_plus.ma".
2 include "ground/arith/nat_le_pred.ma".
4 lemma tls_succ_unwind2_rmap_append_closed_Lq_dx (o) (f) (p) (q) (n):
6 ▶[f]p ≗ ⇂*[↑n]▶[f](p●𝗟◗q).
7 /2 width=2 by tls_succ_plus_unwind2_rmap_push_closed/
10 lemma xap_le_unwind2_rmap_append_closed_dx (o) (f) (p) (q) (n):
11 q ϵ 𝐂❨o,n❩ → ∀m. m ≤ n →
12 ▶[f]q@❨m❩ = ▶[f](p●q)@❨m❩.
13 #o #f #p #q #n #Hq elim Hq -q -n
14 [|*: #q #n [ #k #_ ] #_ #IH ] #m #Hm
15 [ <(nle_inv_zero_dx … Hm) -m //
16 | <unwind2_rmap_d_dx <unwind2_rmap_d_dx
17 <tr_compose_xap <tr_compose_xap
18 @IH -IH (**) (* auto too slow *)
19 @nle_trans [| @tr_uni_xap ]
20 /2 width=1 by nle_plus_bi_dx/
21 | <unwind2_rmap_m_dx <unwind2_rmap_m_dx
23 | <unwind2_rmap_L_dx <unwind2_rmap_L_dx
24 elim (nle_inv_succ_dx … Hm) -Hm // * #Hm #H0
25 >H0 -H0 <tr_xap_push <tr_xap_push
27 | <unwind2_rmap_A_dx <unwind2_rmap_A_dx
29 | <unwind2_rmap_S_dx <unwind2_rmap_S_dx
34 lemma nap_unwind2_rmap_append_closed_Lq_dx (o) (f) (p) (q) (n):
36 ▶[f](𝗟◗q)@§❨n❩ = ▶[f](p●𝗟◗q)@§❨n❩.
38 lapply (pcc_L_sn … Hq) -Hq #Hq
39 lapply (xap_le_unwind2_rmap_append_closed_dx o f p … Hq (↑n) ?) -Hq //
40 <tr_xap_succ_nap <tr_xap_succ_nap #Hq
41 /2 width=1 by eq_inv_nsucc_bi/
44 lemma nap_unwind2_rmap_push_closed_depth (o) (f) (q) (n):
47 #o #f #q #n #Hq elim Hq -q -n
48 [|*: #q #n [ #k #_ ] #_ #IH ] //
49 <unwind2_rmap_d_dx <tr_compose_nap //
52 lemma nap_unwind2_rmap_append_closed_Lq_dx_depth (o) (f) (p) (q) (n):
54 ♭q = ▶[f](p●𝗟◗q)@§❨n❩.
56 <nap_unwind2_rmap_append_closed_Lq_dx //
57 /2 width=2 by nap_unwind2_rmap_push_closed_depth/
60 lemma xap_unwind2_rmap_append_closed_true_dx_depth (f) (p) (q) (n):
61 q ϵ 𝐂❨Ⓣ,n❩ → ♭q = ▶[f](p●q)@❨n❩.
62 #f #p #q #n #Hq elim Hq -q -n //
64 <unwind2_rmap_d_dx <tr_compose_xap
65 >Ho // <tr_uni_xap_succ <Ho //
68 lemma tls_plus_unwind2_rmap_closed_true (f) (q) (n):
70 ∀m. ⇂*[m]f ≗ ⇂*[m+n]▶[f]q.
71 #f #q #n #Hq elim Hq -q -n //
72 #q #n #k #Ho #_ #IH #m
74 @(stream_eq_trans … (tls_unwind2_rmap_d_dx …))
75 >nrplus_inj_dx >nrplus_inj_sn >nsucc_unfold
79 lemma tls_unwind2_rmap_append_closed_true_dx (f) (p) (q) (n):
81 ▶[f]p ≗ ⇂*[n]▶[f](p●q).
82 /2 width=1 by tls_plus_unwind2_rmap_closed_true/
85 lemma nap_plus_unwind2_rmap_append_closed_Lq_dx_depth (o) (f) (p) (q) (m) (n):
87 ▶[f]p@❨m❩+♭q = ▶[f](p●𝗟◗q)@§❨m+n❩.
90 [ <(tr_xap_eq_repl … (tls_succ_unwind2_rmap_append_closed_Lq_dx …)) //
91 | /2 width=2 by nap_unwind2_rmap_append_closed_Lq_dx_depth/
95 lemma nap_plus_unwind2_rmap_append_closed_bLq_dx_depth (o) (f) (p) (b) (q) (m) (n):
96 b ϵ 𝐂❨Ⓣ,m❩ → q ϵ 𝐂❨o,n❩ →
97 ♭b+♭q = ▶[f](p●b●𝗟◗q)@§❨m+n❩.
98 #o #f #p #b #q #m #n #Hb #Hq
99 >(xap_unwind2_rmap_append_closed_true_dx_depth f p … Hb) -Hb
100 >(nap_plus_unwind2_rmap_append_closed_Lq_dx_depth … Hq) -Hq //
103 lemma tls_succ_plus_unwind2_rmap_append_closed_bLq_dx (o) (f) (p) (b) (q) (m) (n):
104 b ϵ 𝐂❨Ⓣ,m❩ → q ϵ 𝐂❨o,n❩ →
105 ▶[f]p ≗ ⇂*[↑(m+n)]▶[f](p●b●𝗟◗q).
106 #o #f #p #b #q #m #n #Hb #Hq
107 >nplus_succ_dx <stream_tls_plus >list_append_assoc
108 @(stream_eq_trans … (tls_unwind2_rmap_append_closed_true_dx … Hb)) -Hb
109 /3 width=2 by stream_tls_eq_repl, tls_succ_unwind2_rmap_append_closed_Lq_dx/