How are long proofs "planned"?

Solution 1:

I think that many mathematicians (including me) create long proofs similarly to you, so this is a general way. Therefore I cannot add much to my answer to the linked question. Sometimes long proof are guided by a priori intuition, as Poincaré wrote, sometimes they are a posteriori glued together, for instance, as a classification of finite simple groups. Sometimes in long proof we just follow standard algorithm, for instance, while we solve PDE. One more approach I used a couple of years ago, while solving a next open problem I had no clear intuition, but I wrote a complex speculations in order to see the ideas more clearly, and, finally, I got it.

But sometimes the work done will be idle, and I don’t know a perfect way to avoid that. One of insurances can be a priori estimation: when you prove the lemmas which you write, will you be able to prove the theorem? As George Polya recommended to start a proof form the end, although this is a “symmetric” situation.