When someone sets out to prove a theorem, they may be able to see for example a couple results that if proven could give them the theorem. But I don't see how anyone could mentally grasp dozens of lemmas/identities and simultaneously fit them together in their head to show they can be used to prove the original theorem. So then how is it that researchers come up with all these lemmas for their theorem? Do they just jot down any identity/interesting property they come across and compile loads of stuff, and then later go back and see if any of it fits together? Also while putting the pieces together so to speak, how are they handling the lemmas/identities? I imagine they are going to want to be able to look at all of them or multiple ones quickly, so it wouldn't be efficient to have each one saved as a separate file with $15+$ open at once. Do people have relevant lemmas/theorems etc. all saved in a single file for viewing when they are writing papers, or what? How does one manage all that information.