]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/relocation/lreq.ma
- degree-based equivalene for terms
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / relocation / lreq.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 "basic_2/notation/relations/lazyeq_3.ma".
16 include "basic_2/relocation/lexs.ma".
17
18 (* RANGED EQUIVALENCE FOR LOCAL ENVIRONMENTS ********************************)
19
20 (* Basic_2A1: includes: lreq_atom lreq_zero lreq_pair lreq_succ *)
21 definition lreq: relation3 rtmap lenv lenv ≝ lexs ceq cfull.
22
23 interpretation
24   "ranged equivalence (local environment)"
25   'LazyEq f L1 L2 = (lreq f L1 L2).
26
27 (* Basic properties *********************************************************)
28
29 lemma lreq_eq_repl_back: ∀L1,L2. eq_repl_back … (λf. L1 ≡[f] L2).
30 /2 width=3 by lexs_eq_repl_back/ qed-.
31
32 lemma lreq_eq_repl_fwd: ∀L1,L2. eq_repl_fwd … (λf. L1 ≡[f] L2).
33 /2 width=3 by lexs_eq_repl_fwd/ qed-.
34
35 lemma sle_lreq_trans: ∀f2,L1,L2. L1 ≡[f2] L2 →
36                       ∀f1. f1 ⊆ f2 → L1 ≡[f1] L2.
37 /2 width=3 by sle_lexs_trans/ qed-.
38
39 (* Basic_2A1: includes: lreq_refl *)
40 lemma lreq_refl: ∀f. reflexive … (lreq f).
41 /2 width=1 by lexs_refl/ qed.
42
43 (* Basic_2A1: includes: lreq_sym *)
44 lemma lreq_sym: ∀f. symmetric … (lreq f).
45 #f #L1 #L2 #H elim H -L1 -L2 -f
46 /2 width=1 by lexs_next, lexs_push/
47 qed-.
48
49 (* Basic inversion lemmas ***************************************************)
50
51 (* Basic_2A1: includes: lreq_inv_atom1 *)
52 lemma lreq_inv_atom1: ∀f,Y. ⋆ ≡[f] Y → Y = ⋆.
53 /2 width=4 by lexs_inv_atom1/ qed-.
54
55 (* Basic_2A1: includes: lreq_inv_pair1 *)
56 lemma lreq_inv_next1: ∀g,J,K1,Y,W1. K1.ⓑ{J}W1 ≡[⫯g] Y →
57                       ∃∃K2. K1 ≡[g] K2 & Y = K2.ⓑ{J}W1.
58 #g #J #K1 #Y #W1 #H elim (lexs_inv_next1 … H) -H /2 width=3 by ex2_intro/
59 qed-.
60
61 (* Basic_2A1: includes: lreq_inv_zero1 lreq_inv_succ1 *)
62 lemma lreq_inv_push1: ∀g,J,K1,Y,W1. K1.ⓑ{J}W1 ≡[↑g] Y →
63                       ∃∃K2,W2. K1 ≡[g] K2 & Y = K2.ⓑ{J}W2.
64 #g #J #K1 #Y #W1 #H elim (lexs_inv_push1 … H) -H /2 width=4 by ex2_2_intro/ qed-.
65
66 (* Basic_2A1: includes: lreq_inv_atom2 *)
67 lemma lreq_inv_atom2: ∀f,X. X ≡[f] ⋆ → X = ⋆.
68 /2 width=4 by lexs_inv_atom2/ qed-.
69
70 (* Basic_2A1: includes: lreq_inv_pair2 *)
71 lemma lreq_inv_next2: ∀g,J,X,K2,W2. X ≡[⫯g] K2.ⓑ{J}W2 →
72                       ∃∃K1. K1 ≡[g] K2 & X = K1.ⓑ{J}W2.
73 #g #J #X #K2 #W2 #H elim (lexs_inv_next2 … H) -H /2 width=3 by ex2_intro/ qed-.
74
75 (* Basic_2A1: includes: lreq_inv_zero2 lreq_inv_succ2 *)
76 lemma lreq_inv_push2: ∀g,J,X,K2,W2. X ≡[↑g] K2.ⓑ{J}W2 →
77                       ∃∃K1,W1. K1 ≡[g] K2 & X = K1.ⓑ{J}W1.
78 #g #J #X #K2 #W2 #H elim (lexs_inv_push2 … H) -H /2 width=4 by ex2_2_intro/ qed-.
79
80 (* Basic_2A1: includes: lreq_inv_pair *)
81 lemma lreq_inv_next: ∀f,I1,I2,L1,L2,V1,V2.
82                      L1.ⓑ{I1}V1 ≡[⫯f] (L2.ⓑ{I2}V2) →
83                      ∧∧ L1 ≡[f] L2 & V1 = V2 & I1 = I2.
84 /2 width=1 by lexs_inv_next/ qed-.
85
86 (* Basic_2A1: includes: lreq_inv_succ *)
87 lemma lreq_inv_push: ∀f,I1,I2,L1,L2,V1,V2.
88                      L1.ⓑ{I1}V1 ≡[↑f] (L2.ⓑ{I2}V2) →
89                      L1 ≡[f] L2 ∧ I1 = I2.
90 #f #I1 #I2 #L1 #L2 #V1 #V2 #H elim (lexs_inv_push … H) -H /2 width=1 by conj/
91 qed-.
92
93 lemma lreq_inv_tl: ∀f,I,L1,L2,V. L1 ≡[⫱f] L2 → L1.ⓑ{I}V ≡[f] L2.ⓑ{I}V.
94 /2 width=1 by lexs_inv_tl/ qed-.
95
96 (* Basic_2A1: removed theorems 5:
97               lreq_pair_lt lreq_succ_lt lreq_pair_O_Y lreq_O2 lreq_inv_O_Y
98 *)