Artificial intelligent assistant

How do I prove the transitivity of a set of implications? If I have a set of implications, how can I prove the transitivity? In other words: I know the transitivity law, but I need to show on paper for an assignment whether the argument is valid or not. $$ \begin{align} P&\to Q\\\ Q&\to R \\\ \therefore P&\to R \end{align} $$ I recall something to do with assuming P and/or Q, since $P\to Q$ will always be true if P is false anyhow, and the same with $Q\to R$... but I don't know how to do it on paper.

$$(1) P\rightarrow Q\tag{Hypothesis}$$ $$(2) Q\rightarrow R\tag{Hypothesis}$$ $$\quad\quad\underline{(3)\; P\quad }\tag{Assumption}$$ $$\quad \quad\quad |(4) Q \tag{1 and 3: Modus Ponens}$$ $$\quad\quad\quad |(5) R \tag{2 and 4: Modus Ponens}$$ $$(6) P \rightarrow R \tag{3 - 5: if P, then R}$$

$$\therefore ((P\rightarrow Q)\land (Q\rightarrow R))\rightarrow (P\to R)$$
(Note: step 6 is sometimes justified by " ** _conditional introduction_** ": together with what you are given or have established, if by assuming P, you can derive R, then you have shown $P \rightarrow R$).

* * *

Note: when I first learned propositional logic, once it was established (proven), we referred to the following "syllogism": $$P\to Q\\\ \underline{Q\to R}\\\ \therefore P\to R\quad$$ by citing it as the " ** _Hypothetical Syllogism_** ", for justification in future proofs.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 72ff985139cdb7c5e37453d52441e79e