Subtraction: example of intertwined proofs and definitions. #
The difference of natural numbers is not a natural number. We see three ways of overcoming this problem, which illustrate various important concepts in Lean.
The first two are in an earlier module while the third is in this one.
Here we subtract natural numbers only when given a proof that the second is less than or equal to the first. Note that as any two terms whose type is the same proposition are equal by definition, the value will not depend on the specific proof.