Nick Cannon beat Mariah Carey to the courthouse … we’ve learned he has quietly filed for divorce.

The timing is interesting. We found out Nick filed papers December 12. The date is relevant because on December 2, Mariah showed up 3 hours late to tape a segment for the NBC tree-lighting special.  

At the time we posted a story … Mariah was on the phone with her lawyers going over the terms of her property settlement. That syncs up with Nick filing papers a week later, after they hashed out a deal.

Short story … Mariah has completely detached Nick from her new, very lucrative deal in Vegas.

Mariah Carey and Nick Cannon have a prenup with a confidentiality clause … and if she blabs out of school she gets socked for twice what he’d have to pay if he violates it.

Sources familiar with the situation say … if Nick violates the confidentiality clause he has to pay her a $250,000 penalty, but if she spills the beans she has to pay him $500K.

And the prenup makes it clear … Mariah came into the marriage with a boatload of money … Nick, not so much.

The prenup says Mariah is worth $150 million … she has so much, $30 million is listed as “miscellaneous.” Nick came into the marriage in 2008 with a little less than $500K.

He’s done well since then, making millions on his various projects, but when they married he ended up buying her engagement ring for $500,000 but took a loan out for $470K. The ring was reportedly worth $2.5 mil, but that’s not what he paid.

As we reported … they’ve already worked out a full property settlement agreement.