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/grammar/lenv_length.ma".
17 (* LOCAL ENVIRONMENT EQUALITY ***********************************************)
19 notation "hvbox( T1 break [ d , break e ] ≈ break T2 )"
20 non associative with precedence 45
21 for @{ 'Eq $T1 $d $e $T2 }.
23 inductive leq: nat → nat → relation lenv ≝
24 | leq_sort: ∀d,e. leq d e (⋆) (⋆)
25 | leq_OO: ∀L1,L2. leq 0 0 L1 L2
26 | leq_eq: ∀L1,L2,I,V,e. leq 0 e L1 L2 →
27 leq 0 (e + 1) (L1. 𝕓{I} V) (L2.𝕓{I} V)
28 | leq_skip: ∀L1,L2,I1,I2,V1,V2,d,e.
29 leq d e L1 L2 → leq (d + 1) e (L1. 𝕓{I1} V1) (L2. 𝕓{I2} V2)
32 interpretation "local environment equality" 'Eq L1 d e L2 = (leq d e L1 L2).
34 definition leq_repl_dx: ∀S. (lenv → relation S) → Prop ≝ λS,R.
35 ∀L1,s1,s2. R L1 s1 s2 →
36 ∀L2,d,e. L1 [d, e]≈ L2 → R L2 s1 s2.
38 (* Basic properties *********************************************************)
40 lemma TC_leq_repl_dx: ∀S,R. leq_repl_dx S R → leq_repl_dx S (λL. (TC … (R L))).
41 #S #R #HR #L1 #s1 #s2 #H elim H -H s2
43 | #s #s2 #_ #Hs2 #IHs1 #L2 #d #e #HL12
44 lapply (HR … Hs2 … HL12) -HR Hs2 HL12 /3/
48 lemma leq_refl: ∀d,e,L. L [d, e] ≈ L.
50 [ #e elim e -e // #e #IHe #L elim L -L /2/
51 | #d #IHd #e #L elim L -L /2/
55 lemma leq_sym: ∀L1,L2,d,e. L1 [d, e] ≈ L2 → L2 [d, e] ≈ L1.
56 #L1 #L2 #d #e #H elim H -H L1 L2 d e /2/
59 lemma leq_skip_lt: ∀L1,L2,d,e. L1 [d - 1, e] ≈ L2 → 0 < d →
60 ∀I1,I2,V1,V2. L1. 𝕓{I1} V1 [d, e] ≈ L2. 𝕓{I2} V2.
62 #L1 #L2 #d #e #HL12 #Hd >(plus_minus_m_m d 1) /2/
65 (* Basic inversion lemmas ***************************************************)