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 (* Initial invocation: - Patience on us to gain peace and perfection! - *)
17 include "background/preamble.ma".
18 include "background/notation.ma".
20 (* TERM STRUCTURE ***********************************************************)
22 (* Policy: term metavariables : A, B, C, D, M, N
23 depth metavariables: i, j
25 inductive term: Type[0] ≝
26 | VRef: nat → term (* variable reference by depth *)
27 | Abst: term → term (* function formation *)
28 | Appl: term → term → term (* function application *)
31 interpretation "term construction (variable reference by index)"
32 'VariableReferenceByIndex i = (VRef i).
34 interpretation "term construction (abstraction)"
35 'Abstraction A = (Abst A).
37 interpretation "term construction (application)"
38 'Application C A = (Appl C A).
40 definition compatible_abst: predicate (relation term) ≝ λR.
41 ∀A1,A2. R A1 A2 → R (𝛌.A1) (𝛌.A2).
43 definition compatible_sn: predicate (relation term) ≝ λR.
44 ∀A,B1,B2. R B1 B2 → R (@B1.A) (@B2.A).
46 definition compatible_dx: predicate (relation term) ≝ λR.
47 ∀B,A1,A2. R A1 A2 → R (@B.A1) (@B.A2).
49 definition compatible_appl: predicate (relation term) ≝ λR.
50 ∀B1,B2. R B1 B2 → ∀A1,A2. R A1 A2 →
53 lemma star_compatible_abst: ∀R. compatible_abst R → compatible_abst (star … R).
54 #R #HR #A1 #A2 #H elim H -A2 // /3 width=3/
57 lemma star_compatible_sn: ∀R. compatible_sn R → compatible_sn (star … R).
58 #R #HR #A #B1 #B2 #H elim H -B2 // /3 width=3/
61 lemma star_compatible_dx: ∀R. compatible_dx R → compatible_dx (star … R).
62 #R #HR #B #A1 #A2 #H elim H -A2 // /3 width=3/
65 lemma star_compatible_appl: ∀R. reflexive ? R →
66 compatible_appl R → compatible_appl (star … R).
67 #R #H1R #H2R #B1 #B2 #H elim H -B2 /3 width=1/ /3 width=5/