(* QuickChick Prelude *)
Set Warnings "-extraction-opaque-accessed,-extraction".
Set Warnings "-notation-overridden,-parsing".
Set Bullet Behavior "Strict Subproofs".
(* End prelude *)
Admitted.  (* QuickChick canonical_forms_bool. *)
Instance dec_ex_abs t T1 : Dec (exists x u, t = tabs x T1 u).
constructor; unfold decidable.
destruct t eqn:Eq;
try solve [right => [[x [id contra]]]; congruence].
destruct (eq_dec_ty t0 T1).
destruct dec eqn:H; subst; eauto.
right => [[x [id contra]]]; inversion contra; subst; congruence.
Defined.

Lemma canonical_forms_fun : forall t T1 T2,
empty |- t \typ (TArrow T1 T2) ->
value t ->
exists x u, t = tabs x T1 u.