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 include "basic_2/substitution/ldrop_append.ma".
16 include "basic_2/multiple/llor_ldrop.ma".
18 (* POINTWISE UNION FOR LOCAL ENVIRONMENTS ***********************************)
20 lemma lt_plus_SO_to_le: ∀x,y. x < y + 1 → x ≤ y.
21 /2 width=1 by monotonic_pred/ qed-.
24 lemma llor_tail_frees: ∀L1,L2,L,U,d. L1 ⩖[U, d] L2 ≡ L → d < yinj (|L1|) →
25 ∀I1,W1. ⓑ{I1}W1.L1 ⊢ |L1| ϵ 𝐅*[d]⦃U⦄ →
26 ∀I2,W2. ⓑ{I1}W1.L1 ⩖[U, d] ⓑ{I2}W2.L2 ≡ ⓑ{I1}W2.L.
27 #L1 #L2 #L #U #d * #HL12 #HL1 #IH #Hd #I1 #W1 #HU #I2 #W2
28 @and3_intro [1,2: >ltail_length /2 width=1 by le_S_S/ ]
29 #J1 #J2 #J #K1 #K2 #K #V1 #V2 #V #i #HLK1 #HLK2 #HLK
30 lapply (ldrop_fwd_length_lt2 … HLK1) >ltail_length #H
31 lapply (lt_plus_SO_to_le … H) -H #H
32 elim (le_to_or_lt_eq … H) -H #H
33 [ elim (ldrop_O1_lt (Ⓕ) … H) #Z1 #Y1 #X1 #HLY1
34 elim (ldrop_O1_lt (Ⓕ) L2 i) [2: /2 width=3 by lt_to_le_to_lt/ ] #Z2 #Y2 #X2 #HLY2
35 elim (ldrop_O1_lt (Ⓕ) L i) // #Z #Y #X #HLY
36 lapply (ldrop_O1_inv_append1_le … HLK1 … HLY1) /2 width=1 by lt_to_le/ -HLK1 normalize #H destruct
37 lapply (ldrop_O1_inv_append1_le … HLK2 … HLY2) /3 width=3 by lt_to_le_to_lt, lt_to_le/ -HLK2 normalize #H destruct
38 lapply (ldrop_O1_inv_append1_le … HLK … HLY) /2 width=1 by lt_to_le/ -HLK normalize #H destruct
39 elim (IH … HLY1 HLY2 HLY) -IH -HLY1 -HLY2 -HLY *
40 [ /3 width=1 by and3_intro, or3_intro0/
45 lapply (ldrop_O1_inv_append1_le … HLK1 … (⋆) ?) // -HLK1 normalize #H destruct
46 lapply (ldrop_O1_inv_append1_le … HLK2 … HL12)
47 lapply (ldrop_O1_inv_append1_le … HLK … (⋆) ?) // -HLK normalize #H destruct
48 @or3_intro2 @and4_intro /2 width=1 by ylt_fwd_le/