def inverse_interleave(a, b):
    """
    Given a coordinate where `a` has been interleaved and `b` hasn't, return 
    the value that `a` would have at `b=0`.
    """
    if a % 2 == 0:
        return a + b % 2
    else:
        return a - (b+1) % 2