It was there in maths and logic, clearly. Copernicus, a hundred years before Descartes, had discovered laws of planetary motion. They seemed to be true in every case examined. Descartes noticed that one could not, because it is always possible that in the next case they will fail. It is not self-contradictory that future evidence should fail to support them.
Science is gone.
That's what's meant by a formal truth. But this kind of formal noncontradiction is not what the insight behind Descartes' cogito was based on. Because seeming is just experiencing. Part of that experience is that you seem to have a tooth, one that hurts. But you could be wrong.