Let $a,b,c\in\mathbb{Z}$. Assume that $a,c\leq 2^p$ and $b\leq 2^q$ - that is, the bit sizes of $a$ and $c$ are bounded by $p+1$ and the bit size of $b$ is bounded by $q+1$. Can I decide whether $$ a^b=c $$ in poly$(p,q)$-time? Can I decide $a^b=c$ in poly$(p,\log q)$-time?
It is clear that I am not allowed to compute $a^b$ as the size of $a^b$ is exponential in $q$. On the other hand, my intuition says it must be correct: If $q$ is small (compared to $p$), then I can compute $a^b$. Otherwise, it is big, and either $a$ has big bit size so $a^b$ cannot be equal to $c$, or it is small so the bit size of $a^b$ does not actually exceed $p$. I think this argument can be made rigorous. On the other hand, I have no idea if I can actually solve the problem in poly$(p,\log q)$-time. I guess it is not actually correct.