Section type_reification.
Inductive term :Type :=
Fun : term -> term -> term
| Prod : term -> term -> term
| Bool : term
| SET :term
| PROP :term
| TYPE :term
| Var : Type -> term.
Fixpoint interp (t:term) :=
match t with
Bool => bool
| SET => Set
| PROP => Prop
| TYPE => Type
| Fun a b => interp a -> interp b
| Prod a b => interp a * interp b
| Var x => x
end.
Class interp_pair (abs : Type) :=
{ repr : term;
link: abs = interp repr }.
Arguments repr _ {interp_pair}.
Arguments link _ {interp_pair}.
simpl. intros. rewrite <- link. rewrite <- (link b). reflexivity.
Qed.
simpl. intros. rewrite <- link. rewrite <- (link b). reflexivity.
Qed.
Coercion repr : interp_pair >-> term.
Definition abs `{interp_pair a} : Type := a.
Coercion abs : interp_pair >-> Sortclass.

Lemma fun_interp' :forall `{ia : interp_pair, ib : interp_pair}, (ia -> ib) = interp (Fun ia ib).