aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories/NArith/Nsqrt_def.v
diff options
context:
space:
mode:
Diffstat (limited to 'theories/NArith/Nsqrt_def.v')
-rw-r--r--theories/NArith/Nsqrt_def.v14
1 files changed, 7 insertions, 7 deletions
diff --git a/theories/NArith/Nsqrt_def.v b/theories/NArith/Nsqrt_def.v
index 750da2397..375ed0f90 100644
--- a/theories/NArith/Nsqrt_def.v
+++ b/theories/NArith/Nsqrt_def.v
@@ -8,7 +8,7 @@
(** Definition of a square root function for N. *)
-Require Import BinPos BinNat Psqrt.
+Require Import BinPos BinNat.
Local Open Scope N_scope.
@@ -16,7 +16,7 @@ Definition Nsqrtrem n :=
match n with
| N0 => (N0, N0)
| Npos p =>
- match Psqrtrem p with
+ match Pos.sqrtrem p with
| (s, IsPos r) => (Npos s, Npos r)
| (s, _) => (Npos s, N0)
end
@@ -25,26 +25,26 @@ Definition Nsqrtrem n :=
Definition Nsqrt n :=
match n with
| N0 => N0
- | Npos p => Npos (Psqrt p)
+ | Npos p => Npos (Pos.sqrt p)
end.
Lemma Nsqrtrem_spec : forall n,
let (s,r) := Nsqrtrem n in n = s*s + r /\ r <= 2*s.
Proof.
destruct n. now split.
- generalize (Psqrtrem_spec p). simpl.
+ generalize (Pos.sqrtrem_spec p). simpl.
destruct 1; simpl; subst; now split.
Qed.
Lemma Nsqrt_spec : forall n,
let s := Nsqrt n in s*s <= n < (Nsucc s)*(Nsucc s).
Proof.
- destruct n. now split. apply (Psqrt_spec p).
+ destruct n. now split. apply (Pos.sqrt_spec p).
Qed.
Lemma Nsqrtrem_sqrt : forall n, fst (Nsqrtrem n) = Nsqrt n.
Proof.
destruct n. reflexivity.
- unfold Nsqrtrem, Nsqrt, Psqrt.
- destruct (Psqrtrem p) as (s,r). now destruct r.
+ unfold Nsqrtrem, Nsqrt, Pos.sqrt.
+ destruct (Pos.sqrtrem p) as (s,r). now destruct r.
Qed. \ No newline at end of file