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.

(** We show that (homotopy-type-theoretically speaking) Tle is a mere proposition. That is, any two proofs of a ≤ b are equal. Note that Tle is in Type and not in Pop and hence we can't use proof-irrelevance.  This is a proof in a hurry, and can perhaps be simplified later. *)
Theorem Tle_is_HProp {n m : nat} (H H' : Tle n m) : H = H'.