Definition constructor_beq (x1 x2 : constructor) : bool :=
if constructor_eq_dec x1 x2 then true else false.

Lemma value_beq_eq v1 v2 : value_beq v1 v2 = true <-> v1 = v2.
Fixpoint term_beq (t1 t2 : term) : bool :=
match t1, t2 with
| var x, var x' => variable_beq x x'
| capply c lt, capply c' lt' => constructor_beq c c' && list_beq _ term_beq lt lt'
| fapply f lt, fapply f' lt' => function_beq f f' && list_beq _ term_beq lt lt'
| _, _ => false
end.