Definition value := (env * term)%type.Inductive subterm : value -> value -> Prop :=
    | sbtrm_abs_l :
        forall (e : env) (A M : term), subterm (e, A) (e, Abs A M)
    | sbtrm_abs_r :
        forall (e : env) (A A' M : term),
        subterm (Ax A' :: e, M) (e, Abs A M)
    | sbtrm_app_l :
        forall (e : env) (u v : term), subterm (e, u) (e, App u v)
    | sbtrm_app_r :
        forall (e : env) (u v : term), subterm (e, v) (e, App u v)
    | sbtrm_prod_l :
        forall (e : env) (A B : term), subterm (e, A) (e, Prod A B)
    | sbtrm_prod_r :
        forall (e : env) (A A' B : term),
        subterm (Ax A' :: e, B) (e, Prod A B).Inductive subterm : value -> value -> Prop :=
    | sbtrm_abs_l :
        forall (e : env) (A M : term), subterm (e, A) (e, Abs A M)
    | sbtrm_abs_r :
        forall (e : env) (A A' M : term),
        subterm (Ax A' :: e, M) (e, Abs A M)
    | sbtrm_app_l :
        forall (e : env) (u v : term), subterm (e, u) (e, App u v)
    | sbtrm_app_r :
        forall (e : env) (u v : term), subterm (e, v) (e, App u v)
    | sbtrm_prod_l :
        forall (e : env) (A B : term), subterm (e, A) (e, Prod A B)
    | sbtrm_prod_r :
        forall (e : env) (A A' B : term),
        subterm (Ax A' :: e, B) (e, Prod A B).Inductive subterm : value -> value -> Prop :=
    | sbtrm_abs_l :
        forall (e : env) (A M : term), subterm (e, A) (e, Abs A M)
    | sbtrm_abs_r :
        forall (e : env) (A A' M : term),
        subterm (Ax A' :: e, M) (e, Abs A M)
    | sbtrm_app_l :
        forall (e : env) (u v : term), subterm (e, u) (e, App u v)
    | sbtrm_app_r :
        forall (e : env) (u v : term), subterm (e, v) (e, App u v)
    | sbtrm_prod_l :
        forall (e : env) (A B : term), subterm (e, A) (e, Prod A B)
    | sbtrm_prod_r :
        forall (e : env) (A A' B : term),
        subterm (Ax A' :: e, B) (e, Prod A B).Inductive subterm : value -> value -> Prop :=
    | sbtrm_abs_l :
        forall (e : env) (A M : term), subterm (e, A) (e, Abs A M)
    | sbtrm_abs_r :
        forall (e : env) (A A' M : term),
        subterm (Ax A' :: e, M) (e, Abs A M)
    | sbtrm_app_l :
        forall (e : env) (u v : term), subterm (e, u) (e, App u v)
    | sbtrm_app_r :
        forall (e : env) (u v : term), subterm (e, v) (e, App u v)
    | sbtrm_prod_l :
        forall (e : env) (A B : term), subterm (e, A) (e, Prod A B)
    | sbtrm_prod_r :
        forall (e : env) (A A' B : term),
        subterm (Ax A' :: e, B) (e, Prod A B).Inductive subterm : value -> value -> Prop :=
    | sbtrm_abs_l :
        forall (e : env) (A M : term), subterm (e, A) (e, Abs A M)
    | sbtrm_abs_r :
        forall (e : env) (A A' M : term),
        subterm (Ax A' :: e, M) (e, Abs A M)
    | sbtrm_app_l :
        forall (e : env) (u v : term), subterm (e, u) (e, App u v)
    | sbtrm_app_r :
        forall (e : env) (u v : term), subterm (e, v) (e, App u v)
    | sbtrm_prod_l :
        forall (e : env) (A B : term), subterm (e, A) (e, Prod A B)
    | sbtrm_prod_r :
        forall (e : env) (A A' B : term),
        subterm (Ax A' :: e, B) (e, Prod A B).Inductive subterm : value -> value -> Prop :=
    | sbtrm_abs_l :
        forall (e : env) (A M : term), subterm (e, A) (e, Abs A M)
    | sbtrm_abs_r :
        forall (e : env) (A A' M : term),
        subterm (Ax A' :: e, M) (e, Abs A M)
    | sbtrm_app_l :
        forall (e : env) (u v : term), subterm (e, u) (e, App u v)
    | sbtrm_app_r :
        forall (e : env) (u v : term), subterm (e, v) (e, App u v)
    | sbtrm_prod_l :
        forall (e : env) (A B : term), subterm (e, A) (e, Prod A B)
    | sbtrm_prod_r :
        forall (e : env) (A A' B : term),
        subterm (Ax A' :: e, B) (e, Prod A B).Inductive subterm : value -> value -> Prop :=
    | sbtrm_abs_l :
        forall (e : env) (A M : term), subterm (e, A) (e, Abs A M)
    | sbtrm_abs_r :
        forall (e : env) (A A' M : term),
        subterm (Ax A' :: e, M) (e, Abs A M)
    | sbtrm_app_l :
        forall (e : env) (u v : term), subterm (e, u) (e, App u v)
    | sbtrm_app_r :
        forall (e : env) (u v : term), subterm (e, v) (e, App u v)
    | sbtrm_prod_l :
        forall (e : env) (A B : term), subterm (e, A) (e, Prod A B)
    | sbtrm_prod_r :
        forall (e : env) (A A' B : term),
        subterm (Ax A' :: e, B) (e, Prod A B).

Lemma wf_subterm : well_founded subterm.