]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/static/req.ma
59efd1af8f640cbc0d1d2b43902467c7c75fe214
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / static / req.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/notation/relations/ideqsn_3.ma".
16 include "static_2/syntax/teq_ext.ma".
17 include "static_2/static/reqg.ma".
18
19 (* SYNTACTIC EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES *********)
20
21 (* Basic_2A1: was: lleq *)
22 definition req: relation3 term lenv lenv ≝
23            reqg (eq …).
24
25 interpretation
26   "syntactic equivalence on referred entries (local environment)"
27   'IdEqSn T L1 L2 = (req T L1 L2).
28
29 (* Note: "R_transitive_req R" is equivalent to "R_transitive_rex ceq R R" *)
30 (* Basic_2A1: uses: lleq_transitive *)
31 definition R_transitive_req: predicate (relation3 lenv term term) ≝
32            λR. ∀L2,T1,T2. R L2 T1 T2 → ∀L1. L1 ≡[T1] L2 → R L1 T1 T2.
33
34 (* Basic inversion lemmas ***************************************************)
35
36 lemma req_inv_bind:
37       ∀p,I,L1,L2,V,T. L1 ≡[ⓑ[p,I]V.T] L2 →
38       ∧∧ L1 ≡[V] L2 & L1.ⓑ[I]V ≡[T] L2.ⓑ[I]V.
39 /2 width=2 by reqg_inv_bind_refl/ qed-.
40
41 lemma req_inv_flat:
42       ∀I,L1,L2,V,T. L1 ≡[ⓕ[I]V.T] L2 →
43       ∧∧ L1 ≡[V] L2 & L1 ≡[T] L2.
44 /2 width=2 by reqg_inv_flat/ qed-.
45
46 (* Advanced inversion lemmas ************************************************)
47
48 lemma req_inv_zero_pair_sn:
49       ∀I,L2,K1,V. K1.ⓑ[I]V ≡[#0] L2 →
50       ∃∃K2. K1 ≡[V] K2 & L2 = K2.ⓑ[I]V.
51 #I #L2 #K1 #V #H
52 elim (reqg_inv_zero_pair_sn … H) -H #K2 #X #HK12 #HX #H destruct
53 @(teq_repl_1 … HX) -X
54 @(ex2_intro … HK12) // (**) (* auto fails because a δ-expamsion gets in the way *)
55 qed-.
56
57 lemma req_inv_zero_pair_dx:
58       ∀I,L1,K2,V. L1 ≡[#0] K2.ⓑ[I]V →
59       ∃∃K1. K1 ≡[V] K2 & L1 = K1.ⓑ[I]V.
60 #I #L1 #K2 #V #H
61 elim (reqg_inv_zero_pair_dx … H) -H #K1 #X #HK12 #HX #H destruct
62 @(teq_repl_1 … HX) -V
63 @(ex2_intro … HK12) // (**) (* auto fails because a δ-expamsion gets in the way *)
64 qed-.
65
66 lemma req_inv_lref_bind_sn:
67       ∀I1,K1,L2,i. K1.ⓘ[I1] ≡[#↑i] L2 →
68       ∃∃I2,K2. K1 ≡[#i] K2 & L2 = K2.ⓘ[I2].
69 /2 width=2 by reqg_inv_lref_bind_sn/ qed-.
70
71 lemma req_inv_lref_bind_dx:
72       ∀I2,K2,L1,i. L1 ≡[#↑i] K2.ⓘ[I2] →
73       ∃∃I1,K1. K1 ≡[#i] K2 & L1 = K1.ⓘ[I1].
74 /2 width=2 by reqg_inv_lref_bind_dx/ qed-.
75
76 (* Basic forward lemmas *****************************************************)
77
78 (* Basic_2A1: was: llpx_sn_lrefl *)
79 (* Basic_2A1: this should have been lleq_fwd_llpx_sn *)
80 lemma req_fwd_rex (R):
81       c_reflexive … R →
82       ∀L1,L2,T. L1 ≡[T] L2 → L1 ⪤[R,T] L2.
83 #R #HR #L1 #L2 #T * #f #Hf #HL12
84 /5 width=7 by sex_co, cext2_co, teq_repl_1, ex2_intro/
85 qed-.
86
87 lemma req_fwd_reqg (S) (T:term):
88       reflexive … S →
89       ∀L1,L2. L1 ≡[T] L2 → L1 ≛[S,T] L2.
90 /3 width=1 by req_fwd_rex, teqg_refl/ qed-.
91
92 lemma transitive_req_fwd_rex (R):
93       R_transitive_req R → R_transitive_rex ceq R R.
94 #R #HR #L1 #L #T1 #HL1 #T #HT #T2 #HT2
95 @(HR … HL1) -HR -HL1 >(teq_inv_eq … HT) -T1 // (**)
96 qed-.
97
98 (* Basic_2A1: removed theorems 10:
99               lleq_ind lleq_fwd_lref
100               lleq_fwd_drop_sn lleq_fwd_drop_dx
101               lleq_skip lleq_lref lleq_free
102               lleq_Y lleq_ge_up lleq_ge
103
104 *)