0

Context: I'm working through Introduction to Algorithms (CLRS), in which one of the questions is:

Show that for any two functions $f(n)$ and $g(n)$ that are asymptotically nonnegative, either $f(n) = O(g(n))$ or $f(n) = \overset{\infty}{\Omega}(g(n))$ or both.

Now, what exactly $O(g(n))$ and $\overset{\infty}{\Omega}(g(n))$ mean doesn't matter; all the matters is that I am to prove a statement of the form $A \vee B$ (where $A$ is the statement $f(n) = O(g(n))$ and $B$ is the statement $f(n) = \overset{\infty}{\Omega}(g(n))$ ).

The problem is that $A$ and $B$ can't be proved by themselves (since whether or not they're true varies from function to function), so to prove $A \vee B$, I need to prove $\neg A \implies B$ (since $A \vee \neg A$ is true), but this shows only that $A$ is true or $B$ is true (or, in other words, $A$ and $B$ partition the set of all possible outcomes); it doesn't show that $A \wedge B$ is also possible.

How would I go about proving this $(A \wedge B)$ in general?
When I say "in general", I'm referring to situations like this, where you can't just prove that $A$ is true and that $B$ is true, and then say, "therefore $A \wedge B$ is true").

  • $\neg A \rightarrow B$ is often the right approach. It doesn't show that $A \land B$ is possible but it doesn't show that it's impossible either. – Dan Brumleve Jul 10 '17 at 21:28
  • @DanBrumleve Exactly. And that's my problem: I'm trying to prove that $A$ is true, or $B$ is true, or both. – Spongebob Jul 10 '17 at 21:29
  • You can prove an $A \lor B$ statement without knowing which by propogating an $\lor$. For example, you can assume (foreach $x$) that $f(x) \le g(x) \lor g(x) \le f(x)$ without knowing which. – DanielV Jul 10 '17 at 21:30
  • The problem says "or both" but it's not really asking for an example. Showing $A \lor B$ should be enough. – Dan Brumleve Jul 10 '17 at 21:31
  • @DanielV Could you elaborate a little? What do you mean by "propagating an $\vee$? Would you mind explaining how I'd do these generally, and not just for my example? – Spongebob Jul 10 '17 at 21:32
  • @WillJagy I'm not sure what you're hinting at... – Spongebob Jul 10 '17 at 21:33
  • @DanBrumleve Surely showing $\neg A \implies B$ is sufficient only in proving that $A$ is true or that $B$ is true, but it doesn't prove that $A$ and $B$ could be simultaneously true. – Spongebob Jul 10 '17 at 21:34
  • Incidentally, I think this particular statement is not valid: for example if $f(n) \equiv 1$, and $g(n) = \begin{cases}n, & n~\mathrm{odd}; \ \frac{1}{n}, & n~\mathrm{even}. \end{cases}$ – Daniel Schepler Jul 10 '17 at 21:37
  • Spongebob, that's correct, but typically a problem worded that way isn't actually asking that. – Dan Brumleve Jul 10 '17 at 21:37
  • Sounds like you're a little confused about the difference between inclusive and exclusive 'or'. Normally, unless stated otherwise, 'or' is assumed to be inclusive. In this instance the author made it explicit that they expect inclusive - so it's just your usual notion of 'or'. – Dan Rust Jul 10 '17 at 21:38
  • "A or B" means exactly the same thing as "A or B or both". If A is true, or if B is true, both statements are true. You couldn't have one of them being true without the other being true. – MPW Jul 10 '17 at 21:38
  • But for your question about "propagating a $\vee$": for example, if you know $A \vee B$, $A \Rightarrow C$, and $B \Rightarrow D$, then you can conclude $C \vee D$. And a good place to start with a $\vee$ to propagate is excluded middle: $A \vee \lnot A$. – Daniel Schepler Jul 10 '17 at 21:39
  • @MPW So if $n$ is a positive integer and $A$ is the statement "$n$ is even" and $B$ is the statement "$n$ is odd", is the statement $A \wedge B$ true? – Spongebob Jul 10 '17 at 21:41
  • You are not being asked to show that $A \wedge B$ is possible. – Robert Israel Jul 10 '17 at 21:41
  • @RobertIsrael But $A \vee B$ means $A$ is true or $B$ is true, or $A \wedge B$ is true, so surely I must... – Spongebob Jul 10 '17 at 21:42
  • No, but the statement "A or B or both" is true. That's what you are being asked to prove. – MPW Jul 10 '17 at 21:43
  • @MPW If that was the case, why is it not sufficient just to prove $A$ is true? – Spongebob Jul 10 '17 at 21:44
  • This is foolish. Do you believe that "T or F or both" is true means that "F" is true? Of course not. – MPW Jul 10 '17 at 21:44
  • No. You are asked to show that $A$ is true or $B$ is true, where this is the "inclusive or". Just to emphasize that point, the question includes the "or both". But it does not care whether the "both" case is actually possible. – Robert Israel Jul 10 '17 at 21:44
  • Because "A" may not be true. It might be B that is true. But if A is false, B is certainly true. – MPW Jul 10 '17 at 21:45
  • @MPW What's with the attitude? I'm trying to learn. – Spongebob Jul 10 '17 at 21:45
  • Here is the truth table for OR. Notice that the top row is true. – Dan Rust Jul 10 '17 at 21:46
  • Okay, apologies. Edited my temper. – MPW Jul 10 '17 at 21:46
  • Ok, I get what you guys are saying algebraically, but this part doesn't make sense: If I've proved $\neg A \implies B$, I haven't shown that $A \wedge B$ is possible (I haven't shown that it's impossible either). Why did the question ask for me to show that $A \wedge B$ is possible if I didn't need to show it? – Spongebob Jul 10 '17 at 21:49
  • @Dan Rust I understand the truth tables, but it just doesn't make intuitive sense: the question asks me to prove that for all $f$ and $g$, either $A$ or $B$ or $A \wedge B$. I know that proving $A \vee B$ implies this, but this doesn't show that $A \wedge B$ is possible, which is what the question is asking. – Spongebob Jul 10 '17 at 21:54
  • 1
    No, the problem is not asking to show that $A \land B$ is possible. "Either $A$ or $B$ or both" is just $A \lor B$. The problem is asking you to not try to show $(A \lor B) \land \lnot(A\land B)$. – Daniel Fischer Jul 10 '17 at 21:59
  • @DanielFischer Ah, ok. I think I get it. Does that mean that if the question had used the exclusive "or", I would have had to show the last statement you wrote? Are you saying, then, that doing what I did and proving $A \vee B$ is sufficient for the question? – Spongebob Jul 10 '17 at 22:02
  • Yes, A xor B is $(A\lor B) \land \lnot(A\land B)$. And yes, proving $A\lor B$, or equivalently $\lnot A \implies B$, is sufficient. But if you're determined to show that "both" can occur, just give an example ($f(n) = g(n) = n$ works fine). – Daniel Fischer Jul 10 '17 at 22:04
  • @Spongebob Assumptions: It is Monday or January. Monday we're tired. January it snows. Conclusion: Today we're tired or it is snowing. There we have proven an $A \lor B$ statement without knowing which of $A$ or $B$ is true. It could be that both are true, or only 1 is true. – DanielV Jul 10 '17 at 22:23

