Require Export Relations.
Unset Standard Proposition Elimination Names.
Section SortsOfECC.
Inductive calc : Set :=
| Pos : calc
| Neg : calc.
Inductive srt_ecc : Set :=
| Sprop : calc -> srt_ecc
| Stype : calc -> nat -> srt_ecc.
Inductive axiom_ecc : srt_ecc -> srt_ecc -> Prop :=
| ax_prop : forall (c : calc) (n : nat), axiom_ecc (Sprop c) (Stype c n)
| ax_type :
forall (c : calc) (n m : nat),
n < m -> axiom_ecc (Stype c n) (Stype c m).
Inductive rules_ecc : srt_ecc -> srt_ecc -> srt_ecc -> Prop :=
| rule_prop_l : forall (c : calc) (s : srt_ecc), rules_ecc (Sprop c) s s
| rule_prop_r :
forall (c : calc) (s : srt_ecc), rules_ecc s (Sprop c) (Sprop c)
| rule_type :
forall (c1 c2 : calc) (n m p : nat),
n <= p -> m <= p -> rules_ecc (Stype c1 n) (Stype c2 m) (Stype c2 p).
Inductive univ_ecc : srt_ecc -> srt_ecc -> Prop :=
univ_type :
forall (c : calc) (n m : nat),
n <= m -> univ_ecc (Stype c n) (Stype c m).
Definition univ : relation srt_ecc := clos_refl_trans _ univ_ecc.
Hint Resolve ax_prop ax_type rule_prop_l rule_prop_r rule_type univ_type:
pts.
Hint Unfold univ: pts.
(* Inversion et Decidabilite de l'inclusion entre sortes *)
Let univ_trans : forall x y z : srt_ecc, univ x y -> univ y z -> univ x z.
Proof rt_trans srt_ecc univ_ecc.
Inductive inv_univ : srt_ecc -> srt_ecc -> Prop :=
| iu_prop : forall c : calc, inv_univ (Sprop c) (Sprop c)
| iu_type :
forall (c : calc) (n m : nat),
n <= m -> inv_univ (Stype c n) (Stype c m).
Hint Resolve iu_prop iu_type: pts.

(* Specifications: *)
Lemma inv_univ_trans :
forall x y z : srt_ecc, inv_univ x y -> inv_univ y z -> inv_univ x z.