Module invert := fc_invert wf weak subst.Definition get_tpg (G : context) (a:tm) : tm :=
  get_tpg_n (size_tm a) G a.Definition get_deq (G : context) (g:co) : (tm*tm) :=
  get_deq_n (size_co g) G g.Definition get_iso (G : context) (g:co) : (constraint*constraint) :=
  get_iso_n (size_co g) G g.

(* Specifications: *)
Lemma get_n_correct : forall n, (forall G a A B, size_tm a <= n -> AnnTyping G a A -> get_tpg_n n G a = B -> A = B) /\ (forall G D g A B A' B', size_co g <= n -> AnnDefEq G D g A B -> get_deq_n n G g = (A',B') -> A = A' /\ B = B') /\ (forall G D g A B A' B', size_co g <= n -> AnnIso G D g A B -> get_iso_n n G g = (A',B') -> A = A' /\ B = B').
Lemma get_tpg_correct : (forall G a A B, AnnTyping G a A -> get_tpg G a = B -> A = B).
Lemma get_deq_correct: (forall G D g A B A' B', AnnDefEq G D g A B -> get_deq G g = (A',B') -> A = A' /\ B = B').
Lemma get_iso_correct: (forall G D g A B A' B', AnnIso G D g A B -> get_iso G g = (A',B') -> A = A' /\ B = B').