From " I see a tree in front of me" it seems legitimate to infer that " there is actually a tree in front of me".
But Descartes denies the legitimacy of this inference , saying :
In case there were a Malin Genie manipulating your mind, the fact that you see a tree in front of you would not imply that there is a tree in front of you.
So, I think that what Descartes' objection says can be expressed in the following way :
$$[ M \rightarrow \neg (S \Rightarrow T) ] \Rightarrow \neg ( S \Rightarrow T) $$
With :
M : there is a Malin Genie
S : I see a tree in front of me
T : there is actually a tree in front of me
" $\to$ " : material implication
" $\Rightarrow$ " logical implication ( entailment)
Does formal logic validate this strategy for undermining a reasoning?
Is this strategy really fair? Can I really imagine any supposition, any arbitrary scenario to show an inference is not valid?
Is it corrrect to say that : if , with a new arbitrary premise ( however fanciful it may be) the conclusion does not follow anymore , then the reasoning is actually invalid?
First, let me quickly comment on your:
Yes! This is what you always do when considering the validity of an argument: you consider all possible scenarios that would make the premises true, and that includes scenarios where pigs can fly, where my coat is pink with orange polka dots, etc. So yes, as long as you find some possible scenario, no matter how fanciful, where you find the premises can be true but the conclusion is false, then the argument is invalid.
Indeed, this is exactly what Descartes does. He imagines a scenario where there is some evil Genie that makes you see things that aren't there. This is a fanciful scenario, for sure, but it is logically possible. And, in that scenario, $S$ is true, but where $T$ is false. As such, Descartes concludes: $$\neg (S \Rightarrow T)$$
OK, but can we represent Descartes logical argument? You tried to formalize what Descartes' is saying as:
$$[ M \rightarrow \neg (S \Rightarrow T) ] \Rightarrow \neg ( S \Rightarrow T) $$
Or, maybe a bit more intuitively, that Descartes is arguing as follows:
$$M \rightarrow \neg (S \Rightarrow T)$$
$$ \therefore \neg ( S \Rightarrow T) \tag{*}$$
Now, this certainly does not look like a valid argument: it would seem to require $M$ as an extra premise, and so since we do not have $M$, this does not seem to be valid. But: looks can deceive!
First of all, note that the argument can still be valid for the simple reason that $$ \neg ( S \Rightarrow T) $$ is already a (meta-)logical truth, and nothing can change that. This is effectively what lemontree does at the end of their Answer. This observation, however, makes no real use of the Malin Genie though, so I am guessing that doesn't feel very satisfying to you.
So, as an alternative 'resolution' that does take into account the Malin Genie, I want to argue that your analysis of Descartes' argument actually isn't quite correct, and that it we make it correct, it will become much more clear that Descartes' argument is perfectly valid.
OK, now, how can we make Descartes' argument work? Again, it would be correct if we had $M$. So, is $M$ maybe a hidden premise, and so the argument really is?
$$M \rightarrow \neg (S \Rightarrow T)$$
$$M$$
$$ \therefore \neg ( S \Rightarrow T) $$
No, clearly not! We do not know if $M$ is true or false, and so we don't have $M$ as a premise.
However, what Descartes is assuming (and hence what the argument is still missing), is that $M$ is possibly true. This is, as Andres pointed out, a necessary condition for this to work. Why? Well, suppose $M$ cannot possibly be true. Then clearly $M \rightarrow \neg (S \Rightarrow T)$ would be vacuously true, but it would not force the truth of $\neg (S \Rightarrow T)$.
Indeed, as a counterexample to the pattern of reasoning presented in $(*)$, we can do:
$$\bot \rightarrow \neg (S \Rightarrow S)$$
$$ \therefore \neg (S \Rightarrow S) $$
which is clearly invalid, because the premise is vacuously true, but the conclusion is false: if you see a tree, then of course it follows that you do see a tree! (and indeed, as Descartes pointed out later in his Meditations, the existence of our perceptual experiences themselves is something we cannot deny, once we have them)
So, there is a hidden premise: for the argument $(*)$ to work, we do at least need $M$ to be logically possible. OK, so this suggests:
$$M \rightarrow \neg (S \Rightarrow T)$$
$$\Diamond M$$
$$ \therefore \neg ( S \Rightarrow T) \tag{**}$$
Well, no, that doesn't quite work either. Consider this:
$$\neg I \rightarrow \neg (S \Rightarrow S)$$
$$\Diamond \neg I$$
$$ \therefore \neg ( S \Rightarrow S) \tag{**}$$
where $I$ represents "I exist"
Now, clearly I exist (and you will have to use 'I' for yourself of course!), so $I$ is true. So, $\neg I \rightarrow \neg (S \Rightarrow S)$ is vacuously true. Premise 2 is true as well: it's logically possible for me to not exist (as soon as I stop thinking and have experiences of any kind). But clearly, the conclusion is once again false.
Fortunately for Descartes, he did not argue in accordance with $(**)$ either. So what really is going on?
Well, consider that first premise $M \rightarrow \neg (S \Rightarrow T)$. You used this as a premise, because Descartes seemed to be thinking like this:
However, the thinking really should be like:
And this now solves the problem we ran into with $(**)$, for now we have:
$$\Diamond M \rightarrow \Diamond (M \land S \land \neg T)$$
$$\Diamond M$$
$$ \therefore \neg ( S \Rightarrow T) $$
With a simple Modus Ponens on the first two premises, you thus get $\Diamond (M \land S \land \neg T)$. Indeed, as you yourself hint at in the Comments in response to Andres' comment, we don't want $M$ to merely be possible (or consistent), but we want $M$ to be consistent with the truth of $S$ and the falsity of $T$. The core of the argument is thus effectively:
$$\Diamond (M \land S \land \neg T) $$
$$ \therefore \neg ( S \Rightarrow T) $$
And this argument really is valid: if you can have $M$ and $S$ be true, and $T$ be false, at the same time, then in particular you can have $S$ be true and $T$ be false at the same time, and hence $S$ does not imply $T$. And that reasoning can be represented as:
$$\Diamond (M \land S \land \neg T) $$
$$\therefore \Diamond (S \land \neg T) $$
$$ \therefore \neg ( S \Rightarrow T) $$
And, as such, we 're back at the very beginning, where Descartes is pointing out the logical possibility of a scenario where $S$ is true, but $T$ is false, in order to argue that $S$ does not logically imply $T$