]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/etc/teqx/req.etc
b53ef17559be823ba437c3a92daf35dad4cd9c8c
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / etc / teqx / req.etc
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/notation/relations/ideqsn_3.ma".
16 include "static_2/static/rex.ma".
17
18 (* SYNTACTIC EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES *********)
19
20 (* Basic_2A1: was: lleq *)
21 definition req: relation3 term lenv lenv ≝
22            rex ceq.
23
24 interpretation
25   "syntactic equivalence on referred entries (local environment)"
26   'IdEqSn T L1 L2 = (req T L1 L2).
27
28 (* Note: "R_transitive_req R" is equivalent to "R_transitive_rex ceq R R" *)
29 (* Basic_2A1: uses: lleq_transitive *)
30 definition R_transitive_req: predicate (relation3 lenv term term) ≝
31            λR. ∀L2,T1,T2. R L2 T1 T2 → ∀L1. L1 ≡[T1] L2 → R L1 T1 T2.
32
33 (* Basic inversion lemmas ***************************************************)
34
35 lemma req_inv_bind:
36       ∀p,I,L1,L2,V,T. L1 ≡[ⓑ[p,I]V.T] L2 →
37       ∧∧ L1 ≡[V] L2 & L1.ⓑ[I]V ≡[T] L2.ⓑ[I]V.
38 /2 width=2 by rex_inv_bind/ qed-.
39
40 lemma req_inv_flat:
41       ∀I,L1,L2,V,T. L1 ≡[ⓕ[I]V.T] L2 →
42       ∧∧ L1 ≡[V] L2 & L1 ≡[T] L2.
43 /2 width=2 by rex_inv_flat/ qed-.
44
45 (* Advanced inversion lemmas ************************************************)
46
47 lemma req_inv_zero_pair_sn:
48       ∀I,L2,K1,V. K1.ⓑ[I]V ≡[#0] L2 →
49       ∃∃K2. K1 ≡[V] K2 & L2 = K2.ⓑ[I]V.
50 #I #L2 #K1 #V #H
51 elim (rex_inv_zero_pair_sn … H) -H #K2 #X #HK12 #HX #H destruct
52 /2 width=3 by ex2_intro/
53 qed-.
54
55 lemma req_inv_zero_pair_dx:
56       ∀I,L1,K2,V. L1 ≡[#0] K2.ⓑ[I]V →
57       ∃∃K1. K1 ≡[V] K2 & L1 = K1.ⓑ[I]V.
58 #I #L1 #K2 #V #H
59 elim (rex_inv_zero_pair_dx … H) -H #K1 #X #HK12 #HX #H destruct
60 /2 width=3 by ex2_intro/
61 qed-.
62
63 lemma req_inv_lref_bind_sn:
64       ∀I1,K1,L2,i. K1.ⓘ[I1] ≡[#↑i] L2 →
65       ∃∃I2,K2. K1 ≡[#i] K2 & L2 = K2.ⓘ[I2].
66 /2 width=2 by rex_inv_lref_bind_sn/ qed-.
67
68 lemma req_inv_lref_bind_dx:
69       ∀I2,K2,L1,i. L1 ≡[#↑i] K2.ⓘ[I2] →
70       ∃∃I1,K1. K1 ≡[#i] K2 & L1 = K1.ⓘ[I1].
71 /2 width=2 by rex_inv_lref_bind_dx/ qed-.
72
73 (* Basic forward lemmas *****************************************************)
74
75 (* Basic_2A1: was: llpx_sn_lrefl *)
76 (* Basic_2A1: this should have been lleq_fwd_llpx_sn *)
77 lemma req_fwd_rex (R):
78       c_reflexive … R →
79       ∀L1,L2,T. L1 ≡[T] L2 → L1 ⪤[R,T] L2.
80 #R #HR #L1 #L2 #T * #f #Hf #HL12
81 /4 width=7 by sex_co, cext2_co, ex2_intro/
82 qed-.
83
84 (* Basic_properties *********************************************************)
85
86 lemma frees_req_conf:
87       ∀f,L1,T. L1 ⊢ 𝐅+❪T❫ ≘ f →
88       ∀L2. L1 ≡[T] L2 → L2 ⊢ 𝐅+❪T❫ ≘ f.
89 #f #L1 #T #H elim H -f -L1 -T
90 [ /2 width=3 by frees_sort/
91 | #f #i #Hf #L2 #H2
92   >(rex_inv_atom_sn … H2) -L2
93   /2 width=1 by frees_atom/
94 | #f #I #L1 #V1 #_ #IH #Y #H2
95   elim (req_inv_zero_pair_sn … H2) -H2 #L2 #HL12 #H destruct
96   /3 width=1 by frees_pair/
97 | #f #I #L1 #Hf #Y #H2
98   elim (rex_inv_zero_unit_sn … H2) -H2 #g #L2 #_ #_ #H destruct
99   /2 width=1 by frees_unit/
100 | #f #I #L1 #i #_ #IH #Y #H2
101   elim (req_inv_lref_bind_sn … H2) -H2 #J #L2 #HL12 #H destruct
102   /3 width=1 by frees_lref/
103 | /2 width=1 by frees_gref/
104 | #f1V #f1T #f1 #p #I #L1 #V1 #T1 #_ #_ #Hf1 #IHV #IHT #L2 #H2
105   elim (req_inv_bind … H2) -H2 /3 width=5 by frees_bind/
106 | #f1V #f1T #f1 #I #L1 #V1 #T1 #_ #_ #Hf1 #IHV #IHT #L2 #H2
107   elim (req_inv_flat … H2) -H2 /3 width=5 by frees_flat/
108 ]
109 qed-.
110
111 (* Basic_2A1: removed theorems 10:
112               lleq_ind lleq_fwd_lref
113               lleq_fwd_drop_sn lleq_fwd_drop_dx
114               lleq_skip lleq_lref lleq_free
115               lleq_Y lleq_ge_up lleq_ge
116
117 *)