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( ⦃ L1, break T1 ⦄ > * break ⦃ L2 , break T2 ⦄ )"
16 non associative with precedence 45
17 for @{ 'SupTermStar $L1 $T1 $L2 $T2 }.
19 include "basic_2/substitution/csup.ma".
20 include "basic_2/unfold/csupp.ma".
22 (* STAR-ITERATED SUPCLOSURE *************************************************)
24 definition csups: bi_relation lenv term ≝ bi_star … csup.
26 interpretation "star-iterated structural predecessor (closure)"
27 'SupTermStar L1 T1 L2 T2 = (csups L1 T1 L2 T2).
29 (* Basic eliminators ********************************************************)
31 lemma csups_ind: ∀L1,T1. ∀R:relation2 lenv term. R L1 T1 →
32 (∀L,L2,T,T2. ⦃L1, T1⦄ >* ⦃L, T⦄ → ⦃L, T⦄ > ⦃L2, T2⦄ → R L T → R L2 T2) →
33 ∀L2,T2. ⦃L1, T1⦄ >* ⦃L2, T2⦄ → R L2 T2.
34 #L1 #T1 #R #IH1 #IH2 #L2 #T2 #H
35 @(bi_star_ind … IH1 IH2 ? ? H)
38 lemma csups_ind_dx: ∀L2,T2. ∀R:relation2 lenv term. R L2 T2 →
39 (∀L1,L,T1,T. ⦃L1, T1⦄ > ⦃L, T⦄ → ⦃L, T⦄ >* ⦃L2, T2⦄ → R L T → R L1 T1) →
40 ∀L1,T1. ⦃L1, T1⦄ >* ⦃L2, T2⦄ → R L1 T1.
41 #L2 #T2 #R #IH1 #IH2 #L1 #T1 #H
42 @(bi_star_ind_dx … IH1 IH2 ? ? H)
45 (* Basic properties *********************************************************)
47 lemma csups_refl: bi_reflexive … csups.
50 lemma csupp_csups: ∀L1,L2,T1,T2. ⦃L1, T1⦄ >+ ⦃L2, T2⦄ → ⦃L1, T1⦄ >* ⦃L2, T2⦄.
53 lemma csup_csups: ∀L1,L2,T1,T2. ⦃L1, T1⦄ > ⦃L2, T2⦄ → ⦃L1, T1⦄ >* ⦃L2, T2⦄.
56 lemma csups_strap1: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ >* ⦃L, T⦄ → ⦃L, T⦄ > ⦃L2, T2⦄ →
60 lemma csups_strap2: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ > ⦃L, T⦄ → ⦃L, T⦄ >* ⦃L2, T2⦄ →
64 lemma csups_csupp_csupp: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ >* ⦃L, T⦄ →
65 ⦃L, T⦄ >+ ⦃L2, T2⦄ → ⦃L1, T1⦄ >+ ⦃L2, T2⦄.
68 lemma csupp_csups_csupp: ∀L1,L,L2,T1,T,T2. ⦃L1, T1⦄ >+ ⦃L, T⦄ →
69 ⦃L, T⦄ >* ⦃L2, T2⦄ → ⦃L1, T1⦄ >+ ⦃L2, T2⦄.
72 (* Basic forward lemmas *****************************************************)
74 lemma csups_fwd_cw: ∀L1,L2,T1,T2. ⦃L1, T1⦄ >* ⦃L2, T2⦄ → #{L2, T2} ≤ #{L1, T1}.
75 #L1 #L2 #T1 #T2 #H @(csups_ind … H) -L2 -T2 //
76 /4 width=3 by csup_fwd_cw, lt_to_le_to_lt, lt_to_le/ (**) (* slow even with trace *)
79 (* Advanced inversion lemmas for csupp **************************************)
81 lemma csupp_inv_atom1_csups: ∀J,L1,L2,T2. ⦃L1, ⓪{J}⦄ >+ ⦃L2, T2⦄ →
82 ∃∃I,K,V,i. ⇩[0, i] L1 ≡ K.ⓑ{I}V &
83 ⦃K, V⦄ >* ⦃L2, T2⦄ & J = LRef i.
84 #J #L1 #L2 #T2 #H @(csupp_ind … H) -L2 -T2
86 elim (csup_inv_atom1 … H) -H * #i #HL12 #H destruct /2 width=7/
87 | #L #T #L2 #T2 #_ #HT2 * #I #K #V #i #HLK #HVT #H destruct /3 width=8/
91 lemma csupp_inv_bind1_csups: ∀b,J,L1,L2,W,U,T2. ⦃L1, ⓑ{b,J}W.U⦄ >+ ⦃L2, T2⦄ →
92 ⦃L1, W⦄ >* ⦃L2, T2⦄ ∨ ⦃L1.ⓑ{J}W, U⦄ >* ⦃L2, T2⦄.
93 #b #J #L1 #L2 #W #U #T2 #H @(csupp_ind … H) -L2 -T2
95 elim (csup_inv_bind1 … H) -H * #H1 #H2 destruct /2 width=1/
96 | #L #T #L2 #T2 #_ #HT2 * /3 width=4/
100 lemma csupp_inv_flat1_csups: ∀J,L1,L2,W,U,T2. ⦃L1, ⓕ{J}W.U⦄ >+ ⦃L2, T2⦄ →
101 ⦃L1, W⦄ >* ⦃L2, T2⦄ ∨ ⦃L1, U⦄ >* ⦃L2, T2⦄.
102 #J #L1 #L2 #W #U #T2 #H @(csupp_ind … H) -L2 -T2
104 elim (csup_inv_flat1 … H) -H #H1 * #H2 destruct /2 width=1/
105 | #L #T #L2 #T2 #_ #HT2 * /3 width=4/