+++ /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 "delayed_updating/unwind1/unwind.ma".
-include "delayed_updating/substitution/fsubst.ma".
-include "delayed_updating/syntax/prototerm_constructors.ma".
-include "delayed_updating/syntax/prototerm_equivalence.ma".
-include "delayed_updating/syntax/path_structure.ma".
-include "delayed_updating/syntax/path_balanced.ma".
-include "delayed_updating/syntax/path_depth.ma".
-include "delayed_updating/notation/relations/black_rightarrow_df_4.ma".
-include "ground/xoa/ex_1_2.ma".
-include "ground/xoa/and_4.ma".
-
-(* DELAYED FOCUSED REDUCTION ************************************************)
-
-definition dfr (p) (q): relation2 prototerm prototerm ≝
- λt1,t2. ∃∃b,n.
- let r ≝ p●𝗔◗b●𝗟◗q in
- ∧∧ (⊗b ϵ 𝐁 ∧ 𝟎 = ❘b❘) & ↑❘q❘ = (▼[r]𝐢)@❨n❩ & r◖𝗱n ϵ t1 &
- t1[⋔r←𝛗(n+❘b❘).(t1⋔(p◖𝗦))] ⇔ t2
-.
-
-interpretation
- "focused balanced reduction with delayed updating (prototerm)"
- 'BlackRightArrowDF t1 p q t2 = (dfr p q t1 t2).
+++ /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 "delayed_updating/reduction/dfr.ma".
-include "delayed_updating/reduction/ifr.ma".
-include "delayed_updating/unwind1/unwind_fsubst.ma".
-include "delayed_updating/unwind1/unwind_constructors.ma".
-include "delayed_updating/unwind1/unwind_preterm_eq.ma".
-include "delayed_updating/unwind1/unwind_structure_depth.ma".
-include "delayed_updating/unwind1/unwind_depth.ma".
-include "delayed_updating/substitution/fsubst_eq.ma".
-include "delayed_updating/substitution/lift_prototerm_eq.ma".
-include "delayed_updating/syntax/prototerm_proper_constructors.ma".
-include "delayed_updating/syntax/path_structure_depth.ma".
-include "ground/relocation/tr_uni_compose.ma".
-include "ground/relocation/tr_pap_pushs.ma".
-
-(* DELAYED FOCUSED REDUCTION ************************************************)
-
-(* COMMENT
-axiom pippo (b) (q) (n):
- ↑❘q❘ = (↑[q]𝐢)@❨n❩ →
- ↑❘q❘+❘b❘= (↑[b●𝗟◗q]𝐢)@❨n+❘b❘❩.
-
-lemma unwind_rmap_tls_eq_id (p) (n):
- ❘p❘ = ↑[p]𝐢@❨n❩ →
- (𝐢) ≗ ⇂*[n]↑[p]𝐢.
-#p @(list_ind_rcons … p) -p
-[ #n <depth_empty #H destruct
-| #p * [ #m ] #IH #n
- [ <depth_d_dx <unwind_rmap_pap_d_dx #H0
- @(stream_eq_trans … (unwind_rmap_tls_d_dx …))
- @(stream_eq_trans … (IH …)) -IH //
- | /2 width=1 by/
- | <depth_L_dx <unwind_rmap_L_dx
- cases n -n [| #n ] #H0
- [
- |
- ]
- | /2 width=1 by/
- | /2 width=1 by/
- ]
-]
-
-
-(* (↑❘q❘+❘b❘=↑[b●𝗟◗q]𝐢@❨n+❘b❘❩ *)
-(* [↑[p]𝐢@❨n❩]⫯*[❘p❘]f∘⇂*[n]↑[p]𝐢) *)
-lemma unwind_rmap_tls_eq (f) (p) (n):
- ❘p❘ = ↑[p]𝐢@❨n❩ →
- f ≗ ⇂*[n]↑[p]f.
-#f #p #n #Hp
-@(stream_eq_canc_dx … (stream_tls_eq_repl …))
-[| @unwind_rmap_decompose | skip ]
-<tr_compose_tls <Hp
-
-@(stream_eq_canc_dx) … (unwind_rmap_decompose …))
-
-*)
-lemma dfr_unwind_id_bi (p) (q) (t1) (t2): t1 ϵ 𝐓 →
- t1 ➡𝐝𝐟[p,q] t2 → ▼[𝐢]t1 ➡𝐟[⊗p,⊗q] ▼[𝐢]t2.
-#p #q #t1 #t2 #H0t1
-* #b #n * #Hb #Hn #Ht1 #Ht2
-@(ex1_2_intro … (⊗b) (↑❘⊗q❘)) @and4_intro
-[ //
-| //
-| lapply (in_comp_unwind_bi (𝐢) … Ht1) -Ht1 -H0t1 -Hb -Ht2
- <unwind_path_d_empty_dx <depth_structure //
-| lapply (unwind_term_eq_repl_dx (𝐢) … Ht2) -Ht2 #Ht2
- @(subset_eq_trans … Ht2) -t2
- @(subset_eq_trans … (unwind_fsubst …))
- [ (*<unwind_rmap_append <unwind_rmap_A_sn <unwind_rmap_append <unwind_rmap_L_sn *)
- <structure_append <structure_A_sn <structure_append <structure_L_sn
- <depth_append <depth_L_sn <depth_structure <depth_structure
- @fsubst_eq_repl [ // ]
- @(subset_eq_trans … (unwind_iref …))
-
- elim Hb -Hb #Hb #H0 <H0 -H0 <nrplus_zero_dx <nplus_zero_dx <Hn
- @(subset_eq_canc_sn … (lift_term_eq_repl_dx …))
- [ @unwind_grafted_S /2 width=2 by ex_intro/ | skip ]
-
-(*
- @(subset_eq_canc_sn … (unwind_term_eq_repl_dx …))
- [ @unwind_grafted_S /2 width=2 by ex_intro/ | skip ]
-
- @(subset_eq_trans … (unwind_term_after …))
- @(subset_eq_canc_dx … (unwind_term_after …))
- @unwind_term_eq_repl_sn -t1
- @(stream_eq_trans … (tr_compose_uni_dx …))
- lapply (Hn (𝐢)) -Hn >tr_id_unfold #Hn
- lapply (pippo … b … Hn) -Hn #Hn
- @tr_compose_eq_repl
- [ <unwind_rmap_pap_le //
- <Hn <nrplus_inj_sn //
- |
- ]
-*)
- | //
- | /2 width=2 by ex_intro/
- | //
- ]
-]
-
-(*
-Hn : ↑❘q❘ = ↑[p●𝗔◗b●𝗟◗q]𝐢@❨n❩
----------------------------
-↑[𝐮❨↑❘q❘+❘b❘❩] ↑[↑[p]𝐢] t ⇔ ↑[𝐮❨↑[p●𝗔◗b●𝗟◗q]𝐢@❨n+❘b❘❩❩] t
-*)
+++ /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 "delayed_updating/unwind1/unwind_prototerm.ma".
-include "delayed_updating/substitution/fsubst.ma".
-include "delayed_updating/substitution/lift_prototerm.ma".
-include "delayed_updating/syntax/prototerm_equivalence.ma".
-include "delayed_updating/syntax/path_depth.ma".
-include "delayed_updating/syntax/path_structure.ma".
-include "delayed_updating/syntax/path_balanced.ma".
-include "delayed_updating/notation/relations/black_rightarrow_f_4.ma".
-include "ground/xoa/ex_1_2.ma".
-include "ground/xoa/and_4.ma".
-
-(* IMMEDIATE FOCUSED REDUCTION ************************************************)
-
-definition ifr (p) (q): relation2 prototerm prototerm ≝
- λt1,t2. ∃∃b,n.
- let r ≝ p●𝗔◗b●𝗟◗q in
- ∧∧ (⊗b ϵ 𝐁 ∧ 𝟎 = ❘b❘) & ↑❘q❘ = (▼[r]𝐢)@❨n❩ & r◖𝗱n ϵ t1 &
- t1[⋔r←↑[𝐮❨❘b●𝗟◗q❘❩](t1⋔(p◖𝗦))] ⇔ t2
-.
-
-interpretation
- "focused balanced reduction with immediate updating (prototerm)"
- 'BlackRightArrowF t1 p q t2 = (ifr p q t1 t2).
h, k : reference index by depth
l : label
m, n : natural number
+ o : option
p, q, r, s: path
t, u, v, w: term
+++ /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 *)
-(* *)
-(**************************************************************************)
-
-(* NOTATION FOR DELAYED UPDATING ********************************************)
-
-notation "hvbox( 𝐂❨ break term 46 n ❩ )"
- non associative with precedence 70
- for @{ 'ClassC $n }.
--- /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 *)
+(* *)
+(**************************************************************************)
+
+(* NOTATION FOR DELAYED UPDATING ********************************************)
+
+notation "hvbox( 𝐂❨ break term 46 b, break term 46 n ❩ )"
+ non associative with precedence 70
+ for @{ 'ClassC $b $n }.
definition dfr (r): relation2 prototerm prototerm ≝
λt1,t2.
∃∃p,q,n. p●𝗔◗𝗟◗q = r &
- q ϵ 𝐂❨n❩ & r◖𝗱↑n ϵ t1 &
+ q ϵ 𝐂❨Ⓕ,n❩ & r◖𝗱↑n ϵ t1 &
t1[⋔r←𝛕↑n.(t1⋔(p◖𝗦))] ⇔ t2
.
@(stream_eq_trans … (tr_compose_uni_dx_pap …)) <tr_pap_succ_nap
@tr_compose_eq_repl
[ <unwind2_rmap_append_closed_Lq_dx_nap_depth //
- | /2 width=1 by tls_succ_unwind2_rmap_append_closed_Lq_dx/
+ | /2 width=2 by tls_succ_unwind2_rmap_append_closed_Lq_dx/
]
(* Note: crux of the proof ends *)
| //
(* *)
(**************************************************************************)
-include "delayed_updating/reduction/dfr.ma".
-
include "delayed_updating/substitution/fsubst_lift.ma".
include "delayed_updating/substitution/fsubst_eq.ma".
include "delayed_updating/substitution/lift_constructors.ma".
include "delayed_updating/substitution/lift_path_closed.ma".
include "delayed_updating/substitution/lift_rmap_closed.ma".
+(**) (* reverse include *)
+include "delayed_updating/reduction/dfr.ma".
+
(* DELAYED FOCUSED REDUCTION ************************************************)
(* Constructions with lift **************************************************)
@(subset_eq_canc_sn … (lift_term_grafted_S …))
@lift_term_eq_repl_sn
(* Note: crux of the proof begins *)
- /2 width=1 by tls_succ_lift_rmap_append_L_closed_dx/
+ /2 width=2 by tls_succ_lift_rmap_append_L_closed_dx/
(* Note: crux of the proof ends *)
]
qed.
definition ifr (r): relation2 prototerm prototerm ≝
λt1,t2.
∃∃p,q,n. p●𝗔◗𝗟◗q = r &
- q ϵ 𝐂❨n❩ & r◖𝗱↑n ϵ t1 &
+ q ϵ 𝐂❨Ⓕ,n❩ & r◖𝗱↑n ϵ t1 &
t1[⋔r←↑[𝐮❨↑n❩](t1⋔(p◖𝗦))] ⇔ t2
.
(* Note: crux of the proof begins *)
@(stream_eq_trans … (tr_compose_uni_dx_pap …)) <tr_pap_succ_nap
@tr_compose_eq_repl // >nsucc_unfold
- /2 width=1 by tls_succ_lift_rmap_append_L_closed_dx/
+ /2 width=2 by tls_succ_lift_rmap_append_L_closed_dx/
(* Note: crux of the proof ends *)
]
qed.
@(stream_eq_trans … (tr_compose_uni_dx_pap …)) <tr_pap_succ_nap
@tr_compose_eq_repl
[ <unwind2_rmap_append_closed_Lq_dx_nap_depth //
- | /2 width=1 by tls_succ_unwind2_rmap_append_closed_Lq_dx/
+ | /2 width=2 by tls_succ_unwind2_rmap_append_closed_Lq_dx/
]
(* Note: crux of the proof ends *)
| //
(* Constructions with pcc ***************************************************)
-lemma lift_path_closed (f) (q) (n):
- q ϵ 𝐂❨n❩ → ↑[f]q ϵ 𝐂❨↑[q]f@❨n❩❩.
-#f #q #n #Hq elim Hq -Hq //
-#q #n [ #k ] #_ #IH
-/2 width=1 by pcc_d_dx, pcc_m_dx, pcc_L_dx, pcc_A_dx, pcc_S_dx/
+lemma lift_path_closed (o) (f) (q) (n):
+ q ϵ 𝐂❨o,n❩ → ↑[f]q ϵ 𝐂❨o,↑[q]f@❨n❩❩.
+#o #f #q #n #H0 elim H0 -q -n //
+#q #n [ #k #Ho ] #_ #IH
+/2 width=1 by pcc_m_dx, pcc_L_dx, pcc_A_dx, pcc_S_dx/
+/4 width=1 by pcc_d_dx, tr_xap_pos/
qed.
-lemma lift_path_rmap_closed (f) (p) (q) (n):
- q ϵ 𝐂❨n❩ → ↑[↑[p]f]q ϵ 𝐂❨↑[p●q]f@❨n❩❩.
+lemma lift_path_rmap_closed (o) (f) (p) (q) (n):
+ q ϵ 𝐂❨o,n❩ → ↑[↑[p]f]q ϵ 𝐂❨o,↑[p●q]f@❨n❩❩.
/2 width=1 by lift_path_closed/
qed.
-lemma lift_path_rmap_closed_L (f) (p) (q) (n):
- q ϵ 𝐂❨n❩ → ↑[↑[p◖𝗟]f]q ϵ 𝐂❨↑[p●𝗟◗q]f@§❨n❩❩.
-#f #p #q #n #Hq
-lapply (lift_path_closed (↑[p◖𝗟]f) … Hq) #Hq0
+lemma lift_path_rmap_closed_L (o) (f) (p) (q) (n):
+ q ϵ 𝐂❨o,n❩ → ↑[↑[p◖𝗟]f]q ϵ 𝐂❨o,↑[p●𝗟◗q]f@§❨n❩❩.
+#o #f #p #q #n #Hq
+lapply (lift_path_closed … (↑[p◖𝗟]f) … Hq) #Hq0
lapply (pcc_L_sn … Hq) -Hq #Hq1
-lapply (lift_path_rmap_closed f p … Hq1) -Hq1
+lapply (lift_path_rmap_closed … f p … Hq1) -Hq1
<lift_path_L_sn >lift_rmap_L_dx #Hq1
elim (pcc_inv_L_sn … Hq1 Hq0) -Hq1 #H0 #_
<H0 in Hq0; -H0 //
(* Destructions with cpp ****************************************************)
-lemma tls_plus_lift_rmap_closed (f) (q) (n):
- q ϵ 𝐂❨n❩ →
+lemma tls_plus_lift_rmap_closed (o) (f) (q) (n):
+ q ϵ 𝐂❨o,n❩ →
∀m. ⇂*[m]f ≗ ⇂*[m+n]↑[q]f.
-#f #q #n #Hq elim Hq -q -n //
+#o #f #q #n #Hq elim Hq -q -n //
#q #n #_ #IH #m
<nplus_succ_dx <stream_tls_swap //
qed-.
-lemma tls_lift_rmap_closed (f) (q) (n):
- q ϵ 𝐂❨n❩ →
+lemma tls_lift_rmap_closed (o) (f) (q) (n):
+ q ϵ 𝐂❨o,n❩ →
f ≗ ⇂*[n]↑[q]f.
-#f #q #n #H0
-/2 width=1 by tls_plus_lift_rmap_closed/
+#o #f #q #n #H0
+/2 width=2 by tls_plus_lift_rmap_closed/
qed-.
-lemma tls_succ_lift_rmap_append_L_closed_dx (f) (p) (q) (n):
- q ϵ 𝐂❨n❩ →
+lemma tls_succ_lift_rmap_append_L_closed_dx (o) (f) (p) (q) (n):
+ q ϵ 𝐂❨o,n❩ →
↑[p]f ≗ ⇂*[↑n]↑[p●𝗟◗q]f.
-#f #p #q #n #Hq
-/3 width=1 by tls_lift_rmap_closed, pcc_L_sn/
+#o #f #p #q #n #Hq
+/3 width=2 by tls_lift_rmap_closed, pcc_L_sn/
qed-.
(**************************************************************************)
include "delayed_updating/syntax/path.ma".
-include "delayed_updating/notation/functions/class_c_1.ma".
+include "delayed_updating/notation/functions/class_c_2.ma".
include "ground/arith/nat_plus.ma".
include "ground/arith/nat_pred_succ.ma".
include "ground/lib/subset.ma".
+include "ground/lib/bool_and.ma".
include "ground/generated/insert_eq_1.ma".
(* CLOSED CONDITION FOR PATH ************************************************)
-inductive pcc: relation2 nat path ≝
+inductive pcc (o): relation2 nat path ≝
| pcc_empty:
- pcc (𝟎) (𝐞)
+ pcc o (𝟎) (𝐞)
| pcc_d_dx (p) (n) (k):
- pcc (n+ninj k) p → pcc n (p◖𝗱k)
+ (Ⓣ = o → n = ↑↓n) →
+ pcc o (n+ninj k) p → pcc o n (p◖𝗱k)
| pcc_m_dx (p) (n):
- pcc n p → pcc n (p◖𝗺)
+ pcc o n p → pcc o n (p◖𝗺)
| pcc_L_dx (p) (n):
- pcc n p → pcc (↑n) (p◖𝗟)
+ pcc o n p → pcc o (↑n) (p◖𝗟)
| pcc_A_dx (p) (n):
- pcc n p → pcc n (p◖𝗔)
+ pcc o n p → pcc o n (p◖𝗔)
| pcc_S_dx (p) (n):
- pcc n p → pcc n (p◖𝗦)
+ pcc o n p → pcc o n (p◖𝗦)
.
interpretation
"closed condition (path)"
- 'ClassC n = (pcc n).
+ 'ClassC o n = (pcc o n).
+
+(* Advanced constructions ***************************************************)
+
+lemma pcc_false_d_dx (p) (n) (k:pnat):
+ p ϵ 𝐂❨Ⓕ,n+k❩ → p◖𝗱k ϵ 𝐂❨Ⓕ,n❩.
+#p #n #k #H0
+@pcc_d_dx [| // ]
+#H0 destruct
+qed.
+
+lemma pcc_true_d_dx (p) (n:pnat) (k:pnat):
+ p ϵ 𝐂❨Ⓣ,n+k❩ → p◖𝗱k ϵ 𝐂❨Ⓣ,n❩.
+/2 width=1 by pcc_d_dx/
+qed.
(* Basic inversions ********************************************************)
-lemma pcc_inv_empty (n):
- (𝐞) ϵ 𝐂❨n❩ → 𝟎 = n.
-#n @(insert_eq_1 … (𝐞))
+lemma pcc_inv_empty (o) (n):
+ (𝐞) ϵ 𝐂❨o,n❩ → 𝟎 = n.
+#o #n @(insert_eq_1 … (𝐞))
#x * -n //
-#p #n [ #k ] #_ #H0 destruct
+#p #n [ #k #_ ] #_ #H0 destruct
qed-.
-lemma pcc_inv_d_dx (p) (n) (k):
- p◖𝗱k ϵ 𝐂❨n❩ → p ϵ 𝐂❨n+k❩.
-#p #n #h @(insert_eq_1 … (p◖𝗱h))
+(**) (* alias *)
+alias symbol "DownArrow" (instance 4) = "predecessor (non-negative integers)".
+alias symbol "UpArrow" (instance 3) = "successor (non-negative integers)".
+alias symbol "and" (instance 1) = "logical and".
+
+lemma pcc_inv_d_dx (o) (p) (n) (k):
+ p◖𝗱k ϵ 𝐂❨o, n❩ →
+ ∧∧ (Ⓣ = o → n = ↑↓n)
+ & p ϵ 𝐂❨o, n+k❩.
+#o #p #n #h @(insert_eq_1 … (p◖𝗱h))
#x * -x -n
-[|*: #x #n [ #k ] #Hx ] #H0 destruct //
+[|*: #x #n [ #k #Ho ] #Hx ] #H0 destruct
+/3 width=1 by conj/
qed-.
-lemma pcc_inv_m_dx (p) (n):
- p◖𝗺 ϵ 𝐂❨n❩ → p ϵ 𝐂❨n❩.
-#p #n @(insert_eq_1 … (p◖𝗺))
+lemma pcc_inv_m_dx (o) (p) (n):
+ p◖𝗺 ϵ 𝐂❨o,n❩ → p ϵ 𝐂❨o,n❩.
+#o #p #n @(insert_eq_1 … (p◖𝗺))
#x * -x -n
-[|*: #x #n [ #k ] #Hx ] #H0 destruct //
+[|*: #x #n [ #k #_ ] #Hx ] #H0 destruct //
qed-.
-lemma pcc_inv_L_dx (p) (n):
- p◖𝗟 ϵ 𝐂❨n❩ →
- ∧∧ p ϵ 𝐂❨↓n❩ & n = ↑↓n.
-#p #n @(insert_eq_1 … (p◖𝗟))
+lemma pcc_inv_L_dx (o) (p) (n):
+ p◖𝗟 ϵ 𝐂❨o,n❩ →
+ ∧∧ p ϵ 𝐂❨o,↓n❩ & n = ↑↓n.
+#o #p #n @(insert_eq_1 … (p◖𝗟))
#x * -x -n
-[|*: #x #n [ #k ] #Hx ] #H0 destruct
+[|*: #x #n [ #k #_ ] #Hx ] #H0 destruct
<npred_succ /2 width=1 by conj/
qed-.
-lemma pcc_inv_A_dx (p) (n):
- p◖𝗔 ϵ 𝐂❨n❩ → p ϵ 𝐂❨n❩.
-#p #n @(insert_eq_1 … (p◖𝗔))
+lemma pcc_inv_A_dx (o) (p) (n):
+ p◖𝗔 ϵ 𝐂❨o,n❩ → p ϵ 𝐂❨o,n❩.
+#o #p #n @(insert_eq_1 … (p◖𝗔))
#x * -x -n
-[|*: #x #n [ #k ] #Hx ] #H0 destruct //
+[|*: #x #n [ #k #_ ] #Hx ] #H0 destruct //
qed-.
-lemma pcc_inv_S_dx (p) (n):
- p◖𝗦 ϵ 𝐂❨n❩ → p ϵ 𝐂❨n❩.
-#p #n @(insert_eq_1 … (p◖𝗦))
+lemma pcc_inv_S_dx (o) (p) (n):
+ p◖𝗦 ϵ 𝐂❨o,n❩ → p ϵ 𝐂❨o,n❩.
+#o #p #n @(insert_eq_1 … (p◖𝗦))
#x * -x -n
-[|*: #x #n [ #k ] #Hx ] #H0 destruct //
+[|*: #x #n [ #k #_ ] #Hx ] #H0 destruct //
+qed-.
+
+(* Advanced destructions ****************************************************)
+
+lemma pcc_des_d_dx (o) (p) (n) (k):
+ p◖𝗱k ϵ 𝐂❨o,n❩ → p ϵ 𝐂❨o,n+k❩.
+#o #p #n #k #H0
+elim (pcc_inv_d_dx … H0) -H0 #H1 #H2 //
+qed-.
+
+lemma pcc_des_gen (o) (p) (n):
+ p ϵ 𝐂❨o,n❩ → p ϵ 𝐂❨Ⓕ,n❩.
+#o #p #n #H0 elim H0 -p -n //
+#p #n [ #k #Ho ] #_ #IH
+/2 width=1 by pcc_m_dx, pcc_L_dx, pcc_A_dx, pcc_S_dx, pcc_false_d_dx/
qed-.
(* Advanced inversions ******************************************************)
-lemma pcc_inv_empty_succ (n):
- (𝐞) ϵ 𝐂❨↑n❩ → ⊥.
-#n #H0
+lemma pcc_inv_empty_succ (o) (n):
+ (𝐞) ϵ 𝐂❨o,↑n❩ → ⊥.
+#o #n #H0
lapply (pcc_inv_empty … H0) -H0 #H0
/2 width=7 by eq_inv_zero_nsucc/
qed-.
-lemma pcc_inv_L_dx_zero (p):
- p◖𝗟 ϵ 𝐂❨𝟎❩ → ⊥.
-#p #H0
+lemma pcc_true_inv_d_dx_zero (p) (k):
+ p◖𝗱k ϵ 𝐂❨Ⓣ,𝟎❩ → ⊥.
+#p #k #H0
+elim (pcc_inv_d_dx … H0) -H0 #H0 #_
+elim (eq_inv_zero_nsucc … (H0 ?)) -H0 //
+qed-.
+
+lemma pcc_inv_L_dx_zero (o) (p):
+ p◖𝗟 ϵ 𝐂❨o,𝟎❩ → ⊥.
+#o #p #H0
elim (pcc_inv_L_dx … H0) -H0 #_ #H0
/2 width=7 by eq_inv_zero_nsucc/
qed-.
-lemma pcc_inv_L_dx_succ (p) (n):
- p◖𝗟 ϵ 𝐂❨↑n❩ → p ϵ 𝐂❨n❩.
-#p #n #H0
+lemma pcc_inv_L_dx_succ (o) (p) (n):
+ p◖𝗟 ϵ 𝐂❨o,↑n❩ → p ϵ 𝐂❨o,n❩.
+#o #p #n #H0
elim (pcc_inv_L_dx … H0) -H0 //
qed-.
+(* Constructions with land **************************************************)
+
+lemma pcc_land_dx (o1) (o2) (p) (n):
+ p ϵ 𝐂❨o1,n❩ → p ϵ 𝐂❨o1∧o2,n❩.
+#o1 * /2 width=2 by pcc_des_gen/
+qed.
+
+lemma pcc_land_sn (o1) (o2) (p) (n):
+ p ϵ 𝐂❨o2,n❩ → p ϵ 𝐂❨o1∧o2,n❩.
+* /2 width=2 by pcc_des_gen/
+qed.
+
(* Main constructions with path_append **************************************)
-theorem pcc_append_bi (p) (q) (m) (n):
- p ϵ 𝐂❨m❩ → q ϵ 𝐂❨n❩ → p●q ϵ 𝐂❨m+n❩.
-#p #q #m #n #Hm #Hm elim Hm -Hm // -Hm
-#p #n [ #k ] #_ #IH [3: <nplus_succ_dx ]
-/2 width=1 by pcc_d_dx, pcc_m_dx, pcc_L_dx, pcc_A_dx, pcc_S_dx/
+theorem pcc_append_bi (o1) (o2) (p) (q) (m) (n):
+ p ϵ 𝐂❨o1,m❩ → q ϵ 𝐂❨o2,n❩ → p●q ϵ 𝐂❨o1∧o2,m+n❩.
+#o1 #o2 #p #q #m #n #Hm #Hn elim Hn -q -n
+/2 width=1 by pcc_m_dx, pcc_A_dx, pcc_S_dx, pcc_land_dx/
+#q #n [ #k #Ho2 ] #_ #IH
+[ @pcc_d_dx // #H0
+ elim (andb_inv_true_sn … H0) -H0 #_ #H0 >Ho2 //
+ <nplus_succ_dx <npred_succ //
+| <nplus_succ_dx /2 width=1 by pcc_L_dx/
+]
qed.
(* Constructions with path_lcons ********************************************)
-lemma pcc_m_sn (q) (n):
- q ϵ 𝐂❨n❩ → (𝗺◗q) ϵ 𝐂❨n❩.
-#q #n #Hq
-lapply (pcc_append_bi (𝐞◖𝗺) … Hq) -Hq
+lemma pcc_m_sn (o) (q) (n):
+ q ϵ 𝐂❨o,n❩ → (𝗺◗q) ϵ 𝐂❨o,n❩.
+#o #q #n #Hq
+lapply (pcc_append_bi (Ⓣ) … (𝐞◖𝗺) … Hq) -Hq
/2 width=3 by pcc_m_dx/
qed.
-lemma pcc_L_sn (q) (n):
- q ϵ 𝐂❨n❩ → (𝗟◗q) ϵ 𝐂❨↑n❩.
-#q #n #Hq
-lapply (pcc_append_bi (𝐞◖𝗟) … Hq) -Hq
+lemma pcc_L_sn (o) (q) (n):
+ q ϵ 𝐂❨o,n❩ → (𝗟◗q) ϵ 𝐂❨o,↑n❩.
+#o #q #n #Hq
+lapply (pcc_append_bi (Ⓣ) … (𝐞◖𝗟) … Hq) -Hq
/2 width=3 by pcc_L_dx/
qed.
-lemma pcc_A_sn (q) (n):
- q ϵ 𝐂❨n❩ → (𝗔◗q) ϵ 𝐂❨n❩.
-#q #n #Hq
-lapply (pcc_append_bi (𝐞◖𝗔) … Hq) -Hq
+lemma pcc_A_sn (o) (q) (n):
+ q ϵ 𝐂❨o,n❩ → (𝗔◗q) ϵ 𝐂❨o,n❩.
+#o #q #n #Hq
+lapply (pcc_append_bi (Ⓣ) … (𝐞◖𝗔) … Hq) -Hq
/2 width=3 by pcc_A_dx/
qed.
-lemma pcc_S_sn (q) (n):
- q ϵ 𝐂❨n❩ → (𝗦◗q) ϵ 𝐂❨n❩.
-#q #n #Hq
-lapply (pcc_append_bi (𝐞◖𝗦) … Hq) -Hq
+lemma pcc_S_sn (o) (q) (n):
+ q ϵ 𝐂❨o,n❩ → (𝗦◗q) ϵ 𝐂❨o,n❩.
+#o #q #n #Hq
+lapply (pcc_append_bi (Ⓣ) … (𝐞◖𝗦) … Hq) -Hq
/2 width=3 by pcc_S_dx/
qed.
(* Main inversions **********************************************************)
-theorem pcc_mono (q) (n1):
- q ϵ 𝐂❨n1❩ → ∀n2. q ϵ 𝐂❨n2❩ → n1 = n2.
-#q1 #n1 #Hn1 elim Hn1 -q1 -n1
-[|*: #q1 #n1 [ #k1 ] #_ #IH ] #n2 #Hn2
+theorem pcc_mono (o1) (o2) (q) (n1):
+ q ϵ 𝐂❨o1,n1❩ → ∀n2. q ϵ 𝐂❨o2,n2❩ → n1 = n2.
+#o1 #o2 #q1 #n1 #Hn1 elim Hn1 -q1 -n1
+[|*: #q1 #n1 [ #k1 #_ ] #_ #IH ] #n2 #Hn2
[ <(pcc_inv_empty … Hn2) -n2 //
-| lapply (pcc_inv_d_dx … Hn2) -Hn2 #Hn2
+| lapply (pcc_des_d_dx … Hn2) -Hn2 #Hn2
lapply (IH … Hn2) -q1 #H0
/2 width=2 by eq_inv_nplus_bi_dx/
| lapply (pcc_inv_m_dx … Hn2) -Hn2 #Hn2
]
qed-.
-theorem pcc_inj_L_sn (p1) (p2) (q1) (n):
- q1 ϵ 𝐂❨n❩ → ∀q2. q2 ϵ 𝐂❨n❩ →
+theorem pcc_inj_L_sn (o1) (o2) (p1) (p2) (q1) (n):
+ q1 ϵ 𝐂❨o1,n❩ → ∀q2. q2 ϵ 𝐂❨o2,n❩ →
p1●𝗟◗q1 = p2●𝗟◗q2 → q1 = q2.
-#p1 #p2 #q1 #n #Hq1 elim Hq1 -q1 -n
-[|*: #q1 #n1 [ #k1 ] #_ #IH ] * //
+#o1 #o2 #p1 #p2 #q1 #n #Hq1 elim Hq1 -q1 -n
+[|*: #q1 #n1 [ #k1 #_ ] #_ #IH ] * //
[1,3,5,7,9,11: #l2 #q2 ] #Hq2
<list_append_lcons_sn <list_append_lcons_sn #H0
elim (eq_inv_list_lcons_bi ????? H0) -H0 #H0 #H1 destruct
[ elim (pcc_inv_L_dx_zero … Hq2)
-| lapply (pcc_inv_d_dx … Hq2) -Hq2 #Hq2
+| lapply (pcc_des_d_dx … Hq2) -Hq2 #Hq2
<(IH … Hq2) //
| lapply (pcc_inv_m_dx … Hq2) -Hq2 #Hq2
<(IH … Hq2) //
]
qed-.
-theorem pcc_inv_L_sn (q) (n) (m):
- (𝗟◗q) ϵ 𝐂❨n❩ → q ϵ 𝐂❨m❩ →
+theorem pcc_inv_L_sn (o) (q) (n) (m):
+ (𝗟◗q) ϵ 𝐂❨o,n❩ → q ϵ 𝐂❨o,m❩ →
∧∧ ↓n = m & n = ↑↓n.
-#q #n #m #H1q #H2q
+#o #q #n #m #H1q #H2q
lapply (pcc_L_sn … H2q) -H2q #H2q
<(pcc_mono … H2q … H1q) -q -n
/2 width=1 by conj/
(* Constructions with structure *********************************************)
-lemma path_closed_structure_depth (p):
- ⊗p ϵ 𝐂❨♭p❩.
-#p elim p -p // *
+lemma path_closed_structure_depth (o) (p):
+ ⊗p ϵ 𝐂❨o,♭p❩.
+#o #p elim p -p // *
/2 width=1 by pcc_L_dx, pcc_A_dx, pcc_S_dx/
qed.
(* Destructions with cpp ****************************************************)
-lemma unwind2_rmap_append_closed_dx_xap_le (f) (p) (q) (n):
- q ϵ 𝐂❨n❩ → ∀m. m ≤ n →
+lemma unwind2_rmap_append_closed_dx_xap_le (o) (f) (p) (q) (n):
+ q ϵ 𝐂❨o,n❩ → ∀m. m ≤ n →
▶[f]q@❨m❩ = ▶[f](p●q)@❨m❩.
-#f #p #q #n #Hq elim Hq -q -n
-[|*: #q #n [ #k ] #_ #IH ] #m #Hm
+#o #f #p #q #n #Hq elim Hq -q -n
+[|*: #q #n [ #k #_ ] #_ #IH ] #m #Hm
[ <(nle_inv_zero_dx … Hm) -m //
| <unwind2_rmap_d_dx <unwind2_rmap_d_dx
<tr_compose_xap <tr_compose_xap
]
qed-.
-lemma unwind2_rmap_append_closed_Lq_dx_nap (f) (p) (q) (n):
- q ϵ 𝐂❨n❩ →
+lemma unwind2_rmap_append_closed_Lq_dx_nap (o) (f) (p) (q) (n):
+ q ϵ 𝐂❨o,n❩ →
▶[f](𝗟◗q)@§❨n❩ = ▶[f](p●𝗟◗q)@§❨n❩.
-#f #p #q #n #Hq
+#o #f #p #q #n #Hq
lapply (pcc_L_sn … Hq) -Hq #Hq
-lapply (unwind2_rmap_append_closed_dx_xap_le f p … Hq (↑n) ?) -Hq //
+lapply (unwind2_rmap_append_closed_dx_xap_le o f p … Hq (↑n) ?) -Hq //
<tr_xap_succ_nap <tr_xap_succ_nap #Hq
/2 width=1 by eq_inv_nsucc_bi/
qed-.
-lemma unwind2_rmap_push_closed_nap (f) (q) (n):
- q ϵ 𝐂❨n❩ →
+lemma unwind2_rmap_push_closed_nap (o) (f) (q) (n):
+ q ϵ 𝐂❨o,n❩ →
♭q = ▶[⫯f]q@§❨n❩.
-#f #q #n #Hq elim Hq -q -n
-[|*: #q #n [ #k ] #_ #IH ] //
+#o #f #q #n #Hq elim Hq -q -n
+[|*: #q #n [ #k #_ ] #_ #IH ] //
<unwind2_rmap_d_dx <tr_compose_nap //
qed-.
-lemma unwind2_rmap_append_closed_Lq_dx_nap_depth (f) (p) (q) (n):
- q ϵ 𝐂❨n❩ →
+lemma unwind2_rmap_append_closed_Lq_dx_nap_depth (o) (f) (p) (q) (n):
+ q ϵ 𝐂❨o,n❩ →
♭q = ▶[f](p●𝗟◗q)@§❨n❩.
-#f #p #q #n #Hq
+#o #f #p #q #n #Hq
<unwind2_rmap_append_closed_Lq_dx_nap //
-/2 width=1 by unwind2_rmap_push_closed_nap/
+/2 width=2 by unwind2_rmap_push_closed_nap/
qed-.
-lemma tls_succ_plus_unwind2_rmap_push_closed (f) (q) (n):
- q ϵ 𝐂❨n❩ →
+lemma tls_succ_plus_unwind2_rmap_push_closed (o) (f) (q) (n):
+ q ϵ 𝐂❨o,n❩ →
∀m. ⇂*[m]f ≗ ⇂*[↑(m+n)]▶[⫯f]q.
-#f #q #n #Hq elim Hq -q -n //
-#q #n [ #k ] #_ #IH #m
+#o #f #q #n #Hq elim Hq -q -n //
+#q #n [ #k #_ ] #_ #IH #m
[ @(stream_eq_trans … (tls_unwind2_rmap_d_dx …))
>nrplus_inj_dx >nrplus_inj_sn >nsucc_unfold //
| <unwind2_rmap_L_dx <nplus_succ_dx //
]
qed-.
-lemma tls_succ_unwind2_rmap_append_closed_Lq_dx (f) (p) (q) (n):
- q ϵ 𝐂❨n❩ →
+lemma tls_succ_unwind2_rmap_append_closed_Lq_dx (o) (f) (p) (q) (n):
+ q ϵ 𝐂❨o,n❩ →
▶[f]p ≗ ⇂*[↑n]▶[f](p●𝗟◗q).
-/2 width=1 by tls_succ_plus_unwind2_rmap_push_closed/
+/2 width=2 by tls_succ_plus_unwind2_rmap_push_closed/
qed-.
-lemma unwind2_rmap_append_closed_Lq_dx_nap_plus (f) (p) (q) (m) (n):
- q ϵ 𝐂❨n❩ →
+lemma unwind2_rmap_append_closed_Lq_dx_nap_plus (o) (f) (p) (q) (m) (n):
+ q ϵ 𝐂❨o,n❩ →
▶[f]p@❨m❩+♭q = ▶[f](p●𝗟◗q)@§❨m+n❩.
-#f #p #q #m #n #Hq
+#o #f #p #q #m #n #Hq
<tr_nap_plus @eq_f2
[ <(tr_xap_eq_repl … (tls_succ_unwind2_rmap_append_closed_Lq_dx …)) //
-| /2 width=1 by unwind2_rmap_append_closed_Lq_dx_nap_depth/
+| /2 width=2 by unwind2_rmap_append_closed_Lq_dx_nap_depth/
]
qed-.
/2 width=1 by pbc_empty, pbc_redex/
qed.
-lemma b_closed: b ϵ 𝐂❨𝟎❩.
-/4 width=1 by pcc_A_sn, pcc_empty, pcc_d_dx, pcc_L_dx/
+lemma b_closed: b ϵ 𝐂❨Ⓕ,𝟎❩.
+/4 width=1 by pcc_A_sn, pcc_empty, pcc_false_d_dx, pcc_L_dx/
qed.
lemma b_unwind2_rmap_unfold (f):
* * // qed.
lemma andb_false_dx (b):
- (b ∧ Ⓕ) = Ⓕ.
+ Ⓕ = (b ∧ Ⓕ).
* // qed.
lemma andb_false_sn (b):
- (Ⓕ ∧ b) = Ⓕ.
+ Ⓕ = (Ⓕ ∧ b).
+// qed.
+
+lemma andb_true_dx (b):
+ b = (b ∧ Ⓣ).
+* // qed.
+
+lemma andb_true_sn (b):
+ b = (Ⓣ ∧ b).
// qed.
(* Advanced inversions ******************************************************)
-lemma andb_inv_true_dx (b1) (b2):
- (b1 ∧ b2) = Ⓣ → ∧∧ b1 = Ⓣ & b2 = Ⓣ.
-* normalize /2 width=1 by conj/ #b2 #H destruct
+lemma andb_inv_true_sn (b1) (b2):
+ Ⓣ = (b1 ∧ b2) → ∧∧ Ⓣ = b1 & Ⓣ = b2.
+* normalize
+[ /2 width=1 by conj/
+| #b2 #H destruct
+]
qed-.
⇂*[↑n]f@❨m❩+f@§❨n❩ = f@§❨m+n❩.
/2 width=1 by eq_inv_nsucc_bi/
qed.
+
+lemma tr_xap_pos (f) (n):
+ n = ↑↓n → f@❨n❩=↑↓(f@❨n❩).
+#f #n #H0 >H0 -H0
+<tr_xap_ninj <nsucc_pnpred //
+qed.