# Class 20: 3D Linkage Folding

Flash and JavaScript are required for this feature.

Description: This class introduces recent research on flattening fixed-angle chains and addresses flipping of pockets in a polygon. Flaws and omissions in proofs on a bounding number of flips are presented along with a correct version of Bing and Kazarinoff's proof.

Speaker: Erik Demaine

PROFESSOR: This class is talking about two lectures, both about protein folding, fixed angled chains, things like that. There's a few questions about them. One is mostly about these open problems, equilateral, equiangular, obtuse 3D chains, fixed angle open problem is, are they locked? So the question is about, what about any subset of those combinations?

So this originally comes from an open problem I think posed in 1999, one of the first 3D linkage papers, and it asked whether equilateral universal joints can lock, and that's still open. For universal joints, these two constraints don't make a lot of sense because who cares if it's initially equiangular. As soon as you move it, it will no longer be equiangular. And obtuseness I don't think matters too much, although it potentially could. So for that problem, equilateral seems to be the core.

For fixed angle, though, we conjecture that fixed angle equilateral is not enough from this example. It's still not proved to be locked. I don't know if it's hard, but it's probably tedious, so it hasn't been done. This was the crossed legs example. All the edge lengths are the same, and if you don't allow the touching part, then all the angles are also the same. So this is everything except the obtuse property and it's probably locked, so dropping obtuse is no good.

The other things you could drop are equilateral or equiangular. This is if you drop equiangular. Fixed angle equilateral is not terribly constraining because you can simulate a long bar by having a lot of 180 degree angles. This is obtuse and it's equilateral but it's not equiangular and it's locked for a trivial reason. So this is dropping equiangular.

If I drop equilateral, I can also just make a knitting needles example. I take a really long link, and this thing is basically string, so I don't really care. This connection can be done with a lot of obtuse angles, and then have a really long link. So dropping any of the three constraints makes it easy to lock, so for fixed angle chains, you need equilateral, equiangular, and obtuse. All these things together potentially mean you're not locked, but we don't know. That's the open problem. Of course, we don't necessarily need exactly equilateral or equiangular. Hopefully, within some small min to max ratio would be enough, but we don't know.

Next question is, why did we model the ribosome as a cone? That seems rather simple. Is this realistic? And partly, when I taught the class in 2010, I didn't use any images I couldn't get permission for. This year I'm more lax. We'll ask for forgiveness instead of permission.

This is a paper from Science 2000. This is what the ribosome actually looks like. There's many different figures of it, but I particularly like this one because it highlights a tunnel in the center of the ribosome. And so the idea is this is a machine for converting MRNA into your proteins, and the idea is the protein comes through here. There's a little bump in the tunnel. Some people conjecture this is where the amino acid gets attached, and then it feeds through here and starts spitting out.

And as I said, there's barely enough room here for an alpha helix, so probably not too much folding happens inside and the folding should just happen over here. And the observation is if you have a reasonable size protein that's only going to be about this big, then there's this big, flat wall at the exit, so you have a plane there and this half space is more or less a big obstacle. It's the alpha cone model where alpha is 180, I think, if alpha is the half angle.

So it's not really a cone. It's a cone that's been opened up all the way to a plane, but that's one of the situations that's handled by the theorems that we talked about. So that's why the cone model. We generalize to cones just because it works for general cones, but the real one is a sort of flat cone. That's where that comes from. I think actually we proved the theorem before we knew this, but then we looked it up and it was true.

And the last question is about the lecture 21, which some of you may not have watched because it's optional, but there's this model called the HP model for protein folding. It's a model of protein energy and it says you have a chain of H and P nodes, and basically, the H nodes are attracted to each other and the P nodes don't care. And the model is that the H nodes are hydrophobic so they want to be next to each other so they're not next to water, which is surrounding the whole molecule, and the P nodes don't care, or they're hydrophilic.

And it's known that if you have an HP string and you want to find the optimal folding into a 2D or a 3D structure, that's NP-hard, which is kind of weird because somehow nature does it, maybe because it found the easy instances by evolution, or maybe there's something we're missing. This model doesn't capture reality. We don't know. But it captures part of reality, as least as we observe it. Unfortunately, these hardness proofs are a little too complicated to cover here, but I can at least answer what are they reducing from.

