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/lfdeq_length.ma".
19 (* DEGREE-BASED EQUIVALENCE FOR LOCAL ENVIRONMENTS ON REFERRED ENTRIES ******)
21 (* Advanced properties ******************************************************)
23 (* Basic_2A1: uses: lleq_sym *)
24 lemma lfdeq_sym: ∀h,o,T. symmetric … (lfdeq h o T).
25 /3 width=3 by lfdeq_fsge_comp, lfxs_sym, tdeq_sym/ qed-.
27 (* Basic_2A1: uses: lleq_dec *)
28 lemma lfdeq_dec: ∀h,o,L1,L2. ∀T:term. Decidable (L1 ≛[h, o, T] L2).
29 /3 width=1 by lfxs_dec, tdeq_dec/ qed-.
31 (* Main properties **********************************************************)
33 (* Basic_2A1: uses: lleq_bind lleq_bind_O *)
34 theorem lfdeq_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 lfxs_bind/ qed.
39 (* Basic_2A1: uses: lleq_flat *)
40 theorem lfdeq_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 lfxs_flat/ qed.
44 theorem lfdeq_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 lfxs_bind_void/ qed.
49 (* Basic_2A1: uses: lleq_trans *)
50 theorem lfdeq_trans: ∀h,o,T. Transitive … (lfdeq h o T).
51 #h #o #T #L1 #L * #f1 #Hf1 #HL1 #L2 * #f2 #Hf2 #HL2
52 lapply (frees_tdeq_conf_lfdeq … Hf1 T … HL1) // #H0
53 lapply (frees_mono … Hf2 … H0) -Hf2 -H0
54 /5 width=7 by lexs_trans, lexs_eq_repl_back, tdeq_trans, ext2_trans, ex2_intro/
57 (* Basic_2A1: uses: lleq_canc_sn *)
58 theorem lfdeq_canc_sn: ∀h,o,T. left_cancellable … (lfdeq h o T).
59 /3 width=3 by lfdeq_trans, lfdeq_sym/ qed-.
61 (* Basic_2A1: uses: lleq_canc_dx *)
62 theorem lfdeq_canc_dx: ∀h,o,T. right_cancellable … (lfdeq h o T).
63 /3 width=3 by lfdeq_trans, lfdeq_sym/ qed-.
65 theorem lfdeq_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 lfdeq_canc_sn, lfdeq_trans/ qed-.
69 (* Negated properties *******************************************************)
71 (* Note: auto works with /4 width=8/ so lfdeq_canc_sn is preferred **********)
72 (* Basic_2A1: uses: lleq_nlleq_trans *)
73 lemma lfdeq_lfdneq_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 lfdeq_canc_sn/ qed-.
77 (* Basic_2A1: uses: nlleq_lleq_div *)
78 lemma lfdneq_lfdeq_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 lfdeq_trans/ qed-.
82 theorem lfdneq_lfdeq_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 lfdeq_trans/ qed-.
86 (* Negated inversion lemmas *************************************************)
88 (* Basic_2A1: uses: nlleq_inv_bind nlleq_inv_bind_O *)
89 lemma lfdneq_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 lfnxs_inv_bind, tdeq_dec/ qed-.
93 (* Basic_2A1: uses: nlleq_inv_flat *)
94 lemma lfdneq_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 lfnxs_inv_flat, tdeq_dec/ qed-.
98 lemma lfdneq_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 lfnxs_inv_bind_void, tdeq_dec/ qed-.