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 "static_2/notation/relations/ideqsn_3.ma".
16 include "static_2/syntax/teq_ext.ma".
17 include "static_2/static/reqg.ma".
19 (* SYNTACTIC EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES *********)
21 (* Basic_2A1: was: lleq *)
22 definition req: relation3 term lenv lenv ≝
26 "syntactic equivalence on referred entries (local environment)"
27 'IdEqSn T L1 L2 = (req T L1 L2).
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.
34 (* Basic inversion lemmas ***************************************************)
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-.
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-.
46 (* Advanced inversion lemmas ************************************************)
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.
52 elim (reqg_inv_zero_pair_sn … H) -H #K2 #X #HK12 #HX #H destruct
54 @(ex2_intro … HK12) // (**) (* auto fails because a δ-expamsion gets in the way *)
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.
61 elim (reqg_inv_zero_pair_dx … H) -H #K1 #X #HK12 #HX #H destruct
63 @(ex2_intro … HK12) // (**) (* auto fails because a δ-expamsion gets in the way *)
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-.
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-.
76 (* Basic forward lemmas *****************************************************)
78 (* Basic_2A1: was: llpx_sn_lrefl *)
79 (* Basic_2A1: this should have been lleq_fwd_llpx_sn *)
80 lemma req_fwd_rex (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/
87 lemma req_fwd_reqg (S) (T:term):
89 ∀L1,L2. L1 ≡[T] L2 → L1 ≛[S,T] L2.
90 /3 width=1 by req_fwd_rex, teqg_refl/ qed-.
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 // (**)
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