2026-04-19 research 7 min read

0.99999524: The Near-Miss

How close can an EML tree get to i? A gap of 4.76×10⁻⁶ at depth 6, and what that does and does not show.

Correction (2026-09-13): this post said it had found "a proof of why the gap can't close", from the transcendence of π/tan(1) and a structural reason that depth 7 cannot help. Neither holds. Membership in the field of exp–log numbers is no obstruction, since π/tan(1) lies in that field; π/tan(1) is 2.0172, not 2.0270; and a depth-7 tree has imaginary part within 7.9×10⁻¹² of 1. The post also called the depth-1 and depth-2 value sets a curve and an arc; both are finite. The searches were re-run and are printed below. Whether i is an EML value under the complex principal branch, or a limit of EML values (C03), is open.

One of the open problems once posted on monogate.dev is constructing the imaginary unit i from the EML grammar with terminal {1}. We haven't solved it. Exploring how close you can get turned up a near-miss.

The setup

The EML grammar over ℂ starts with 1 and applies eml(x, y) = exp(x) − Log(y) (principal branch complex log). Each depth has finitely many values: 2 through depth 1, 5 through depth 2, 397 through depth 4 (all real), and 77,528 through depth 5.

We want Im(z) = 1, Re(z) = 0. The question is: does anything in the depth-6 closure hit exactly i?

The near-miss

Among the depth-6 values, the closest to i is 8.07×10⁻⁸ + 0.99999523722i, at distance 4.7634634×10⁻⁶. For reference: every depth-5 value has imaginary part 0 or −π, so the jump to Im ≈ 1 at depth 6 is a structural phase transition, not a gradual convergence.

That value is eml(a, b) with b = 2.0172146 − πi, a depth-5 value. Because ea is real, its imaginary part is −arg b = atan2(π, Re b), which equals 1 exactly when Re b = π/tan(1) ≈ 2.0171934 (this post first gave 2.0270). The closest depth-5 b misses that by 2.1×10⁻⁵, and a nearly matching ea cancels the real part.

The obstruction that isn't

This post argued that reaching Im = 1 exactly needs Re(y) = π/tan(1), that π/tan(1) is transcendental, and that the grammar "can only generate numbers in the EL field", which π/tan(1) is not in. None of that is a proof:

The draft paper python/paper/near_miss_obstruction.tex states this obstruction as a theorem conditional on Schanuel's conjecture. For the reasons above it does not establish that the gap cannot close; the errata list it.

Depth 7

This post gave "a structural reason the near-miss gap doesn't improve at depth 7": depth-5 values have Im = −π, so the depth-6 values built from them carry no imaginary contribution from exp. That stops at depth 6. At depth 7 the left argument A can be a depth-6 value with a nontrivial imaginary part, and Im eml(A, B) = eRe A·sin(Im A) − arg B.

A targeted search shows the gap does shrink. Take A = eml(a, q) with a and q of depth 5 and q non-real (so Im q = −π), and B of depth 5. Then Im eml(A, B) = π·eea/|q|² − arg B, and matching that to 1 is a sorted search over the depth-5 values. The best tree found has imaginary part 1.000000000007852, within 7.9×10⁻¹² of 1. Its value is −1.3173 + 1.0000i, so it is 1.32 from i. The search covers one family of depth-7 trees, not all of them, and does not look for depth-7 values close to i itself.

What we have

A depth-6 value 4.76×10⁻⁶ from i, a depth-7 value whose imaginary part is within 7.9×10⁻¹² of 1, and no proof either way. Under strict real semantics i is not an EML value (T17). Under the complex principal branch, whether i is an EML value, or a limit of EML values (C03), is open.

Reproduce

The script rebuilds every value of depth at most 5 over the leaf 1, as the depth-6 post does (skipping pairs with Re a > 10⁵), keeps one tree for each value, and runs both searches. It takes a few seconds.

import itertools, numpy as np, mpmath as mp          # pip install mpmath numpy
mp.mp.dps = 50
REL = mp.mpf(10) ** -30
def eml(a, b):                                        # principal log; None where ln 0 or e^a is out of reach
    if b == 0 or mp.re(a) > 1e5: return None
    ea, lb = mp.e**a, mp.log(b)
    if abs(mp.im(ea)) <= REL * abs(ea): ea = mp.re(ea)
    z = ea - lb
    return mp.mpf(0) if abs(z) <= REL * max(abs(ea), abs(lb)) else z
