Binary representation of integers using inductive types #
Note: Unlike in Coq, where this representation is preferred because of
the reliance on kernel reduction, in Lean this representation is discouraged
in favor of the "Peano" natural numbers Nat, and the purpose of this
collection of theorems is to show the equivalence of the different approaches.
castPosNum casts a PosNum into any type which has 1 and +.
Instances For
bitm1 x appends a 1 to the end of x, mapping x to 2 * x - 1.
Instances For
Subtraction of PosNums, where if a < b, then a - b = 1.
Instances For
Auxiliary definition for PosNum.divMod.