]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/syntax/sd.ma
533a79e05bc91ce73cce3c3391f94d6088c76f14
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / syntax / sd.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 "static_2/syntax/sh.ma".
16
17 (* SORT DEGREE **************************************************************)
18
19 (* sort degree specification *)
20 record sd: Type[0] ≝ {
21 (* degree of the sort *)
22    deg: relation nat
23 }.
24
25 (* sort degree postulates *)
26 record sd_props (h) (o): Prop ≝ {
27 (* functional relation axioms *)
28    deg_total: ∀s. ∃d. deg o s d;
29    deg_mono : ∀s,d1,d2. deg o s d1 → deg o s d2 → d1 = d2;
30 (* compatibility condition *)
31    deg_next : ∀s,d. deg o s d → deg o (⫯[h]s) (↓d)
32 }.
33
34 (* Notable specifications ***************************************************)
35
36 definition deg_O: relation nat ≝ λs,d. d = 0.
37
38 definition sd_O: sd ≝ mk_sd deg_O.
39
40 lemma sd_O_props (h): sd_props h sd_O ≝ mk_sd_props ….
41 /2 width=2 by le_n_O_to_eq, le_n, ex_intro/ qed.
42
43 (* Basic inversion lemmas ***************************************************)
44
45 lemma deg_inv_pred (h) (o): sd_props h o →
46       ∀s,d. deg o (⫯[h]s) (↑d) → deg o s (↑↑d).
47 #h #o #Ho #s #d #H1
48 elim (deg_total … Ho s) #d0 #H0
49 lapply (deg_next … Ho … H0) #H2
50 lapply (deg_mono … Ho … H1 H2) -H1 -H2 #H >H >S_pred
51 /2 width=2 by ltn_to_ltO/
52 qed-.
53
54 lemma deg_inv_prec (h) (o): sd_props h o →
55       ∀s,n,d. deg o ((next h)^n s) (↑d) → deg o s (↑(d+n)).
56 #h #o #H0 #s #n elim n -n normalize /3 width=3 by deg_inv_pred/
57 qed-.
58
59 (* Basic properties *********************************************************)
60
61 lemma deg_iter (h) (o): sd_props h o →
62       ∀s,d,n. deg o s d → deg o ((next h)^n s) (d-n).
63 #h #o #Ho #s #d #n elim n -n normalize /3 width=1 by deg_next/
64 qed.
65
66 lemma deg_next_SO (h) (o): sd_props h o →
67       ∀s,d. deg o s (↑d) → deg o (next h s) d.
68 /2 width=1 by deg_next/ qed-.