I can write a poem in my head without ever writing it down on paper. I still wrote a poem, even if I just pass it along orally.
If I write a song for my girl, I'm not going to hand her a piece of paper with sheet music and lyrics, I'm going to perform it for her. I may write it down, or I may not.
Of course, composed is a more precise word, but everyone still knows what I mean if I replace it with write.
> I can write a poem in my head without ever writing it down on paper. I still wrote a poem, even if I just pass it along orally
This is generalising the term writing to the point of uselessness. In your example, you thought of a poem and spoke it. You didn't write it.
Are you also calling it literature if it's not written down?
You can take note. Writing is a physical action, e.g. performing output.
Writing is an action. You can memorize, take a mental note, but you are not writing.
(Someone else mentioned Camōes, a portuguese who famously/allegedly saved his writings from a shipwreck by swimming with one arm and using the other to keep the book above water; your interpretation of "writing" is an insult)