1 Answers1

0

$A\wedge B$ might not be possible; that doesn't matter here. What the problem is asking you to show is that one of those situations ($A$, $B$, or $A\wedge B$) must hold; it's not asking you to show that they each must be possible. In fact, you don't have to show that any one of the various options is possible - just that one of them has to hold. We might later rule out (say) $B$ as impossible; that doesn't affect our having proved "Either $A$ is true or $B$ is true (or both)," and this statement remains true.

Noah Schweber
  • 260,658
  • So if the question were " Suppose $n$ is a positive integer. Prove that $n$ is odd or that $n$ is even, or both", would that question be a legitimate one (given that you can't have a number that's both even and odd), and if indeed I proved that any positive number is odd or even (but not necessarily both), would that be sufficient for the question? – Spongebob Jul 10 '17 at 22:05
  • @Spongebob Yup! Although it's poorly phrased: it should be "prove that $n$ is odd or $n$ is even or both," that is, the second "that" should be dropped. With the second "that," it could be misinterpreted as telling you that your task is to either prove that $n$ is odd, or to prove that $n$ is even; and this obviously isn't what is really wanted. – Noah Schweber Jul 10 '17 at 22:28
  • @Spongebob It might be helpful, by the way, to think in terms of the "no-counterexample" interpretation: when you're asked to prove "either $A$ or $B$ (or both) is true," what you're being asked to show is "it is not the case that both $A$ and $B$ fail," and you may find this clearer to think about, at least at first. – Noah Schweber Jul 10 '17 at 22:31
  • Thanks! Just one more thing: would would "prove that $n$ is odd or that $n$ is even or both" be in algebraic symbols (as opposed to $A \vee B$)? – Spongebob Jul 10 '17 at 22:35
  • @Spongebob The notation "$\Gamma\vdash A$" means "$\Gamma$ proves $A$," and an expression like this is called a sequent. When asked to prove a statement $A$ from some axioms $\Gamma$, you're being asked to derive the sequent "$\Gamma\vdash A$." So the distinction would be between "derive the sequent "$\Gamma\vdash A\vee B$"" and "either derive the sequent "$\Gamma\vdash A$," or derive the sequent "$\Gamma\vdash B$."" (Here $\Gamma$ is the set of axioms you're using - they may well be "in the background" and not explicitly stated.) – Noah Schweber Jul 10 '17 at 22:41
  • This is a rather more formal approach than is usually useful to go into, but you may find sequents in general satisfying in terms of clarifying the formal foundations of how proofs work. – Noah Schweber Jul 10 '17 at 22:43
  • Awesome. Is there a name for this subject in general? "Logic" seems a bit broad. I do have an elementary understanding of boolean operators and basic things like De Morgan's laws and properties of $\vee, \wedge, \implies$, etc., but would like to expand this to gain more understanding of the topic, so I'm looking for lecture notes. Do you have any that you'd recommend (or even a name of this topic)? – Spongebob Jul 10 '17 at 23:09
  • @Spongebob This is definitely covered under the heading of logic, but more specifically sequents (and related notions) belong to proof theory. You should be aware that proof theory quickly gets extremely technical; the basic parts around what sequents are and how to study formal proofs should be separated from the more advanced parts, which in my opinion are of more technical interest, rather than foundational. (Incidentally, sequent calculus is only one approach here: natural deduction is another, and there are many more. Sequent calculus is my favorite though.) – Noah Schweber Jul 10 '17 at 23:15
  • Re: texts, I think Enderton's book on logic does a very good job, as does Chapter 9 (IIRC) of Boolos, Burgess, and Jeffries' book Computability and Logic. – Noah Schweber Jul 10 '17 at 23:16
  • @Spongebob: If you're interested in logic, some free online material I can recommend are listed in this post. Specifically, the first book is a gentle introduction to first-order logic and natural deduction for it. Stephen's notes will give a formal treatment of logic, as does Enderton (but his isn't free). Your misconception in this particular question seems to be that you don't realize "$\neg A \to B$" does not assert anything about the case where $A$ is true, so it is true (not false) in that case, including when $A \land B$ is true. – user21820 Jul 12 '17 at 07:48