There's two proofs. I guess they were basically the same time, I think around 2001. The first one here is in 3D, and these are by two MIT professors. There's this big construction but the reduction is from bin packing. So you have a bunch of fixed size bins and you have a bunch of items of varying sizes and you just want to fit them all in using the fewest bins possible. And the rough idea of the construction of this one, this is how an individual number is represented.

The rough idea is you have this big cube. You fill the sides with stuff to protect from the outside boundary. The insides are just used for connections, and then the front face here is this stuff. You construct these bins, and you construct numbers which have to fit inside the bins. That's the rough idea. The details are complicated.

The 2D proof by several people is from Hamiltonicity in maximum degree-4 graphs. So you have a graph for every vertex that has at most four incident edges. You want to find a Hamiltonian cycle, I think. It's much harder to see this picture, I would say. There's no one diagram that summarizes it. This is roughly the construction, which is quite complicated, and I'll just leave it at that.

That's what they're reduced from. I think an interesting open problem would be to find a simple or cleaner proof of these results. Now that it's known that they're hard, it's probably easy or hardness proofs. There's also some open questions from lecture, like is it APX hard? Is it approximable to a 1 plus epsilon factor or 1 minus epsilon factor for any epsilon or is there some limit to approximability? We saw a nice approximation 4/3 whatever, 3/4 whatever, but can you do better? Still open.

So that was the questions, and then this is a question that you usually ask in every lecture. You didn't actually ask it on this one, but I copied and pasted. So there's some interesting progress from this class two years ago, and I think in the open problem session initially, probably also a class project related to this part.

So this is back in lecture 20. We had this proof, which is kind of fun, that flattening a fixed angle chain, deciding whether there was a flat folded state, is weakly NP hard, weakly meaning it depended a lot on what these numbers look like and it was a reduction from partitions. You had to split up the numbers into two equal parts, and if you did, then this key would fit in the slot and you're OK. If you didn't, the key would collide with something here.

So this means the problem is hard if your edge lengths are vastly different. They would have to differ by a ratio of exponential in the number of edges for this to really be hard. So a natural question is, well, what if all the lengths are equal, equilateral chains? Turns out that is still hard, and this is a paper just published last year with Sarah Eisenstadt, who took the class then.

And there's a bunch of results here. All of these are NP hardness results, strong NP hardness, so it doesn't depend on the numbers. We've got flattening results. There's also min flat span and max flat span. Once you have that flattening is hard, these are pretty easy to show hard, so I won't talk about them so much.

But basically, we consider different ranges of angles and what you might allow. In some cases, we can get perfect equilateral chains. In some cases, they have to range between, say, 1 and 2 in length. A natural question is obtuse angles. We don't quite know that. The best we have is 60 degrees minus epsilon and larger. This is nice for orthogonal chains, but it's not for chains, it's for trees. So still some open questions here, but lots of hardness results.

I thought I'd show you roughly what the hardness proofs look like because they're kind of fun. They all follow this kind of structure. This is a gadget, and it's a fixed angle chain. Here I'm going to show everything with 90 degrees because it's easier to think about. And it's kind of like-- I'm thinking plunger, but it's something like that. You can decide which parts get pushed in and which parts get popped out, and this L shape can basically shift left and right to three different places if I did it right-- this one, this one, and this one.

So that's a useful construction, as you might imagine, and the idea is you take that and you add on these guys. So I've got another kind of plungey thing like this, and this guy can move left and right to various extents. That's not very intuitive. So then this connects to these little guys, and these can just flip up or down if it's a flat embedding of a fixed angle chain.

And so the idea is you have three of these pokey elements and they can attach. They bump into these different things. And if it's up, then this can be up, but when they're down-- like this guy is currently down, but it could be pushed up-- then this guy must be flipped down like that. That's the rough idea of how these parts fit together.

And so then this is how you end up building some kind of three sat problem. So you have some variables. They can either be true or false. And the idea is that the true guys are on the top, the bottom guys are on the bottom, and there's some complicated interaction between them to make sure that they can't both be true and false. Basically, you want these things to point in whenever possible because then these guys can go down. Otherwise, you would collide.

