# What is it called when !(a < b) and !(b < a) implies a = b?

I thought it would be some kind of symmetric equality but its impossible to do a google search on this, all I get are definitions of reflexive, symmetric and transitive. I'm not really sure which applies here.

To clarify: this is in a programming context, specifically, I am falling back on two less-than comparisons when equality hasn't been explicitly defined for some type. I'm looking for an accurate name for the function that performs the comparison.

edit (more details): < doesn't necessarily imply a real number comparison, (in my case, it would be a floating point anyway, and its almost always a mistake to compare floating point numbers like this).

Actually this problem came up in the context of implementing a generic binary search: I need a comparison operator to perform the search, and then some way to test for equivalence to determine whether my element was actually found.

For things like integers, obviously I can just use equality to know whether or not the element was found. But I also have a case where I search through a set of intervals, and a member-wise equality comparison between two intervals A and B

A.start = B.start and A.end = B.end


would not yield the result I want. So instead, I define comparison for the Interval type:

A < B iff A.start < B.start


and then I define equivalence as:

not (A < B) and not (B < A)


which makes the search do what I want, however my name for the generic version of this comparison function is "reflexively_equal" and I know this isn't right.

Basically my question boils down to this: If you were reading my code, what would I have to name this function in order for you to immediately guess what it does?

• If $a,b$ are in a totally ordered set and $!$ means $\neg$, it's called anti-symmetry. – Git Gud Jul 23 '14 at 18:52
• I seem to remember it being called trichotomy, but I may have spelled it wrong. Anti-symmetry means (IIRC) that if a<b then not b<a. – Ned Jul 23 '14 at 18:56
• @Ned You're right, it is trichotomy in general (which doesn't invalidate my comment since trichotomy 'is the same' as a totally ordered set). I had missed that. You're wrong about anti-symmetry though. – Git Gud Jul 23 '14 at 19:00
• I suppose the assumptions allow for both $a \lt b$ and $b \lt a$ to hold, as far as the Q statement goes. – hardmath Jul 23 '14 at 19:08
• Process of elimination? :) – D_S Jul 23 '14 at 20:19

It means that $\leq$ is a total relation: any two elements can be compared. To see this, look at the contrapositive: $$a \neq b \implies (a < b) \lor (b < a)$$ Equivalently, the statement is: $$(a = b) \lor (a < b) \lor (b < a)$$

As far as I know this is just simplifying the expressions:

\begin{align} \neg (a<b) \text{ and } \neg(b<a) \iff a \geq b \text{ and } b\geq a \iff a = b\end{align}

This is under the assumption that $a,b$ are real numbers, which I assumed since the notation of the OP indicates use in programming languages.

• There are instances in which $\neg (a<b)$ does not imply $b\leq a$. For instance if $\leq$ means $\subseteq$ it's easy to find examples. – Git Gud Jul 23 '14 at 19:01
• Have you ever seen using someone $<$ instead of $\subset$? For me it is pretty clear that $<$ and $\leq$ is only used for real numbers and $\subset$ etc is used for sets, and the use of $<$ instead of $\subset$ is just wrong. But I'd be happy if you could tell me where that is the case! – flawr Jul 23 '14 at 19:10
• Yes, I have, any time a person is talking about a Poset in general, and thus might be talking about a poset of sets under inclusion... @flawr – Thomas Andrews Jul 23 '14 at 19:12
• – Thomas Andrews Jul 23 '14 at 19:16
• This answer still doesn't address the question: What is this property called? In general, we name a property when it comes up again and again, and thus the question is about all contexts where it comes up, and the search is for a name, not a restatement of the property in one particular case. – Thomas Andrews Jul 23 '14 at 19:20

a and b are asymmetrically equivalent.

Note: I think this question was misinterpreted in the other answers. GitGud posted "asymmetric" in the comments but not as an answer. After leaving it up for a week I settled on "asymmetrically_equivalent" as a function name. I'd like to credit GitGud instead of myself but it seems this question has gone stale, so I'm self-answering to remove it from the queue.