]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/static/lsuba.ma
5d087c93c7f7fb0e21a32ae3f0b6dc41258c5d45
[helm.git] / matita / matita / contribs / lambda_delta / basic_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 "Basic_2/static/aaa.ma".
16
17 (* LOCAL ENVIRONMENT REFINEMENT FOR ATOMIC ARITY ASSIGNMENT *****************)
18
19 inductive lsuba: relation lenv ≝
20 | lsuba_atom: lsuba (⋆) (⋆)
21 | lsuba_pair: ∀I,L1,L2,V. lsuba L1 L2 → lsuba (L1. ⓑ{I} V) (L2. ⓑ{I} V)
22 | lsuba_abbr: ∀L1,L2,V,W,A. L1 ⊢ V ÷ A → L2 ⊢ W ÷ A → 
23               lsuba L1 L2 → lsuba (L1. ⓓV) (L2. ⓛW)
24 .
25
26 interpretation
27   "local environment refinement (atomic arity assigment)"
28   'CrSubEqA L1 L2 = (lsuba L1 L2).
29
30 (* Basic inversion lemmas ***************************************************)
31
32 fact lsuba_inv_atom1_aux: ∀L1,L2. L1 ÷⊑ L2 → L1 = ⋆ → L2 = ⋆.
33 #L1 #L2 * -L1 -L2
34 [ //
35 | #I #L1 #L2 #V #_ #H destruct
36 | #L1 #L2 #V #W #A #_ #_ #_ #H destruct
37 ]
38 qed.
39
40 lemma lsuba_inv_atom1: ∀L2. ⋆ ÷⊑ L2 → L2 = ⋆.
41 /2 width=3/ qed-.
42
43 fact lsuba_inv_pair1_aux: ∀L1,L2. L1 ÷⊑ L2 → ∀I,K1,V. L1 = K1. ⓑ{I} V →
44                           (∃∃K2. K1 ÷⊑ K2 & L2 = K2. ⓑ{I} V) ∨
45                           ∃∃K2,W,A. K1 ⊢ V ÷ A & K2 ⊢ W ÷ A & K1 ÷⊑ K2 &
46                                     L2 = K2. ⓛW & I = Abbr.
47 #L1 #L2 * -L1 -L2
48 [ #I #K1 #V #H destruct
49 | #J #L1 #L2 #V #HL12 #I #K1 #W #H destruct /3 width=3/
50 | #L1 #L2 #V1 #W2 #A #HV1 #HW2 #HL12 #I #K1 #V #H destruct /3 width=7/
51 ]
52 qed.
53
54 lemma lsuba_inv_pair1: ∀I,K1,L2,V. K1. ⓑ{I} V ÷⊑ L2 →
55                        (∃∃K2. K1 ÷⊑ K2 & L2 = K2. ⓑ{I} V) ∨
56                        ∃∃K2,W,A. K1 ⊢ V ÷ A & K2 ⊢ W ÷ A & K1 ÷⊑ K2 &
57                                  L2 = K2. ⓛW & I = Abbr.
58 /2 width=3/ qed-.
59
60 fact lsuba_inv_atom2_aux: ∀L1,L2. L1 ÷⊑ L2 → L2 = ⋆ → L1 = ⋆.
61 #L1 #L2 * -L1 -L2
62 [ //
63 | #I #L1 #L2 #V #_ #H destruct
64 | #L1 #L2 #V #W #A #_ #_ #_ #H destruct
65 ]
66 qed.
67
68 lemma lsubc_inv_atom2: ∀L1. L1 ÷⊑ ⋆ → L1 = ⋆.
69 /2 width=3/ qed-.
70
71 fact lsuba_inv_pair2_aux: ∀L1,L2. L1 ÷⊑ L2 → ∀I,K2,W. L2 = K2. ⓑ{I} W →
72                           (∃∃K1. K1 ÷⊑ K2 & L1 = K1. ⓑ{I} W) ∨
73                           ∃∃K1,V,A. K1 ⊢ V ÷ A & K2 ⊢ W ÷ A & K1 ÷⊑ K2 &
74                                     L1 = K1. ⓓV & I = Abst.
75 #L1 #L2 * -L1 -L2
76 [ #I #K2 #W #H destruct
77 | #J #L1 #L2 #V #HL12 #I #K2 #W #H destruct /3 width=3/
78 | #L1 #L2 #V1 #W2 #A #HV1 #HW2 #HL12 #I #K2 #W #H destruct /3 width=7/
79 ]
80 qed.
81
82 lemma lsuba_inv_pair2: ∀I,L1,K2,W. L1 ÷⊑ K2. ⓑ{I} W →
83                        (∃∃K1. K1 ÷⊑ K2 & L1 = K1. ⓑ{I} W) ∨
84                        ∃∃K1,V,A. K1 ⊢ V ÷ A & K2 ⊢ W ÷ A & K1 ÷⊑ K2 &
85                                  L1 = K1. ⓓV & I = Abst.
86 /2 width=3/ qed-.
87
88 (* Basic properties *********************************************************)
89
90 lemma lsuba_refl: ∀L. L ÷⊑ L.
91 #L elim L -L // /2 width=1/
92 qed.