Apart from anything else, it would be much more difficult (though not impossible) for an ANSP or regulator to monitor instantaneous climb gradients in order to detect infringements.
Far easier to look at the point where you reach 4,000' and then work out what the average gradient must have been.