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/xoa/ex_5_4.ma".
16 include "static_2/notation/relations/lrsubeqa_3.ma".
17 include "static_2/static/aaa.ma".
19 (* RESTRICTED REFINEMENT FOR ATOMIC ARITY ASSIGNMENT ************************)
21 inductive lsuba (G:genv): relation lenv ≝
22 | lsuba_atom: lsuba G (⋆) (⋆)
23 | lsuba_bind: ∀I,L1,L2. lsuba G L1 L2 → lsuba G (L1.ⓘ[I]) (L2.ⓘ[I])
24 | lsuba_beta: ∀L1,L2,W,V,A. ❨G,L1❩ ⊢ ⓝW.V ⁝ A → ❨G,L2❩ ⊢ W ⁝ A →
25 lsuba G L1 L2 → lsuba G (L1.ⓓⓝW.V) (L2.ⓛW)
29 "local environment refinement (atomic arity assignment)"
30 'LRSubEqA G L1 L2 = (lsuba G L1 L2).
32 (* Basic inversion lemmas ***************************************************)
34 fact lsuba_inv_atom1_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → L1 = ⋆ → L2 = ⋆.
37 | #I #L1 #L2 #_ #H destruct
38 | #L1 #L2 #W #V #A #_ #_ #_ #H destruct
42 lemma lsuba_inv_atom1: ∀G,L2. G ⊢ ⋆ ⫃⁝ L2 → L2 = ⋆.
43 /2 width=4 by lsuba_inv_atom1_aux/ qed-.
45 fact lsuba_inv_bind1_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → ∀I,K1. L1 = K1.ⓘ[I] →
46 (∃∃K2. G ⊢ K1 ⫃⁝ K2 & L2 = K2.ⓘ[I]) ∨
47 ∃∃K2,W,V,A. ❨G,K1❩ ⊢ ⓝW.V ⁝ A & ❨G,K2❩ ⊢ W ⁝ A &
48 G ⊢ K1 ⫃⁝ K2 & I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW.
51 | #I #L1 #L2 #HL12 #J #K1 #H destruct /3 width=3 by ex2_intro, or_introl/
52 | #L1 #L2 #W #V #A #HV #HW #HL12 #J #K1 #H destruct /3 width=9 by ex5_4_intro, or_intror/
56 lemma lsuba_inv_bind1: ∀I,G,K1,L2. G ⊢ K1.ⓘ[I] ⫃⁝ L2 →
57 (∃∃K2. G ⊢ K1 ⫃⁝ K2 & L2 = K2.ⓘ[I]) ∨
58 ∃∃K2,W,V,A. ❨G,K1❩ ⊢ ⓝW.V ⁝ A & ❨G,K2❩ ⊢ W ⁝ A & G ⊢ K1 ⫃⁝ K2 &
59 I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW.
60 /2 width=3 by lsuba_inv_bind1_aux/ qed-.
62 fact lsuba_inv_atom2_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → L2 = ⋆ → L1 = ⋆.
65 | #I #L1 #L2 #_ #H destruct
66 | #L1 #L2 #W #V #A #_ #_ #_ #H destruct
70 lemma lsuba_inv_atom2: ∀G,L1. G ⊢ L1 ⫃⁝ ⋆ → L1 = ⋆.
71 /2 width=4 by lsuba_inv_atom2_aux/ qed-.
73 fact lsuba_inv_bind2_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → ∀I,K2. L2 = K2.ⓘ[I] →
74 (∃∃K1. G ⊢ K1 ⫃⁝ K2 & L1 = K1.ⓘ[I]) ∨
75 ∃∃K1,V,W,A. ❨G,K1❩ ⊢ ⓝW.V ⁝ A & ❨G,K2❩ ⊢ W ⁝ A &
76 G ⊢ K1 ⫃⁝ K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V.
79 | #I #L1 #L2 #HL12 #J #K2 #H destruct /3 width=3 by ex2_intro, or_introl/
80 | #L1 #L2 #W #V #A #HV #HW #HL12 #J #K2 #H destruct /3 width=9 by ex5_4_intro, or_intror/
84 lemma lsuba_inv_bind2: ∀I,G,L1,K2. G ⊢ L1 ⫃⁝ K2.ⓘ[I] →
85 (∃∃K1. G ⊢ K1 ⫃⁝ K2 & L1 = K1.ⓘ[I]) ∨
86 ∃∃K1,V,W,A. ❨G,K1❩ ⊢ ⓝW.V ⁝ A & ❨G,K2❩ ⊢ W ⁝ A & G ⊢ K1 ⫃⁝ K2 &
87 I = BPair Abst W & L1 = K1.ⓓⓝW.V.
88 /2 width=3 by lsuba_inv_bind2_aux/ qed-.
90 (* Basic properties *********************************************************)
92 lemma lsuba_refl: ∀G,L. G ⊢ L ⫃⁝ L.
93 #G #L elim L -L /2 width=1 by lsuba_atom, lsuba_bind/