Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Motion P1788/M0032.01:MidpointMeaning -- discussion period begins



On 2012-03-09 05:08:53 -0800, Dan Zuras Intervals wrote:
> 	The midpoint function for non-Empty, non-Entire intervals
> 	---------------------------------------------------------
> 
> 	At level 1: mid(X) = (inf(X) + sup(X))/2

IMHO, at Level 1, the midpoint is defined on bounded (non-empty)
intervals only. In particular, one would not want mid(X) = +inf
or -inf exactly (for semi-unbounded intervals) at Level 1, but
something finite at Level 2.

> 	Properties: For intervals X & Y & when using midpoint to
> 	split an X into X1 & X2 we have
> 
> 			X \subset (X1 \union X2)
> 			[inf(X),mid(X)] \subset X1
> 			[mid(X),sup(X)] \subset X2
> 		mid(X) \element-of (X1 \intersect X2)
> 	X \subset Y ==> if (inf(X)==inf(Y)) then mid(X) <= mid(Y)
> 	X \subset Y ==> if (sup(X)==sup(Y)) then mid(X) >= mid(Y)

Instead of the above two properties, how about using the following
one (which is equivalent)?

  if inf(X) <= inf(Y) and sup(X) <= sup(Y) then mid(X) <= mid(Y)

or, said otherwise:

  if X <= Y then mid(X) <= mid(Y)

> 	always.  These are required.  The first 4 properties are
> 	required for containment to hold.  The last 2 for weak
> 	ordering.
> 
> 	Coercion to level 2: For some implicit or explicit IFbar
> 	based on a some floating-point system F we have that

AFAIK, "based on a some floating-point system F" has not been defined
for implicit interval types (see the discussion about associated /
compatible number formats). IMHO, we could just require that each
non-empty interval of T must contain an element of F.

> 		mid_F(X) = if ((inf(X) == -inf) && (sup(X) == +inf)) then 0
> 			   else if (round2Nearest_F(mid(X)) == +inf)
> 				then nextDown_F(+inf)
> 			   else if (round2Nearest_F(mid(X)) == -inf)
> 				then nextUp_F(-inf)
> 			   else round2Nearest_F(mid(X))

So, as a consequence, inf_F(X) <= mid_F(X) <= sup_F(X). This is
important, because this will be assumed below.

> 	Note that midpoint has been generalized to include Entire via
> 	the means of the arbitrary choice of zero as its midpoint.
> 	This choice is part of this motion.  Midpoint is still not
> 	defined for Empty & any generalization to include Empty is
> 	not part of this motion.
> 
> 	The coercion mid_F(X) always returns a finite result even
> 	when mid(X) is infinite.
> 
> 	If, for any X & Y that live at level 2, we define intervals
> 	X1 & X2 to be the smallest representable intervals for which
> 	[inf_F(X),mid_F(X)] \subset X1 & [mid_F(X),sup_F(X)] \subset
> 	X2 we have

Such X1 and X2 do not necessarily exist for implicit interval types.
You should remove "smallest" (I don't think this is necessary: if X1
and/or X2 are enlarged, the properties below will remain true). So,
the only requirements on X1 and X2 should be:
  [inf_F(X),mid_F(X)] \subset X1
  [mid_F(X),sup_F(X)] \subset X2

In particular, these requirements are valid for:
  X1 = hull_T([inf_F(X),mid_F(X)])
  X2 = hull_T([mid_F(X),sup_F(X)])
if a hull_T function is defined.

> 			X \subset (X1 \union X2)
> 			[inf_F(X),mid_F(X)] \subset X1 (trivially)
> 			[mid_F(X),sup_F(X)] \subset X2 (trivially)
> 		mid_F(X) \element-of (X1 \intersect X2)
> 	X \subset Y ==> if (inf_F(X)==inf_F(Y)) then mid_F(X) <= mid_F(Y)
> 	X \subset Y ==> if (sup_F(X)==sup_F(Y)) then mid_F(X) >= mid_F(Y)
> 
> 	The first 4 assure containment.  The last 2, weak ordering.

For the last 2, same remark as above.

> <end motion for midpoint>
> 
> <begin rationale>
[...]
> 	Therefore I arbitrarily choose zero as midpoint(Entire).

I think you should give a reason (it is not completely arbitrary):
at Level 2, it is a point of symmetry, i.e. if x is in F, then
mid_F(Entire) - x = - x is also in F.

> 	The value of midpoint(Empty) is not part of this motion.
> 
> 	There is an argument that if midpoint cannot return an
> 	interior point of X then it should return NaN.  As
> 	singleton intervals HAVE no interior even at level 1,
> 	this would mean that midpoint([r,r]) = NaN for all Real r.

The interior property is useful only for splitting, but mathematically
midpoint([r,r]) = r.

> 	Further, that finite intervals for which inf(X) > Fmax_F
> 	for some number system F should return midpoint_F(X) = NaN
> 	on the grounds that neither Fmax_F nor +inf are in the
> 	interior of X.

By "finite intervals", I think you mean "bounded intervals".

And what about the fact that the midpoint of a semi-unbounded interval
is not defined (at Level 1)?

> 	Further, that intervals for which X lies entirely between
> 	two consecutive representable numbers of F should return
> 	midpoint_F(X) = NaN on the grounds that neither number is
> 	in the interior of X.
> 
> 	I reject all 3 of these arguments.
> 
> 	In the first case, I find it unreasonable to define
> 	anything other than midpoint([r,r]) = r on the grounds
> 	that the midpoint is perfectly well defined in the case
> 	of singletons & one should expect this to be so.

Agreed.

> 	I reject the other two on the grounds that the property
> 	of "interiorness" is a derived one which fails in these
> 	two cases not due to any failure in the definition of
> 	midpoint but due to limited range & limited precision,
> 	respectively, of the number system within which one is
> 	forced to express the answer.
[...]

OK, but what about the fact that the midpoint is not defined on
semi-unbounded intervals? (For Entire, you could say that the
set of the points of symmetry is Entire, so that you can choose
an arbitrary value, but for semi-unbounded intervals, you do not
have points of symmetry.)

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)