1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 notation "hvbox( ⦃ term 46 L1, break term 46 T1 ⦄ ⧁ * break ⦃ term 46 L2 , break term 46 T2 ⦄ )"
16 non associative with precedence 45
17 for @{ 'RestSupTermStar $L1 $T1 $L2 $T2 }.
19 include "basic_2/unfold/frsupp.ma".
21 (* STAR-ITERATED RESTRICTED SUPCLOSURE **************************************)
23 definition frsups: bi_relation lenv term ≝ bi_star … frsup.
25 interpretation "star-iterated restricted structural predecessor (closure)"
26 'RestSupTermStar L1 T1 L2 T2 = (frsups L1 T1 L2 T2).
28 (* Basic eliminators ********************************************************)
30 lemma frsups_ind: ∀L1,T1. ∀R:relation2 lenv term. R L1 T1 →
31 (∀L,L2,T,T2. ⦃L1, T1⦄ ⧁* ⦃L, T⦄ → ⦃L, T⦄ ⧁ ⦃L2, T2⦄ → R L T → R L2 T2) →
32 ∀L2,T2. ⦃L1, T1⦄ ⧁* ⦃L2, T2⦄ → R L2 T2.
33 #L1 #T1 #R #IH1 #IH2 #L2 #T2 #H
34 @(bi_star_ind … IH1 IH2 ? ? H)
37 lemma frsups_ind_dx: ∀L2,T2. ∀R:relation2 lenv term. R L2 T2 →
38 (∀L1,L,T1,T. ⦃L1, T1⦄ ⧁ ⦃L, T⦄ → ⦃L, T⦄ ⧁* ⦃L2, T2⦄ → R L T → R L1 T1) →
39 ∀L1,T1. ⦃L1, T1⦄ ⧁* ⦃L2, T2⦄ → R L1 T1.
40 #L2 #T2 #R #IH1 #IH2 #L1 #T1 #H
41 @(bi_star_ind_dx … IH1 IH2 ? ? H)
44 (* Basic properties *********************************************************)
46 lemma frsups_refl: bi_reflexive … frsups.
49 lemma frsupp_frsups: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⧁* ⦃L2, T2⦄.
52 lemma frsup_frsups: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⧁* ⦃L2, T2⦄.
55 lemma frsups_strap1: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⧁* ⦃L, T⦄ → ⦃L, T⦄ ⧁ ⦃L2, T2⦄ →
59 lemma frsups_strap2: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⧁ ⦃L, T⦄ → ⦃L, T⦄ ⧁* ⦃L2, T2⦄ →
63 lemma frsups_frsupp_frsupp: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⧁* ⦃L, T⦄ →
64 ⦃L, T⦄ ⧁+ ⦃L2, T2⦄ → ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄.
67 lemma frsupp_frsups_frsupp: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ ⧁+ ⦃L, T⦄ →
68 ⦃L, T⦄ ⧁* ⦃L2, T2⦄ → ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄.
71 (* Basic inversion lemmas ***************************************************)
73 lemma frsups_inv_all: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁* ⦃L2, T2⦄ →
74 (L1 = L2 ∧ T1 = T2) ∨ ⦃L1, T1⦄ ⧁+ ⦃L2, T2⦄.
75 #L1 #L2 #T1 #T2 * /2 width=1/
78 (* Basic forward lemmas *****************************************************)
80 lemma frsups_fwd_fw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁* ⦃L2, T2⦄ → ♯{L2, T2} ≤ ♯{L1, T1}.
81 #L1 #L2 #T1 #T2 #H elim (frsups_inv_all … H) -H [ * // ]
82 /3 width=1 by frsupp_fwd_fw, lt_to_le/
85 lemma frsups_fwd_lw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁* ⦃L2, T2⦄ → ♯{L1} ≤ ♯{L2}.
86 #L1 #L2 #T1 #T2 #H elim (frsups_inv_all … H) -H [ * // ]
87 /2 width=3 by frsupp_fwd_lw/
90 lemma frsups_fwd_tw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁* ⦃L2, T2⦄ → ♯{T2} ≤ ♯{T1}.
91 #L1 #L2 #T1 #T2 #H elim (frsups_inv_all … H) -H [ * // ]
92 /3 width=3 by frsupp_fwd_tw, lt_to_le/
95 lemma frsups_fwd_append: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ⧁* ⦃L2, T2⦄ → ∃L. L2 = L1 @@ L.
96 #L1 #L2 #T1 #T2 #H elim (frsups_inv_all … H) -H
99 | /2 width=3 by frsupp_fwd_append/
102 (* Advanced forward lemmas ***************************************************)
104 lemma lift_frsups_trans: ∀T1,U1,d,e. ⇧[d, e] T1 ≡ U1 →
105 ∀L,K,U2. ⦃L, U1⦄ ⧁* ⦃L @@ K, U2⦄ →
106 ∃T2. ⇧[d + |K|, e] T2 ≡ U2.
107 #T1 #U1 #d #e #HTU1 #L #K #U2 #H elim (frsups_inv_all … H) -H
109 >(append_inv_refl_dx … (sym_eq … H1)) -H1 normalize /2 width=2/
110 | /2 width=5 by lift_frsupp_trans/
114 (* Advanced inversion lemmas for frsupp **************************************)
116 lemma frsupp_inv_atom1_frsups: ∀J,L1,L2,T2. ⦃L1, ⓪{J}⦄ ⧁+ ⦃L2, T2⦄ → ⊥.
117 #J #L1 #L2 #T2 #H @(frsupp_ind … H) -L2 -T2 //
118 #L2 #T2 #H elim (frsup_inv_atom1 … H)
121 lemma frsupp_inv_bind1_frsups: ∀b,J,L1,L2,W,U,T2. ⦃L1, ⓑ{b,J}W.U⦄ ⧁+ ⦃L2, T2⦄ →
122 ⦃L1, W⦄ ⧁* ⦃L2, T2⦄ ∨ ⦃L1.ⓑ{J}W, U⦄ ⧁* ⦃L2, T2⦄.
123 #b #J #L1 #L2 #W #U #T2 #H @(frsupp_ind … H) -L2 -T2
125 elim (frsup_inv_bind1 … H) -H * #H1 #H2 destruct /2 width=1/
126 | #L #T #L2 #T2 #_ #HT2 * /3 width=4/
130 lemma frsupp_inv_flat1_frsups: ∀J,L1,L2,W,U,T2. ⦃L1, ⓕ{J}W.U⦄ ⧁+ ⦃L2, T2⦄ →
131 ⦃L1, W⦄ ⧁* ⦃L2, T2⦄ ∨ ⦃L1, U⦄ ⧁* ⦃L2, T2⦄.
132 #J #L1 #L2 #W #U #T2 #H @(frsupp_ind … H) -L2 -T2
134 elim (frsup_inv_flat1 … H) -H #H1 * #H2 destruct /2 width=1/
135 | #L #T #L2 #T2 #_ #HT2 * /3 width=4/