TITLE: When can we detect forcing?
QUESTION [13 upvotes]: First, a rather broad question: has there been any work on what, given a model $M$ of set theory, we can say about those models of set theory $N$ and posets $\mathbb{P}$ such that $\mathbb{P}\in N$ and $M=N[G]$ for some $G$ $\mathbb{P}$-generic over $N$?
Second, a more specific question. Let a poset $\mathbb{P}$ be $detectable$ if there is some sentence $\phi_\mathbb{P}$ in the language of set theory + a constant denoting $\mathbb{P}$ such that for all $M$ with $\mathbb{P}\in M$, we have $(M, \mathbb{P})\models\phi\iff M=N[G]$ for some model $N$ with $\mathbb{P}\in N$ and $G$ $\mathbb{P}$-generic over $N$. What posets are detectable? [Answered in the comments by Amit Kumar Gupta.]
Finally, an incredibly general question. Let $M$ be a model of $ZFC$, $\mathcal{C}$ a class of posets in $M$. Say $\mathcal{C}$ is $consistent$ if there is some elementary extension $N$ of $M$ such that, for all $\mathbb{P}\in \mathcal{C}$, there is some $N_\mathbb{P}\models ZFC$ with $\mathbb{P}\in N_\mathbb{P}$ and some $G$ $\mathbb{P}$-generic over $N_\mathbb{P}$ such that $N=N_\mathbb{P}[G]$. What are the consistent classes like? Can we say anything interesting about them?
I'm not sure if these questions are meaningful, or - even assuming they are - if they are interesting. Basically, what I'm interested in is the notion of inverse forcing - similar in an aesthetic sense, at least to me, to inverse Galois theory - and I haven't run into anything along these lines yet.

REPLY [5 votes]: Here is a nice observation that is not mentioned in the previous answers: 
Even if we know that a model is a forcing extension, we may still not know either the forcing or the original model. Of course, this is clear if $V=M[G]$ where $G$ is generic over $M$ for some poset ${\mathbb P}$ that admits some ${\mathbb Q}$ as a factor, so $G=H*I$ for some $H$ generic over $M$ for ${\mathbb Q}$ and $V=(M[H])[I]$ for $I$ generic over $M[H]$ for the poset that is usually denoted by ${\mathbb Q}/G$. But in fact, $V$ could be generic over different, ${\subseteq}$-incomparable models for very different posets. 
Here is an example (probably due to Woodin?): Assume a tiny amount of determinacy ($\Sigma^1_2$-determinacy is an overkill). It follows that, for any real $x$, ${\mathcal P}(\omega)\cap L[x]$ is countable, so there is a real $w$ such that $x\le_T w$ and $L[w]$ is a forcing extension of $L[x]$ by Cohen forcing. Also, there is a $w'$ with $x\le_T w'$ and $L[w']$ a forcing extension of $L[x]$ by random forcing. The amount of determinacy we are assuming allows us to invoke Martin's cone theorem to conclude that (from a mild large cardinal hypothesis):

There is a real $x$ such that for any real $y$, if $x\le_T y$, then $L[y]$ is both a forcing extension of some model $L[z]$ by Cohen forcing, and a random extension of some model $L[z']$ by random forcing.

(I know a few years ago a student of Kunen was looking at a similar problem, but I did not keep up with their results.)