If I can prove $Y$ from "$X$ is true" and from "$X$ is false", can I prove $Y$ without using $X$ at all? Suppose I have a statement $X$, for which I do not know whether it is true or false. And suppose further that I want to prove a statement $Y$:

*

*I first assume that $X$ is true, and I construct an involved argument that shows that $Y$ follows.

*I then assume that $X$ is false, and another involved argument shows that $Y$ still follows.

I have then proven $Y$ (assuming excluded middle). Now, is there any kind of meta-theorem in mathematics that tells me that there should be a proof of $Y$ that is not mentioning $X$ at all (whatever that means formally)?
You can think about this as follows:

Was it necessary to have formulated $X$ in order to give a proof for $Y$, or could we have proven $Y$ right away without the "halt in between"?

For example, the Riemann hypothesis seems to be such an important "halt in the middle" for some statements.
I know, this is a rather informal question.
I do not want to formulate it in terms of mathematical logic and proof theory, simply beacuse I do not know enough about these subjects.
Maybe the question has a trivial counterexample if we go formal enough.
But then again, maybe someone with enough knowledge still sees an interesting variant of the question.
I am also happy to receive quite technical answers.

Proposition: The set $c\mathbb R = \{cx : x\in\mathbb R\}$ is closed.
You can prove this if you assume $c=0,$ and also if you assume $c\ne0.$ But I will be surprised if you can do it without considering those two cases.
