With all the math in the world this can't be proved generically because we don't know anything other than the top tube is carbon. It being carbon says nothing about wall thickness, shape, or construction type/quality, and we know even less about the seatpost in question. We also don't know where we're clamping on the TT and what the shape and clamping force characteristics are of our clamp, namely whether it's a cam-over versus screw-down type of repair clamp, which has a massive impact on how much force it exposes the clamped member to. If all we know is the top tube is carbon and the seatpost and clamp exist, it is absolutely possible to contrive a situation where clamping the top tube is safer than clamping the seatpost.
In actual practice, almost the entire conversation when it comes to risk of damage is about wall thickness, which seatposts are very likely to have a lot of and top tubes typically have among the least of anywhere on a given bike. This is aside from the consideration that while damage is unlikely either way, it's a worse accident if it happens to the frame.
Some different questions that may be similar in intent are how to discern a situation where clamping the top tube may be better than clamping the seatpost, or how to discern when clamping a given seatpost with a given clamp is a bad idea. These are valid concerns, especially when combining aero and other non-round seatposts with clamps that are bad at accomodating them. Some simple guidlines are it's hard to damage any seatpost with a reasonably padded clamp that squeezes fore-aft, but there are aero posts where the side wall thickness is dainty enough that putting certain clamps on them that squeeze side-to-side is somewhere between suboptimal and actively dangerous. Considerations about aesthetic marring aside, most CF top tubes on "normal" bikes can be safely clamped at the spot adjacent to the seattube joint by a screw-down clamp with reasonable force, although it is possible to contrive all sorts of exceptions to that, most which would involve a tube that's flat in one direction or the other (aero or shoulderable) and again being squeezed in the direction where it's weak.