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/generated/pull_2.ma".
16 include "ground/arith/pnat_pred.ma".
17 include "static_2/syntax/sh_props.ma".
18 include "static_2/syntax/sd.ma".
20 (* SORT DEGREE **************************************************************)
22 (* Basic_2A1: includes: deg_SO_pos *)
23 inductive deg_SO (h) (s) (s0): predicate nat ≝
24 | deg_SO_succ : ∀n. ⇡*[h,n]s0 = s → deg_SO h s s0 (↑n)
25 | deg_SO_zero: (∀n. ⇡*[h,n]s0 = s → ⊥) → deg_SO h s s0 𝟎
28 fact deg_SO_inv_succ_aux (h) (s) (s0):
29 ∀n0. deg_SO h s s0 n0 → ∀n. n0 = ↑n → ⇡*[h,n]s0 = s.
31 [ #n #Hn #x #H destruct //
32 | #_ #x #H elim (eq_inv_zero_nsucc … H)
36 (* Basic_2A1: was: deg_SO_inv_pos *)
37 lemma deg_SO_inv_succ (h) (s) (s0):
38 ∀n. deg_SO h s s0 (↑n) → ⇡*[h,n]s0 = s.
39 /2 width=3 by deg_SO_inv_succ_aux/ qed-.
41 lemma deg_SO_refl (h) (s):
43 #h #s @(deg_SO_succ … 𝟎 ?) //
46 definition sd_SO (h) (s):
47 sd ≝ mk_sd (deg_SO h s).
49 lemma sd_SO_props (h) (s):
50 sh_decidable h → sh_acyclic h →
51 sd_props h (sd_SO h s).
55 elim (sh_nexts_dec … Hhd s0 s) -Hhd
56 [ * /3 width=2 by deg_SO_succ, ex_intro/
57 | /5 width=2 by deg_SO_zero, ex_intro/
59 | #s0 #d1 #d2 * [ #n1 ] #H1 * [1,3: #n2 ] #H2
61 lapply (sh_nexts_inj … Hha … H) -H #H destruct //
62 | elim H1 /2 width=2 by ex_intro/
63 | elim H2 /2 width=2 by ex_intro/
68 <npred_succ @(nat_ind_succ … n) -n
69 [ @deg_SO_zero #n >sh_nexts_succ_next #H
70 lapply (sh_nexts_inj … Hha … H) -H #H
71 elim (eq_inv_nsucc_zero … H)
72 | #n #_ /2 width=1 by deg_SO_succ/
74 | #H0 @deg_SO_zero #n >sh_nexts_succ_next #H destruct
80 rec definition sd_d_pnat (h) (s) (d) on d: sd ≝
83 | psucc d ⇒ sd_d_pnat h (⇡[h]s) d
86 definition sd_d (h) (s) (d): sd ≝
89 | ninj d ⇒ sd_d_pnat h s d
92 lemma sd_d_props (h) (s) (d):
93 sh_decidable h → sh_acyclic h →
94 sd_props h (sd_d h s d).
96 #d elim d -d /2 width=1 by sd_SO_props/
99 (* Properties with sd_d *****************************************************)
102 ∀s,d. sd_d h s (↑↑d) = sd_d h (⇡[h]s) (↑d).
105 lemma sd_d_correct (h):
106 sh_decidable h → sh_acyclic h →
107 ∀s,d. deg (sd_d h s d) s d.
108 #h #Hhd #Hha @pull_2 * [ // ]
109 #d elim d -d [ // ] #d #IH #s
110 >(npsucc_pred d) in ⊢ (???%);
112 [ /2 width=1 by sd_d_props/