<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate_header(fields, # type: Sequence[FieldSpec] column_names # type: Sequence[str] ):
 """ Validate the `column_names` according to the specification in `fields`. :param fields: The `FieldSpec` objects forming the specification. :param column_names: A sequence of column identifier. :raises FormatError: When the number of columns or the column identifiers don't match the specification. """

    if len(fields) != len(column_names):
        msg = 'Header has {} columns when {} are expected.'.format(
            len(column_names), len(fields))
        raise FormatError(msg)

    for f, column in zip(fields, column_names):
        if f.identifier != column:
            msg = "Column has identifier '{}' when '{}' is expected.".format(
                column, f.identifier)
            raise FormatError(msg)