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/notation/relations/crsubeqa_2.ma".
16 include "basic_2/static/aaa.ma".
18 (* LOCAL ENVIRONMENT REFINEMENT FOR ATOMIC ARITY ASSIGNMENT *****************)
20 inductive lsuba: relation lenv ≝
21 | lsuba_atom: lsuba (⋆) (⋆)
22 | lsuba_pair: ∀I,L1,L2,V. lsuba L1 L2 → lsuba (L1. ⓑ{I} V) (L2. ⓑ{I} V)
23 | lsuba_abbr: ∀L1,L2,V,W,A. L1 ⊢ V ⁝ A → L2 ⊢ W ⁝ A →
24 lsuba L1 L2 → lsuba (L1. ⓓV) (L2. ⓛW)
28 "local environment refinement (atomic arity assigment)"
29 'CrSubEqA L1 L2 = (lsuba L1 L2).
31 (* Basic inversion lemmas ***************************************************)
33 fact lsuba_inv_atom1_aux: ∀L1,L2. L1 ⁝⊑ L2 → L1 = ⋆ → L2 = ⋆.
36 | #I #L1 #L2 #V #_ #H destruct
37 | #L1 #L2 #V #W #A #_ #_ #_ #H destruct
41 lemma lsuba_inv_atom1: ∀L2. ⋆ ⁝⊑ L2 → L2 = ⋆.
44 fact lsuba_inv_pair1_aux: ∀L1,L2. L1 ⁝⊑ L2 → ∀I,K1,V. L1 = K1. ⓑ{I} V →
45 (∃∃K2. K1 ⁝⊑ K2 & L2 = K2. ⓑ{I} V) ∨
46 ∃∃K2,W,A. K1 ⊢ V ⁝ A & K2 ⊢ W ⁝ A & K1 ⁝⊑ K2 &
47 L2 = K2. ⓛW & I = Abbr.
49 [ #I #K1 #V #H destruct
50 | #J #L1 #L2 #V #HL12 #I #K1 #W #H destruct /3 width=3/
51 | #L1 #L2 #V1 #W2 #A #HV1 #HW2 #HL12 #I #K1 #V #H destruct /3 width=7/
55 lemma lsuba_inv_pair1: ∀I,K1,L2,V. K1. ⓑ{I} V ⁝⊑ L2 →
56 (∃∃K2. K1 ⁝⊑ K2 & L2 = K2. ⓑ{I} V) ∨
57 ∃∃K2,W,A. K1 ⊢ V ⁝ A & K2 ⊢ W ⁝ A & K1 ⁝⊑ K2 &
58 L2 = K2. ⓛW & I = Abbr.
61 fact lsuba_inv_atom2_aux: ∀L1,L2. L1 ⁝⊑ L2 → L2 = ⋆ → L1 = ⋆.
64 | #I #L1 #L2 #V #_ #H destruct
65 | #L1 #L2 #V #W #A #_ #_ #_ #H destruct
69 lemma lsubc_inv_atom2: ∀L1. L1 ⁝⊑ ⋆ → L1 = ⋆.
72 fact lsuba_inv_pair2_aux: ∀L1,L2. L1 ⁝⊑ L2 → ∀I,K2,W. L2 = K2. ⓑ{I} W →
73 (∃∃K1. K1 ⁝⊑ K2 & L1 = K1. ⓑ{I} W) ∨
74 ∃∃K1,V,A. K1 ⊢ V ⁝ A & K2 ⊢ W ⁝ A & K1 ⁝⊑ K2 &
75 L1 = K1. ⓓV & I = Abst.
77 [ #I #K2 #W #H destruct
78 | #J #L1 #L2 #V #HL12 #I #K2 #W #H destruct /3 width=3/
79 | #L1 #L2 #V1 #W2 #A #HV1 #HW2 #HL12 #I #K2 #W #H destruct /3 width=7/
83 lemma lsuba_inv_pair2: ∀I,L1,K2,W. L1 ⁝⊑ K2. ⓑ{I} W →
84 (∃∃K1. K1 ⁝⊑ K2 & L1 = K1. ⓑ{I} W) ∨
85 ∃∃K1,V,A. K1 ⊢ V ⁝ A & K2 ⊢ W ⁝ A & K1 ⁝⊑ K2 &
86 L1 = K1. ⓓV & I = Abst.
89 (* Basic properties *********************************************************)
91 lemma lsuba_refl: ∀L. L ⁝⊑ L.
92 #L elim L -L // /2 width=1/