Thank you, bitpicker and Hanna!
But the question about the function of the infinitive is still open.