S = {'1': (mp.mpf(1), '1')}                           # every value of depth <= 5, with one tree for it
for d in range(1, 6):
    for (a, ta), (b, tb) in itertools.product(list(S.values()), repeat=2):
        z = eml(a, b)
        if z is not None: S.setdefault(mp.nstr(z, 30), (z, f'eml({ta},{tb})'))
V = list(S.values())
E = sorted((float(mp.e**mp.re(a) * (-1 if mp.im(a) else 1)), a, t) for a, t in V if mp.re(a) <= 700)
Ef = np.array([e for e, _, _ in E])                   # e^a is real for every a here: Im a is 0 or -pi
# depth 6: |eml(a,b) - i|^2 = (e^a - ln|b|)^2 + (arg b + 1)^2, nearest e^a for each b
best = min(((Ef[k] - float(mp.log(abs(b))))**2 + (float(mp.arg(b)) + 1)**2, k, b, tb)
           for b, tb in V if b != 0
           for j in [int(np.searchsorted(Ef, float(mp.log(abs(b)))))] for k in (j - 1, j) if 0 <= k < len(Ef))
_, k, b, tb = best; w = eml(E[k][1], b)
print("depth 6, closest to i:", mp.nstr(w, 12), " |w - i| =", mp.nstr(abs(w - 1j), 8))
print("   tree:", f"eml({E[k][2]},{tb})")
print("   its b has Re b - pi/tan(1) =", mp.nstr(mp.re(b) - mp.pi / mp.tan(1), 6))
# depth 7: w = eml(eml(a, q), B) with q complex, so Im w = pi*e^(e^a)/|q|^2 - arg B
Q = [(q, t) for q, t in V if mp.im(q)]
lnq2 = np.array([float(2 * mp.log(abs(q))) for q, _ in Q])
bestg = (np.inf,)
for B, tB in {round(float(mp.arg(B)), 15): (B, tB) for B, tB in V if B != 0 and 1 + float(mp.arg(B)) > 0}.values():
    ab = float(mp.arg(B))
    j = np.searchsorted(Ef, np.log((1 + ab) / np.pi) + lnq2)
    for kk in (np.clip(j - 1, 0, len(Ef) - 1), np.clip(j, 0, len(Ef) - 1)):
        ea = np.minimum(Ef[kk], 700.0)
        gap = np.abs(np.pi * np.exp(ea - lnq2) - ab - 1)
        m = int(np.argmin(gap))
        if gap[m] < bestg[0]: bestg = (gap[m], int(kk[m]), m, B, tB)
_, k, m, B, tB = bestg
A = eml(E[k][1], Q[m][0]); w = eml(A, B)
print("depth 7, Im closest to 1:", mp.nstr(mp.im(w), 16), " gap", mp.nstr(abs(mp.im(w) - 1), 4), " w =", mp.nstr(w, 8))
print("   tree:", f"eml(eml({E[k][2]},{Q[m][1]}),{tB})")

Output:

depth 6, closest to i: (8.06915650831e-8 + 0.99999523722j)  |w - i| = 4.7634634e-6
   tree: eml(eml(eml(eml(1,1),eml(eml(eml(1,1),eml(1,1)),eml(eml(1,1),eml(1,1)))),eml(eml(1,eml(1,eml(1,1))),eml(1,eml(eml(1,1),eml(1,1))))),eml(eml(1,eml(eml(1,1),eml(eml(1,1),1))),eml(eml(1,eml(eml(1,1),eml(1,1))),eml(eml(1,eml(1,1)),eml(1,1)))))
   its b has Re b - pi/tan(1) = 2.11317e-5
depth 7, Im closest to 1: 1.000000000007852  gap 7.852e-12  w = (-1.3173319 + 1.0j)
   tree: eml(eml(eml(eml(eml(1,1),eml(eml(eml(1,1),eml(1,1)),eml(eml(1,1),1))),eml(eml(1,eml(eml(1,1),eml(1,1))),eml(eml(1,1),eml(eml(1,1),eml(1,1))))),eml(eml(1,eml(eml(1,eml(1,1)),eml(eml(1,1),1))),eml(eml(1,eml(1,1)),eml(eml(eml(1,1),eml(1,1)),eml(eml(1,1),1))))),eml(eml(1,eml(eml(1,1),eml(eml(1,1),1))),eml(eml(1,eml(eml(1,1),eml(1,1))),eml(eml(1,eml(1,1)),eml(1,1)))))

Code: pip install monogate