HOUSTON — This was the goal. This was the imperative. The mathematics of the American League Championship Series were simple, really: the Yankees needed to win at least one game here, at Minute Maid Park, a place where the Astros are so comfortable, so relaxed, they practically play their positions reclining in chaise lounges.

The Yankees, you may recall, never did get that one win in Houston two years ago, when the Astros leaned in at the tape, beat them four games to three, each team holding serve at home, the Astros having that extra game at home.

But, then, the Yankees were a different team two years ago.

Specifically, the Yankees didn’t have Gleyber Torres two years ago.

“He likes playing in these situations and he has confidence in his ability to produce,” Yankees manager Aaron Boone said of Torres, who was 3-for-5 with a double, a homer and five RBIs, one shy of the Yankees’ postseason record. “That leads to a dangerous player.”

Said Torres: “I try to have a really good plan at home plate, I try to feel comfortable because I’ve got so many good guys behind me. So I can just go to home plate believing in what I can do and expecting to help my team.”

Helping them is one thing; carrying them something else. Torres was recovering from Tommy John surgery during the ’17 ALCS, and he was mostly a mystery to Yankees fans, who could have no way of knowing what they were getting. They know now.

The Astros know now, too. The Yankees got the win they needed in Houston, splattering the ’Stros 7-0 in Game 1 of this best-of-seven ALCS. Masahiro Tanaka was just about perfect for six innings, facing the minimum 18 batters, allowing one hit and one walk, both of which were erased with double plays. Giancarlo Stanton hit a towering home run, certainly an encouraging sign. It was a feel-good day all the way around for the Yankees.

Most of all, it was another Gleyber Day for the Yankees. The second batter of the game, he made a defensive gem (add it to his October collection), fielding the ball, tumbling to his knees, still managing to throw out Michael Brantley by a step from the seat of his pants.

That, it turns out, was merely prologue.

With one out in the fourth, at a time when it felt like this was destined to be a pitchers’ duel of the highest order between Tanaka and Houston’s Zack Greinke, Torres drilled one into the left-field gap for a double, breaking the ice. Two innings later, he found the ever-inviting Crawford Boxes in left field for a home run.

It was 2-0. It felt like 20-0. Minute Maid Park, begging for a reason to pounce all night, was muffled and muted. The Astros, who believe they are bulletproof here, suddenly looked lifeless, cut down like Sonny Corleone at the Causeway toll booth.

And Torres wasn’t done. The next inning, facing Ryan Pressly, he was fooled on a pitch and, as these things sometimes happen, found the outfield grass anyway. Two more runs. It was 5-0, on the way to 7-0, on the way to a 1-0 head start in this series.

“He’s smart, confident, and he has a lot of talent,” Boone said. “And that’s a really good combination.”

“Nothing surprises me,” Yankees center fielder Brett Gardner said. “His ability is off the charts.”

Said Astros manager A.J. Hinch: “He didn’t miss any pitches. It looked like he was locked in on pitches, looked at the right location, the right spot. He didn’t miss.”

So the Yankees did as they needed to, and will have house money spilling out of their pockets Sunday night, Game 2, with Justin Verlander awaiting them alongside a suddenly desperate army of Astros. No matter what, they will fly East afterward with home field on their side.

Defend The Bronx, and they will be World Series bound. Nothing about that will be easy, of course. They will still see Gerrit Cole and Verlander four times if they let the series get that far. Cole will be lurking in a Game 7, meaning the Yankees’ task now becomes the same one facing another New York team entangled with Houston many years ago, the ’86 Mets, who knew they didn’t want to face Mike Scott — the ’86 version of ’19 Cole — in Game 7.

But there is time to worry about that.

For now, the Yankees have done what they needed to do, they stole one in these most unfriendly environs, they proved to the Astros — and, not least, themselves — they can win here if they need to. They never did do that two years ago.

But, then, two years ago, Gleyber Torres was in Tampa, rehabbing his bum elbow, rather than carrying this team on two healthy shoulders, as he is now. Now is better.