In my logic class last semester, we went over proofs with the rules of induction and replacement. In a couple of the exercises, I noticed something. In each of the exercises in question, all of the letters in the conclusion weren't in any of the premises. So how I went about getting to conclusion is that I eventually got to some letter by itself (like A) and the opposite (~A). I then added the entire conclusion to the A through addition and used the ~A to prove it using a disjunctive syllogism.
My question is that if I am able to have both A and ~A in the same proof, wouldn't that mean that the argument is invalid because there is a contradiction?
Here is an example of one of the problems that I came across and my proof for it (which it said was correct):