]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/static/rex_rex.ma
update in ground and delayed updating
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / static / rex_rex.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/relocation/sex_sex.ma".
16 include "static_2/static/frees_fqup.ma".
17 include "static_2/static/rex.ma".
18
19 (* GENERIC EXTENSION ON REFERRED ENTRIES OF A CONTEXT-SENSITIVE REALTION ****)
20
21 (* Advanced inversion lemmas ************************************************)
22
23 lemma rex_inv_frees (R):
24       ∀L1,L2,T. L1 ⪤[R,T] L2 →
25       ∀f. L1 ⊢ 𝐅+❨T❩ ≘ f → L1 ⪤[cext2 R,cfull,f] L2.
26 #R #L1 #L2 #T * /3 width=6 by frees_mono, sex_eq_repl_back/
27 qed-.
28
29 (* Advanced properties ******************************************************)
30
31 (* Basic_2A1: uses: llpx_sn_dec *)
32 lemma rex_dec (R):
33       (∀L,T1,T2. Decidable (R L T1 T2)) →
34       ∀L1,L2,T. Decidable (L1 ⪤[R,T] L2).
35 #R #HR #L1 #L2 #T
36 elim (frees_total L1 T) #f #Hf
37 elim (sex_dec (cext2 R) cfull … L1 L2 f)
38 /4 width=3 by rex_inv_frees, cfull_dec, ext2_dec, ex2_intro, or_intror, or_introl/
39 qed-.
40
41 (* Main properties **********************************************************)
42
43 (* Basic_2A1: uses: llpx_sn_bind llpx_sn_bind_O *)
44 theorem rex_bind (R) (p) (I):
45         ∀L1,L2,V1,V2,T. L1 ⪤[R,V1] L2 → L1.ⓑ[I]V1 ⪤[R,T] L2.ⓑ[I]V2 →
46         L1 ⪤[R,ⓑ[p,I]V1.T] L2.
47 #R #p #I #L1 #L2 #V1 #V2 #T * #f1 #HV #Hf1 * #f2 #HT #Hf2
48 lapply (sex_fwd_bind … Hf2) -Hf2 #Hf2 elim (pr_sor_isf_bi f1 (⫰f2))
49 /3 width=7 by frees_fwd_isfin, frees_bind, sex_join, pr_isf_tl, ex2_intro/
50 qed.
51
52 (* Basic_2A1: llpx_sn_flat *)
53 theorem rex_flat (R) (I):
54         ∀L1,L2,V,T. L1 ⪤[R,V] L2 → L1 ⪤[R,T] L2 → L1 ⪤[R,ⓕ[I]V.T] L2.
55 #R #I #L1 #L2 #V #T * #f1 #HV #Hf1 * #f2 #HT #Hf2 elim (pr_sor_isf_bi f1 f2)
56 /3 width=7 by frees_fwd_isfin, frees_flat, sex_join, ex2_intro/
57 qed.
58
59 theorem rex_bind_void (R) (p) (I):
60         ∀L1,L2,V,T. L1 ⪤[R,V] L2 → L1.ⓧ ⪤[R,T] L2.ⓧ → L1 ⪤[R,ⓑ[p,I]V.T] L2.
61 #R #p #I #L1 #L2 #V #T * #f1 #HV #Hf1 * #f2 #HT #Hf2
62 lapply (sex_fwd_bind … Hf2) -Hf2 #Hf2 elim (pr_sor_isf_bi f1 (⫰f2))
63 /3 width=7 by frees_fwd_isfin, frees_bind_void, sex_join, pr_isf_tl, ex2_intro/
64 qed.
65
66 (* Negated inversion lemmas *************************************************)
67
68 (* Basic_2A1: uses: nllpx_sn_inv_bind nllpx_sn_inv_bind_O *)
69 lemma rnex_inv_bind (R):
70       (∀L,T1,T2. Decidable (R L T1 T2)) →
71       ∀p,I,L1,L2,V,T. (L1 ⪤[R,ⓑ[p,I]V.T] L2 → ⊥) →
72       ∨∨ (L1 ⪤[R,V] L2 → ⊥) | (L1.ⓑ[I]V ⪤[R,T] L2.ⓑ[I]V → ⊥).
73 #R #HR #p #I #L1 #L2 #V #T #H elim (rex_dec … HR L1 L2 V)
74 /4 width=2 by rex_bind, or_intror, or_introl/
75 qed-.
76
77 (* Basic_2A1: uses: nllpx_sn_inv_flat *)
78 lemma rnex_inv_flat (R):
79       (∀L,T1,T2. Decidable (R L T1 T2)) →
80       ∀I,L1,L2,V,T. (L1 ⪤[R,ⓕ[I]V.T] L2 → ⊥) →
81       ∨∨ (L1 ⪤[R,V] L2 → ⊥) | (L1 ⪤[R,T] L2 → ⊥).
82 #R #HR #I #L1 #L2 #V #T #H elim (rex_dec … HR L1 L2 V)
83 /4 width=1 by rex_flat, or_intror, or_introl/
84 qed-.
85
86 lemma rnex_inv_bind_void (R):
87       (∀L,T1,T2. Decidable (R L T1 T2)) →
88       ∀p,I,L1,L2,V,T. (L1 ⪤[R,ⓑ[p,I]V.T] L2 → ⊥) →
89       ∨∨ (L1 ⪤[R,V] L2 → ⊥) | (L1.ⓧ ⪤[R,T] L2.ⓧ → ⊥).
90 #R #HR #p #I #L1 #L2 #V #T #H elim (rex_dec … HR L1 L2 V)
91 /4 width=2 by rex_bind_void, or_intror, or_introl/
92 qed-.