An assertion should just be the evaluation of a boolean expression.
Assertions can be anything you want them to be. There is no (nor should there be) requirement that they be a boolean expression.
Sometimes it is sensible to say assert(foo_is_valid(foo)); on some object foo, and the foo_is_valid() call might need to do a lot of work.
Or... In an arbitrary precision integer arithmetic library, if you compute the quotient and remainder q and r of a divided by b, it is sensible right before returning to assert that b times q plus r equals a, which obviously incurs a significant speed penalty and should not be part of the production code if the math library needs to be as performant as possible.
I write assertions to document state and to help catch errors. I don't care how fast or slow they run. They are meant to be compiled out.