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 (* SORT-IRRELEVANT EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ***)
21 (* Advanced properties ******************************************************)
23 (* Basic_2A1: uses: lleq_sym *)
24 lemma rdeq_sym: ∀T. symmetric … (rdeq T).
25 /3 width=3 by rdeq_fsge_comp, rex_sym, tdeq_sym/ qed-.
27 (* Basic_2A1: uses: lleq_dec *)
28 lemma rdeq_dec: ∀L1,L2. ∀T:term. Decidable (L1 ≛[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: ∀p,I,L1,L2,V1,V2,T.
35 L1 ≛[V1] L2 → L1.ⓑ{I}V1 ≛[T] L2.ⓑ{I}V2 →
37 /2 width=2 by rex_bind/ qed.
39 (* Basic_2A1: uses: lleq_flat *)
40 theorem rdeq_flat: ∀I,L1,L2,V,T.
41 L1 ≛[V] L2 → L1 ≛[T] L2 → L1 ≛[ⓕ{I}V.T] L2.
42 /2 width=1 by rex_flat/ qed.
44 theorem rdeq_bind_void: ∀p,I,L1,L2,V,T.
45 L1 ≛[V] L2 → L1.ⓧ ≛[T] L2.ⓧ → L1 ≛[ⓑ{p,I}V.T] L2.
46 /2 width=1 by rex_bind_void/ qed.
48 (* Basic_2A1: uses: lleq_trans *)
49 theorem rdeq_trans: ∀T. Transitive … (rdeq T).
50 #T #L1 #L * #f1 #Hf1 #HL1 #L2 * #f2 #Hf2 #HL2
51 lapply (frees_tdeq_conf_rdeq … Hf1 T … HL1) // #H0
52 lapply (frees_mono … Hf2 … H0) -Hf2 -H0
53 /5 width=7 by sex_trans, sex_eq_repl_back, tdeq_trans, ext2_trans, ex2_intro/
56 (* Basic_2A1: uses: lleq_canc_sn *)
57 theorem rdeq_canc_sn: ∀T. left_cancellable … (rdeq T).
58 /3 width=3 by rdeq_trans, rdeq_sym/ qed-.
60 (* Basic_2A1: uses: lleq_canc_dx *)
61 theorem rdeq_canc_dx: ∀T. right_cancellable … (rdeq T).
62 /3 width=3 by rdeq_trans, rdeq_sym/ qed-.
64 theorem rdeq_repl: ∀L1,L2. ∀T:term. L1 ≛[T] L2 →
65 ∀K1. L1 ≛[T] K1 → ∀K2. L2 ≛[T] K2 → K1 ≛[T] K2.
66 /3 width=3 by rdeq_canc_sn, rdeq_trans/ qed-.
68 (* Negated properties *******************************************************)
70 (* Note: auto works with /4 width=8/ so rdeq_canc_sn is preferred **********)
71 (* Basic_2A1: uses: lleq_nlleq_trans *)
72 lemma rdeq_rdneq_trans: ∀T:term.∀L1,L. L1 ≛[T] L →
73 ∀L2. (L ≛[T] L2 → ⊥) → (L1 ≛[T] L2 → ⊥).
74 /3 width=3 by rdeq_canc_sn/ qed-.
76 (* Basic_2A1: uses: nlleq_lleq_div *)
77 lemma rdneq_rdeq_div: ∀T:term.∀L2,L. L2 ≛[T] L →
78 ∀L1. (L1 ≛[T] L → ⊥) → (L1 ≛[T] L2 → ⊥).
79 /3 width=3 by rdeq_trans/ qed-.
81 theorem rdneq_rdeq_canc_dx: ∀L1,L. ∀T:term. (L1 ≛[T] L → ⊥) →
82 ∀L2. L2 ≛[T] L → L1 ≛[T] L2 → ⊥.
83 /3 width=3 by rdeq_trans/ qed-.
85 (* Negated inversion lemmas *************************************************)
87 (* Basic_2A1: uses: nlleq_inv_bind nlleq_inv_bind_O *)
88 lemma rdneq_inv_bind: ∀p,I,L1,L2,V,T. (L1 ≛[ⓑ{p,I}V.T] L2 → ⊥) →
89 (L1 ≛[V] L2 → ⊥) ∨ (L1.ⓑ{I}V ≛[T] L2.ⓑ{I}V → ⊥).
90 /3 width=2 by rnex_inv_bind, tdeq_dec/ qed-.
92 (* Basic_2A1: uses: nlleq_inv_flat *)
93 lemma rdneq_inv_flat: ∀I,L1,L2,V,T. (L1 ≛[ⓕ{I}V.T] L2 → ⊥) →
94 (L1 ≛[V] L2 → ⊥) ∨ (L1 ≛[T] L2 → ⊥).
95 /3 width=2 by rnex_inv_flat, tdeq_dec/ qed-.
97 lemma rdneq_inv_bind_void: ∀p,I,L1,L2,V,T. (L1 ≛[ⓑ{p,I}V.T] L2 → ⊥) →
98 (L1 ≛[V] L2 → ⊥) ∨ (L1.ⓧ ≛[T] L2.ⓧ → ⊥).
99 /3 width=3 by rnex_inv_bind_void, tdeq_dec/ qed-.