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_6_4.ma".
16 include "static_2/notation/relations/lrsubeqc_4.ma".
17 include "static_2/static/aaa.ma".
18 include "static_2/static/gcp_cr.ma".
20 (* LOCAL ENVIRONMENT REFINEMENT FOR GENERIC REDUCIBILITY ********************)
22 inductive lsubc (RP) (G): relation lenv ≝
23 | lsubc_atom: lsubc RP G (⋆) (⋆)
24 | lsubc_bind: ∀I,L1,L2. lsubc RP G L1 L2 → lsubc RP G (L1.ⓘ[I]) (L2.ⓘ[I])
25 | lsubc_beta: ∀L1,L2,V,W,A. ❨G,L1,V❩ ϵ ⟦A⟧[RP] → ❨G,L1,W❩ ϵ ⟦A⟧[RP] → ❨G,L2❩ ⊢ W ⁝ A →
26 lsubc RP G L1 L2 → lsubc RP G (L1. ⓓⓝW.V) (L2.ⓛW)
30 "local environment refinement (generic reducibility)"
31 'LRSubEqC RP G L1 L2 = (lsubc RP G L1 L2).
33 (* Basic inversion lemmas ***************************************************)
35 fact lsubc_inv_atom1_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → L1 = ⋆ → L2 = ⋆.
36 #RP #G #L1 #L2 * -L1 -L2
38 | #I #L1 #L2 #_ #H destruct
39 | #L1 #L2 #V #W #A #_ #_ #_ #_ #H destruct
43 (* Basic_1: was just: csubc_gen_sort_r *)
44 lemma lsubc_inv_atom1: ∀RP,G,L2. G ⊢ ⋆ ⫃[RP] L2 → L2 = ⋆.
45 /2 width=5 by lsubc_inv_atom1_aux/ qed-.
47 fact lsubc_inv_bind1_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → ∀I,K1. L1 = K1.ⓘ[I] →
48 (∃∃K2. G ⊢ K1 ⫃[RP] K2 & L2 = K2.ⓘ[I]) ∨
49 ∃∃K2,V,W,A. ❨G,K1,V❩ ϵ ⟦A⟧[RP] & ❨G,K1,W❩ ϵ ⟦A⟧[RP] & ❨G,K2❩ ⊢ W ⁝ A &
51 L2 = K2. ⓛW & I = BPair Abbr (ⓝW.V).
52 #RP #G #L1 #L2 * -L1 -L2
54 | #J #L1 #L2 #HL12 #I #K1 #H destruct /3 width=3 by ex2_intro, or_introl/
55 | #L1 #L2 #V1 #W2 #A #HV1 #H1W2 #H2W2 #HL12 #I #K1 #H destruct
56 /3 width=10 by ex6_4_intro, or_intror/
60 (* Basic_1: was: csubc_gen_head_r *)
61 lemma lsubc_inv_bind1: ∀RP,I,G,K1,L2. G ⊢ K1.ⓘ[I] ⫃[RP] L2 →
62 (∃∃K2. G ⊢ K1 ⫃[RP] K2 & L2 = K2.ⓘ[I]) ∨
63 ∃∃K2,V,W,A. ❨G,K1,V❩ ϵ ⟦A⟧[RP] & ❨G,K1,W❩ ϵ ⟦A⟧[RP] & ❨G,K2❩ ⊢ W ⁝ A &
65 L2 = K2.ⓛW & I = BPair Abbr (ⓝW.V).
66 /2 width=3 by lsubc_inv_bind1_aux/ qed-.
68 fact lsubc_inv_atom2_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → L2 = ⋆ → L1 = ⋆.
69 #RP #G #L1 #L2 * -L1 -L2
71 | #I #L1 #L2 #_ #H destruct
72 | #L1 #L2 #V #W #A #_ #_ #_ #_ #H destruct
76 (* Basic_1: was just: csubc_gen_sort_l *)
77 lemma lsubc_inv_atom2: ∀RP,G,L1. G ⊢ L1 ⫃[RP] ⋆ → L1 = ⋆.
78 /2 width=5 by lsubc_inv_atom2_aux/ qed-.
80 fact lsubc_inv_bind2_aux: ∀RP,G,L1,L2. G ⊢ L1 ⫃[RP] L2 → ∀I,K2. L2 = K2.ⓘ[I] →
81 (∃∃K1. G ⊢ K1 ⫃[RP] K2 & L1 = K1. ⓘ[I]) ∨
82 ∃∃K1,V,W,A. ❨G,K1,V❩ ϵ ⟦A⟧[RP] & ❨G,K1,W❩ ϵ ⟦A⟧[RP] & ❨G,K2❩ ⊢ W ⁝ A &
84 L1 = K1.ⓓⓝW.V & I = BPair Abst W.
85 #RP #G #L1 #L2 * -L1 -L2
87 | #J #L1 #L2 #HL12 #I #K2 #H destruct /3 width=3 by ex2_intro, or_introl/
88 | #L1 #L2 #V1 #W2 #A #HV1 #H1W2 #H2W2 #HL12 #I #K2 #H destruct
89 /3 width=10 by ex6_4_intro, or_intror/
93 (* Basic_1: was just: csubc_gen_head_l *)
94 lemma lsubc_inv_bind2: ∀RP,I,G,L1,K2. G ⊢ L1 ⫃[RP] K2.ⓘ[I] →
95 (∃∃K1. G ⊢ K1 ⫃[RP] K2 & L1 = K1.ⓘ[I]) ∨
96 ∃∃K1,V,W,A. ❨G,K1,V❩ ϵ ⟦A⟧[RP] & ❨G,K1,W❩ ϵ ⟦A⟧[RP] & ❨G,K2❩ ⊢ W ⁝ A &
98 L1 = K1.ⓓⓝW.V & I = BPair Abst W.
99 /2 width=3 by lsubc_inv_bind2_aux/ qed-.
101 (* Basic properties *********************************************************)
103 (* Basic_1: was just: csubc_refl *)
104 lemma lsubc_refl: ∀RP,G,L. G ⊢ L ⫃[RP] L.
105 #RP #G #L elim L -L /2 width=1 by lsubc_bind/
108 (* Basic_1: removed theorems 3:
109 csubc_clear_conf csubc_getl_conf csubc_csuba