This article is from the Magic: The Gathering Rules FAQ, by Patrik Linell (pls@claymore.nu) with numerous contributions by others.
Trample doesn't care about what's going to happen to the damage
after it's assigned; it will assign enough damage to be lethal anyway. A
green 7/7 trampler, blocked by a 2/2 with protection from green, will still
have to assign 2 damage to the blocker; the rest can be assigned to the
defending player. This won't kill the blocker due to the protection, but
that doesn't matter.
 
Continue to: