Section SortsOfECC.
Inductive srt_ecc : Set :=
| Sprop : srt_ecc
| Stype : nat -> srt_ecc.
Inductive axiom_ecc : srt_ecc -> srt_ecc -> Prop :=
| ax_prop : forall (n : nat), axiom_ecc Sprop (Stype n)
| ax_type : forall (n m : nat), n < m -> axiom_ecc (Stype n) (Stype m).
Inductive rules_ecc : srt_ecc -> srt_ecc -> srt_ecc -> Prop :=
| rule_prop_l : forall (s : srt_ecc), rules_ecc Sprop s s
| rule_prop_r : forall (s : srt_ecc), rules_ecc s Sprop Sprop
| rule_type :
forall (n m p : nat),
n <= p -> m <= p -> rules_ecc (Stype n) (Stype m) (Stype p).
Inductive univ_ecc : srt_ecc -> srt_ecc -> Prop :=
univ_type :
forall (n m : nat),
n <= m -> univ_ecc (Stype n) (Stype 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 : inv_univ Sprop Sprop
| iu_type :
forall (n m : nat),
n <= m -> inv_univ (Stype n) (Stype m).
Hint Resolve iu_prop iu_type: pts.
simple induction 1; intros; auto with arith pts.
inversion_clear H1.
apply iu_type.
apply le_trans with m; auto with arith pts.
Qed.

Lemma univ_inv :
forall s s' : srt_ecc,
univ s s' -> forall P : Prop, (inv_univ s s' -> P) -> P.