Question from Medium difficulty(Greg's video)

Am I missing something?

How do you know that x + y = 6?

Got it. Thanks

I have erroneously assumed hypotenuse as 6. That’s the flaw.(In the first picture)