[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making 'eq' == 'eql' in bignum branch
From: |
Clément Pit-Claudel |
Subject: |
Re: Making 'eq' == 'eql' in bignum branch |
Date: |
Sat, 1 Sep 2018 00:47:36 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
Hi again Alan,
Thanks for your thoughtful response!
On 2018-08-31 15:59, Alan Mackenzie wrote:
> There have been discussions about the Lisp functions max and min being
> called without arguments. Some people have advocated that non-numbers
> be returned in such cases. I request most earnestly that this is not
> done. Callers of these functions have a right to assume that returned
> results are mathematically correct and that they can do arithmetic with
> them.
>
> Currently, max and min throw errors if called with no arguments. This
> is surely the right thing to do, and we should carry on doing it.
Thinking more about your message, I'm not sure I agree with this point, either.
I don't know about the US or Germany, but at least in France it is common to
define inf and sup as functions from ℝ into ℝ ∪ {–∞, +∞}, the extended real
number line. With these definitions, inf(∅) is customarily set to +∞, and
sup(∅) is set to +∞.
https://en.wikipedia.org/wiki/Empty_set#Extended_real_numbers says:
Since the empty set has no members, when it is considered as a subset of
any ordered set, then every member of that set will be an upper bound and lower
bound for the empty set. For example, when considered as a subset of the real
numbers, with its usual ordering, represented by the real number line, every
real number is both an upper and lower bound for the empty set. When considered
as a subset of the extended reals formed by adding two "numbers" or "points" to
the real numbers, namely negative infinity, denoted −∞, which is defined to be
less than every other extended real number, and positive infinity, denoted +∞,
which is defined to be greater than every other extended real number, then:
sup ∅ = min({−∞, +∞} ∪ R) = −∞
and
inf ∅ = max({−∞, +∞} ∪ R) = +∞
That is, the least upper bound (sup or supremum) of the empty set is
negative infinity, while the greatest lower bound (inf or infimum) is positive
infinity. By analogy with the above, in the domain of the extended reals,
negative infinity is the identity element for the maximum and supremum
operators, while positive infinity is the identity element for minimum and
infimum.
I could be convinced that returning −∞ and +∞ is wrong based on the fact that
inf and sup are not min and max, and that the outputs of min and max should be
elements of the sets they operate on; conversely, I'm also receptive to the
convenience aspect or min and max returning infinities; but all in all I don't
find the "numberness" argument particularly compelling, based on the reasoning
outlined above.
Clément.
- Re: Making 'eq' == 'eql' in bignum branch,
Clément Pit-Claudel <=