(**************************************************************************) (* ___ *) (* ||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 "basic_2/notation/relations/lazyeq_4.ma". include "basic_2/multiple/llpx_sn.ma". (* LAZY EQUIVALENCE FOR LOCAL ENVIRONMENTS **********************************) (* Basic inversion lemmas ***************************************************) lemma lleq_ind: ∀R:relation4 ynat term lenv lenv. ( ∀L1,L2,l,s. |L1| = |L2| → R l (⋆s) L1 L2 ) → ( ∀L1,L2,l,i. |L1| = |L2| → yinj i < l → R l (#i) L1 L2 ) → ( ∀I,L1,L2,K1,K2,V,l,i. l ≤ yinj i → ⬇[i] L1 ≡ K1.ⓑ{I}V → ⬇[i] L2 ≡ K2.ⓑ{I}V → K1 ≡[V, yinj O] K2 → R (yinj O) V K1 K2 → R l (#i) L1 L2 ) → ( ∀L1,L2,l,i. |L1| = |L2| → |L1| ≤ i → |L2| ≤ i → R l (#i) L1 L2 ) → ( ∀L1,L2,l,p. |L1| = |L2| → R l (§p) L1 L2 ) → ( ∀a,I,L1,L2,V,T,l. L1 ≡[V, l]L2 → L1.ⓑ{I}V ≡[T, ⫯l] L2.ⓑ{I}V → R l V L1 L2 → R (⫯l) T (L1.ⓑ{I}V) (L2.ⓑ{I}V) → R l (ⓑ{a,I}V.T) L1 L2 ) → ( ∀I,L1,L2,V,T,l. L1 ≡[V, l]L2 → L1 ≡[T, l] L2 → R l V L1 L2 → R l T L1 L2 → R l (ⓕ{I}V.T) L1 L2 ) → ∀l,T,L1,L2. L1 ≡[T, l] L2 → R l T L1 L2. #R #H1 #H2 #H3 #H4 #H5 #H6 #H7 #l #T #L1 #L2 #H elim H -L1 -L2 -T -l /2 width=8 by/ qed-. (* Basic forward lemmas *****************************************************) lemma lleq_fwd_lref: ∀L1,L2,l,i. L1 ≡[#i, l] L2 → ∨∨ |L1| ≤ i ∧ |L2| ≤ i | yinj i < l | ∃∃I,K1,K2,V. ⬇[i] L1 ≡ K1.ⓑ{I}V & ⬇[i] L2 ≡ K2.ⓑ{I}V & K1 ≡[V, yinj 0] K2 & l ≤ yinj i. #L1 #L2 #l #i #H elim (llpx_sn_fwd_lref … H) /2 width=1 by or3_intro0, or3_intro1/ * /3 width=7 by or3_intro2, ex4_4_intro/ qed-. lemma lleq_fwd_drop_sn: ∀L1,L2,T,l. L1 ≡[l, T] L2 → ∀K1,i. ⬇[i] L1 ≡ K1 → ∃K2. ⬇[i] L2 ≡ K2. /2 width=7 by llpx_sn_fwd_drop_sn/ qed-. lemma lleq_fwd_drop_dx: ∀L1,L2,T,l. L1 ≡[l, T] L2 → ∀K2,i. ⬇[i] L2 ≡ K2 → ∃K1. ⬇[i] L1 ≡ K1. /2 width=7 by llpx_sn_fwd_drop_dx/ qed-. (* Basic properties *********************************************************) lemma lleq_lref: ∀I,L1,L2,K1,K2,V,l,i. l ≤ yinj i → ⬇[i] L1 ≡ K1.ⓑ{I}V → ⬇[i] L2 ≡ K2.ⓑ{I}V → K1 ≡[V, 0] K2 → L1 ≡[#i, l] L2. /2 width=9 by llpx_sn_lref/ qed.