  This proof uses the cut rule at the topmost step. The idea is that inferences can be combined. If \(X \vdash A\) and \(Y(A) \vdash B\) (where \(Y(A)\) is a structure of premises possibly including \(A\) one or more times) then \(Y(X) \vdash B\) too (where \(Y(X)\) is that structure of premises with those instances of \(A\) replaced by \(X)\). In this proof, we replace the \(p\) in \(p \rightarrow q, p \vdash q\) by \(r \rightarrow p, r\) on the basis of the validity of \(r \rightarrow p, r \vdash p\). 