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/lrsubeqa_3.ma".
16 include "basic_2/static/aaa.ma".
18 (* RESTRICTED REFINEMENT FOR ATOMIC ARITY ASSIGNMENT ************************)
20 inductive lsuba (G:genv): relation lenv ≝
21 | lsuba_atom: lsuba G (⋆) (⋆)
22 | lsuba_pair: ∀I,L1,L2,V. lsuba G L1 L2 → lsuba G (L1.ⓑ{I}V) (L2.ⓑ{I}V)
23 | lsuba_beta: ∀L1,L2,W,V,A. ⦃G, L1⦄ ⊢ ⓝW.V ⁝ A → ⦃G, L2⦄ ⊢ W ⁝ A →
24 lsuba G L1 L2 → lsuba G (L1.ⓓⓝW.V) (L2.ⓛW)
28 "local environment refinement (atomic arity assignment)"
29 'LRSubEqA G L1 L2 = (lsuba G L1 L2).
31 (* Basic inversion lemmas ***************************************************)
33 fact lsuba_inv_atom1_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → L1 = ⋆ → L2 = ⋆.
36 | #I #L1 #L2 #V #_ #H destruct
37 | #L1 #L2 #W #V #A #_ #_ #_ #H destruct
41 lemma lsuba_inv_atom1: ∀G,L2. G ⊢ ⋆ ⫃⁝ L2 → L2 = ⋆.
42 /2 width=4 by lsuba_inv_atom1_aux/ qed-.
44 fact lsuba_inv_pair1_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → ∀I,K1,X. L1 = K1.ⓑ{I}X →
45 (∃∃K2. G ⊢ K1 ⫃⁝ K2 & L2 = K2.ⓑ{I}X) ∨
46 ∃∃K2,W,V,A. ⦃G, K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G, K2⦄ ⊢ W ⁝ A &
47 G ⊢ K1 ⫃⁝ K2 & I = Abbr & L2 = K2.ⓛW & X = ⓝW.V.
49 [ #J #K1 #X #H destruct
50 | #I #L1 #L2 #V #HL12 #J #K1 #X #H destruct /3 width=3 by ex2_intro, or_introl/
51 | #L1 #L2 #W #V #A #HV #HW #HL12 #J #K1 #X #H destruct /3 width=9 by or_intror, ex6_4_intro/
55 lemma lsuba_inv_pair1: ∀I,G,K1,L2,X. G ⊢ K1.ⓑ{I}X ⫃⁝ L2 →
56 (∃∃K2. G ⊢ K1 ⫃⁝ K2 & L2 = K2.ⓑ{I}X) ∨
57 ∃∃K2,W,V,A. ⦃G, K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G, K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃⁝ K2 &
58 I = Abbr & L2 = K2.ⓛW & X = ⓝW.V.
59 /2 width=3 by lsuba_inv_pair1_aux/ qed-.
61 fact lsuba_inv_atom2_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → L2 = ⋆ → L1 = ⋆.
64 | #I #L1 #L2 #V #_ #H destruct
65 | #L1 #L2 #W #V #A #_ #_ #_ #H destruct
69 lemma lsubc_inv_atom2: ∀G,L1. G ⊢ L1 ⫃⁝ ⋆ → L1 = ⋆.
70 /2 width=4 by lsuba_inv_atom2_aux/ qed-.
72 fact lsuba_inv_pair2_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → ∀I,K2,W. L2 = K2.ⓑ{I}W →
73 (∃∃K1. G ⊢ K1 ⫃⁝ K2 & L1 = K1.ⓑ{I}W) ∨
74 ∃∃K1,V,A. ⦃G, K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G, K2⦄ ⊢ W ⁝ A &
75 G ⊢ K1 ⫃⁝ K2 & I = Abst & L1 = K1.ⓓⓝW.V.
77 [ #J #K2 #U #H destruct
78 | #I #L1 #L2 #V #HL12 #J #K2 #U #H destruct /3 width=3 by ex2_intro, or_introl/
79 | #L1 #L2 #W #V #A #HV #HW #HL12 #J #K2 #U #H destruct /3 width=7 by or_intror, ex5_3_intro/
83 lemma lsuba_inv_pair2: ∀I,G,L1,K2,W. G ⊢ L1 ⫃⁝ K2.ⓑ{I}W →
84 (∃∃K1. G ⊢ K1 ⫃⁝ K2 & L1 = K1.ⓑ{I}W) ∨
85 ∃∃K1,V,A. ⦃G, K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G, K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃⁝ K2 &
86 I = Abst & L1 = K1.ⓓⓝW.V.
87 /2 width=3 by lsuba_inv_pair2_aux/ qed-.
89 (* Basic properties *********************************************************)
91 lemma lsuba_refl: ∀G,L. G ⊢ L ⫃⁝ L.
92 #G #L elim L -L /2 width=1 by lsuba_atom, lsuba_pair/