Is the undefined value in Isabelle formalized in mathematics? I just encountered the concept of &quot;undefined&quot; values for any type from this blog article that &quot; every Isabelle function is total&quot;. In addition

... This design has an important consequence: It allows the existence
of a polymorphic expression that inhabits any type, namely
undefined :: 'a
The naming of this term alone has caused a great deal of confusion for Isabelle beginners, or in communication with users of different systems, so I implore you to not read too much into the name.In fact, you will have a better time if you think of it as arbitrary or, even better, unknown.
we can observe an important fact: undefined is not an extra value
besides the “usual ones”. It is simply some value of that type ...

So for example, if you define a function (e.g. division of natural numbers) without a specified value at certain input values (e.g. 0):
fun division :: &quot;nat ⇒ nat ⇒ nat&quot;  where
   &quot;division n (Suc m) = n div (Suc m)&quot;

then in Isabelle/HOL, at this input (0), the value of the function does exist, but is undefined/arbitrary/unknown.
⋀a. division a 0 = undefined 

If I understand it right, in ordinary math, division at zero does not have a value. But in Isabelle/HOL logic, the notion is replaced by one that the value is undefined/unknown.
My question is:
Is there any rigorous formalization of the undefined/unknown value in mathematics elsewhere, and are there axioms to govern how &quot;undefined&quot; values behave?
For example, from this Math.SE question, we have  $0 \cdot \infty = 0$ etc. Are there similar formal rules about the &quot;undefined&quot; value in Isabelle/HOL?
In Isabelle/HOL, there is:
lemma &quot;undefined = undefined&quot; by auto

By comparison, I am not so sure that $\infty = \infty$.
Disclaimer: there are several proof assistants for HOL and Isabelle/HOL is the one that I am least familiar with. The different proof assistants all take slightly different lines on the design of their mathematical libraries, but have the same basic mechanisms for defining the objects in those libraries. The principle here is common to all of them.
As discussed in the blog article that you reference, a feature of HOL is that the mechanism for introducing a new constant is not restricted to simple equational definitions, but allows you to give implicit and possibly loose specifications of the constant. So, for example, you could introduce $\pi$ with the defining property:
$$ 0 &lt; \pi \land \forall x\cdot \sin x = 0 \Leftrightarrow \exists m:\Bbb{Z}\cdot x = m \times \pi$$
(There is a small price to pay: a proof obligation is imposed that ensures that the the defining property is consistent.)
The above is an implicit specification, but can be shown not to be loose: i.e., you can prove that there is exactly one real number $\pi$ that satisfies the above property. As a conceivable example of a loose specification, after defining the complex numbers as pairs of reals with the usual definition of the arithmetic operators, you could define $\mathbf{i}$ by:
$$ \mathbf{i}^2 = -1 $$
(The above example is not very likely in practice as it is more convenient to be less abstract and to require $\mathbf{i} = (0, 1)$. The blog article contains other relevant examples, e.g., see its discussion of $\mathtt{fromSome}$.)
$\mathtt{undefined}$ in Isabelle/HOL is an extreme example of loose specification: its defining property is just $\mathbf{true}$. It has a polymorphic type such that it can be instantiated to any type. Its instance in any type has all the properties that are common to all elements of the type. So you have properties like::
$$
(\mathtt{undefined} : \tau) = (\mathtt{undefined} : \tau) \\
\lnot (\mathtt{undefined} : \Bbb{N}) &lt; 0 \\
(\mathtt{undefined} : \Bbb{R}) &lt; 0.0 \lor (\mathtt{undefined} : \Bbb{R}) = 0.0 \lor (\mathtt{undefined} : \Bbb{R}) &gt; 0.0  
$$
where $\tau$ can be any type. $\mathtt{undefined}$ has no other special properties: In particular, $f(x) = \mathtt{undefined}$ does not imply that $x$ is not in the domain of $f$. The definition of $\mathtt{division}$ is just saying that $\mathtt{division} \, a \, 0$ is equal to $\mathtt{undefined}$, some unspecified, but perfectly ordinary natural number. As the blog article suggests, it would perhaps have been more appropriate to call it $\mathtt{unspecified}$, rather than $\mathtt{undefined}$.
There are logics that do explicitly model undefined terms. Tennant's natural logic is one example. See also this article on free logics. HOL is not one of these logics.
As regards the conventions for the use of $\infty$ in ordinary mathematics, good texts will make it quite clear what conventions are being used. I don't think equations like $\infty = \infty$ involving $\infty$ are considered as problematic. E.g., Rudin's Principles of Mathematical Analysis states a convention that $x + \infty = \infty$ when $x$ is finite.
In mathematics founded on the ZFC set theory the value of a function applied at $x$ that is not in the domain of the function is the empty set. In Isabelle/ZF this is lemma apply_0 in the func theory, and in Metamath theorem ndmfv.