That Sri Lanka had even got that far was due in large part to lefthand opener Dimuth Karunaratne.
He hit his maiden test century, a resilient, grafting 152 during which he spent eight hours defying a New Zealand bowling attack asking plenty of questions in what might come to be a career-defining innings.
Add in an obdurate effort from Lahiru Thirimanne and a more assertive innings from Mathews, his second half century of the match, and it proved a far more even day's cricket than the previous two had suggested might be the case.
Sri Lanka were relying initially on their champion batsman Kumar Sangakkara. But for the second time in the match he was undone by Boult, swinging a ball away from him.
It was the third time the swing man has dismissed Sangakkara. Boult's Bunny? Let's wait and see at the Basin Reserve in a few days' time.
Sangakkara has scored over 1400 test runs this year, but added only seven to that in this match. It is only the third time in 129 tests that he's been dismissed twice for single figures.
Instead Karunaratne showed why he is regarded as one of Sri Lanka's most promising players.
He's had a penchant for getting starts, then getting out. Twelve times in 26 innings he's been dismissed between 30 and 85. Yesterday he mixed determination with some classy shots, all at an unhurried pace. Yesterday was not a day for fast, target-setting batting.
He rode his luck too. Twice he rightly survived New Zealand referrals for a leg side catch at 83 and an lbw appeal at 103; on other days Ross Taylor would have snared a catch at slip off Craig when Karunaratne was on 135. And all that followed being dropped twice on Saturday.
Still, that's the game and undeterred by his first over duck in the first innings, Karunaratne became the seventh Sri Lankan batsman to score a century when following on; the ninth to make a duck and a century in the same test.
Mathews is a different case. His form is outstanding right now and he's a clever operator. Slow to get settled, then capable of rapid acceleration. At 28 he might have been caught by Kane Williamson at gully off Tim Southee, but it would have been a brilliant effort.
Mark Craig's offspin gave him the odd palpitation too. Craig had the ball turning sharply and bouncing, one ball grazing the inside edge of Mathews' bat and evading leg stump.
Craig will have times when he bowls poorer and gets better reward than yesterday.
Indeed New Zealand's bowlers did well yesterday, frequently beating the defensive stroke. They knew Sri Lanka would hunker down and it would require patience and persistence and that's why Boult's late strikes were so important.
Now, an end has been opened up to attack.
Late in the day, New Zealand posted a ring of eight catchers from first slip to square gully for nightwatchman Thirandu Kaushal as Southee and Boult went for a late kill. The debutant hung on and ended the day with a classy four through the covers. Good for him.
Mathews has already batted 2h 40 min. He's not unfamiliar with these situations. The first hour promises to be fascinating.
The pitch is offering help. He may figure if Sri Lanka can get 200 ahead things may yet be seriously interesting.