And if this guy's in, the corresponding guys in the bottom must be down, and that's enforced by this long thing, which is either completely down or completely up. So when it's completely down, these guys all have to be down, which is going to be a problem down below if things aren't satisfied. When it's up, all of these guys would have to be up. Some of them could be up if you feel like it, but really, you'd probably put them all down whenever you can because then you can take these guys and stick them down.

So this is how you set variables, and then the other things I showed were clauses, essentially. At least one of those pins had to be pushed down and you don't know which one, and that's the hard part. Rough sketch of how this proof looks.

One thing is here, for this to work, these edges can't be spinnable. When I go here, I must immediately go back down. I can't flip it. So these are rigid edges. That's not really the original problem, but you can simulate rigid edges, and this is where the angles get small. You can simulate rigid edges with a very sharp zigzag because if you ever flipped one of these, it would collide with the previous edge.

So for sufficiently sharp angles, you can force parts to stay straight in this funny way, which is not great, but it's one way to force it. We can also do it with trees or various other techniques, but that's how the proof looks. So that is flattening fixed angle chains, strongly NP hard.

We go next to one more topic for fun. This is the topic of flips. I guess I have an image for this. This is a problem posed by Paul Erdos, I think when he was a student. He was a very famous mathematician. 1935, he asked this question. This is the whole question as originally written.

You have a polygon and you take the convex hull of the polygon, and you take these regions which are in the convex hull but outside the polygon. We call those pockets. And you imagine flipping those outside, reflecting through that supporting line, that tangent on the outside, so then you get this polygon. Here you get two pockets. Maybe you flip both of them, and then you get a convex polygon. Now you have no pockets, and so you're done.

And the question is as posed. Prove that after a finite number of such steps, the polygon would become convex. So you might call this a conjecture by Erdos that it is finite. He'd never published a proof.

There's one issue with the problem as stated. You can't actually flip both pockets at once if you want to avoid collisions. The relation to linkages is we imagine these flips could actually happen by a rotation, but you could also just imagine them as reflecting instantaneously.

There's this issue. If you flip two pockets at once, you might have collisions afterwards. The way this problem has been interpreted by most people is don't flip them all at once. Just flip them one at a time, and then you guarantee, because this is a supporting line, a tangent line, of the convex hull, when you flip one pocket out, it will go to the other side so it can't intersect the rest of the polygon. So you would avoid collision if you do one flip at a time.

Now, this was observed, I guess, a few years later by Bela de Sz. Nagy, and he also published the first proof. Before we get there, a weird property and why you might worry about this being finite or infinite is if you take this quadrilateral and make this very narrow, this edge very small relative to the horizontal edge, then you can require arbitrarily many flips to convexify. Even for n equals 4, you could require a million flips. So definitely there's some dependence on the ratio between the longest length and the smallest length, though in open problem, what we still don't know is whether you can bound the number of flips in terms of n and that ratio. Is it pseudo-polynomial? Who knows?

So it turns out it's always finite, and there have been many proofs over the years of this result. It's kind of been rediscovered many times. Nagy solved it originally in 1939, and he cited Erdos. These two guys didn't cite anyone, so they may have come up with the problem independently. This paper, these are two Russian proofs. Then this paper cited-- they knew about everything. They cited all of them. They cited Reshetnyak. I don't think they necessarily knew about Yusupov.

Independently, Kaluza posed the problem in 1981 and Wegner solved it, and then to finally clean it up, Grunbaum, who we saw from un-un-unfoldable, knew about everything. Presumably, this is everything. Of course, we might have missed one. But he knew all the above, came up with his own proof. And then Godfried Touissant, father of computational geometry, one of them, knew about these and came up with yet another, simpler proof.

So the story of this is kind of fun. When I taught this class for the very first time, 2003 or so, I thought, OK, cool. This is a classic theorem. Everyone should know it. So I thought I'd cover the latest proof that's presumably the best, so I covered Godfried's proof. I was a little unhappy with it, but I finished writing down the proof, and then one of the students raised their hand and asked, is that really right? Can you do that in step two? And the answer was no, you can't do that. It basically skipped a step.

And so I thought, oh gee. And so I corresponded with O'Rourke and Godfried that weekend and was like, is something missing here? Maybe we should go back to some of the other proofs because we've got lots to choose from. So we went to the original, which is a very short proof. It's only one page long, maybe one and a half pages. And so this is fun. This is 1939, the way mathematics used to be done.

