]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/apps_2/models/veq.ma
47d4a1b74a4238e3898c2e0ac4ff4a0469f4ab3a
[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 mq/ qed.
30
31 lemma veq_repl (M): is_model M →
32                     replace_2 … (veq M) (veq M) (veq M).
33 /2 width=5 by mr/ qed-.
34
35 lemma ext_veq (M): is_model M →
36                    ∀lv1,lv2. lv1 ≐ lv2 → lv1 ≗{M} lv2.
37 /2 width=1 by mq/ qed.
38
39 lemma exteq_veq_trans (M): ∀lv1,lv. lv1 ≐ lv →
40                            ∀lv2. lv ≗{M} lv2 → lv1 ≗ lv2.
41 // qed-.
42
43 (* Properties with evaluation evaluation lift *******************************)
44
45 lemma vlift_comp (M): ∀i. compatible_3 … (vlift M i) (sq M) (veq M) (veq M).
46 #m #i #d1 #d2 #Hd12 #lv1 #lv2 #HLv12 #j
47 elim (lt_or_eq_or_gt j i) #Hij destruct
48 [ >(vlift_lt … Hij) >(vlift_lt … Hij) //
49 | >(vlift_eq …) >(vlift_eq …) //
50 | >(vlift_gt … Hij) >(vlift_gt … Hij) //
51 ]
52 qed.
53
54 (* Properies with term interpretation ***************************************) 
55
56 lemma ti_comp_l (M): is_model M →
57                      ∀T,gv,lv1,lv2. lv1 ≗{M} lv2 →
58                      ⟦T⟧[gv, lv1] ≗ ⟦T⟧[gv, lv2].
59 #M #HM #T elim T -T * [||| #p * | * ]
60 [ /4 width=3 by seq_trans, seq_sym, ms/
61 | /4 width=5 by seq_sym, ml, mr/
62 | /4 width=3 by seq_trans, seq_sym, mg/
63 | /5 width=5 by vlift_comp, seq_sym, md, mr/
64 | /5 width=1 by vlift_comp, mi, mq/
65 | /4 width=5 by seq_sym, ma, mc, mr/
66 | /4 width=5 by seq_sym, me, mr/
67 ]
68 qed.