Euclidean division using primitive recursion/induction.
Given a number less than or equal to a bound, is it equal, or less?
the greater or equal number
the lesser or equal number
proof that m
is less than or equal to n
Euclidean division. Note that this takes the predecessor of the divisor to
avoid division by zero.
the dividend
the predecessor of the desired divisor
The base case, dividing zero by a successor.
the predecessor of the divisor
The inductive step, taking a division of m
to a division of S m
the divisor
the dividend in the inductive hypothesis
the inductive hypothesis
The result of euclidean division of natural numbers
the dividend
the divisor
The result of division. The order of operations and operands in the
result type was picked to not require any explicit proofs.
the divisor
the quotient
the remainder
proof that the remainder is in the range
[0 .. divisor - 1]