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_bind: ∀I,L1,L2. lsuba G L1 L2 → lsuba G (L1.ⓘ{I}) (L2.ⓘ{I})
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 #_ #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_bind1_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → ∀I,K1. L1 = K1.ⓘ{I} →
45 (∃∃K2. G ⊢ K1 ⫃⁝ K2 & L2 = K2.ⓘ{I}) ∨
46 ∃∃K2,W,V,A. ⦃G, K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G, K2⦄ ⊢ W ⁝ A &
47 G ⊢ K1 ⫃⁝ K2 & I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW.
50 | #I #L1 #L2 #HL12 #J #K1 #H destruct /3 width=3 by ex2_intro, or_introl/
51 | #L1 #L2 #W #V #A #HV #HW #HL12 #J #K1 #H destruct /3 width=9 by ex5_4_intro, or_intror/
55 lemma lsuba_inv_bind1: ∀I,G,K1,L2. G ⊢ K1.ⓘ{I} ⫃⁝ L2 →
56 (∃∃K2. G ⊢ K1 ⫃⁝ K2 & L2 = K2.ⓘ{I}) ∨
57 ∃∃K2,W,V,A. ⦃G, K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G, K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃⁝ K2 &
58 I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW.
59 /2 width=3 by lsuba_inv_bind1_aux/ qed-.
61 fact lsuba_inv_atom2_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → L2 = ⋆ → L1 = ⋆.
64 | #I #L1 #L2 #_ #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_bind2_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → ∀I,K2. L2 = K2.ⓘ{I} →
73 (∃∃K1. G ⊢ K1 ⫃⁝ K2 & L1 = K1.ⓘ{I}) ∨
74 ∃∃K1,V,W, A. ⦃G, K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G, K2⦄ ⊢ W ⁝ A &
75 G ⊢ K1 ⫃⁝ K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V.
78 | #I #L1 #L2 #HL12 #J #K2 #H destruct /3 width=3 by ex2_intro, or_introl/
79 | #L1 #L2 #W #V #A #HV #HW #HL12 #J #K2 #H destruct /3 width=9 by ex5_4_intro, or_intror/
83 lemma lsuba_inv_bind2: ∀I,G,L1,K2. G ⊢ L1 ⫃⁝ K2.ⓘ{I} →
84 (∃∃K1. G ⊢ K1 ⫃⁝ K2 & L1 = K1.ⓘ{I}) ∨
85 ∃∃K1,V,W,A. ⦃G, K1⦄ ⊢ ⓝW.V ⁝ A & ⦃G, K2⦄ ⊢ W ⁝ A & G ⊢ K1 ⫃⁝ K2 &
86 I = BPair Abst W & L1 = K1.ⓓⓝW.V.
87 /2 width=3 by lsuba_inv_bind2_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_bind/