The question has arisen from multidimensional arrays comparisons. I will describe those operations using the library NumPy. In case that library is not known by someone, please check this article in the Nature Magazine, which shows the importance of this library for the scientific community: [1]: https://www.nature.com/articles/s41586-020-2649-2
Comparing two multidimensional arrays with the same shape:
x = np.zeros((5,5,5))
y = np.zeros((5,5,5))
result = x == y
The result is an array with three dimensions and all values equals to 'True'
Comparing one multidimensional array with a scalar:
x = np.zeros((5,5,5))
result = x == 0
The result is an array with three dimensions and all values equals to 'True'
Comparing two multidimensional arrays with 'similar' shapes:
x = np.zeros((5,5,5))
y = np.zeros((5,5))
result = x == y
The result is an array with three dimensions and all values equals to 'True'
In this last case, as the array of three dimensions (5,5,5) can be composed of a set of arrays of two dimensions (5,5), the result is the same of the two previous cases. If we try to compare an three dimension array that cannot be 'composed' of two dimension arrays (e.g. (5,5,5) and (4,4)) the result is an error. In that sense, I was wondering if there is any concept that can defines that kind of composition.
x = np.zeros((5,5,5)) result = x == 5The result is an array with three dimensions and all values equals to 'True'" - Are you sure about that? Since your array has $0$ for all entries, I would think asking if they are equal to $5$ should return false. – Paul Sinclair May 21 '21 at 20:46