Solution (source code)

= Solution

Using the definition twice gives $P(a,b)=1$ when $a\le b$; when $a>b$, $a\to b=b$, then $b\to a=1$, and $1\to a=a$.