The former can be demonstrated using property-base...
# arrow
b
The former can be demonstrated using property-based testing (commonly available) or formalized proof systems (available in more advanced languages); the latter is common in most unit tests