def x_in_process(coord2d: list, x_coord: int, lx: int, processes_in_x: int) -> bool:
    """
    Checks whether a global x coordinate is in a given process or not.

    Args:
        coord2d: process coordinates given the cartesian topology
        x_coord: global x coordinate
        lx: size of the lattice grid in x direction
        processes_in_x: number of processes in x direction

    Returns:
        boolean whether global x coordinate is in given process or not

    """
    lower = coord2d[0] * (lx // processes_in_x)
    upper = (coord2d[0] + 1) * (lx // processes_in_x) - 1 if not coord2d[0] == processes_in_x - 1 else lx - 1
    return lower <= x_coord <= upper