Measurement of the cosmic ray proton spectrum from 40 GeV to 100 TeV with the DAMPE satellite