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 "basic_2/syntax/ext2_ext2.ma".
16 include "basic_2/syntax/tdeq_tdeq.ma".
17 include "basic_2/static/lfxs_lfxs.ma".
18 include "basic_2/static/lfdeq_length.ma".
20 (* DEGREE-BASED EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ******)
22 (* Advanced properties ******************************************************)
24 (* Basic_2A1: uses: lleq_sym *)
25 lemma lfdeq_sym: ∀h,o,T. symmetric … (lfdeq h o T).
26 /3 width=3 by lfdeq_fle_comp, lfxs_sym, tdeq_sym/ qed-.
28 (* Basic_2A1: uses: lleq_dec *)
29 lemma lfdeq_dec: ∀h,o,L1,L2. ∀T:term. Decidable (L1 ≛[h, o, T] L2).
30 /3 width=1 by lfxs_dec, tdeq_dec/ qed-.
32 (* Main properties **********************************************************)
34 (* Basic_2A1: uses: lleq_bind lleq_bind_O *)
35 theorem lfdeq_bind: ∀h,o,p,I,L1,L2,V1,V2,T.
36 L1 ≛[h, o, V1] L2 → L1.ⓑ{I}V1 ≛[h, o, T] L2.ⓑ{I}V2 →
37 L1 ≛[h, o, ⓑ{p,I}V1.T] L2.
38 /2 width=2 by lfxs_bind/ qed.
40 (* Basic_2A1: uses: lleq_flat *)
41 theorem lfdeq_flat: ∀h,o,I,L1,L2,V,T. L1 ≛[h, o, V] L2 → L1 ≛[h, o, T] L2 →
42 L1 ≛[h, o, ⓕ{I}V.T] L2.
43 /2 width=1 by lfxs_flat/ qed.
45 theorem lfdeq_bind_void: ∀h,o,p,I,L1,L2,V,T.
46 L1 ≛[h, o, V] L2 → L1.ⓧ ≛[h, o, T] L2.ⓧ →
47 L1 ≛[h, o, ⓑ{p,I}V.T] L2.
48 /2 width=1 by lfxs_bind_void/ qed.
50 (* Basic_2A1: uses: lleq_trans *)
51 theorem lfdeq_trans: ∀h,o,T. Transitive … (lfdeq h o T).
52 #h #o #T #L1 #L * #f1 #Hf1 #HL1 #L2 * #f2 #Hf2 #HL2
53 lapply (frees_tdeq_conf_lfdeq … Hf1 T … HL1) // #H0
54 lapply (frees_mono … Hf2 … H0) -Hf2 -H0
55 /5 width=7 by lexs_trans, lexs_eq_repl_back, tdeq_trans, ext2_trans, ex2_intro/
58 (* Basic_2A1: uses: lleq_canc_sn *)
59 theorem lfdeq_canc_sn: ∀h,o,T. left_cancellable … (lfdeq h o T).
60 /3 width=3 by lfdeq_trans, lfdeq_sym/ qed-.
62 (* Basic_2A1: uses: lleq_canc_dx *)
63 theorem lfdeq_canc_dx: ∀h,o,T. right_cancellable … (lfdeq h o T).
64 /3 width=3 by lfdeq_trans, lfdeq_sym/ qed-.
66 theorem lfdeq_repl: ∀h,o,L1,L2. ∀T:term. L1 ≛[h, o, T] L2 →
67 ∀K1. L1 ≛[h, o, T] K1 → ∀K2. L2 ≛[h, o, T] K2 → K1 ≛[h, o, T] K2.
68 /3 width=3 by lfdeq_canc_sn, lfdeq_trans/ qed-.
70 (* Negated properties *******************************************************)
72 (* Note: auto works with /4 width=8/ so lfdeq_canc_sn is preferred **********)
73 (* Basic_2A1: uses: lleq_nlleq_trans *)
74 lemma lfdeq_lfdneq_trans: ∀h,o.∀T:term.∀L1,L. L1 ≛[h, o, T] L →
75 ∀L2. (L ≛[h, o, T] L2 → ⊥) → (L1 ≛[h, o, T] L2 → ⊥).
76 /3 width=3 by lfdeq_canc_sn/ qed-.
78 (* Basic_2A1: uses: nlleq_lleq_div *)
79 lemma lfdneq_lfdeq_div: ∀h,o.∀T:term.∀L2,L. L2 ≛[h, o, T] L →
80 ∀L1. (L1 ≛[h, o, T] L → ⊥) → (L1 ≛[h, o, T] L2 → ⊥).
81 /3 width=3 by lfdeq_trans/ qed-.
83 theorem lfdneq_lfdeq_canc_dx: ∀h,o,L1,L. ∀T:term. (L1 ≛[h, o, T] L → ⊥) →
84 ∀L2. L2 ≛[h, o, T] L → L1 ≛[h, o, T] L2 → ⊥.
85 /3 width=3 by lfdeq_trans/ qed-.
87 (* Negated inversion lemmas *************************************************)
89 (* Basic_2A1: uses: nlleq_inv_bind nlleq_inv_bind_O *)
90 lemma lfdneq_inv_bind: ∀h,o,p,I,L1,L2,V,T. (L1 ≛[h, o, ⓑ{p,I}V.T] L2 → ⊥) →
91 (L1 ≛[h, o, V] L2 → ⊥) ∨ (L1.ⓑ{I}V ≛[h, o, T] L2.ⓑ{I}V → ⊥).
92 /3 width=2 by lfnxs_inv_bind, tdeq_dec/ qed-.
94 (* Basic_2A1: uses: nlleq_inv_flat *)
95 lemma lfdneq_inv_flat: ∀h,o,I,L1,L2,V,T. (L1 ≛[h, o, ⓕ{I}V.T] L2 → ⊥) →
96 (L1 ≛[h, o, V] L2 → ⊥) ∨ (L1 ≛[h, o, T] L2 → ⊥).
97 /3 width=2 by lfnxs_inv_flat, tdeq_dec/ qed-.
99 lemma lfdneq_inv_bind_void: ∀h,o,p,I,L1,L2,V,T. (L1 ≛[h, o, ⓑ{p,I}V.T] L2 → ⊥) →
100 (L1 ≛[h, o, V] L2 → ⊥) ∨ (L1.ⓧ ≛[h, o, T] L2.ⓧ → ⊥).
101 /3 width=3 by lfnxs_inv_bind_void, tdeq_dec/ qed-.