2 ms·
I guess you are right. Of course, the Python function named 'min' could very well implement an infimum in this case, and it would be OK. In general, there's s
by eru 7y ago
I guess you are right.
Of course, the Python function named 'min' could very well implement an infimum in this case, and it would be OK.
In general, there's some conventions, like using the words 'minimum' vs 'infimum'. Or stressing the property 'result of min should be an element of the input set' vs 'min on lists should behave like repeated application of min on two arguments starting with the neutral element'.
The right choice depends on context. In lots of programming context, I find stressing the connection with the minimum monoid was useful.
- thaumasiotes 7y ago> Of course, the Python function named 'min' could very well implement an infimum in this case, and it would be OK. Using min(∅) = +inf and max(∅) = -inf would violate the otherwise valid constraint that min(x) ≤ max(x). I'd be a little uncomfortable with it for that reason. > The right choice depends on context. Definitely.
- eru 7y ago> Using min(∅) = +inf and max(∅) = -inf would violate the otherwise valid constraint that min(x) ≤ max(x). I'd be a little uncomfortable with it for that reason. Excellent point! Funny enough, we have the same with 'any' and 'all': For most lists of booleans: all(l) ≤ any(l). Or equivalently all(l) implies any(l). But that property is broken for empty lists. Hmm, I think I might understand the case for `all([]) == False` a bit better now. Though I still disagree with it.