Delimit Scope omegacat_scope with omegacat.
Local Open Scope omegacat_scope.
(** Since we can't eliminate prop to define functors in a simple way, we redefine the notion of le (less than or equal) for natural numbers in Type (Tle).  We show that le implies Tle (and vise versa).  What follows are some properties of Tle. *)
Inductive Tle (n : nat) : nat → Type :=
| Tle_n : Tle n n
| Tle_S : ∀ m, Tle n m → Tle n (S m)
.
Hint Constructors Tle.
Notation "n ≤ m" := (Tle n m) : omegacat_scope.
Definition Tle_addS (n m : nat) : n ≤ m → S n ≤ S m.
Definition Tle_trans (n m t : nat) : n ≤ m → m ≤ t → n ≤ t.
(** Tle is decidable. This is crutial in conversion from le to Tle. *)
Definition Tle_dec (n m : nat) : (n ≤ m) + ((n ≤ m) → False).
(** This is prety straightforward. *)
Definition Tle_le {n m : nat} : n ≤ m → le n m.
(** The contrapositive of conversion from le to Tle. *)
Definition NTle_Nle {n m : nat} : (n ≤ m → False) → (le n m → False).
(** This is the actual conversion from le to Tle.  Here, the trick is that we use decidability of Tle. In case the relation holds, we have the proof. In case it does not, we can refute the le relation.  Hence, this conversion is (as expected) does not preform an explicit elimination of le (as it is impossible) and hence is not computationally simplifiable. *)
Definition le_Tle {n m : nat} : le n m → n ≤ m.
(** Natural numbers form a preorder with le (less than or equal relation). *)
Definition OmegaPreOrder :=
{|
PreOrder_car := nat : Type;
PreOrder_rel := Tle : _ → _ → Type;
PreOrder_rel_isProp :=
fun _ _ h h' => Tle_is_HProp h h';
PreOrder_refl := Tle_n;
PreOrder_trans := Tle_trans
|}.
(** The pre-order category ω. *)
Definition OmegaCat : Category := PreOrder_Cat OmegaPreOrder.
Notation "'ω'" := (OmegaCat) : omegacat_scope.

Lemma le_Tle_n (n : nat) : le_Tle (le_n n) = Tle_n n.