In propositional logic, logical consequence is just defined in terms of applying rules of inference to the premises, regardless of whether the premises are true or even whether they could possibly be true. In this case, to show that any arbitrary proposition Q follows from a contradiction like "P AND ~P", you only need three basic rules of inference (a minimal set of 8 rules for propositional logic is listed on page 296 here, with other useful rules deducible from those 8 given on pages 298, 300, 302, and 304):
--The "simplification" or "conjunction elimination" rule: if you have a proposition of the form "P AND Q", you are allowed to then infer P, or then infer Q.
--The "addition" or "disjunction introduction" rule: if you have some proposition P, you can infer the proposition "P OR Q" for any other proposition Q.
--The "disjunctive syllogism" rule: if you have a proposition of the form "P OR Q", and you also have the proposition ~P (i.e. 'P is false'), then you can infer the proposition Q.
So, say you start with the premise "P AND ~P" (line 1). Using the simplification rule, you can then infer ~P (line 2). Using the simplification rule again, you can also infer P (line 3). Then using the "addition" rule with proposition P that you had on line 3, you can infer the proposition "P OR Q" (line 4), where Q is any arbitrary proposition. Now you have both "P OR Q" (line 4) and ~P (line 2), so using the "disjunctive syllogism" rule, you can then infer Q (line 5). Since Q was a completely arbitrary proposition, this shows that you can infer any arbitrary proposition starting from a contradiction of the form "P AND ~P" as a premise.
line 1: P AND ~P (premise)
line 2: ~P (simplification applied to line 1)
line 3: P (simplification applied to line 1)
line 4: P OR Q (addition applied to line 3)
line 5: Q (disjunctive syllogism applied to line 2 and line 4)
Alternately, you could just take P (line 2) and ~P (line 3) as independent premises, and in this way show that any conclusion follows from a set of inconsistent premises without needing to use the simplification rule.