Breaking Transitivity in Mathematics: If a=b, b=c, Can You Prove c≠a?

Breaking Transitivity in Mathematics

One evening, I was having a sip of coffee when the question suddenly popped into my mind. As a mathematics enthusiast, I want to find the cases where a is equal to b, b is equal to c, but c is not equal to a.

In standard mathematics, it’s impossible to find such cases, as there are no possible conditions. By the fundamental axiom of equality in mathematics, if a=b and b=c, then c=a must be true. As long as “=” is the mathematical equality, all the real numbers, complex numbers, and integers fall under the transitive property of equality.

But several cases break the transitivity in a non-mathematical context. One example is the Floating-point NaN (Not a Number) used for breaking transitivity in mathematics. To violate the ironclad rule, we can use the non-standard scenarios like NaN = NaN, which is false chaining it to a, b, and c all equal to NaN, but a is not equal to c due to self-inequality.

Here are the ways to prove such cases:

Custom Non-Transitive Operators in Programming Language

Let us define a custom function called cases equal() that returns true only when the values differ by exactly 1. We will create a broken equality relation that is a non-transitive operator, which violates the mathematical rules.

Here is the working example of the following program in the C language:

#include <stdio.h>
#include <stdbool.h>

typedef struct {
    int value;
} Cases;

bool cases_equal(const Cases *x, const Cases *y) {
    // Equality is defined as: |x.value - y.value| == 1
    // This deliberately makes equality NON-TRANSITIVE
    int diff = x->value > y->value ? x->value - y->value : y->value - x->value;
    return diff == 1;
}

int main() {
    Cases a = { .value = 10 };
    Cases b = { .value = 11 };
    Cases c = { .value = 12 };

    printf("a == b : %s\n", cases_equal(&a, &b) ? "true" : "false");
    printf("b == c : %s\n", cases_equal(&b, &c) ? "true" : "false");
    printf("c == a : %s\n", cases_equal(&c, &a) ? "true" : "false");

    return 0;
}

The key result for the above C program would be a=b, b=c, but c≠a. In case of c=a, the output is false since the transitivity is broken.

Here’s the output of this program:

a == b : true
b == c : true
c == a : false

While the program itself doesn’t break mathematics, the above example shows that with a programming language, we can intentionally make it violate the mathematical rules.

But are there any usecases for such programs?

No, you should not try this in a real-world coding scenario, as it breaks sorting, hashing, and the Standard Template Library (STL). This might work in the simulation software for particle physics models, but it’s discouraged, and it only proves to be a logical demonstration.

Cryptographic Hash Function Collisions (In Theory)

I’m establishing this scenario specifically with the SHA-256 Cryptographic Hash Algorithm, often used in password hashing with salts.

Let us have the SHA256 algorithm labeled by (salt.a) = (salt.b), (salt.b) = (salt.c), but (salt.a) ≠ (salt.c). We can establish that a, b, and c are different inputs that provide the output for a=b, b=c, but c≠a in theory.

Theoretically, with three way collision, it requires finding three distinct messages a, b, and c such that (salt.a) = (salt.b), (salt.b) = (salt.c), but (salt.a) ≠ (salt.c). In practice, it’s impossible because no one has managed to find a two-way collision in the full SHA-256 algorithm, let alone a three-way collision, which is approximately 2192 operations.

With a normal collision, it’s theoretically possible, but in a practical usecase, even a single collision is out of reach. So, if (salt.a) and (salt.b) produce the same hash, a is equal to b, but for (salt.c) to be not equal to (salt.a), it should break the original logic of SHA-256 algorithms for real-world passwords.

Tolerance Relation in Mathematics and Measurements

In mathematics and engineering, a tolerance relation is defined with a fixed error margin ε > 0. Let’s say two real numbers x and y are “approximately equal” (denoted x ≈ y or x ~ y) if:

|xy|ε|x – y| \leq \varepsilon

This relation is Reflexive as x ~ x always holds (|x – x| = 0 ≤ ε), and Symmetric if x ~ y then y ~ x (absolute value is symmetric).

The tolerance of 1 unit is denoted by ε = 1, and let the real numbers be a = 0, b = 1, and c = 2.

If we check the relation of a ~ b, it is:

|01|=11true|0 – 1| = 1 \leq 1 \quad \Rightarrow \quad \text{true}

The relation of b ~ c is:

|12|=11true|1 – 2| = 1 \leq 1 \quad \Rightarrow \quad \text{true}

And the relation of c ~ a is:

|02|=2>1false|0 – 2| = 2 > 1 \quad \Rightarrow \quad \text{false}

With the tolerance relation, we can clearly establish that a=b, b=c, but c≠a, i.e., violation of transitivity. In a real-world context, parts of measurements in engineering may differ by at most a tolerance (i.e., ±0.01 mm or such). Part “(a fits with b), (b fits with c), but (c might not fit with a)” due to the non-transitive behavior.

Non-Transitive Relation In Social Network Analysis

Let us establish a “mutual friendship” scenario where I will take three of our “The Focus Article authors.” For example: Charlie Rush = a, Marshall Johnson = b, and Michael Wright = c.

Rush is a mutual friend of Johnson and Johnson with Wright. But Wright is not a friend of Rush. If we modeled this relation in social network analysis with an adjacency matrix in mathematics, we can check that a and b = 1, b and c = 1, but c and a = 0.

In standard matrix notation, we can denote it by:

M=(110111011)M=\begin{pmatrix} 1 & 1 & 0 \\ 1 & 1 & 1 \\ 0 & 1 & 1 \end{pmatrix}

In the equality check, if M[a][b] = 1, it means a and b are friends, but M[c][a] = 0 means c and a are not friends. It’s non-transitive, where (a~b) is true M[a][b] = 1, (b~c) is true, M[b][c] = 1, but (c~a) is false, M[c][a] = 0.

Hence, the above matrix represents the graph theory of a=b, b=c, but c≠a under a non-transitive relation.

Updated on Last Updated: January 8, 2026
Posted by
Marshall Johnson

Marshall Johnson is a valued member of TFA who is working as a freelance journalist. If you're looking for fascinating and spiritual articles, Marshall is your guy.