Battery power for project
You need to break down the question into :

How many ampere hours do you need?

To convert 40Watts to 12 volt and ampere = I = P/U = 40W/12V = 3.33A

And to run the lamp for 4 hours you need a battery with 4h x 3.33A = 13.33A/h

So a battery with 12V and a minimum of 13.33A/h is needed.