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 "apps_2/models/model_props.ma".
17 (* EVALUATION EQUIVALENCE ***************************************************)
19 definition veq (M): relation (evaluation M) ≝
20 λv1,v2. ∀d. v1 d ≗ v2 d.
22 interpretation "evaluation equivalence (model)"
23 'RingEq M v1 v2 = (veq M v1 v2).
25 (* Basic properties *********************************************************)
27 lemma veq_refl (M): is_model M →
29 /2 width=1 by mr/ qed.
31 lemma veq_repl (M): is_model M →
32 replace_2 … (veq M) (veq M) (veq M).
33 /2 width=5 by mq/ qed-.
35 lemma veq_sym (M): is_model M → symmetric … (veq M).
36 /3 width=5 by veq_repl, veq_refl/ qed-.
38 lemma veq_trans (M): is_model M → Transitive … (veq M).
39 /3 width=5 by veq_repl, veq_refl/ qed-.
41 lemma veq_canc_sn (M): is_model M → left_cancellable … (veq M).
42 /3 width=3 by veq_trans, veq_sym/ qed-.
44 lemma veq_canc_dx (M): is_model M → right_cancellable … (veq M).
45 /3 width=3 by veq_trans, veq_sym/ qed-.
47 (* Properties with evaluation lift ******************************************)
49 theorem vlift_swap (M): is_model M →
51 ∀lv,d1,d2. ⫯[i1←d1] ⫯[i2←d2] lv ≗{M} ⫯[↑i2←d2] ⫯[i1←d1] lv.
52 #M #HM #i1 #i2 #Hi12 #lv #d1 #d2 #j
53 elim (lt_or_eq_or_gt j i1) #Hji1 destruct
54 [ lapply (lt_to_le_to_lt … Hji1 Hi12) #Hji2
55 >vlift_lt // >vlift_lt // >vlift_lt /2 width=1 by lt_S/ >vlift_lt //
56 /2 width=1 by veq_refl/
57 | >vlift_eq >vlift_lt /2 width=1 by monotonic_le_plus_l/ >vlift_eq
59 | >vlift_gt // elim (lt_or_eq_or_gt (↓j) i2) #Hji2 destruct
60 [ >vlift_lt // >vlift_lt /2 width=1 by lt_minus_to_plus/ >vlift_gt //
61 /2 width=1 by veq_refl/
62 | >vlift_eq <(lt_succ_pred … Hji1) >vlift_eq
64 | lapply (le_to_lt_to_lt … Hi12 Hji2) #Hi1j
65 >vlift_gt // >vlift_gt /2 width=1 by lt_minus_to_plus_r/ >vlift_gt //
66 /2 width=1 by veq_refl/
71 lemma vlift_comp (M): is_model M →
72 ∀i. compatible_3 … (vlift M i) (sq M) (veq M) (veq M).
73 #M #HM #i #d1 #d2 #Hd12 #lv1 #lv2 #HLv12 #j
74 elim (lt_or_eq_or_gt j i) #Hij destruct
75 [ >vlift_lt // >vlift_lt //
76 | >vlift_eq >vlift_eq //
77 | >vlift_gt // >vlift_gt //
81 (* Properies with term interpretation ***************************************)
83 lemma ti_comp (M): is_model M →
84 ∀T,gv1,gv2. gv1 ≗ gv2 → ∀lv1,lv2. lv1 ≗ lv2 →
85 ⟦T⟧[gv1, lv1] ≗{M} ⟦T⟧[gv2, lv2].
86 #M #HM #T elim T -T * [||| #p * | * ]
87 [ /4 width=5 by seq_trans, seq_sym, ms/
88 | /4 width=5 by seq_sym, ml, mq/
89 | /4 width=3 by seq_trans, seq_sym, mg/
90 | /5 width=5 by vlift_comp, seq_sym, md, mq/
91 | /5 width=1 by vlift_comp, mi, mr/
92 | /4 width=5 by seq_sym, ma, mp, mq/
93 | /4 width=5 by seq_sym, me, mq/