\begin{logicproof}{2}
    p \implies q & \prem \\
    \begin{subproof}
        r \implies p & \assum \\
        \begin{subproof}
            r & \assum \\
            p & $\impe 2,3$ \\
            q & $\impe 1,4$
        \end{subproof}
        r \implies q & $\impi 3-5$
    \end{subproof}
    (r \implies p) \implies (r \implies q) & $\impi 2-6$
\end{logicproof}
