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 "ground_2/relocation/rtmap_uni.ma".
16 include "basic_2/notation/relations/relation_3.ma".
17 include "basic_2/syntax/cext2.ma".
18 include "basic_2/relocation/lexs.ma".
20 (* GENERIC EXTENSION OF A CONTEXT-SENSITIVE REALTION ON TERMS ***************)
22 (* Basic_2A1: includes: lpx_sn_atom lpx_sn_pair *)
23 definition lex: (lenv → relation term) → relation lenv ≝
24 λR,L1,L2. ∃∃f. 𝐈⦃f⦄ & L1 ⪤*[cfull, cext2 R, f] L2.
26 interpretation "generic extension (local environment)"
27 'Relation R L1 L2 = (lex R L1 L2).
29 (* Basic properties *********************************************************)
31 (* Basic_2A1: was: lpx_sn_refl *)
32 lemma lex_refl: ∀R. c_reflexive … R → reflexive … (lex R).
33 /4 width=3 by lexs_refl, ext2_refl, ex2_intro/ qed.
35 (* Basic inversion lemmas ***************************************************)
37 (* Basic_2A1: was: lpx_sn_inv_atom1: *)
38 lemma lex_inv_atom_sn: ∀R,L2. ⋆ ⪤[R] L2 → L2 = ⋆.
39 #R #L2 * #f #Hf #H >(lexs_inv_atom1 … H) -L2 //
42 (* Basic_2A1: was: lpx_sn_inv_pair1 *)
43 lemma lex_inv_pair_sn: ∀R,I,L2,K1,V1. K1.ⓑ{I}V1 ⪤[R] L2 →
44 ∃∃K2,V2. K1 ⪤[R] K2 & R K1 V1 V2 & L2 = K2.ⓑ{I}V2.
45 #R #I #L2 #K1 #V1 * #f #Hf #H
46 lapply (lexs_eq_repl_fwd … H (↑f) ?) -H /2 width=1 by eq_push_inv_isid/ #H
47 elim (lexs_inv_push1 … H) -H #Z2 #K2 #HK12 #HZ2 #H destruct
48 elim (ext2_inv_pair_sn … HZ2) -HZ2 #V2 #HV12 #H destruct
49 /3 width=5 by ex3_2_intro, ex2_intro/
52 (* Basic_2A1: was: lpx_sn_inv_atom2 *)
53 lemma lex_inv_atom_dx: ∀R,L1. L1 ⪤[R] ⋆ → L1 = ⋆.
54 #R #L1 * #f #Hf #H >(lexs_inv_atom2 … H) -L1 //
57 (* Basic_2A1: was: lpx_sn_inv_pair2 *)
58 lemma lex_inv_pair_dx: ∀R,I,L1,K2,V2. L1 ⪤[R] K2.ⓑ{I}V2 →
59 ∃∃K1,V1. K1 ⪤[R] K2 & R K1 V1 V2 & L1 = K1.ⓑ{I}V1.
60 #R #I #L1 #K2 #V2 * #f #Hf #H
61 lapply (lexs_eq_repl_fwd … H (↑f) ?) -H /2 width=1 by eq_push_inv_isid/ #H
62 elim (lexs_inv_push2 … H) -H #Z1 #K1 #HK12 #HZ1 #H destruct
63 elim (ext2_inv_pair_dx … HZ1) -HZ1 #V1 #HV12 #H destruct
64 /3 width=5 by ex3_2_intro, ex2_intro/
67 (* Advanced inversion lemmas ************************************************)
69 (* Basic_2A1: was: lpx_sn_inv_pair *)
70 lemma lex_inv_pair: ∀R,I1,I2,L1,L2,V1,V2.
71 L1.ⓑ{I1}V1 ⪤[R] L2.ⓑ{I2}V2 →
72 ∧∧ L1 ⪤[R] L2 & R L1 V1 V2 & I1 = I2.
73 #R #I1 #I2 #L1 #L2 #V1 #V2 #H elim (lex_inv_pair_sn … H) -H
74 #L0 #V0 #HL10 #HV10 #H destruct /2 width=1 by and3_intro/