Per question #1, it's probably in the data, a direct inference, and not a deduction.
Per question #2, I don't know, but I've heard that distance is registered every minute. The game could maybe track distance changes according to gps changes but only register them every minute, or they could perhaps record walking patterns for a minute and then zero them out from the ledger on the minute with your distance gains.