4
$\begingroup$

Why are function definitions not written with the $:=$ sign instead of the $=$ sign. It seems to me that $:=$ would be more intuitive and avoid a lot of unnecessary ambiguity.

Consider the following example:

$$f(x,y,z) = x^2 + y^2 + z^2$$ $$f(x,y,z) = 0$$

  • The first line - defines a real valued function who's output is the sum of squares of all of its parameters $x,y,z$

  • The second line - either also defines a real valued function who's output is always $0$, or more commonly, is asking us to find the roots of some function $f(x,y,z)$

Notice the subtle difference between the meaning of the 2 equal signs. So, would it not be more appropriate to instead write the first line (the actual function definition and not root finding) with the $:=$ sign? (since we are defining it, after all)

$$f(x,y,z) := x^2 + y^2 + z^2$$ $$f(x,y,z) = 0$$

Is there a reason why we don't do this? Am I totally mistaken on some subtle detail in the notation?

$\endgroup$
  • 1
    $\begingroup$ Usually, the context makes clear what is meant by "$=$". If you want to work really neat and consequent, then sure, use "$:=$" for definitions. But since people usually write some text around their formulas, things such as "Let $f(x,y,z)=x^2+y^2+z^2$" are clear enough and so we won't actually need $:=$ much. $\endgroup$ – vrugtehagel Mar 23 '16 at 10:39
  • $\begingroup$ Is my interpretation itself flawed though? Is the second line actually commonly used to specify root-finding procedure or am I making a grave mistake. When I made this post I actually have no clue if what Im typing is right or not. @vrugtehagel $\endgroup$ – AlanSTACK Mar 23 '16 at 10:42
  • 1
    $\begingroup$ Both interpretations could be right (the first line could even mean "solve $f(x,y,z)=x^2+y^2+z^2$" if $f$ has been defined already). If you're reading this from a book or article, context should make clear what's meant. If you're writing this yourself, then for example, say something like "Let us define $f(x,y,z)=x^2+y^2+z^2$. We will find solutions $(x,y,z)$ to $f(x,y,z)=0$". You can still use the "$:=$" notation, but it's almost never beneficial to not-use text. $\endgroup$ – vrugtehagel Mar 23 '16 at 10:49
  • $\begingroup$ @vrugtehagel unfortunately, many websites/forum responses often assume the reader knows many things already and does not specify (rigorously anyways) many subtle details. Does higher mathematics just inherently come with poorly-enforced syntactical rules then? $\endgroup$ – AlanSTACK Mar 23 '16 at 11:01
  • 1
    $\begingroup$ I think it's just that $:=$ is sometimes replaced by preceding a formula by "Let..." or "We define..." or something similar. You should be aware that an article, forum response, or any mathematical text is not divided into "text that contributes little to nothing to the content" and "formulas which are the most important thing and reading only formulas will be enough to understand the math". The text and the formula's are one, and the text is part of the mathematical syntax. $\endgroup$ – vrugtehagel Mar 23 '16 at 11:08
3
$\begingroup$

First of all it is totally fine if you want to use $:=$, and there certainly are people who systematically do it.

What you have to cosider is that both your formuals do not make much sense without any context. Example:

$$f(x,y,z) := x^2+y^2+z^2$$

It looks like $f$ is supposed to be a function, but what set is it defined on? This is crucial. If we know that our subject "takes place" in $\mathbb R^n$ it might be unnecessary to specify this, but it might also be just a substet who knows?

$$f(x,y,z)=0$$

This is very unclear now without any contex, is $f$ just the zero function? Are $x,y,z$ defined?

With the corresponding context it is usually quit clear what your equality wants to express, e.g. equality as a definition, equality as two equal values e.t.c.


EDIT: To the comment:

The first thing to notice: You can consider all textbooks and papers as written as a text that you can continuously read through. So here your requested examples:

Defining a function

(Context: Real analysis)

Choose any open set $U \subset \mathbb R^3$ and define $f: U \to \mathbb R$ as $f(x,y,z) = x^2+y^2+z^2$. It is obvious that $f(x,y,z) \geq 0$ $\ldots$

Alternatively if the domain does not really matter or is obvious you could just write: *Let $f(x,y,z) = x^2+y^2+z^2$.

E.g. in this textbook.

Specifying equality

An equality is usually the implication of something that came before so it should be qute clear what we're talking about.

(Assuming we have defined $f,x,y,z$ before) $\ldots$ Then $f(x,y,z)=1$ holds.

Finding roots

As said above, if you just write $f(x,y,z)=0$ nobody will understand what you want to say. As always it should be written as a sentence.

Or if we want to look at the roots: *$\ldots$ Then the roots of $f$ are given by $\ldots$

Or

$f(x,y,z)=0 \iff x^2+y^2+z^2 = 0 \iff (x,y,z)=0$

$\endgroup$
  • $\begingroup$ Thanks for the response. As someone who is just a beginner into the world of higher mathematics and who has not been heavily exposed to notation. Could you provide some examples of how people commonly 1) define functions 2) specify equality between two expressions 3) finding roots. The perhaps not super rigorously enforced syntax of mathematics often comes at a great burden to newcomers like me $\endgroup$ – AlanSTACK Mar 23 '16 at 10:58
  • $\begingroup$ @Alan Avoid making questions that might take a post (instead of a comment) to answer in comments. Please make new posts for such questions. $\endgroup$ – Pedro Tamaroff Mar 23 '16 at 11:11

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.