]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/apps_2/models/veq.ma
update in static_2 and app_2
[helm.git] / matita / matita / contribs / lambdadelta / apps_2 / models / veq.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "apps_2/models/model_props.ma".
16
17 (* EVALUATION EQUIVALENCE ***************************************************)
18
19 definition veq (M): relation (evaluation M) ≝
20                     λv1,v2. ∀d. v1 d ≗ v2 d.
21
22 interpretation "evaluation equivalence (model)"
23    'RingEq M v1 v2 = (veq M v1 v2).
24
25 (* Basic properties *********************************************************)
26
27 lemma veq_refl (M): is_model M →
28                     reflexive … (veq M).
29 /2 width=1 by mr/ qed.
30
31 lemma veq_repl (M): is_model M →
32                     replace_2 … (veq M) (veq M) (veq M).
33 /2 width=5 by mq/ qed-.
34
35 lemma veq_sym (M): is_model M → symmetric … (veq M).
36 /3 width=5 by veq_repl, veq_refl/ qed-.
37
38 lemma veq_trans (M): is_model M → Transitive … (veq M).
39 /3 width=5 by veq_repl, veq_refl/ qed-.
40
41 lemma veq_canc_sn (M): is_model M → left_cancellable … (veq M).
42 /3 width=3 by veq_trans, veq_sym/ qed-.
43
44 lemma veq_canc_dx (M): is_model M → right_cancellable … (veq M).
45 /3 width=3 by veq_trans, veq_sym/ qed-.
46
47 (* Properties with evaluation lift ******************************************)
48
49 theorem vlift_swap (M): is_model M →
50                         ∀i1,i2. i1 ≤ i2 →
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
58   /2 width=1 by mr/
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
63     /2 width=1 by mr/
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/
67   ]
68 ]
69 qed.
70
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 //
78 ]
79 qed-.
80
81 (* Properies with term interpretation ***************************************) 
82
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/
94 ]
95 qed.