]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/delayed_updating/syntax/prototerm_constructors.ma
update in delayed_updating
[helm.git] / matita / matita / contribs / lambdadelta / delayed_updating / syntax / prototerm_constructors.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 "delayed_updating/syntax/prototerm.ma".
16 include "delayed_updating/notation/functions/hash_1.ma".
17 include "delayed_updating/notation/functions/phi_2.ma".
18 include "delayed_updating/notation/functions/lamda_1.ma".
19 include "delayed_updating/notation/functions/at_2.ma".
20
21 (* CONSTRUCTORS FOR PROTOTERM ***********************************************)
22
23 definition prototerm_node_0 (l): prototerm ≝
24            λp. l◗𝐞 = p.
25
26 definition prototerm_node_1 (l): prototerm → prototerm ≝
27            λt,p. ∃∃q. q ϵ t & l◗q = p.
28
29 definition prototerm_node_2 (l1) (l2): prototerm → prototerm → prototerm ≝
30            λt1,t2,p.
31            ∨∨ ∃∃q. q ϵ t1 & l1◗q = p
32             | ∃∃q. q ϵ t2 & l2◗q = p.
33
34 interpretation
35   "outer variable reference by depth (prototerm)"
36   'Hash n = (prototerm_node_0 (label_node_d n)).
37
38 interpretation
39   "inner variable reference by depth (prototerm)"
40   'Phi n t = (prototerm_node_1 (label_node_d n) t).
41
42 interpretation
43   "name-free functional abstraction (prototerm)"
44   'Lamda t = (prototerm_node_1 label_edge_L t).
45
46 interpretation
47   "application (prototerm)"
48   'At u t = (prototerm_node_2 label_edge_S label_edge_A u t).
49
50 (* Basic Inversions *********************************************************)
51
52 lemma prototerm_in_root_inv_lcons_oref:
53       ∀p,l,n. l◗p ϵ ▵#n →
54       ∧∧ 𝗱n = l & 𝐞 = p.
55 #p #l #n * #q
56 <list_append_lcons_sn #H0 destruct -H0
57 elim (eq_inv_list_empty_append … e0) -e0 #H0 #_
58 /2 width=1 by conj/
59 qed-.
60
61 lemma prototerm_in_root_inv_lcons_iref:
62       ∀t,p,l,n. l◗p ϵ ▵𝛗n.t →
63       ∧∧ 𝗱n = l & p ϵ ▵t.
64 #t #p #l #n * #q
65 <list_append_lcons_sn * #r #Hr #H0 destruct
66 /3 width=2 by ex_intro, conj/
67 qed-.
68
69 lemma prototerm_in_root_inv_lcons_abst:
70       ∀t,p,l. l◗p ϵ ▵𝛌.t →
71       ∧∧ 𝗟 = l & p ϵ ▵t.
72 #t #p #l * #q
73 <list_append_lcons_sn * #r #Hr #H0 destruct
74 /3 width=2 by ex_intro, conj/
75 qed-.
76
77 lemma prototerm_in_root_inv_lcons_appl:
78       ∀u,t,p,l. l◗p ϵ ▵@u.t →
79       ∨∨ ∧∧ 𝗦 = l & p ϵ ▵u
80        | ∧∧ 𝗔 = l & p ϵ ▵t.
81 #u #t #p #l * #q
82 <list_append_lcons_sn * * #r #Hr #H0 destruct
83 /4 width=2 by ex_intro, or_introl, or_intror, conj/
84 qed-.