My neighbor, Glenn, is fond of asking math-folks that he meets the question "Is mathematics discovered or invented?" -- and when he asked the question of MAA lecturer William Dunham the response was one word, delivered with a smile, "Yes." The question of invention versus discovery -- which may apply to poetry or to mathematics -- is thoughtfully considered in "Notes toward a Supreme Fiction" by Wallace Stevens (1879-1955); here are a few lines from that poem.
from It Must Give Pleasure, VII by Wallace Stevens
He imposes orders as he thinks of them,
As the fox and the snake do. It is a brave affair.
Next he builds capitols and in their corridors,
Whiter than wax, sonorous, fame as it is,
He establishes statues of reasonable men,
Who surpassed the most literate owl, the most erudite
Of elephants. But to impose is not
To discover. To discover an order as of
A season, to discover summer and know it,
To discover winter and know it well, to find,
Not to impose, not to have reasoned at all,
Out of nothing to have come on major weather,
It is possible, possible, possible. It must
be possible. It must be that in time
The real will from its crude compoundings come . . .
The complete text of "Notes toward a Supreme Fiction" is found on my shelf in The Collected Poems of Wallace Stevens (Vintage Books, 1990).