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/syntax/ext2_ext2.ma".
16 include "static_2/syntax/tdeq_tdeq.ma".
17 include "static_2/static/rdeq_length.ma".
19 (* DEGREE-BASED EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ******)
21 (* Advanced properties ******************************************************)
23 (* Basic_2A1: uses: lleq_sym *)
24 lemma rdeq_sym: ∀h,o,T. symmetric … (rdeq h o T).
25 /3 width=3 by rdeq_fsge_comp, rex_sym, tdeq_sym/ qed-.
27 (* Basic_2A1: uses: lleq_dec *)
28 lemma rdeq_dec: ∀h,o,L1,L2. ∀T:term. Decidable (L1 ≛[h, o, T] L2).
29 /3 width=1 by rex_dec, tdeq_dec/ qed-.
31 (* Main properties **********************************************************)
33 (* Basic_2A1: uses: lleq_bind lleq_bind_O *)
34 theorem rdeq_bind: ∀h,o,p,I,L1,L2,V1,V2,T.
35 L1 ≛[h, o, V1] L2 → L1.ⓑ{I}V1 ≛[h, o, T] L2.ⓑ{I}V2 →
36 L1 ≛[h, o, ⓑ{p,I}V1.T] L2.
37 /2 width=2 by rex_bind/ qed.
39 (* Basic_2A1: uses: lleq_flat *)
40 theorem rdeq_flat: ∀h,o,I,L1,L2,V,T. L1 ≛[h, o, V] L2 → L1 ≛[h, o, T] L2 →
41 L1 ≛[h, o, ⓕ{I}V.T] L2.
42 /2 width=1 by rex_flat/ qed.
44 theorem rdeq_bind_void: ∀h,o,p,I,L1,L2,V,T.
45 L1 ≛[h, o, V] L2 → L1.ⓧ ≛[h, o, T] L2.ⓧ →
46 L1 ≛[h, o, ⓑ{p,I}V.T] L2.
47 /2 width=1 by rex_bind_void/ qed.
49 (* Basic_2A1: uses: lleq_trans *)
50 theorem rdeq_trans: ∀h,o,T. Transitive … (rdeq h o T).
51 #h #o #T #L1 #L * #f1 #Hf1 #HL1 #L2 * #f2 #Hf2 #HL2
52 lapply (frees_tdeq_conf_rdeq … Hf1 T … HL1) // #H0
53 lapply (frees_mono … Hf2 … H0) -Hf2 -H0
54 /5 width=7 by sex_trans, sex_eq_repl_back, tdeq_trans, ext2_trans, ex2_intro/
57 (* Basic_2A1: uses: lleq_canc_sn *)
58 theorem rdeq_canc_sn: ∀h,o,T. left_cancellable … (rdeq h o T).
59 /3 width=3 by rdeq_trans, rdeq_sym/ qed-.
61 (* Basic_2A1: uses: lleq_canc_dx *)
62 theorem rdeq_canc_dx: ∀h,o,T. right_cancellable … (rdeq h o T).
63 /3 width=3 by rdeq_trans, rdeq_sym/ qed-.
65 theorem rdeq_repl: ∀h,o,L1,L2. ∀T:term. L1 ≛[h, o, T] L2 →
66 ∀K1. L1 ≛[h, o, T] K1 → ∀K2. L2 ≛[h, o, T] K2 → K1 ≛[h, o, T] K2.
67 /3 width=3 by rdeq_canc_sn, rdeq_trans/ qed-.
69 (* Negated properties *******************************************************)
71 (* Note: auto works with /4 width=8/ so rdeq_canc_sn is preferred **********)
72 (* Basic_2A1: uses: lleq_nlleq_trans *)
73 lemma rdeq_rdneq_trans: ∀h,o.∀T:term.∀L1,L. L1 ≛[h, o, T] L →
74 ∀L2. (L ≛[h, o, T] L2 → ⊥) → (L1 ≛[h, o, T] L2 → ⊥).
75 /3 width=3 by rdeq_canc_sn/ qed-.
77 (* Basic_2A1: uses: nlleq_lleq_div *)
78 lemma rdneq_rdeq_div: ∀h,o.∀T:term.∀L2,L. L2 ≛[h, o, T] L →
79 ∀L1. (L1 ≛[h, o, T] L → ⊥) → (L1 ≛[h, o, T] L2 → ⊥).
80 /3 width=3 by rdeq_trans/ qed-.
82 theorem rdneq_rdeq_canc_dx: ∀h,o,L1,L. ∀T:term. (L1 ≛[h, o, T] L → ⊥) →
83 ∀L2. L2 ≛[h, o, T] L → L1 ≛[h, o, T] L2 → ⊥.
84 /3 width=3 by rdeq_trans/ qed-.
86 (* Negated inversion lemmas *************************************************)
88 (* Basic_2A1: uses: nlleq_inv_bind nlleq_inv_bind_O *)
89 lemma rdneq_inv_bind: ∀h,o,p,I,L1,L2,V,T. (L1 ≛[h, o, ⓑ{p,I}V.T] L2 → ⊥) →
90 (L1 ≛[h, o, V] L2 → ⊥) ∨ (L1.ⓑ{I}V ≛[h, o, T] L2.ⓑ{I}V → ⊥).
91 /3 width=2 by rnex_inv_bind, tdeq_dec/ qed-.
93 (* Basic_2A1: uses: nlleq_inv_flat *)
94 lemma rdneq_inv_flat: ∀h,o,I,L1,L2,V,T. (L1 ≛[h, o, ⓕ{I}V.T] L2 → ⊥) →
95 (L1 ≛[h, o, V] L2 → ⊥) ∨ (L1 ≛[h, o, T] L2 → ⊥).
96 /3 width=2 by rnex_inv_flat, tdeq_dec/ qed-.
98 lemma rdneq_inv_bind_void: ∀h,o,p,I,L1,L2,V,T. (L1 ≛[h, o, ⓑ{p,I}V.T] L2 → ⊥) →
99 (L1 ≛[h, o, V] L2 → ⊥) ∨ (L1.ⓧ ≛[h, o, T] L2.ⓧ → ⊥).
100 /3 width=3 by rnex_inv_bind_void, tdeq_dec/ qed-.