I am asked to prove that the following are equivalent:

- $ A \in NP$
- There exists $ B \in L= LOGSPACE$ and $ c \geq 0$ such that $ A = \{ x : \exists y \in \{0,1\}^* \text{ s.t. } |y| \leq |x|^c \text{ and } \langle x,y \rangle \in B \} $

I know how to do it if instead of asking for logarithmic space, it asks for polynomical time. But I have no Idea how to do it in this case. In particular I am interested on the proff of 1) $ \Longrightarrow$ 2) (the other is triviall because $ L \subseteq P$ .