Skip to content

Commit 1efda51

Browse files
committed
update context
1 parent 530c8c0 commit 1efda51

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

coq_error_metrics/absolute_prec.v

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,23 @@ Import Order.TTheory GRing.Theory Num.Def Num.Theory.
88

99
Local Open Scope ring_scope.
1010

11-
Context {R : realType}.
12-
1311
Section AbsPrec.
1412

15-
Definition AbsPrec (a a' α : R) : Prop := α >= 0 -> `| (a - a')%R | <= α.
13+
Context {R : realType}.
14+
15+
Definition AbsPrec (a a' α : R) : Prop := α >= 0 -> `| (a - a') | <= α.
1616

1717
End AbsPrec.
1818

1919
Notation "a ~ a' ; α" := (AbsPrec a a' α) (at level 99).
2020

21-
Fact abs_eq : forall (a b : R), a = b -> `|a| = `|b|.
22-
Proof. move => a b H1; by rewrite H1. Qed.
21+
Fact abs_eq : forall {R : realType} (a b : R), a = b -> `|a| = `|b|.
22+
Proof. move => HR a b H1; by rewrite H1. Qed.
2323

2424
(* Properties from Olver Section 2.2 *)
2525
Section ElementaryProperties.
2626

27+
Context {R : realType}.
2728
Variables (a a' α : R).
2829
Hypothesis Halpha : 0 <= α.
2930

@@ -67,18 +68,19 @@ Section ElementaryProperties.
6768

6869
End ElementaryProperties.
6970

70-
Fact normr_inv : forall (x : R), `|1/x| = 1/`|x|.
71-
Proof. move => x; have Hx : (0 <= x) \/ (x < 0) by nra. destruct Hx;
71+
Fact normr_inv : forall {R : realType} (x : R), `|1/x| = 1/`|x|.
72+
Proof. move => H x; have Hx : (0 <= x) \/ (x < 0) by nra. destruct Hx;
7273
[rewrite !ger0_norm => //|]. rewrite divr_ge0 => //.
7374
rewrite !ltr0_norm => //; [nra|]. rewrite ltr_ndivrMr; nra. Qed.
7475

75-
Fact divr_le : forall (x y : R), 0< y -> y <= x -> 1/x <= 1/y.
76-
Proof. move => x y H1 H2. rewrite ler_pdivrMr => //; [|nra].
76+
Fact divr_le : forall {R : realType} (x y : R), 0< y -> y <= x -> 1/x <= 1/y.
77+
Proof. move => H x y H1 H2. rewrite ler_pdivrMr => //; [|nra].
7778
rewrite div1r ler_pdivlMl => //; nra. Qed.
7879

7980
(* Theorems from Section 2.3 *)
8081
Section MultDiv.
8182

83+
Context {R : realType}.
8284
Variables (a a' b b' α β : R).
8385

8486
Hypothesis Halpha : 0 <= α.
@@ -124,6 +126,7 @@ End MultDiv.
124126

125127
Section MultDiv2.
126128

129+
Context {R: realType}.
127130
Variable (a a' α b b' β : R).
128131
Hypothesis Halpha : 0 <= α.
129132
Hypothesis Hbeta : 0 <= β.

0 commit comments

Comments
 (0)