Roger Federer put in a vintage performance to give Switzerland a 1-0 lead in the Hopman Cup final against Germany.