Assuming that $P$ is arbitrary, and that $P_1$ and $P_2$ are then constructed so that $\angle AP_1P$ and $\angle AP_3P$ are right, we have that
$$\angle AP_1P + \angle P_1PP_3 + \angle PP_3A + \angle P_3AP_1 = 360^\circ$$ $$\angle P_1PP_3 + \angle P_3AP_1 = 180^\circ$$ $$(\angle BPP_1 + \angle BPP_3) + \angle CAB = 180^\circ.$$