lambda reduction (using de Bruijn indices, no caching)