4 ms·
> This is not clear at all ! He is using 'type check' to point out the flaw. x = y means x and y are the same thing. If x is a function and y is an integer, th
by esrauch 14y ago
> This is not clear at all !
He is using 'type check' to point out the flaw. x = y means x and y are the same thing. If x is a function and y is an integer, then it can't possibly hold that x = y.
Consider x = O(n). The implication would be that whatever type of thing O(n) is, x also is. This is trivially untrue.
If x = y, and x is a function, then x(K) = y(K). It would be ridiculous to say that x(K) = O(n)(k).
> Yes well, f(x) = f(y) does not implies x = y. I think people know this ..
I don't understand why you are mentioning that. The issue is that x = f(z) and y = f(z), then x = y. You can't get two different values by applying the same function to the same value.
Saying that f is O(n), the "is" is not an equality statement at all, "is" is some other function exactly as you mention that people understand. It is clearly some function that is non-transitive.
In this case the relationship is most easily expressed using existing operators by having O(n) be a set of functions and the "is" in that sentence be the "exists-in" set operator, which is a case where the transitive property doesn't hold. Using the = symbol in that context is just bizarre when = is a otherwise always used to mean equality, which is function with special properties that don't apply here.