Two grids share a lattice when their cell boundaries coincide: the resolutions are commensurate (one is an exact integer multiple of the other, in x and in y) and the origins differ by a whole number of the finer cells. When this holds every index operation between the grids is exact integer arithmetic. The test is symmetric.
Details
Note that alignment is not containment: a grid may be aligned to another
and lie entirely outside it. Use intersect_extent() for overlap.