# Prove that any sequence of five distinct integers must contain a 3-chain

This task is from MIT OpenCourse Mathematics for CS 2010 course, problem set 2, exercise 1(d). I am aware that this question has already been asked several times previously on this platform. Yet, the replies that were given did not help me with my particular question.

Problem statement:

Given: A sequence of five distinct integers $$(a_1, ..., a_5)$$.
Show: Prove by contradiction, that any such sequence contains a 3-chain

(Define a 3-chain to be a (not necessarily contiguous) subsequence of three integers,
which is either monotonically increasing or monotonically decreasing).

For the prove you are allowed to use the following findings from (a)-(b):
$$\nexists3{\text -}chain \wedge (a_1 $$\nexists3{\text -}chain \wedge (a_1 $$(a_1

Proof: Assume $$\nexists3{\text -}chain$$. Then from (a) and (b) we know: $$(a_1, and we have a $$3{\text -}chain$$ $$a_1. Contradiction! (*)

Problem: this contradiction relies on the assumption $$a_1. How can we get rid of this condition?

Update: In case $$a_1>a_2$$, multiply the sequence $$(a_1, ..., a_5)$$ with -1. We get a sequence $$(-a_1, ..., -a_5)$$ with $$-a_1<-a_2$$. From (*) follows that $$(-a_1, ..., -a_5)$$ contains a 3-chain. Then, by the symmetry, $$(a_1, ..., a5)$$ also contains a 3-chain. $$\blacksquare$$

Before update:

One idea I was given is to use symmetry: f.e., if $$(a_1, ..., a_5)$$ with $$a_1 has a $$3{\text-}chain$$, then a sequence $$(-a_1, ..., > -a_5)$$ would have $$a_1>a_2$$ and would also contain a $$3{\text-}chain$$ just with the reversed monotony. Though I see why this true, I am not sure if this argument is right for this problem. What about $$(a_1, > ..., a_5)$$ exactly the same as for the case $$a_1 where we just switch $$a_1, a_2$$ and get $$a_1>a_2$$, i.e., we do not reverse the signs of the elements?

Question 1: How would you write the prove using given information? (Not referring to theorems for general case).
Question 2: If you think the argument with the symmetry is the right way to go, could you please write how you would phrase it and maybe fill some logical steps I am missing in order to make it robust?

Let the numbers be $$A,B,C,D,E$$

Let Solid line indicate $$X , while Dashed line indicate $$X>Y$$ , in this Solution with graphs.
When 2 Points have no line , it means we are not yet sure which condition holds.

CORE IDEA : When we have 2 Consecutive Solid lines , we have $$X which is a 3-Chain ; When we have 2 Consecutive Dashed lines , we have $$X>Y>Z$$ which is a 3-Chain

We then have to check what occurs when we have alternating Solid lines & Dashed lines like this :

Here we assume the 5 Points are the $$5$$ numbers in order & we are considering the Case $$A

In Case , $$A , we get this graph & the 3-Chain is $$ACD$$

Else , we have this graph , where $$A>D$$ is also shown :

Then the 3-Chain is $$ADE$$

We might get unlucky & $$A , which looks like this :

We are almost DONE with the Proof !
Check $$B$$ & $$D$$ , Either $$B or $$B>D$$ , giving these 2 graphs :

We will get 2 Solid lines to get the 3-Chain $$ABD$$ or we will get 2 Dashed lines to get the 3-Chain $$BDE$$

DONE !

When we consider the Case when $$A>B$$ , Proof Outline will Symmetrically match.

• That looks fancy. Thank you for the solution, I will try to understand it. I doubt the MIT professor meant the problem to be solved with graphs as they are taught later in the course.
– Lina
Commented Jun 24 at 16:43

Your symmetry argument is basically correct. The reason is that your assumptions can be reduced to just a totally ordered set with 5 elements. If you prove that your three findings are valid for a total order $$<$$ then they are also valid for $$\gt.$$ Taking the dual order is equivalent to changing signs in this case..

Another argument goes:

Take the first element $$a_1$$. Then among the middle elements $$a_2, a_3, a_4$$ there are 2 that are either both greater or both smaller than $$a_1$$. Similarly there are 2 middle elements that are either both greater or both smaller than $$a_5.$$ So take $$a_i$$ to be in the intersection of both sets. If $$a_1 < a_i < a_5$$ or vice versa then you are done.

Otherwise $$a_1 < a_i \gt a_5$$ or something symmetrical. Then one of the remaining numbers $$a_j$$ is greater than $$a_1$$ and $$a_5$$. (Just take the maximum of the 2 remaining elements.) Then $$a_i$$ and $$a_j$$ form a $$3$$-chain together with one of $$a_1$$ or $$a_5$$.

• Both @Prem's solution and mine further show that the chain contains the first or last element. This is because we are not making heavy use of contradiction by assuming that no such chain exists. Commented Jun 24 at 18:38
• Interesting. Thank you. Also I updated my proof with symmetry.
– Lina
Commented Jun 24 at 18:51
• Yeah, I think it's fine now Commented Jun 24 at 18:54

I'd use the trichotomy property: Given any two real numbers $$x$$ and $$y$$, either $$x=y, xy$$. We are given that the 5 integers are distinct, so no integers are equal to each other.

That means for any pair from the five, $$a,b$$, we have $$a. Now for some third number $$c$$, $$c or $$c>a$$ and $$c or $$c>b$$. If $$c or $$c>b$$, then we have a 3-cycle. Note these scenarios cancel each other out, if $$c>b$$ then $$\lnot (c and vice versa.

Suppose $$c>a$$. We've already established a 3-cycle if $$c>b$$, so let's also assume $$c. Then $$a, so we have a 3 cycle.

All possible scenarios have been addressed and in each case, we have a 3 cycle.

• Thank you for the reply. That is a good idea. I am going through all possible cases. I am afraid the case you pointed out with a<b and c<a does not qualify, as 3-chain is defined as a monotonic subsequence of (a, b, c, d, e). So in that case we need to consider d, I guess. Lots of cases.
– Lina
Commented Jun 24 at 15:15
• a 3 chain is a monotonic 3 member subset of any elements, right? I could be misunderstanding the definition. So if c<a and a<b, then c <a < b by transitivity and we have a 3 chain. Commented Jun 24 at 15:23
• "Define a 3-chain to be a (not necessarily contiguous) subsequence of three integers, which is either monotonically increasing or monotonically decreasing)". F.e., in (1, 3, 0, 5, 8) would be (1, 3, 5) or (3, 5, 8). I do not think we can treat sequences as sets.
– Lina
Commented Jun 24 at 15:26
• @Prem, we are currently discussing it in the comments to the answer.
– Lina
Commented Jun 24 at 16:12
• Prem, I think you are right. At the very least something has to be added to my proof. Commented Jun 24 at 16:18