Definition t_lookup (m : total_map) x := 
  let (m, d) := m in
  match lookup m x with
  | Some v => v
  | None => d
  end.

Theorem t_update_permute : forall v1 v2 x1 x2 (m : total_map), x2 <> x1 -> (t_update (t_update m x2 v2) x1 v1) = (t_update (t_update m x1 v1) x2 v2).