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 (* POINTWISE EXTENSION OF A FOCALIZED REALTION FOR TERMS ********************)
19 inductive lpx_bi (R:bi_relation lenv term): relation lenv ≝
20 | lpx_bi_stom: lpx_bi R (⋆) (⋆)
21 | lpx_bi_pair: ∀I,K1,K2,V1,V2.
22 lpx_bi R K1 K2 → R K1 V1 K2 V2 →
23 lpx_bi R (K1. ⓑ{I} V1) (K2. ⓑ{I} V2)
26 (* Basic inversion lemmas ***************************************************)
28 fact lpx_bi_inv_atom1_aux: ∀R,L1,L2. lpx_bi R L1 L2 → L1 = ⋆ → L2 = ⋆.
31 | #I #K1 #K2 #V1 #V2 #_ #_ #H destruct
35 lemma lpx_bi_inv_atom1: ∀R,L2. lpx_bi R (⋆) L2 → L2 = ⋆.
36 /2 width=4 by lpx_bi_inv_atom1_aux/ qed-.
38 fact lpx_bi_inv_pair1_aux: ∀R,L1,L2. lpx_bi R L1 L2 →
39 ∀I,K1,V1. L1 = K1. ⓑ{I} V1 →
40 ∃∃K2,V2. lpx_bi R K1 K2 &
41 R K1 V1 K2 V2 & L2 = K2. ⓑ{I} V2.
43 [ #J #K1 #V1 #H destruct
44 | #I #K1 #K2 #V1 #V2 #HK12 #HV12 #J #L #W #H destruct /2 width=5/
48 lemma lpx_bi_inv_pair1: ∀R,I,K1,V1,L2. lpx_bi R (K1. ⓑ{I} V1) L2 →
49 ∃∃K2,V2. lpx_bi R K1 K2 & R K1 V1 K2 V2 &
51 /2 width=3 by lpx_bi_inv_pair1_aux/ qed-.
53 fact lpx_bi_inv_atom2_aux: ∀R,L1,L2. lpx_bi R L1 L2 → L2 = ⋆ → L1 = ⋆.
56 | #I #K1 #K2 #V1 #V2 #_ #_ #H destruct
60 lemma lpx_bi_inv_atom2: ∀R,L1. lpx_bi R L1 (⋆) → L1 = ⋆.
61 /2 width=4 by lpx_bi_inv_atom2_aux/ qed-.
63 fact lpx_bi_inv_pair2_aux: ∀R,L1,L2. lpx_bi R L1 L2 →
64 ∀I,K2,V2. L2 = K2. ⓑ{I} V2 →
65 ∃∃K1,V1. lpx_bi R K1 K2 & R K1 V1 K2 V2 &
68 [ #J #K2 #V2 #H destruct
69 | #I #K1 #K2 #V1 #V2 #HK12 #HV12 #J #K #W #H destruct /2 width=5/
73 lemma lpx_bi_inv_pair2: ∀R,I,L1,K2,V2. lpx_bi R L1 (K2. ⓑ{I} V2) →
74 ∃∃K1,V1. lpx_bi R K1 K2 & R K1 V1 K2 V2 &
76 /2 width=3 by lpx_bi_inv_pair2_aux/ qed-.
78 (* Basic forward lemmas *****************************************************)
80 lemma lpx_bi_fwd_length: ∀R,L1,L2. lpx_bi R L1 L2 → |L1| = |L2|.
81 #R #L1 #L2 #H elim H -L1 -L2 normalize //
84 (* Basic properties *********************************************************)
86 lemma lpx_bi_refl: ∀R. bi_reflexive ? ? R → reflexive … (lpx_bi R).
87 #R #HR #L elim L -L // /2 width=1/