{"id":546,"date":"2007-11-14T11:26:40","date_gmt":"2007-11-14T11:26:40","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2007\/11\/14\/basics-proof-by-contradiction\/"},"modified":"2007-11-14T11:26:40","modified_gmt":"2007-11-14T11:26:40","slug":"basics-proof-by-contradiction","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2007\/11\/14\/basics-proof-by-contradiction\/","title":{"rendered":"Basics: Proof by Contradiction"},"content":{"rendered":"<p> I haven&#8217;t written a basics post in a while, because for the most part, that well has run dry, but once<br \/>\nin a while, one still pops up. I got an email recently asking about proofs by contradiction and<br \/>\ncounterexamples, and I thought that would be a great subject for a post. The email was really<br \/>\nsomeone trying to get me to do their homework for them, which I&#8217;m not going to do &#8211; but I can<br \/>\nexplain the ideas, and the relationships and differences between them.<\/p>\n<p> Proof by contradiction, also known as &#8220;reductio ad absurdum&#8221;, is one of the most beautiful proof<br \/>\ntechniques in math. In my experience, among proofs of difficult theorems, proofs by contradiction are the<br \/>\nmost easy to understand. The basic idea of them is very simple. Want to prove that something is true? Look<br \/>\nat what would happen if it were false. If you get a nonsensical, contradictory result from assuming its<br \/>\nfalse, then it must be true.<\/p>\n<p><!--more--><\/p>\n<p> Let&#8217;s be a bit more precise. The principle of proof by contradiction comes from the logical law of the<br \/>\nexcluded middle, which says &#8220;for any statement S, (S or not S) is true&#8221; &#8211; that is, S must be either true or false.  From that, we can infer that if S in true, not S must be false; if not S is true, then S must be false. There is no third option. So if we can prove that (not S) is false, then we know that S must be true. The way that we can prove that (not S) is false is by assuming that it&#8217;s true, and showing that<br \/>\nthat leads to a contradictory result.<\/p>\n<p> The alterative form (which is really the same thing, but can look different when it&#8217;s presented by<br \/>\nmediocre teachers) is proving that something is false. Just switch S and not S in the above discussion. Proving that S is false is just another way of saying that we want to prove that (not S) is<br \/>\ntrue. In a proof by contradiction, we can do that by assuming that S is true, and showing that that<br \/>\nleads to a contradictory result.<\/p>\n<p> As always, things are best with an example. Since I&#8217;m a computer scientist, I&#8217;ll pull out<br \/>\nmy favorite proof by contradiction: the proof of the Halting theorem.<\/p>\n<p> Suppose you have a computer, which we&#8217;ll call &phi;. Every program for &phi; can be<br \/>\ndescribed by as a number. Similarly, every possibly input for a program can be represented<br \/>\nas a number. The result of running a particular program on &phi; can be described as a function<br \/>\n&phi;(p,i) where p is the program, and i is the input.<\/p>\n<p> One thing about programs is that they can contain infinite loops: there are some programs<br \/>\nwhich for some inputs will run forever without producing any results. One thing that we would<br \/>\nreally like to know is for a program p with input i, will &phi;(p,i) ever return a result? If<br \/>\nit does, we say that program p <em>halts<\/em>  with input i. The big question is, can we<br \/>\nwrite a program h such that takes any pair of p and i as inputs, and tells us whether p halts with input i?<\/p>\n<p> The answer is no. The way that we prove that is by a classic proof by contradiction. So we<br \/>\nstart by assuming that it&#8217;s true:<\/p>\n<ol>\n<li> Suppose that we <em>do<\/em> have a program h such that &phi;(h,(p,i))=true if &phi;(p,i)<br \/>\nhalts, and false otherwise.<\/p>\n<li> We can write a program q, where &phi;(q,i) runs &phi;(h,(q,i)) as a subroutine. If<br \/>\n&phi;(h,(q,i)) returns true, then q enters an endless loop. Otherwise, q halts.<\/li>\n<li> For program q, if &phi;(h,(q,i)) says that q halts, then q doesn&#8217;t halt. If &phi;(h,(q,i))<br \/>\nsays that q doesn&#8217;t halt, then q halts. Therefore h isn&#8217;t a program which correctly says<br \/>\nwhether another program will halt. This contradicts the assumption in step one, so that<br \/>\nassumption must be false.<\/li>\n<\/ol>\n<p> For another example, one of the classic logic errors is the misuse of implication. If you have a logical statement<br \/>\nthat for all possible values X, if A is true for X, then B must also true for that X, and you know that A is true for some specific thing Y, then you can infer that B must be true for Y. There&#8217;s a common error where you get that backwards: for all X, if A is true for  X, then B must be true for X, and you know B is true for some specific Y, then inferring A is true for Y. That is <em>not<\/em> valid inference &#8211; it&#8217;s false.<\/p>\n<p> We can prove that that kind of inference is invalid. The way we&#8217;ll do it is by assuming its true,<br \/>\nand then reasoning from it.<\/p>\n<ol>\n<li> Assume that it is true that &#8220;for all values X, if A is true for X, then B must be true for X&#8221;, and<br \/>\n&#8220;B is true for Y&#8221;, then &#8220;A is true for Y&#8221;.<\/li>\n<li> Take the classic example statement of this type: &#8220;If X is a man, then X is mortal&#8221;,<br \/>\nand we&#8217;ll use it as an instantiation of the rule above: If we know that &#8220;If X is a man, then X is mortal, and we know that X is a mortal, then X is a man.&#8221;<\/li>\n<li> The pet dog that I grew up died about 15 years ago. Since he died, he must have been mortal.<\/li>\n<li> By the statement we just derived, we can conclude that my pet dog was a man.<\/li>\n<li> But my pet dog was <em>not<\/em> a man, he was a dog. So we have a contradiction, and<br \/>\nthat means that the statement cannot be true.<\/li>\n<\/ol>\n<p> Presto, one proof by contradiction.<\/p>\n<p> Often, as in the example above, when you do proof by contradiction, what you do is find a specific<br \/>\nexample which leads to a contradiction. If you can do that, that example is called a<br \/>\n<em>counter-example<\/em> for the disproven statement. Not all proofs by contradiction use specific<br \/>\ncounter-examples. A proof by contradiction can be done using a specific counterexample for which the<br \/>\nstatement is false. But it can also be done in a more general way by using general principles to show that<br \/>\nthere is a contradiction. Stylistically, it&#8217;s usually considered more elegant in a proof by<br \/>\ncontradiction to show a way o constructing a specific counterexample. In the two example proofs<br \/>\nI showed above, both proofs used counterexamples. The first proof used a <em>constructed counter-example<\/em>: it didn&#8217;t show a specific counter-example, but it showed how to construct<br \/>\na counterexample. The second proof used a specific counter-example. <em>Most<\/em> proofs<br \/>\nby contradiction rely on a constructed counter-example, but sometimes you can simply show by<br \/>\npure logic that the assumption leads to a contradiction.<\/p>\n<p> An important thing to be careful for in proofs by contradiction is that you are actually obtaining<br \/>\n<em>true contradictions<\/em>. Many creationist &#8220;proofs&#8221; about evolution, age of the universe, radiological<br \/>\ndating, and many other things are structured as proofs by contradiction; but the conclusion is merely<br \/>\nsomething that <em>seems<\/em> unlikely, without actually being a logical contradiction. A very common<br \/>\nexample of this is the big-numbers argument, in which the creationist says &#8220;Suppose that life were the<br \/>\nproduct of natural processes. Then the following unlikely events would have had to occur. The probability<br \/>\nof that combination of events is incredibly small, therefore it couldn&#8217;t have happened.&#8221; That&#8217;s not<br \/>\na proof of any kind. There is no logical contradiction between &#8220;X has a probability of 1 in 10<sup>10<sup>10<\/sup><\/sup> of occuring&#8221;, &#8220;X occured&#8221;. Improbable never equals impossible, no matter<br \/>\nhow small the probability &#8211; and so it can&#8217;t create a logical contradiction, which is required for<br \/>\na proof by contradiction.<\/p>\n<p> As an interesting concluding side-note, there are schools of mathematical thought that do not<br \/>\nfully accept proof by contradiction.  For example, intuitionism doesn&#8217;t accept the law<br \/>\nof the excluded middle, which limits proof by contradiction. Intuitionism also, by its<br \/>\nnature, requires that proofs of existence show how to construct an example. So a proof by<br \/>\ncontradiction that proves that something exists, by showing that assuming its non-existence<br \/>\nleads to a logical contradiction, are not considered valid existence proofs in intuitionistic<br \/>\nlogic. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I haven&#8217;t written a basics post in a while, because for the most part, that well has run dry, but once in a while, one still pops up. I got an email recently asking about proofs by contradiction and counterexamples, and I thought that would be a great subject for a post. The email was [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[74],"tags":[],"class_list":["post-546","post","type-post","status-publish","format-standard","hentry","category-basics"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-8O","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=546"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/546\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=546"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}