Open Caps and Cups in Planar Point Sets

Points p1,p2,...,pk in the plane, ordered in the x-direction, form a k-cap (k-cup}, respectively) if they are in convex position and p2,...,pk-1 lie all above (below, respectively) the segment p1pk. We prove the following generalization of the Erdos-Szekeres theorem. For any k, any sufficiently large set P of points in general position contains k points, p11,p2,...,pk, that form either a k-cap or a k-cup, and there is no point of P vertically above the polygonal line p1p2···pk. We give double-exponential lower and upper bounds on the minimal size of P. We also give several related results.