# What does "def" above an equals sign mean?

https://www.cs.ubc.ca/~murphyk/Papers/bayesGauss.pdf

and on equation (17), there is a def on top of the equal sign. What does this mean?

• en.wikipedia.org/wiki/Triple_bar (See last paragraph under "Mathematics and philosophy.) Oct 9, 2016 at 14:31
• Is equal to by definition. Oct 9, 2016 at 14:32
• Thanks for the answer. Now I am confused. How is (16) equal to (17)? Oct 9, 2016 at 14:35
• Questions about statistical notation, and relevant mathematical notation, are generally on-topic here - we have the tag notation for them. Oct 9, 2016 at 14:58
• Without more context it is a bit hard to say but try multiplying out (16) and simplifying. However I would not have said that amounted to equality by definition. Oct 9, 2016 at 14:59

The "def" can be read as "definition", "is defined" or "is defined to be".

See for example Wikipedia, in the last sentence of this section (just before the subsection labelled "Science"):

https://en.wikipedia.org/wiki/Triple_bar#Mathematics_and_philosophy

which says (the first sentence refers to the triple bar symbol, but the second sentence talks about what you ask about):

This symbol is also sometimes used in place of an equal sign for equations that define the symbol on the left-hand side of the equation, to contrast them with equations in which the terms on both sides of the equation were already defined.[13] An alternative notation for this usage is to typeset the letters "def" above an ordinary equality sign.[14]

I think the actual definition of $\sigma^2_n$ and $\mu_n$ follow equation 17 in 19 and 24.

See $(19)$ just under the part you quote, which defines $\sigma^2_n$ via $\frac{1}{\sigma^2_n}=\frac{1}{\sigma^2_0}+\frac{n}{\sigma^2}$.

But isn't (19) derived by matching coefficients of (16) and (17)?

Essentially, yes -- but Murphy is sort of putting the cart before the horse; he's sort of saying "I know how it is going to look like this, so here's what the variance and mean terms in it must be". Which if you've done these things a lot makes sense. It's actually no harder to derive it directly though, and even though the terms may differ from one problem to another, the structure of the solution is of the same form.]

(17) explicitly states that it's definition, but really that is where the term-matching takes place and the definition of the symbol $\sigma^2_n$ is then made explicit in (18) and (19) and $\mu_n$ in the following equations (down to (24)). I regard (19) and (24) as the definitions of the new symbols introduced in (17).

(17) is saying "when we complete the square, we collect the terms that represent the posterior variance and call that thing $\sigma^2_n$". (18) and (19) then simply explicitly state what those terms are (i.e. defines them) from simple inspection of (16).

Outlining the derivation more directly: at (16), having collected the terms in $\mu^2$, $\mu$ and $\mu^0$, you have in the exponent something of the form $-\frac12(A\mu^2-2B\mu + C)$, at that point you can write it as $-\frac12 A[(\mu-B/A)^2] -\frac12[C-B^2/A]$ which (ignoring the constants at the end for the present) is by inspection a normal distribution with mean $B/A$ and variance $1/A$. That manipulation is called "completing the square" (write it out in smaller steps to see in detail what happens). He's just calling the $B/A$ (i.e. posterior mean) term "$\mu_n$" and the $1/A$ (posterior variance) term "$\sigma^2_n$" in order to have symbols to write down instead of writing the formulas every time -- and then writes out what that means in terms of what $B/A$ and $1/A$ consist of in the original setup.

• I like the notations $a := b$ and $b =: a$, which are asymmetric and define $a$ as being $b$. It appears that := was used in Algol before it passed into mathematics, but I welcome examples or explanation to the contrary. Even mathematics has asymmetry, whereby $a = 2$ and $2 = a$ have different nuances, as has been pointed out if you think that $=$ stands for is, then $a$ is $2$ and $2$ is $a$ have different flavours. (I am recalling Donald E. Knuth quoting De Bruijn.) Dec 3, 2023 at 15:46

The notations $$\overset{\text{def}}{=}$$, $$\equiv$$ and $$:=$$ each refer to definitional equivalence where two things are stipulated to be equivalent by definition. This notation is used in mathematics in place of a standard $$=$$ sign to make the reader aware that they should not look for a logical derivation of the equivalence being asserted (since it is solely a definition).

Unfortunately, in the present case the use of $$\overset{\text{def}}{=}$$ in the asserted equation is extremely poor practice. The definitions at issue actually apply to the objects $$\mu_n$$ and $$\sigma_n$$ which then lead to proportionality (not even equivalence) of the exponential functions at issue. It would be far better if the author of this passage were to separate the definitions of the two updated moments $$\mu_n$$ and $$\sigma_n$$ from the exponential equivalence that follows; here is how this ought to be done:

To facilitate our analysis we define the moments:

$$\mu_n \overset{\text{def}}{=} \frac{\mu_0 \sigma^2 + n \bar{x}_n \sigma_0^2}{\sigma^2 + n \sigma_0^2} \quad \quad \quad \quad \quad \sigma_n^2 \overset{\text{def}}{=} \frac{\sigma_0^2 \sigma^2}{\sigma^2 + n \sigma_0^2}.$$

We then have:

\begin{align} p(\mu|D) &\propto \exp \Bigg[ - \frac{\mu^2}{2} \bigg( \ \frac{1}{\sigma_0^2} + \frac{n}{\sigma^2} \bigg) + \mu \bigg( \ \frac{\mu_0}{\sigma_0^2} + \frac{\sum_i x_i}{\sigma^2} \bigg) - \bigg( \ \frac{\mu_0^2}{2 \sigma_0^2} + \frac{\sum_i x_i^2}{2 \sigma^2} \bigg) \Bigg] \\[6pt] &\propto \exp \Bigg[ - \frac{\mu^2}{2} \cdot \frac{1}{\sigma_n^2} + \mu \cdot \frac{\mu_n}{\sigma_n^2} - \frac{\mu_n^2}{2 \sigma_n^2} \Bigg] \\[6pt] &= \exp \Bigg[ - \frac{1}{2 \sigma_n^2} ( \mu^2 - 2 \mu \mu_n + \mu_n^2 ) \Bigg] \\[6pt] &= \exp \Bigg[ - \frac{1}{2 \sigma_n^2} (\mu - \mu_n)^2 \Bigg]. \\[6pt] \end{align}