And it's funny because Grunbaum's proof was based on Nagy's proof and Toussaint's proof was based on Grunbaum's proof, so in the end, these proofs were very similar. In fact, they differed exactly in the one step, which was kind of omitted here. So I thought, OK great. Here we have a fill-in on how to do it.

And so the next class, I went up and I presented it. I was really happy. Isn't this cool, 1939 mathematics? It's really awesome, and it's one line that filled in this step. The same student raises his hand and is like, I don't think that's true. So now the step was filled in but it was wrong.

So it turns out actually most of these proofs are wrong, but not all of them, fortunately, so the theorem is still true. So that one was wrong, this one was wrong, this one was wrong, this one skipped a step that was key, this one essentially also skipped the step that was key. So in the end, there's two correct proofs, Reshetnyak and Bing and Kazarinoff, which was surprising. So I thought I'd show you one of the errors in the Nagy proof.

There's one other interesting feature here, which is, why wasn't this discovered until our class? The student was Blaise Gassand, and so then we wrote a paper about it and we have our own proof, of course. Now, some people may have realized there was an error in some of the proofs. Bing and Kazarinoff, one of the correct proofs, a very nice one, wrote-- here's the original Russian sentence. The English translation is, "the proof of this theorem given by Nagy is incorrect," which leaves something to be desired. And Grunbaum, who can read Russian-- we had to get them translated-- mentioned this. So he noticed that point. "They remarked that Nagy's proof is invalid but there's no basis for this claim." Then it remained undiscovered until 2005 or something. Kind of funny. Good thing there's so many proofs to choose from.

So this is Nagy's original proof. You can see the example where flipping two pockets simultaneously causes a crossing. Don't read the whole thing, obviously, but there's one sentence here which is, if you take a polygon, call it p0, and you flip a pocket and you get p1, and you flip a pocket and you get p2, and you take the convex hull of p and you get c0, and you take the convex hull of p1 and you get c1, p2, you get c2. And then you interleave these polygons so that the polygon is a convex hull, next polygon is a convex hull, because you're always flipping out, each of these polygons obviously contains the foregoing ones.

And so that seemed really nice and we thought, oh, this is so elegant. They used this to prove that the limit of the p's is convex because the limit of the p's then would be the limit of the c's because it was interleaving. But it's not true that these things contain the previous ones because if you have two pockets and you flip one of them, it's this one pocket versus multiple pockets issue. If you flip one of them, that will not contain the convex hull of the original because you haven't flipped them all. If you flipped all the pockets, than you would contain the convex hull of the original, but that would end up arguing that some flip sequences work, not all of them.

So this is annoying, and I think this is where I run out of slides. But we have some time, so I can give you a sketch of the proof. This is the Bing and Kazarinoff proof or our version of it. Give you an idea of how this works. It's an easy proof, it's just easy also to get it wrong or to skip one of the steps.

I will just do a proof by picture, I think. So suppose you have a polygon on the plane, and let's say you flip a pocket. So this would look something like that. A little hard to do a reflection. So this is the reflective polygon, and if we look at each of the vertices over here, these guys don't move, these guys moved over here, reflecting through that line.

Observation one. If I take some point x interior to the polygon, then these points that move get farther away from x. Why? Because if you look at this line here, let's say you look at a vertex and where it goes. This line is the Voronoi diagram of those two points. This is the perpendicular bisector of this and this. That's the meaning of reflection.

So that means everything to the left of the line here is closer to this point than that point. Everything to the right of the line is closer to this point than that point. Now x, which is interior to the polygon, must be to the left of the line because the whole polygon is to the left of the line. So distance from x to this vertex increases.

I mean, x will remain inside because as you flip, you only get bigger. So if I take a point x and I look at the distance to some vertex, it can only monotonically increase. It also can't get arbitrarily large because the maximum it could possibly be is half the perimeter of the polygon. The perimeter of the polygon is preserved so it can only stretch so far.

So if you look at this distance, it's monotonically increasing and it's bounded because it can never get bigger than the perimeter of the polygon. Therefore, it has a limit. That distance has a limit because monotone bounded sequences always have a unique limit. So cool. Distance from x to some vertex has a limit.

