From your referenced answer:
However, one way of thinking about it is that "P implies Q" is
logically equivalent to "(P and Q) or (not-P)", which is at least
somewhat intuitive--either P is true and therefore Q is true as well,
or P is false so it doesn't matter if Q is true or false.
...the author here is making note that the only case where P is true and the supposition "if P, then Q" is true is when Q is also true in the "if P, then Q" supposition. If P is false then "(P and Q) or (not-P)" will evaluate to "(false and Q) or (true)" and since (false and Q) will evaluate to (false), we are left with ((false) or (true)). The "or" here is an "inclusive or" ("exclusive or"s are usually explicitly denoted as "xor") and so long as one of the constituent propositions, or operands, in an evaluation proposition with an "inclusive or" operator is true, then the expression evaluates to true. Hence, "[when P is false] it does not matter if Q is true or false."
Apologies if this is already familiar to you, but note that "P is false" is not the same as "not P" - "not P" only evaluates to true when "P" is false. If "P" is true, then "not P" evaluates to false. If "P" is false, then "not P" evaluates to true.
To get an intuitive sense of this, it might help to note that when there are two propositions (for ease of discussion I will use the capital letters P, Q to represent non-identical, non-equivalent propositions) and each proposition has only one of two aspects (in this case, either "is true" or "is false" such that P is exclusively true or P is exclusively false) then the maximum count of possible arrangements is equal to the number of propositions to the power of the number of aspects. In other words, there are 2 propositions (P, Q). There are 2 possible aspects ("is true", "is false"). The total number of possible combinations is two propositions to the power two aspects, or 22 and 22 = 4. Note that when there are 3 propositions with only two aspects, there are 23 and two times two times two is eight.
Note: it is not necessary to only calculate for "is true" or "is false" - these are arbitrary considerations. You could arbitrarily do the same for the number of possible values when rolling two six sided dice. 2 dice, 6 aspects to each die, total number of potential outcomes when each roll results in exclusively one of the six aspect values amounts to each roll of two dice having 62 possible combinations, or, 36 "outcomes". Three dice have 63, or 216 possible combinations with every roll.
Back to our set of propositions [P, Q] and our set of aspects ["is true", "is false"]. For this next illustration I will shorten ["is true", "is false"] to [T, F]. We can then compose a compact visual shorthand for comparing the propositions and their aspects - a "table" if you will pardon the expression - like so:
P | Q
---|---
T | T
T | F
F | T
F | F
Note that there are several ways to arrange these elements which display the same relationship, for example:
P | Q
---|---
T | T
F | T
T | F
F | F
or
Q | P
---|---
T | T
T | F
F | T
F | F
or
Q | P
---|---
T | T
F | T
T | F
F | F
or
Q | P
---|---
T | T
F | F
F | T
T | F
...and so on.
It's worth noting that the familiar alphabetical order of the letters p and q have no bearing on the relationship of any propositions represented by and which have been shortened to P and Q. Also note that I am not examining the relationship of the content of propositions to each other, only the rendered values of exclusively either "is true" or "is false". For example, comparing the truth values of "Ceasar had epileptic seizures" and "Henry VIII had gouty arthritis" is not a comparison of the rulers medical conditions, nor conjecture whether or not they did suffer these maladies. Comparing the truth values of the two statements is a comparison of the set of statements equivalent to ["that it is true that Ceasar had epileptic seizures", "that it is true that Henry VIII had gouty arthritis"] and for the purposes of demonstrating logical relationships it is enough that this set of statements logically equivalent to [("is true" exclusively or "is false" exclusively), ("is true" exclusively or "is false" exclusively)].
P | Q |"not P"|"not Q"
---|------|-------|--------
T | T | F | F
T | F | F | T
F | T | T | F
F | F | T | T
Note here that we are not now discussing two propositions [P, Q] and four aspects ["is true", "is false", "is not true", "is not false"] or 24 total combinations due to the logical constant "not" resulting in an identical equivalency of terms, i.e. ("is true" <=> "is not false") and ("is false" <=> "is not true"). We are simply visualizing the counter-propositions, the "opposite" truth values, the propositional "negation" or "inversion".
Lastly, for a visual example, if we were explicitly articulating every combination of the truth or falsity (two aspects) of three propositions(23), note one way we could draw them all to coincide with our convention for the drawing of 22 propositional aspects:
X | B | R
-----|-----|-----
T | T | T
T | T | F
T | F | T
T | F | F
F | T | T
F | T | F
F | F | T
F | F | F
So, how then to compare P, Q, not P, not Q, P --> Q, P and Q, P or Q inclusively, P or Q exclusively and all the possible variations? Well, this is where truth tables come in handy to make a visual representation which gets at expressing an intuitive or explicitly articulated sense of the logical relationship of propositional truth values.
As discussed here, we can visually represent "If P, then Q" (i.e. P --> Q, P implies Q, P then Q, etc.) like so:
P | Q | if P, then Q
---|-----|---------------
T | T | T
T | F | F
F | T | T
F | F | T
Before we can compare [if P, then Q] to ["not P" "inclusive or" (P and Q)], let us evaluate the constituent propositions in ["not P" "inclusive or" (P and Q)], specifically I will show "P and Q" in a truth table:
P | Q | [not]P | P and Q | P [inclusive]or Q |
---|-----|---------|-----------|-------------------|
T | T | F | T | T |
T | F | F | F | T |
F | T | T | F | T |
F | F | T | F | F |
Side note: this is a good time to also display the differences of "inclusive or" and "exclusive or":
P | Q | P and Q | P [inclusive]or Q | P [exclusive]or Q |
---|-----|-----------|-------------------|-------------------|
T | T | T | T | T |
T | F | F | T | F |
F | T | F | T | F |
F | F | F | F | T |
...and I will comment on this later.
We can now evaluate ["not P" "inclusive or" (P and Q)]
P | Q | P and Q | [not]P | [not]P [incl]or (P and Q)
---|-----|---------------|---------|--------------------------
T | T | T | F | T
T | F | F | F | F
F | T | F | T | T
F | F | F | T | T
...and here we have demonstrated the equivalence of "if P, then Q" and "not P inclusive_or (P and Q)"
P | Q | "not P" | (P and Q) | "not P" incl_or (P and Q) | "if P, then Q"
---|-----|----------|-----------|---------------------------|---------------
T | T | F | T | T | T
T | F | F | F | F | F
F | T | T | F | T | T
F | F | T | F | T | T
Lastly, as I suspect the difference between the logical constants "inclusive or" and "exclusive or" may be causing some confusion (and I may be completely incorrect on this account) I will also provide a visual representation of "if P, then Q" and "not P exclusive_or (P and Q)"
P | Q |"not P"| (P and Q) | "not P" Xor (P and Q)
---|-----|-------|-------------|---------------------
T | T | F | T | F
T | F | F | F | F
F | T | T | F | F
F | F | T | F | F
To sum up: "if P, then Q" is logically equivalent to "[not]P [inclusive]or (P and Q)".
Q.E.D.
You might find these videos from Computerphile useful:
https://youtu.be/UvI-AMAtrvE
https://youtu.be/XETZoRYdtkw