Live data from Hacker News

For mathematicians, = does not mean equality

jeremykun.com

91–100 of 206 posts

Re: For mathematicians, = does not mean equality

#91
All these discussions of "=" are missing the point.

The notation "x = x + 1" is awful because at lhs x denotes a reference to an integer while at rhs x denotes the value hold by the reference. If you know C, it is similar to the difference between an integer pointer *x and an integer x. As an illustration, here are two programs that are doing the same thing, one in C and one in Haskell.

  #include 

  int main() {
    int x = 0;
    x = x + 1;
    printf("%d\n", x);
    return 0;
  }


  import Data.IORef

  main :: IO ()
  main = do
    xref 

Re: For mathematicians, = does not mean equality

#92
I noticed this recently when I was trying to define a note-taking syntax for my math classes. I thought it would be smart to use := for definitions and = for equality, but then I was frustrated when = didn't always mean equals in the same way, and some things didn't really fit into either category. I ended up just giving up and switching back to abusing = in all situations. I think math has a really cool human aspect, it's very rigorous but also relies on the fact that your notes/proofs/whatevers are going to be read by a person.

Re: For mathematicians, = does not mean equality

#93

Interestingly, when using mathematics to describe the semantics of programming languages (say, operational structural semantics for an imperative language), the assignment tends to use an arrow, i.e. S[ x ↦ V ] indicates that the new state is equal to old state S, but with variable x now bound to value V.

Most commonly I see a “substitution” notation for that, S[V/x], but unfortunately there are dozens of variations in use, including: [V/x]S, [x ↦ V]S, [x ⇒ V]S, [x → V]S, {V/x}S, {x ↦ V}S, S_(x → V), S[V|x], S[x := V], S[x/V], S[x ← V], S[V\x], S(v/x), S{V/x}, S{x ↦ V}, S{x := V}, S{x → V}, S⦃x ← V⦄, S{x ← V}, …

Re: For mathematicians, = does not mean equality

#94
post #80

Earlier quoted context omitted.

I disagree. If you are saying 'the solution's is -2, you have to be clear what the problem is. This becomes clearer when you have a problem with multiple variables. Then saying 'x=-2, y=3', makes clear the value each variable is taking in the solution.

Solutions to equations in multiple variables are ordered tuples. For instance, x y + 2 = 0 has infinitely many solutions. One of them is (1, -2).

I feel like that example counters your claim in two different ways.

First, (1, 2) only makes sense if you assume that x is first and y is second, or in other words that they correspond to X_1 and X_2 for some vector X. This is probably a reasonable assumption for x and y, but what if you have some other arbitrary choice of variables?

a ρ + 2 = 0

Then the only unambiguous way to write a solution is with explicit labels: a = 1, ρ = -2.

Second, another way to “solve” the equation “x y + 2 = 0” is: “y = -2/x, for any x ∈ ℝ \ {0}”. You could argue that this is also a different kind of “equation” than the one you started with: the reason it can be seen as a solution is not (just) that it’s simpler than the original equation, but that it provides an algorithm to enumerate the set of individual solutions, as well as the set of solutions given some proposed x value. (That is, a set with one or zero members depending on whether x = 0.) However, even if it is a different kind of object, there’s no way to represent it in standard notation that doesn’t conflate ‘questions’ with ‘answers’. If you really want to use tuples, you could go for “{(x, -2/x) | x ∈ ℝ \ {0}}”, which avoids the equals sign – but the ∈ is playing a similar role, an algorithm (enumerate all members of this set) disguised as a test (is this value a member of the set?).

edit: Upon further reflection, I might actually just be expressing violent agreement with the point you were trying to make. shrug

Re: For mathematicians, = does not mean equality

#95
post #31

(I assume this was inspired by https://news.ycombinator.com/item?id=16803874 ) The use of ‘=’ for assignment in programming languages comes, not directly from mathematics, but indirectly from the use of mathematics in science and engineering. As an example, consider the formula for kinetic energy, commonly written 𝑚𝑣² 𝐾 = ─── 2 Why isn't it written 2 K = m v ², which expresses the same mathematical equality in a s…

I believe it comes directly from conventional math exposition. In a general form it’s about emphasis. “The change of subject from “The dog bit the boy” to “the boy was bitten by the dog” is similar to the change of subject in a formula, as for example … In each case, the two sentences state the same relationship, but with different emphasis.” [1] [1] https://medium.com/q-e-d/that-loser-woman-mathematician-who-...

Speaking of subject, I find it helpful to have awareness of changes in agent/patient, and not just object/subject:

https://en.wikipedia.org/wiki/Thematic_relation

https://en.wikipedia.org/wiki/Agent_(grammar)

https://en.wikipedia.org/wiki/Patient_(grammar)

Re: For mathematicians, = does not mean equality

#96

Also the asymptotic notation where f(n) = O(n^2) means a set membership operation.

The notation is also used elsewhere, for instance in math and physics to connote "here's how the next term in this series behaves" when using a series approximation of a function.

Re: For mathematicians, = does not mean equality

#97
post #91

All these discussions of "=" are missing the point. The notation "x = x + 1" is awful because at lhs x denotes a reference to an integer while at rhs x denotes the value hold by the reference. If you know C, it is similar to the difference between an integer pointer *x and an integer x. As an illustration, here are two programs that are doing the same thing, one in C and one in Haskell. #include int main() { int x =…

We don't have such problem in Prolog. In prolog X can never be equal to X+1. X will always be X. Once X has a value, it never changes. One of the thing that gives most procedural programmers a headache.

Re: For mathematicians, = does not mean equality

#99
post #79

Earlier quoted context omitted.

> x is a variable that can assume a myriad of values. No it can’t. x in this case is a bound variable. It’s not that it just so happens to take on -2, but that it is already bounded to -2 to make the statement true. It really says: There exists some x in Z such that x + 3 = 1. What is that x, or what is a proof of the statement? The answer is in the form of a logical implication.

Let’s assume we are talking about Q, the rationals. x+3 is an element of Q[x]. This element of Q[x] defines a natural map from Q to Q. The equation x+3 = -2 is equivalent to finding the pre-image of -2 of this natural map. x is actually just, in the language of computer science, syntactic sugar. In reality x+3 is really the infinite tuple (3, 1, 0, 0, .....)

>x+3 is an element of Q[x].

I think this is incorrect.

Lets continue to assume we are working over Q. Without further context I would take "x+3=-1" to mean that x,3, and -1 are all elements of Q. 3 and -1 being the obvious elements; and x being an a-priori unknown elements which we can easility derive to be 2.

Notably, x+3 is not a polynomial in the technical sense. If we wanted to consider x+3 a polynomial, we would be asking for the t value such that (x+3)[t] = (-1)[t]. Where (-1) is also a polynomial, and (g)[t] is the map Q[x] X Q -> Q given by standard polynomial evaluation.

Sure, this question is equivalent, but I see nothing in the original equation "x+3=-1" to suggest any involvement of formal polynomials.

Re: For mathematicians, = does not mean equality

#100
post #76

Earlier quoted context omitted.

That it was a quote from the article seemed clear in the post in which the quote was presented, so while I agree that it can be difficult to clearly present quotes in some situations on HN and a good blockquote formatting facility would be preferable, I don't think that's really a problem here.

As I read the comments on this post, the top reply contains multiple mathematical symbols which aren't rendering on my recent Android phone. You can't pretend that HN has a huge proactive team working on these issues. I'm loathe to infer that you think that the problem is "me" because I think the underlying question is whether the comments should be a friendly place for people who do not have time or inclination to r…

[deleted]
Post reply on HN