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 "static_2/notation/relations/lrsubeqc_4.ma".
16 include "static_2/static/aaa.ma".
17 include "static_2/static/gcp_cr.ma".
19 (* LOCAL ENVIRONMENT REFINEMENT FOR GENERIC REDUCIBILITY ********************)
21 inductive lsubc (RP) (G): relation lenv ≝
22 | lsubc_atom: lsubc RP G (⋆) (⋆)
23 | lsubc_bind: ∀I,L1,L2. lsubc RP G L1 L2 → lsubc RP G (L1.ⓘ{I}) (L2.ⓘ{I})
24 | lsubc_beta: ∀L1,L2,V,W,A. ⦃G, L1, V⦄ ϵ[RP] 〚A〛 → ⦃G, L1, W⦄ ϵ[RP] 〚A〛 → ⦃G, L2⦄ ⊢ W ⁝ A →
25 lsubc RP G L1 L2 → lsubc RP G (L1. ⓓⓝW.V) (L2.ⓛW)
29 "local environment refinement (generic reducibility)"
30 'LRSubEqC RP G L1 L2 = (lsubc RP G L1 L2).
32 (* Basic inversion lemmas ***************************************************)
34 fact lsubc_inv_atom1_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → L1 = ⋆ → L2 = ⋆.
35 #RP #G #L1 #L2 * -L1 -L2
37 | #I #L1 #L2 #_ #H destruct
38 | #L1 #L2 #V #W #A #_ #_ #_ #_ #H destruct
42 (* Basic_1: was just: csubc_gen_sort_r *)
43 lemma lsubc_inv_atom1: ∀RP,G,L2. G ⊢ ⋆ ⫃[RP] L2 → L2 = ⋆.
44 /2 width=5 by lsubc_inv_atom1_aux/ qed-.
46 fact lsubc_inv_bind1_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → ∀I,K1. L1 = K1.ⓘ{I} →
47 (∃∃K2. G ⊢ K1 ⫃[RP] K2 & L2 = K2.ⓘ{I}) ∨
48 ∃∃K2,V,W,A. ⦃G, K1, V⦄ ϵ[RP] 〚A〛 & ⦃G, K1, W⦄ ϵ[RP] 〚A〛 & ⦃G, K2⦄ ⊢ W ⁝ A &
50 L2 = K2. ⓛW & I = BPair Abbr (ⓝW.V).
51 #RP #G #L1 #L2 * -L1 -L2
53 | #J #L1 #L2 #HL12 #I #K1 #H destruct /3 width=3 by ex2_intro, or_introl/
54 | #L1 #L2 #V1 #W2 #A #HV1 #H1W2 #H2W2 #HL12 #I #K1 #H destruct
55 /3 width=10 by ex6_4_intro, or_intror/
59 (* Basic_1: was: csubc_gen_head_r *)
60 lemma lsubc_inv_bind1: ∀RP,I,G,K1,L2. G ⊢ K1.ⓘ{I} ⫃[RP] L2 →
61 (∃∃K2. G ⊢ K1 ⫃[RP] K2 & L2 = K2.ⓘ{I}) ∨
62 ∃∃K2,V,W,A. ⦃G, K1, V⦄ ϵ[RP] 〚A〛 & ⦃G, K1, W⦄ ϵ[RP] 〚A〛 & ⦃G, K2⦄ ⊢ W ⁝ A &
64 L2 = K2.ⓛW & I = BPair Abbr (ⓝW.V).
65 /2 width=3 by lsubc_inv_bind1_aux/ qed-.
67 fact lsubc_inv_atom2_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → L2 = ⋆ → L1 = ⋆.
68 #RP #G #L1 #L2 * -L1 -L2
70 | #I #L1 #L2 #_ #H destruct
71 | #L1 #L2 #V #W #A #_ #_ #_ #_ #H destruct
75 (* Basic_1: was just: csubc_gen_sort_l *)
76 lemma lsubc_inv_atom2: ∀RP,G,L1. G ⊢ L1 ⫃[RP] ⋆ → L1 = ⋆.
77 /2 width=5 by lsubc_inv_atom2_aux/ qed-.
79 fact lsubc_inv_bind2_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → ∀I,K2. L2 = K2.ⓘ{I} →
80 (∃∃K1. G ⊢ K1 ⫃[RP] K2 & L1 = K1. ⓘ{I}) ∨
81 ∃∃K1,V,W,A. ⦃G, K1, V⦄ ϵ[RP] 〚A〛 & ⦃G, K1, W⦄ ϵ[RP] 〚A〛 & ⦃G, K2⦄ ⊢ W ⁝ A &
83 L1 = K1.ⓓⓝW.V & I = BPair Abst W.
84 #RP #G #L1 #L2 * -L1 -L2
86 | #J #L1 #L2 #HL12 #I #K2 #H destruct /3 width=3 by ex2_intro, or_introl/
87 | #L1 #L2 #V1 #W2 #A #HV1 #H1W2 #H2W2 #HL12 #I #K2 #H destruct
88 /3 width=10 by ex6_4_intro, or_intror/
92 (* Basic_1: was just: csubc_gen_head_l *)
93 lemma lsubc_inv_bind2: ∀RP,I,G,L1,K2. G ⊢ L1 ⫃[RP] K2.ⓘ{I} →
94 (∃∃K1. G ⊢ K1 ⫃[RP] K2 & L1 = K1.ⓘ{I}) ∨
95 ∃∃K1,V,W,A. ⦃G, K1, V⦄ ϵ[RP] 〚A〛 & ⦃G, K1, W⦄ ϵ[RP] 〚A〛 & ⦃G, K2⦄ ⊢ W ⁝ A &
97 L1 = K1.ⓓⓝW.V & I = BPair Abst W.
98 /2 width=3 by lsubc_inv_bind2_aux/ qed-.
100 (* Basic properties *********************************************************)
102 (* Basic_1: was just: csubc_refl *)
103 lemma lsubc_refl: ∀RP,G,L. G ⊢ L ⫃[RP] L.
104 #RP #G #L elim L -L /2 width=1 by lsubc_bind/
107 (* Basic_1: removed theorems 3:
108 csubc_clear_conf csubc_getl_conf csubc_csuba