--- /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 "ground/lib/stream_hdtl.ma".
+include "ground/lib/stream_eq.ma".
+
+(* HEAD AND TAIL FOR STREAMS ************************************************)
+
+(* Constructions with stream_eq *********************************************)
+
+lemma stream_hd_eq_repl (A):
+ stream_eq_repl A (λt1,t2. ⇃t1 = ⇃t2).
+#A * #a1 #t1 * #a2 #t2 #H
+elim (stream_eq_inv_cons_bi … H) -H
+/2 width=7 by/
+qed.
+
+lemma stream_tl_eq_repl (A):
+ stream_eq_repl A (λt1,t2. ⇂t1 ≗ ⇂t2).
+#A * #a1 #t1 * #a2 #t2 #H
+elim (stream_eq_inv_cons_bi … H) -H
+/2 width=7 by/
+qed.
(* *)
(**************************************************************************)
-include "ground/lib/stream_eq.ma".
include "ground/lib/stream_tls.ma".
+include "ground/lib/stream_hdtl_eq.ma".
(* ITERATED TAIL FOR STREAMS ************************************************)
lemma stream_tls_eq_repl (A) (n):
stream_eq_repl A (λt1,t2. ⇂*[n] t1 ≗ ⇂*[n] t2).
#A #n @(nat_ind_succ … n) -n //
-#n #IH * #n1 #t1 * #n2 #t2 #H
-elim (stream_eq_inv_cons_bi … H) /2 width=7 by/
+#n #IH /3 width=1 by stream_tl_eq_repl/
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 "ground/relocation/tr_compose.ma".
+include "ground/relocation/tr_pap_eq.ma".
+include "ground/lib/stream_tls_eq.ma".
+
+(* COMPOSITION FOR TOTAL RELOCATION MAPS ************************************)
+
+(* Constructions with stream_eq *********************************************)
+
+corec lemma tr_compose_eq_repl (f2) (g2):
+ f2 ≗ g2 → stream_eq_repl … (λf1,g1. f2∘f1 ≗ g2∘g1).
+#Hfg2 * #p1 #f1 * #q1 #g1 #H
+cases (stream_eq_inv_cons_bi … H) -H [|*: // ] * #Hfg1 -q1
+cases tr_compose_unfold cases tr_compose_unfold
+/5 width=1 by tr_pap_eq_repl, stream_tls_eq_repl, stream_eq_cons/
+qed.
(* Main constructions with stream_eq ****************************************)
-(* Note: a better statement would be: tr_eq_repl … (λf1,f2. f1@❨i❩ = f2@❨i❩) *)
(*** apply_eq_repl *)
-theorem apply_eq_repl (i):
- ∀f1,f2. f1 ≗ f2 → f1@❨i❩ = f2@❨i❩.
+theorem tr_pap_eq_repl (i):
+ stream_eq_repl … (λf1,f2. f1@❨i❩ = f2@❨i❩).
#i elim i -i [2: #i #IH ] * #p1 #f1 * #p2 #f2 #H
elim (stream_eq_inv_cons_bi … H) -H [1,8: |*: // ] #Hp #Hf //
<tr_pap_succ <tr_pap_succ /3 width=1 by eq_f2/
--- /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 "ground/relocation/tr_eq.ma".
+include "ground/relocation/tr_pn.ma".
+
+(* PUSH AND NEXT FOR TOTAL RELOCATION MAPS **********************************)
+
+(* Constructions with stream_eq *********************************************)
+
+lemma tr_push_eq_bi:
+ stream_eq_repl … (λf1,f2. ⫯f1 ≗ ⫯f2).
+/2 width=1 by stream_eq_cons/ qed.
+
+lemma tr_next_eq_repl:
+ stream_eq_repl … (λf1,f2. ↑f1 ≗ ↑f2).
+* #p1 #f1 * #p2 #f2 #H
+elim (stream_eq_inv_cons_bi … H) -H [|*: // ]
+/2 width=1 by stream_eq_cons/
+qed.
[ { "total relocation" * } {
[ "tr_uni ( 𝐮❨?❩ )" * ]
[ "tr_id ( 𝐢 ) " "tr_id_pushs" "tr_id_pap" * ]
- [ "tr_compose ( ?∘? )" "tr_compose_tls" "tr_compose_pn" "tr_compose_pap" "tr_compose_compose" * ]
+ [ "tr_compose ( ?∘? )" "tr_compose_eq" "tr_compose_tls" "tr_compose_pn" "tr_compose_pap" "tr_compose_compose" * ]
[ "tr_pap ( ?@❨?❩ )" "tr_pap_eq" "tr_pap_tls" "tr_pap_pat" "tr_pap_pn" "tr_pap_pushs" "tr_pap_pap" * ]
[ "tr_pushs ( ⫯*[?]? )" * ]
- [ "tr_pn ( ⫯? ) ( ↑? )" "tr_pn_hdtl" "tr_pn_tls" * ]
+ [ "tr_pn ( ⫯? ) ( ↑? )" "tr_pn_eq" "tr_pn_hdtl" "tr_pn_tls" * ]
[ "tr_map ( 𝐭❨?❩ )" "tr_eq" "tr_nexts" "tr_pat" "tr_ist" * ]
}
]
[ { "extensions to the library" * } {
[ { "streams" * } {
[ "stream_tls ( ⇂*{?}[?]? )" "stream_tls_eq" "stream_tls_plus" * ]
- [ "stream_hdtl ( ⇃{?}? ) ( ⇂{?}? )" * ]
+ [ "stream_hdtl ( ⇃{?}? ) ( ⇂{?}? )" "stream_hdtl_eq" * ]
[ "stream_eq ( ? ≗{?} ? )" "stream_eq_eq" * ]
[ "stream ( ? ⨮{?} ? )" * ]
}