Well, I'm going to do this for three different points, x, that lie on some non-degenerate triangle, so not all on a line. That means the three distances from these points to this vertex all converge to some limit. And therefore, that point converges to a limit, namely the intersection of those three circles centered at those points. So this proves that the polygon has a limit because every vertex has a limiting point. Cool.

Now the tricky part is to argue that limit is convex, and this is where everyone had an issue. The first thing we argue is that the angles converge to a limit. This is kind of a technicality because we know the points converge to a limit, so surely the angle does. The only issue is, well, if all the points converge to the same point, then the angle would not have a limit, but that's easy to argue can't happen because these edge links are preserved. So I will just skip that one. It follows from some of the things we said.

Now we get to the fun part. This polygon has a limit. The angles have limits. So I want to look at the limiting angles. I want to in particular look at the vertices that move because if you flip an infinite number of times, that means some vertex must move an infinite number of times, because every time you flip, somebody moves. These guys are considered not moving even though they're kind of involved in the flip.

So if you look at the moved guys, what is their angle? So before, there was some angle here, and afterwards, the interior angle is the reverse. If this was reflex before, it's convex now. If there were a convex angle over here like this, it would become reflex over here. You alternate between being less than 180 and greater than 180 every time you move.

So if you have a vertex that is moving infinitely many times, its angle must alternate between less than 180 convex and greater than 180 reflex infinitely many times. If that happens and you have a unique limit angle, your limit angle must be 180. That's interesting.

If our vertex moves infinitely many times, then its limit angle equals 180, must be flat. Very close to a contradiction at this point. These guys are going to end up looking like this.

Well, let's look at the other guys. So we have some limit polygon. In the limit polygon, there are some flat vertices, but there must also be some non-flat vertices. You can't just go straight and hope to close a cycle. So there's maybe some convex ones like this. There may be some reflex ones.

At some point, these vertices must stop moving because everyone who moves infinitely many times has a limit angle flat. So anybody who is-- we call it "pointed" here, although it's a little different from pointed pseudo triangulations. Anyone who's not a flat angle must stop moving after finite time. So let's go to that time when all of these guys have stopped moving.

So your limit polygon is something. We don't know whether it's convex or whatever. It could have many flat angles. It's got to have at least one of them if we assume there's something infinite here. This is the limit polygon.

Now, at finite time, we know that these guys have stopped moving, meaning we're done with those guys. I've drawn the limit here, but also the finite thing, which must be on the inside, right? This must be something like this. Somehow it's going to flip and reach the infinitely many times and reach this in the limit. Hm. That looks weird.

So the way to argue this in the clean way is if you look at the convex hull of the limit, let's say, convex hull of the limit is this. And look at the convex hull of this finite time when the squared vertices have stopped moving. Convex hull will be-- well, it's got to be at least this because these guys are already there. The convex hull is defined by the square points. You don't care about the flat vertices. That won't affect the convex hull. So that means the convex hull equals the limit convex hull at this finite time. Now you're about to do another flip, which means you're going to go outside that convex hull and contradiction. Is that clear?

Maybe go through that part one more time. After finite time, when all of the non-flat vertices have stopped moving, we have reached the final convex hull. That means you can't do any more flips because every flip makes the convex hull bigger, so you actually had to stop at that time. That's kind of a fun proof. The key is really this part, that if a vertex flips infinitely many times, then that limit angle must be flat, and so they really don't participate in the convex hull. This is the Bing and Kazarinoff key idea.

AUDIENCE: Two questions. Does anyone do this for 3D?

PROFESSOR: 3D is a good. People have tried to define flips for 3D, and I think there's never really been a successful definition.

AUDIENCE: [INAUDIBLE]?

PROFESSOR: Yeah, and exactly how to flip it. I mean, you can define pocket in the same way, but then the boundary won't be a single plane. It'll be some convex cap, and so flipping, you can't really just reflect. It's kind of annoying.

AUDIENCE: The other question was, you have a sequence of simple operations that takes you from non-convex to convex. Does anybody use that in a proof to say, these things are preserved across the operations? You said perimeter was preserved. What about shortest paths?

