how does white win the endgame?



Try to see how white will force mate from the position I posted, then how white can force that position. There are a lot of possibilities, but it works.


It took me about an hour to figure all this out, and even then I'd put the queen on a4 ond later realized black would win with Ra7. If this is from an actual game, I'd like to know who played.
can white win?