1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* This file was automatically generated: do not edit *********************)
19 (*#***********************************************************************)
21 (* v * The Coq Proof Assistant / The Coq Development Team *)
23 (* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
25 (* \VV/ **************************************************************)
27 (* // * This file is distributed under the terms of the *)
29 (* * GNU Lesser General Public License Version 2.1 *)
31 (*#***********************************************************************)
33 (* $Id: Zsqrt.v,v 1.11.2.1 2004/07/16 19:31:22 herbelin Exp $ *)
35 include "ZArith/ZArith_base.ma".
38 Open Local Scope Z_scope.
41 (*#*********************************************************************)
43 (*#* Definition and properties of square root on Z *)
45 (*#* The following tactic replaces all instances of (POS (xI ...)) by
46 `2*(POS ...)+1`, but only when ... is not made only with xO, XI, or xH. *)
51 | |- context [(Zpos (xI ?X1))] =>
53 | context [1%positive] => fail
54 | _ => rewrite (BinInt.Zpos_xI X1)
56 | |- context [(Zpos (xO ?X1))] =>
58 | context [1%positive] => fail
59 | _ => rewrite (BinInt.Zpos_xO X1)
64 inline procedural "cic:/Coq/ZArith/Zsqrt/sqrt_data.ind".
66 inline procedural "cic:/Coq/ZArith/Zsqrt/sqrtrempos.con" as definition.
68 (*#* Define with integer input, but with a strong (readable) specification. *)
70 inline procedural "cic:/Coq/ZArith/Zsqrt/Zsqrt.con" as definition.
72 (*#* Define a function of type Z->Z that computes the integer square root,
73 but only for positive numbers, and 0 for others. *)
75 inline procedural "cic:/Coq/ZArith/Zsqrt/Zsqrt_plain.con" as definition.
77 (*#* A basic theorem about Zsqrt_plain *)
79 inline procedural "cic:/Coq/ZArith/Zsqrt/Zsqrt_interval.con" as theorem.