PROFESSOR: So is this useful for something? Shortest paths are certainly not preserved. Edge lengths are preserved. Of course, we know how to do that with the carpenter's rule theorem, just staying in 2D, so it's not that exciting. But the operations are definitely a lot simpler. I think the easy answer to your question is there are many natural, simple moves, and this is the first one that people considered, but actually, there are a lot more, and I'm going to talk about those.

The main application I know for this stuff is basically, people wanted to generate random closed walks in 3D typically, and so they wanted to find a small set of operations they could just perform randomly and hope that that was a rapidly mixing Markov chain, so eventually, you'd have a kind of random thing. I don't think there are any rapid mixing results, at least that I'm aware of. In order to hope to get the space randomly, you would at least have to be able to make anything. So for that, the question is, can you convexify anything, because if you can convexify anything, then at least you can make anything, more or less. So that's where these questions come from. We focus more on the universality, but I think what people care about is this random generation business.

To that end, of course, for random generation, you don't really care about crossings. And so another fun extension which was in, I think, our paper for the first time, although there's a weaker version in Grunbaum's paper, if you start with a non-crossing, this proof still works. You need to add a little more to the argument. Either you decrease the number of crossings, which can only happen a finite number of times, or this kind of stuff works. You can make crossing polygons, too, which is kind of cool.

So that's the end of basic flips. Then we have something called a flip turn, which is kind of fun and in some ways better behaved, and gets to your question of what else is preserved. So let's say you have a pocket like this. So normally with a flip, we would reflect. With a flip turn, you reflect and then also flip this way, so it's the same as rotating 180 degrees about the center.

In addition to preserving perimeter, this preserves the edge directions. This matches this, this matches this, this matches this. It does not preserve the edge order, however. Here, we preserve the edge order. Here, we've reversed the order of those three edges. So all this is really doing is permuting the sequence of edges. The edge directions and the edge lengths are all the same.

So this means you could make at most n factorial moves here. Immediately, it's different from this situation where even for n equals 4, you could have arbitrarily many moves. Here, it's at most n factorial. That was the original bound. It turns out every polygon convexifies after order n squared flip turns. It's a fun proof but I don't have time to cover it here. That's flip turns.

Then we go to deflations. This is the inverse of a flip. So suppose you take a polygon and you do an operation that, if flipped, would result in the original polygon, exactly the opposite of a flip. This was conjectured to also finish after finite time, but in fact it doesn't. If you take any quadrilateral satisfying Kawasaki, so if you add up the opposite edge lengths and they're equal-- so 6 plus 3 is 9, 4 plus 5 is 9-- then there it is at least a flat limit possibly. That's the Kawasaki thing. And in fact, it will converge to that flat limit and it will take infinite time to get there. So that's kind of fun. It gets very hard to draw the pictures.

This is really the main example of an infinitely deflating polygon. We have a paper called "Deflating the Pentagon," which got some fun political views at some point. It's about a pentagon, five sides. And essentially, unless you have a flat vertex, in which case you are quadrilateral, there is no infinitely deflating pentagon, which means you can deflate the pentagon always in finite time. It is open for hexagons and higher whether there is another example different from the quadrilateral.

Then there's the idea of a pop. This is an even simpler operation than a flip. You just take two edges, like here we're taking these two edges, and, ignoring crossings, you just flip as if that were a pocket lid, so if this were a pocket. Then you get this polygon. Now here, you can be forced to get crossings. No matter how you flip, you might get a crossing.

Still, we're wondering-- who cares about crossings-- are pops enough to make anything, or to convexify? And the answer is no. There's this set of polygons called alternating polygons where the vertices alternate between the x-axis and the y-axis. And you can prove that no matter what pop you do, you are still an alternating polygon, and alternating polygons, you can also prove, are never convex, so you're stuck. This was open for many years but finally solved a few years ago.

There's also pop turns, which is where you take two edges and you do a 180 degree rotation like this. And there, we can prove if you allow crossings, you can convexify any polygon. I don't have a figure of that because it's just an algorithm. We haven't actually run it on a nice example. If you avoid crossings, we can characterize when it's possible and when it's impossible. And those are pretty much all the simple operations that at least have been studied. There's probably more to think about, but that's it, and that's the end of my part of the class.