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 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".
20 (* SORT DEGREE **************************************************************)
22 (* sort degree specification *)
23 record sd: Type[0] ≝ {
24 (* degree of the sort *)
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)
37 (* Notable specifications ***************************************************)
39 definition deg_O: relation nat ≝ λs,d. d = 𝟎.
41 definition sd_O: sd ≝ mk_sd deg_O.
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.
46 (* Basic inversion lemmas ***************************************************)
48 lemma deg_inv_pred (h) (o): sd_props h o →
49 ∀s,d. deg o (⇡[h]s) (↑d) → deg o s (↑↑d).
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/
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
62 @IH -IH @(deg_inv_pred … H0) // (**) (* auto fails *)
65 (* Basic properties *********************************************************)
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/
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-.