Why should a publication present results in a way that significantly differs from the discovery of said results? In the various projects I've worked on, professors have insisted that a writeup for a journal submission should state and prove only the final results (rather than describe the process of arriving at those results). I see how this makes things concise, but it seems to obscure the process of discovery.

Here's an example of this situation from a mathematics paper I've worked on.

What I did:


I have a direct proof for "X".
After looking at my direct proof for "X", I see that I could generalize "X" if I prove "Y" (it was not immediately clear that proving "Y" was useful for proving "X").
I prove "Y", then prove "Generalized X" (duplicating some work from the proof of "X").


What the paper does:


Prove "Y".
Use "Y" to prove "Generalized X".
Refine the proof of "Generalized X" ever so slightly to get "X".


My frustration:

I feel like the paper is good reference material, but it's not educational. I think a reader would stand to benefit much more from a direct proof of "X", since it shows why I would try to show "Y" in the first place.
I think this comes down to the subtle but important difference between communication and education. The target audience of a research paper is experts in the field, not students. Most readers want to know what your theorem says, why it's important and relevant, intuition about why it "should" be true and why the proof works, and (sometimes) the details of the proof. Few people are reading in order to learn how to prove theorems, which is what your suggested presentation would serve.

Having said that, it's possible to take the "uneducational" approach too far and actively cover one's tracks, so that the paper is hard to understand but looks impressive. By all means, if an informal discussion of the special case "X" will help give intuition about the main theorem, include such in your introduction.