Polynomial Time and Dependent Types