1
$\begingroup$

If I have a set of objects which support + and <, is that necessarily isomorphic to a subset of the real numbers?

I ask this question because I'm trying to figure out the most general type of a parameter in a Scala program I'm writing. The only thing I assume about the type is that it supports addition and ordering. I.e., given two of them, a and b, I need a+b to be in the type; and given any two of them, a and b, I need to be able to evaluate (a < b) to make an if/then decision. Someone suggested, that this is just the set of what Scala calls Numbers. My first reaction was, no that's too restrictive, but then I can't think of any other example.

$\endgroup$
  • $\begingroup$ No, as there are ordered fields of every infinite cardinality. $\endgroup$ – YuiTo Cheng Apr 23 at 10:04
  • $\begingroup$ I figured out a way to answer the question without answering it. It turns out I don't really need <, what I need is + and if (a < b) then a else b. And I can generalize those two operations to the operations of a semi-ring. E.g., the positive integers with operation + and min. Although that does not answer my original question, it does solve the programming problem which motivated the question. $\endgroup$ – Jim Newton Apr 23 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.