]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/syntax/sd.ma
partial commit in static_2
[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 "ground/arith/nat_plus.ma".
16 include "ground/arith/nat_minus.ma".
17 include "ground/arith/nat_lt_pred.ma".
18 include "static_2/syntax/sh_nexts.ma".
19
20 (* SORT DEGREE **************************************************************)
21
22 (* sort degree specification *)
23 record sd: Type[0] ≝ {
24 (* degree of the sort *)
25    deg: relation nat
26 }.
27
28 (* sort degree postulates *)
29 record sd_props (h) (o): Prop ≝ {
30 (* functional relation axioms *)
31    deg_total: ∀s. ∃d. deg o s d;
32    deg_mono : ∀s,d1,d2. deg o s d1 → deg o s d2 → d1 = d2;
33 (* compatibility condition *)
34    deg_next : ∀s,d. deg o s d → deg o (⇡[h]s) (↓d)
35 }.
36
37 (* Notable specifications ***************************************************)
38
39 definition deg_O: relation nat ≝ λs,d. d = 𝟎.
40
41 definition sd_O: sd ≝ mk_sd deg_O.
42
43 lemma sd_O_props (h): sd_props h sd_O ≝ mk_sd_props ….
44 /2 width=2 by nle_inv_zero_dx, nle_refl, ex_intro/ qed.
45
46 (* Basic inversion lemmas ***************************************************)
47
48 lemma deg_inv_pred (h) (o): sd_props h o →
49       ∀s,d. deg o (⇡[h]s) (↑d) → deg o s (↑↑d).
50 #h #o #Ho #s #d #H1
51 elim (deg_total … Ho s) #d0 #H0
52 lapply (deg_next … Ho … H0) #H2
53 lapply (deg_mono … Ho … H1 H2) -H1 -H2 #H >H <nlt_des_gen
54 /2 width=2 by nlt_des_lt_zero_sn/
55 qed-.
56
57 lemma deg_inv_prec (h) (o): sd_props h o →
58       ∀s,n,d. deg o (⇡*[h,n]s) (↑d) → deg o s (↑(d+n)).
59 #h #o #H0 #s #n @(nat_ind_succ … n) -n [ // ]
60 #n #IH #d <sh_nexts_succ
61 #H <nplus_succ_shift
62 @IH -IH @(deg_inv_pred … H0) // (**) (* auto fails *)
63 qed-.
64
65 (* Basic properties *********************************************************)
66
67 lemma deg_iter (h) (o): sd_props h o →
68       ∀s,d,n. deg o s d → deg o (⇡*[h,n]s) (d-n).
69 #h #o #Ho #s #d #n @(nat_ind_succ … n) -n [ // ]
70 #n #IH #H <nminus_succ_dx <sh_nexts_succ
71 /3 width=1 by deg_next/
72 qed.
73
74 lemma deg_next_SO (h) (o): sd_props h o →
75       ∀s,d. deg o s (↑d) → deg o (⇡[h]s) d.
76 /2 width=1 by deg_next/ qed-.