Australia spinner Nathan Lyon picked a total of seven wickets in the first Test against Sri Lanka to script history.