Exponential and logarithm¶
exp and log are the profile's only analytic primitives:
every other elementary function is defined from them by a formula.
Definitions used by the axioms¶
Definition E-1 (real and imaginary parts). For finite \(z\), \(\mathrm{re}(z)\) and \(\mathrm{im}(z)\) are the reals \(a\), \(b\) with \(z = a + i b\) (axiom G3 gives existence, the field laws uniqueness), defined by choice; for non-finite \(z\), both are \(I\). Then \(\mathrm{conj}(z) = \mathrm{re}(z) - i\,\mathrm{im}(z)\) and \(\lvert z\rvert^2 = \mathrm{re}(z)^2 + \mathrm{im}(z)^2\).
Definition E-2 (\(\pi\)). \(\pi\) is, by choice, the least positive real \(y\) with \(\exp(i y) = -1\): the \(y\) with \(\mathrm{real}(y)\), \(0 < y\), \(\exp(i y) = -1\), and \(\exp(i u) \ne -1\) for real \(0 < u < y\).
That such a \(y\) exists and is unique is a theorem of the model; in the kernel, the definition is conservative whether or not existence is proved (the kernel's Theorem M-5), and the library proves the facts it needs about \(\pi\) from G7, including \(3 < \pi < 4\).
Values¶
Definition E-3 (values on finite arguments). \(\exp\) is the complex exponential. \(\log(z)\), for finite \(z \ne 0\), is the principal logarithm \(\ln\lvert z\rvert + i\,\mathrm{Arg}(z)\) with \(\mathrm{Arg}(z) \in (-\pi, \pi]\): on the negative reals, \(\log(x) = \ln\lvert x\rvert + i\pi\), the value from above (counterclockwise continuity). \(\log(0) = -\infty = D(-1)\).
Definition E-4 (values at infinity: the ray-limit principle). For a function \(f\) defined on finite arguments, and a direction \(\theta\) with \(\lvert\theta\rvert = 1\):
- \(f(D(\theta))\) is the limit of \(f(r\theta)\) as \(r \to +\infty\), when it exists in \(\hat S\): a finite value; or \(D(\varphi)\) when \(\lvert f(r\theta)\rvert \to \infty\) and \(f(r\theta)/\lvert f(r\theta)\rvert \to \varphi\); or \(C_\infty\) when \(\lvert f(r\theta)\rvert \to \infty\) without a limiting direction. Otherwise \(f(D(\theta)) = I\).
- \(f(C_\infty)\) is the common value of \(f(D(\theta))\) over all \(\theta\) when it is the same finite value or the same \(D(\varphi)\) for every \(\theta\); \(C_\infty\) when every \(f(D(\theta))\) is infinite but they differ; otherwise \(I\).
- \(f(I) = I\).
Every elementary function of the profile takes its values at infinity by this principle, subject to the explicit exceptions in its definition. The behavior checklist collects the resulting special values.
Proposition E-1 (the tables of exp and log). With \(\theta = e^{i\phi}\), \(\phi \in (-\pi, \pi]\):
| \(\theta = 1\) | \(\mathrm{Re}\,\theta > 0\), \(\theta \ne 1\) | \(\theta = \pm i\) | \(\mathrm{Re}\,\theta < 0\) | \(C_\infty\) | |
|---|---|---|---|---|---|
| \(\exp\) | \(D(1)\) | \(C_\infty\) | \(I\) | \(0\) | \(I\) |
| \(\log\) | \(D(1)\) | \(D(1)\) | \(D(1)\) | \(D(1)\) | \(D(1)\) |
Proof. \(\lvert e^{r\theta}\rvert = e^{r\cos\phi}\) and \(\arg e^{r\theta} = r \sin\phi\): for \(\cos\phi > 0\) the modulus grows, with a fixed argument only when \(\sin\phi = 0\); for \(\cos\phi < 0\) it tends to \(0\); for \(\cos\phi = 0\) the modulus is \(1\) and the argument rotates. \(\log(r\theta) = \ln r + i\phi\), whose modulus grows and whose direction tends to \(1\), uniformly in \(\theta\). \(\square\)
These are axiom G7's tables. The reference script
tests/scalar_tests/reference/elementary_reference.py confirms them numerically, with
every other function's.
Identities and their domains¶
Theorem E-2.
- For finite \(z \ne 0\): \(\exp(\log z) = z\).
- For finite \(z\): \(\log(\exp z) = z - 2\pi i\, K(z)\), where \(K(z) = \lceil (\mathrm{im}(z) - \pi)/(2\pi) \rceil\) is the unwinding number [Corless and Jeffrey 1996]; so \(\log(\exp z) = z\) exactly when \(-\pi < \mathrm{im}(z) \le \pi\).
- For finite nonzero \(z, w\): \(\log(z w) = \log z + \log w - 2\pi i\, K(\log z + \log w)\); in particular \(\log(xy) = \log x + \log y\) for positive reals \(x, y\).
- For finite nonzero \(z\): \(\log(1/z) = -\log z\) unless \(z\) is a negative real, where \(\log(1/z) = -\log z + 2\pi i\).
- On the reals: \(\exp\) is real, positive, strictly increasing, and \(\exp(x) \ge 1 + x\); \(\log\) is real on positive reals and strictly increasing there.
Proof. (1) is G7. (2): \(\exp(\log(\exp z)) = \exp z\), so \(\log(\exp z) - z \in 2\pi i\,\mathbb Z\), and the imaginary part of \(\log(\exp z)\) lies in \((-\pi, \pi]\); \(K(z)\) is the integer that brings \(\mathrm{im}(z)\) into that interval. (3): apply (2) to \(u = \log z + \log w\), whose exponential is \(zw\). (4): (3) with \(w = 1/z\), where \(\mathrm{im}(\log z) + \mathrm{im}(\log(1/z))\) is \(0\), or \(2\pi\) on the negative reals. (5): from G7 and the real-valued theory of the exponential. \(\square\)
Statements like (2) and (3) are why the profile needs guards beyond "finite and nonzero": their validity depends on imaginary parts. The guard language of the elementary functions page makes such conditions expressible and checkable.