]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/static/reqg_reqg.ma
update in ground and delayed updating
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / static / reqg_reqg.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/syntax/ext2_ext2.ma".
16 include "static_2/syntax/teqg_teqg.ma".
17 include "static_2/static/reqg_length.ma".
18
19 (* GENERIC EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ***********)
20
21 (* Advanced forward lemmas **************************************************)
22
23 lemma frees_reqg_conf (S):
24       reflexive … S →
25       ∀f,L1,T. L1 ⊢ 𝐅+❨T❩ ≘ f →
26       ∀L2. L1 ≛[S,T] L2 → L2 ⊢ 𝐅+❨T❩ ≘ f.
27 /3 width=7 by frees_seqg_conf, rex_inv_frees/ qed-.
28
29 (* Properties with free variables inclusion for restricted closures *******)
30
31 lemma reqg_fsle_comp (S):
32       reflexive … S →
33       rex_fsle_compatible (ceqg S).
34 #S #HS #L1 #L2 #T #HL12
35 elim (frees_total L1 T) #f #Hf
36 /4 width=8 by frees_reqg_conf, rex_fwd_length, lveq_length_eq, pr_sle_refl, ex4_4_intro/
37 qed.
38
39 (* Advanced properties ******************************************************)
40
41 lemma reqg_sym (S) (T):
42       reflexive … S → symmetric … S →
43       symmetric … (reqg S T).
44 /3 width=3 by reqg_fsge_comp, rex_sym, teqg_sym/ qed-.
45
46 (* Basic_2A1: uses: lleq_dec *)
47 lemma reqg_dec (S):
48       (∀s1,s2. Decidable … (S s1 s2)) →
49       ∀L1,L2. ∀T:term. Decidable (L1 ≛[S,T] L2).
50 /3 width=1 by rex_dec, teqg_dec/ qed-.
51
52 (* Main properties **********************************************************)
53
54 (* Basic_2A1: uses: lleq_bind lleq_bind_O *)
55 theorem reqg_bind (S):
56         ∀p,I,L1,L2,V1,V2,T.
57         L1 ≛[S,V1] L2 → L1.ⓑ[I]V1 ≛[S,T] L2.ⓑ[I]V2 →
58         L1 ≛[S,ⓑ[p,I]V1.T] L2.
59 /2 width=2 by rex_bind/ qed.
60
61 (* Basic_2A1: uses: lleq_flat *)
62 theorem reqg_flat (S):
63         ∀I,L1,L2,V,T.
64         L1 ≛[S,V] L2 → L1 ≛[S,T] L2 → L1 ≛[S,ⓕ[I]V.T] L2.
65 /2 width=1 by rex_flat/ qed.
66
67 theorem reqg_bind_void (S):
68         ∀p,I,L1,L2,V,T.
69         L1 ≛[S,V] L2 → L1.ⓧ ≛[S,T] L2.ⓧ → L1 ≛[S,ⓑ[p,I]V.T] L2.
70 /2 width=1 by rex_bind_void/ qed.
71
72 (* Basic_2A1: uses: lleq_trans *)
73 theorem reqg_trans (S) (T):
74         reflexive … S → Transitive … S →
75         Transitive … (reqg S T).
76 #S #T #H1S #H2S #L1 #L * #f1 #Hf1 #HL1 #L2 * #f2 #Hf2 #HL2
77 lapply (frees_teqg_conf_seqg … Hf1 T … HL1) /2 width=1 by teqg_refl/ #H0
78 lapply (frees_mono … Hf2 … H0) -Hf2 -H0
79 /5 width=7 by sex_trans, sex_eq_repl_back, teqg_trans, ext2_trans, ex2_intro/
80 qed-.
81
82 (* Basic_2A1: uses: lleq_canc_sn *)
83 theorem reqg_canc_sn (S) (T):
84         reflexive … S → symmetric … S → Transitive … S →
85         left_cancellable … (reqg S T).
86 /3 width=3 by reqg_trans, reqg_sym/ qed-.
87
88 (* Basic_2A1: uses: lleq_canc_dx *)
89 theorem reqg_canc_dx (S) (T):
90         reflexive … S → symmetric … S → Transitive … S →
91         right_cancellable … (reqg S T).
92 /3 width=3 by reqg_trans, reqg_sym/ qed-.
93
94 theorem reqg_repl (S) (T:term):
95         reflexive … S → symmetric … S → Transitive … S → 
96         ∀L1,L2. L1 ≛[S,T] L2 →
97         ∀K1. L1 ≛[S,T] K1 → ∀K2. L2 ≛[S,T] K2 → K1 ≛[S,T] K2.
98 /3 width=3 by reqg_canc_sn, reqg_trans/ qed-.
99
100 (* Negated properties *******************************************************)
101
102 (* Note: auto works with /4 width=8/ so reqg_canc_sn is preferred **********)
103 (* Basic_2A1: uses: lleq_nlleq_trans *)
104 lemma reqg_rneqg_trans (S) (T:term):
105       reflexive … S → symmetric … S → Transitive … S →
106       ∀L1,L. L1 ≛[S,T] L →
107       ∀L2. (L ≛[S,T] L2 → ⊥) → (L1 ≛[S,T] L2 → ⊥).
108 /3 width=3 by reqg_canc_sn/ qed-.
109
110 (* Basic_2A1: uses: nlleq_lleq_div *)
111 lemma rneqg_reqg_div (S) (T:term):
112       reflexive … S → Transitive … S →
113       ∀L2,L. L2 ≛[S,T] L →
114       ∀L1. (L1 ≛[S,T] L → ⊥) → (L1 ≛[S,T] L2 → ⊥).
115 /3 width=3 by reqg_trans/ qed-.
116
117 theorem rneqg_reqg_canc_dx (S) (T:term):
118         reflexive … S → Transitive … S →
119         ∀L1,L. (L1 ≛[S,T] L → ⊥) →
120         ∀L2. L2 ≛[S,T] L → L1 ≛[S,T] L2 → ⊥.
121 /3 width=3 by reqg_trans/ qed-.
122
123 (* Negated inversion lemmas *************************************************)
124
125 (* Basic_2A1: uses: nlleq_inv_bind nlleq_inv_bind_O *)
126 lemma rneqg_inv_bind (S):
127       (∀s1,s2. Decidable … (S s1 s2)) →
128       ∀p,I,L1,L2,V,T. (L1 ≛[S,ⓑ[p,I]V.T] L2 → ⊥) →
129       ∨∨ L1 ≛[S,V] L2 → ⊥ | (L1.ⓑ[I]V ≛[S,T] L2.ⓑ[I]V → ⊥).
130 /3 width=2 by rnex_inv_bind, teqg_dec/ qed-.
131
132 (* Basic_2A1: uses: nlleq_inv_flat *)
133 lemma rneqg_inv_flat (S):
134       (∀s1,s2. Decidable … (S s1 s2)) →
135       ∀I,L1,L2,V,T. (L1 ≛[S,ⓕ[I]V.T] L2 → ⊥) →
136       ∨∨ L1 ≛[S,V] L2 → ⊥ | (L1 ≛[S,T] L2 → ⊥).
137 /3 width=2 by rnex_inv_flat, teqg_dec/ qed-.
138
139 lemma rneqg_inv_bind_void (S):
140       (∀s1,s2. Decidable … (S s1 s2)) →
141       ∀p,I,L1,L2,V,T. (L1 ≛[S,ⓑ[p,I]V.T] L2 → ⊥) →
142       ∨∨ L1 ≛[S,V] L2 → ⊥ | (L1.ⓧ ≛[S,T] L2.ⓧ → ⊥).
143 /3 width=3 by rnex_inv_bind_void, teqg_dec/ qed-.