From e4328f6887dc0235d49d965a5ba44787b1754b80 Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Sun, 14 Aug 2022 18:02:46 +0200 Subject: [PATCH] update in delayed_updating + focused reduction takes just one focus + changed minor premise of ifr_unwind_bi + some renaming --- ...arrow_df_4.ma => black_rightarrow_df_3.ma} | 4 +- ...arrow_if_4.ma => black_rightarrow_if_3.ma} | 4 +- .../delayed_updating/reduction/dfr.ma | 16 +++-- .../delayed_updating/reduction/dfr_ifr.ma | 15 ++-- .../delayed_updating/reduction/dfr_lift.ma | 15 ++-- .../delayed_updating/reduction/ifr.ma | 16 +++-- .../delayed_updating/reduction/ifr_lift.ma | 13 ++-- .../delayed_updating/reduction/ifr_unwind.ma | 22 +++--- .../syntax/prototerm_proper_inner.ma | 2 +- .../unwind/unwind2_path_append.ma | 68 +++++++++---------- .../unwind/unwind2_preterm_eq.ma | 6 +- .../unwind/unwind2_preterm_fsubst.ma | 57 +++++++++++++--- .../unwind/unwind2_prototerm_inner.ma | 6 +- 13 files changed, 146 insertions(+), 98 deletions(-) rename matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/{black_rightarrow_df_4.ma => black_rightarrow_df_3.ma} (89%) rename matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/{black_rightarrow_if_4.ma => black_rightarrow_if_3.ma} (89%) diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/black_rightarrow_df_4.ma b/matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/black_rightarrow_df_3.ma similarity index 89% rename from matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/black_rightarrow_df_4.ma rename to matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/black_rightarrow_df_3.ma index ca059fc5c..f50962063 100644 --- a/matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/black_rightarrow_df_4.ma +++ b/matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/black_rightarrow_df_3.ma @@ -14,6 +14,6 @@ (* NOTATION FOR DELAYED UPDATING ********************************************) -notation "hvbox( t1 ➡𝐝𝐟[ break term 46 p, break term 46 q ] break term 46 t2 )" +notation "hvbox( t1 ➡𝐝𝐟[ break term 46 r ] break term 46 t2 )" non associative with precedence 45 - for @{ 'BlackRightArrowDF $t1 $p $q $t2 }. + for @{ 'BlackRightArrowDF $t1 $r $t2 }. diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/black_rightarrow_if_4.ma b/matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/black_rightarrow_if_3.ma similarity index 89% rename from matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/black_rightarrow_if_4.ma rename to matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/black_rightarrow_if_3.ma index 2b35b91ea..d2568773a 100644 --- a/matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/black_rightarrow_if_4.ma +++ b/matita/matita/contribs/lambdadelta/delayed_updating/notation/relations/black_rightarrow_if_3.ma @@ -14,6 +14,6 @@ (* NOTATION FOR DELAYED UPDATING ********************************************) -notation "hvbox( t1 ➡𝐢𝐟[ break term 46 p, break term 46 q ] break term 46 t2 )" +notation "hvbox( t1 ➡𝐢𝐟[ break term 46 r ] break term 46 t2 )" non associative with precedence 45 - for @{ 'BlackRightArrowIF $t1 $p $q $t2 }. + for @{ 'BlackRightArrowIF $t1 $r $t2 }. diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dfr.ma b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dfr.ma index 135a48b1d..a610cd323 100644 --- a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dfr.ma +++ b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dfr.ma @@ -17,17 +17,19 @@ include "delayed_updating/syntax/prototerm_constructors.ma". include "delayed_updating/syntax/prototerm_eq.ma". include "delayed_updating/syntax/path_head.ma". include "delayed_updating/syntax/path_depth.ma". -include "delayed_updating/notation/relations/black_rightarrow_df_4.ma". +include "delayed_updating/notation/relations/black_rightarrow_df_3.ma". +include "ground/xoa/ex_4_3.ma". (* DELAYED FOCUSED REDUCTION ************************************************) -definition dfr (p) (q): relation2 prototerm prototerm ≝ - λt1,t2. ∃k:pnat. - let r ≝ p●𝗔◗𝗟◗q in - ∧∧ 𝗟◗q = ↳[k](𝗟◗q) & r◖𝗱k ϵ t1 & - t1[⋔r←𝛕k.(t1⋔(p◖𝗦))] ⇔ t2 +(**) (* explicit ninj because we cannot declare the expectd type of k *) +definition dfr (r): relation2 prototerm prototerm ≝ + λt1,t2. + ∃∃p,q,k. p●𝗔◗𝗟◗q = r & + (𝗟◗q) = ↳[ninj k](𝗟◗q) & r◖𝗱k ϵ t1 & + t1[⋔r←𝛕k.(t1⋔(p◖𝗦))] ⇔ t2 . interpretation "focused reduction with delayed updating (prototerm)" - 'BlackRightArrowDF t1 p q t2 = (dfr p q t1 t2). + 'BlackRightArrowDF t1 r t2 = (dfr r t1 t2). diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dfr_ifr.ma b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dfr_ifr.ma index 638dad75b..68cea487c 100644 --- a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dfr_ifr.ma +++ b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/dfr_ifr.ma @@ -32,12 +32,13 @@ include "delayed_updating/syntax/path_structure_depth.ma". (* Main destructions with ifr ***********************************************) -theorem dfr_des_ifr (f) (p) (q) (t1) (t2): t1 ϵ 𝐓 → - t1 ➡𝐝𝐟[p,q] t2 → ▼[f]t1 ➡𝐢𝐟[⊗p,⊗q] ▼[f]t2. -#f #p #q #t1 #t2 #H0t1 -* #k * #H1k #Ht1 #Ht2 -@(ex_intro … (↑♭q)) @and3_intro -[ -H0t1 -Ht1 -Ht2 +theorem dfr_des_ifr (f) (t1) (t2) (r): t1 ϵ 𝐓 → + t1 ➡𝐝𝐟[r] t2 → ▼[f]t1 ➡𝐢𝐟[⊗r] ▼[f]t2. +#f #t1 #t2 #r #H0t1 +* #p #q #k #Hr #H1k #Ht1 #Ht2 destruct +@(ex4_3_intro … (⊗p) (⊗q) (↑♭q)) +[ -H0t1 -H1k -Ht1 -Ht2 // +| -H0t1 -Ht1 -Ht2 >structure_L_sn >H1k in ⊢ (??%?); >path_head_structure_depth lift_path_L_sn <(lift_path_head_closed … H1k) in ⊢ (??%?); -H1k // | lapply (in_comp_lift_path_term f … Ht1) -Ht2 -Ht1 -H1k diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/ifr.ma b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/ifr.ma index 6ded5c377..b36038141 100644 --- a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/ifr.ma +++ b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/ifr.ma @@ -16,18 +16,20 @@ include "delayed_updating/substitution/fsubst.ma". include "delayed_updating/substitution/lift_prototerm.ma". include "delayed_updating/syntax/prototerm_eq.ma". include "delayed_updating/syntax/path_head.ma". -include "delayed_updating/notation/relations/black_rightarrow_if_4.ma". +include "delayed_updating/notation/relations/black_rightarrow_if_3.ma". include "ground/relocation/tr_uni.ma". +include "ground/xoa/ex_4_3.ma". (* IMMEDIATE FOCUSED REDUCTION ************************************************) -definition ifr (p) (q): relation2 prototerm prototerm ≝ - λt1,t2. ∃k:pnat. - let r ≝ p●𝗔◗𝗟◗q in - ∧∧ 𝗟◗q = ↳[k](𝗟◗q) & r◖𝗱k ϵ t1 & - t1[⋔r←↑[𝐮❨k❩](t1⋔(p◖𝗦))] ⇔ t2 +(**) (* explicit ninj because we cannot declare the expectd type of k *) +definition ifr (r): relation2 prototerm prototerm ≝ + λt1,t2. + ∃∃p,q,k. p●𝗔◗𝗟◗q = r & + (𝗟◗q) = ↳[ninj k](𝗟◗q) & r◖𝗱k ϵ t1 & + t1[⋔r←↑[𝐮❨ninj k❩](t1⋔(p◖𝗦))] ⇔ t2 . interpretation "focused reduction with immediate updating (prototerm)" - 'BlackRightArrowIF t1 p q t2 = (ifr p q t1 t2). + 'BlackRightArrowIF t1 r t2 = (ifr r t1 t2). diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/ifr_lift.ma b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/ifr_lift.ma index 59c9dcc9e..7c4d11d73 100644 --- a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/ifr_lift.ma +++ b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/ifr_lift.ma @@ -27,12 +27,13 @@ include "ground/relocation/tr_compose_eq.ma". (* Constructions with lift **************************************************) -theorem ifr_lift_bi (f) (p) (q) (t1) (t2): - t1 ➡𝐢𝐟[p,q] t2 → ↑[f]t1 ➡𝐢𝐟[↑[f]p,↑[↑[p◖𝗔◖𝗟]f]q] ↑[f]t2. -#f #p #q #t1 #t2 -* #k * #H1k #Ht1 #Ht2 -@(ex_intro … ((↑[p●𝗔◗𝗟◗q]f)@⧣❨k❩)) @and3_intro -[ -Ht1 -Ht2 +theorem ifr_lift_bi (f) (t1) (t2) (r): + t1 ➡𝐢𝐟[r] t2 → ↑[f]t1 ➡𝐢𝐟[↑[f]r] ↑[f]t2. +#f #t1 #t2 #r +* #p #q #k #Hr #H1k #Ht1 #Ht2 destruct +@(ex4_3_intro … (↑[f]p) (↑[↑[p◖𝗔◖𝗟]f]q) ((↑[p●𝗔◗𝗟◗q]f)@⧣❨k❩)) +[ -H1k -Ht1 -Ht2 // +| -Ht1 -Ht2 lift_path_L_sn <(lift_path_head_closed … H1k) in ⊢ (??%?); -H1k // | lapply (in_comp_lift_path_term f … Ht1) -Ht2 -Ht1 -H1k diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/ifr_unwind.ma b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/ifr_unwind.ma index a554bdbe2..e8cc51826 100644 --- a/matita/matita/contribs/lambdadelta/delayed_updating/reduction/ifr_unwind.ma +++ b/matita/matita/contribs/lambdadelta/delayed_updating/reduction/ifr_unwind.ma @@ -20,7 +20,6 @@ include "delayed_updating/unwind/unwind2_prototerm_lift.ma". include "delayed_updating/unwind/unwind2_rmap_head.ma". include "delayed_updating/substitution/fsubst_eq.ma". -include "delayed_updating/substitution/lift_prototerm_proper.ma". include "delayed_updating/substitution/lift_prototerm_eq.ma". include "delayed_updating/syntax/path_head_structure.ma". @@ -30,23 +29,24 @@ include "delayed_updating/syntax/path_structure_depth.ma". (* Constructions with unwind2 ***********************************************) -lemma ifr_unwind_bi (f) (p) (q) (t1) (t2): - t1 ϵ 𝐓 → t1⋔(p◖𝗦) ϵ 𝐏 → - t1 ➡𝐢𝐟[p,q] t2 → ▼[f]t1 ➡𝐢𝐟[⊗p,⊗q] ▼[f]t2. -#f #p #q #t1 #t2 #H1t1 #H2t1 -* #k * #H1k #Ht1 #Ht2 -@(ex_intro … (↑♭q)) @and3_intro -[ -H1t1 -H2t1 -Ht1 -Ht2 +lemma ifr_unwind_bi (f) (t1) (t2) (r): + t1 ϵ 𝐓 → r ϵ 𝐈 → + t1 ➡𝐢𝐟[r] t2 → ▼[f]t1 ➡𝐢𝐟[⊗r] ▼[f]t2. +#f #t1 #t2 #r #H1t1 #H2r +* #p #q #k #Hr #H1k #Ht1 #Ht2 destruct +@(ex4_3_intro … (⊗p) (⊗q) (↑♭q)) +[ -H1t1 -H2r -H1k -Ht1 -Ht2 // +| -H1t1 -H2r -Ht1 -Ht2 >structure_L_sn >H1k in ⊢ (??%?); >path_head_structure_depth list_cons_comm #H0 - elim (unwind2_path_inv_append_proper_dx … H0) -H0 // #r1 #r2 #Hr1 #_ #_ -r2 + elim (unwind2_path_inv_append_ppc_dx … H0) -H0 // #r1 #r2 #Hr1 #_ #_ -r2 elim (eq_inv_d_dx_structure … Hr1) ] qed-. @@ -176,7 +176,7 @@ lemma eq_inv_m_sn_unwind2_path (f) (q) (p): (𝗺◗q) = ▼[f]p → ⊥. #f #q #p >list_cons_comm #H0 -elim (unwind2_path_des_append_inner_sn … H0) list_cons_comm #H0 -elim (unwind2_path_des_append_inner_sn … H0) list_cons_comm #H0 -elim (unwind2_path_des_append_inner_sn … H0) list_cons_comm #H0 -elim (unwind2_path_des_append_inner_sn … H0) (Ht … Hp0) [|*: /2 width=2 by ex_intro/ ] -p /2 width=1 by in_comp_unwind2_path_term/ @@ -46,7 +46,7 @@ lemma unwind2_term_grafted_S_dx (f) (t) (p): p ϵ ▵t → t ϵ 𝐓 → (▼[f]t)⋔((⊗p)◖𝗦) ⊆ ▼[▶[f]p](t⋔(p◖𝗦)). #f #t #p #Hp #Ht #q * #r #Hr >list_append_rcons_sn #H0 -elim (unwind2_path_inv_append_proper_dx … (sym_eq … H0)) -H0 // +elim (unwind2_path_inv_append_ppc_dx … (sym_eq … H0)) -H0 // #p0 #q0 #Hp0 #Hq0 #H0 destruct >(Ht … Hp0) [|*: /2 width=2 by ex_intro/ ] -p elim (eq_inv_S_sn_unwind2_path … Hq0) -Hq0 diff --git a/matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind2_preterm_fsubst.ma b/matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind2_preterm_fsubst.ma index 19634dccc..ecf0eaf0f 100644 --- a/matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind2_preterm_fsubst.ma +++ b/matita/matita/contribs/lambdadelta/delayed_updating/unwind/unwind2_preterm_fsubst.ma @@ -20,30 +20,69 @@ include "delayed_updating/syntax/prototerm_proper.ma". (* TAILED UNWIND FOR PRETERM ************************************************) -(* Constructions with fsubst ************************************************) +(* Constructions with fsubst and pic ****************************************) -lemma unwind2_term_fsubst_sn (f) (t) (u) (p): u ϵ 𝐏 → +lemma unwind2_term_fsubst_pic_sn (f) (t) (u) (p): p ϵ 𝐈 → + (▼[f]t)[⋔(⊗p)←▼[▶[f]p]u] ⊆ ▼[f](t[⋔p←u]). +#f #t #u #p #Hp #ql * * +[ #rl * #r #Hr #H1 #H2 destruct + >unwind2_path_append_pic_sn + /4 width=3 by in_comp_unwind2_path_term, or_introl, ex2_intro/ +| * #q #Hq #H1 #H0 + @(ex2_intro … H1) @or_intror @conj // * + [ unwind2_path_append_proper_dx + >unwind2_path_append_ppc_dx /4 width=5 by in_comp_unwind2_path_term, in_comp_tpc_trans, or_introl, ex2_intro/ | * #q #Hq #H1 #H0 @(ex2_intro … H1) @or_intror @conj // * [