THIS FILE IS DEPRECATED
Instead of the various
Zsqrt defined here, please use rather
Z.sqrt (or
Z.sqrtrem). The latter are pure functions without
proof parts, and more results are available about them.
Some equivalence proofs between the old and the new versions
can be found below. Importing ZArith will provides by default
the new versions.
Definition and properties of square root on Z
The following tactic replaces all instances of (POS (xI ...)) by
`2*(POS ...)+1`, but only when ... is not made only with xO, XI, or xH.
Define with integer input, but with a strong (readable) specification.
Define a function of type Z->Z that computes the integer square root,
but only for positive numbers, and 0 for others.
Direct correctness on squares.