2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department of the University of Bologna, Italy.
7 ||A|| This file is distributed under the terms of the
8 \ / GNU General Public License Version 2
10 V_______________________________________________________________ *)
12 include "lambda-delta/syntax/lenv.ma".
14 (* LOCAL ENVIRONMENT EQUALITY ***********************************************)
16 inductive leq: lenv → nat → nat → lenv → Prop ≝
17 | leq_sort: ∀d,e. leq (⋆) d e (⋆)
18 | leq_comp: ∀L1,L2,I1,I2,V1,V2.
19 leq L1 0 0 L2 → leq (L1. 𝕓{I1} V1) 0 0 (L2. 𝕓{I2} V2)
20 | leq_eq: ∀L1,L2,I,V,e. leq L1 0 e L2 → leq (L1. 𝕓{I} V) 0 (e + 1) (L2.𝕓{I} V)
21 | leq_skip: ∀L1,L2,I1,I2,V1,V2,d,e.
22 leq L1 d e L2 → leq (L1. 𝕓{I1} V1) (d + 1) e (L2. 𝕓{I2} V2)
25 interpretation "local environment equality" 'Eq L1 d e L2 = (leq L1 d e L2).
27 (* Basic properties *********************************************************)
29 lemma leq_refl: ∀d,e,L. L [d, e] ≈ L.
31 [ #e elim e -e [ #L elim L -L /2/ | #e #IHe #L elim L -L /2/ ]
32 | #d #IHd #e #L elim L -L /2/
36 lemma leq_sym: ∀L1,L2,d,e. L1 [d, e] ≈ L2 → L2 [d, e] ≈ L1.
37 #L1 #L2 #d #e #H elim H -H L1 L2 d e /2/
40 lemma leq_skip_lt: ∀L1,L2,d,e. leq L1 (d - 1) e L2 → 0 < d →
41 ∀I1,I2,V1,V2. L1. 𝕓{I1} V1 [d, e] ≈ L2. 𝕓{I2} V2.
43 #L1 #L2 #d #e #HL12 #Hd >(plus_minus_m_m d 1) /2/
46 (* Basic inversion lemmas ***************************************************)
48 lemma leq_inv_sort1_aux: ∀L1,L2,d,e. L1 [d, e] ≈ L2 → L1 = ⋆ → L2 = ⋆.
49 #L1 #L2 #d #e #H elim H -H L1 L2 d e
51 | #L1 #L2 #I1 #I2 #V1 #V2 #_ #_ #H destruct
52 | #L1 #L2 #I #V #e #_ #_ #H destruct
53 | #L1 #L2 #I1 #I2 #V1 #V2 #d #e #_ #_ #H destruct
56 lemma leq_inv_sort1: ∀L2,d,e. ⋆ [d, e] ≈ L2 → L2 = ⋆.
59 lemma leq_inv_sort2: ∀L1,d,e. L1 [d, e] ≈ ⋆ → L1 = ⋆.