]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/static/lsuba.ma
syntactic components detached from basic_2 become static_2
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / static / lsuba.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "static_2/notation/relations/lrsubeqa_3.ma".
16 include "static_2/static/aaa.ma".
17
18 (* RESTRICTED REFINEMENT FOR ATOMIC ARITY ASSIGNMENT ************************)
19
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)
25 .
26
27 interpretation
28   "local environment refinement (atomic arity assignment)"
29   'LRSubEqA G L1 L2 = (lsuba G L1 L2).
30
31 (* Basic inversion lemmas ***************************************************)
32
33 fact lsuba_inv_atom1_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → L1 = ⋆ → L2 = ⋆.
34 #G #L1 #L2 * -L1 -L2
35 [ //
36 | #I #L1 #L2 #_ #H destruct
37 | #L1 #L2 #W #V #A #_ #_ #_ #H destruct
38 ]
39 qed-.
40
41 lemma lsuba_inv_atom1: ∀G,L2. G ⊢ ⋆ ⫃⁝ L2 → L2 = ⋆.
42 /2 width=4 by lsuba_inv_atom1_aux/ qed-.
43
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.
48 #G #L1 #L2 * -L1 -L2
49 [ #J #K1 #H destruct
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/
52 ]
53 qed-.
54
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-.
60
61 fact lsuba_inv_atom2_aux: ∀G,L1,L2. G ⊢ L1 ⫃⁝ L2 → L2 = ⋆ → L1 = ⋆.
62 #G #L1 #L2 * -L1 -L2
63 [ //
64 | #I #L1 #L2 #_ #H destruct
65 | #L1 #L2 #W #V #A #_ #_ #_ #H destruct
66 ]
67 qed-.
68
69 lemma lsubc_inv_atom2: ∀G,L1. G ⊢ L1 ⫃⁝ ⋆ → L1 = ⋆.
70 /2 width=4 by lsuba_inv_atom2_aux/ qed-.
71
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.
76 #G #L1 #L2 * -L1 -L2
77 [ #J #K2 #H destruct
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/
80 ]
81 qed-.
82
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-.
88
89 (* Basic properties *********************************************************)
90
91 lemma lsuba_refl: ∀G,L. G ⊢ L ⫃⁝ L.
92 #G #L elim L -L /2 width=1 by lsuba_atom, lsuba_bind/
93 qed.