I am studying the logic section of discrete mathematics. While thinking about a proof problem, I wanted to use $$ (p \rightarrow (\lnot q \lor r)) \land q $$ to prove $$ p \rightarrow r$$ I assumed that since $q$ is $T$, then $\lnot q$ is $F$, and $F \lor r \equiv r$, so I naively simplified the original expression to $$p \rightarrow (F \lor r)$$ and then concluded that $p \rightarrow r$.
I realized that I was wrong because no one said that directly substituting truth values into an expression during a proof is valid, and it seemed to be a coincidence.
However, I constructed several other expressions where this substitution method was valid. Is it reasonable to do so, or is it purely coincidental?
Suppose that a compound proposition $P$ contains proposition $\color\red X,$ and proposition $Q$ is $P$ but with all instances of $\color\red X$ replaced by a tautology. You're asking whether the conjunction of $P$ and $\color\red X$ entails $Q.$ In other words: is it legitimate to assume a hypothesis to be true?
The answer is: Yes! In particular:
(1) does entail (2), so your "simplification" is actually a valid deduction.
I put quotation marks around "simplification" because, of course, (1) and (2) aren't equivalent to each other: put $$p\;:\Leftrightarrow\;r\;:\Leftrightarrow\;(1=1)\\q\;:\Leftrightarrow\;(1\ne1).$$ Similarly, for $\color\red{X}\;:\Leftrightarrow\;(1\ne1),$ $$\big(\color\red{\boldsymbol\top}\lor(1\ne1)\big)\kern.6em\not\kern-.6em\implies\big(\color\red{X}\lor(1\ne1)\big)\land \color\red{X}.$$