2727(* sup A - eps < x for any 0 < eps (lemma sup_adherent) *)
2828(* *)
2929(* ``` *)
30- (* Rint == the set of real numbers that can be written as z%:~R, *)
31- (* i.e., as an integer *)
3230(* Rtoint r == r when r is an integer, 0 otherwise *)
33- (* floor_set x := [set y | Rtoint y /\ y <= x] *)
31+ (* floor_set x := [set y | (y \is a Num.int) && ( y <= x)] *)
3432(* Rfloor x == the floor of x as a real number *)
3533(* range1 x := [set y |x <= y < x + 1] *)
3634(* Rceil x == the ceil of x as a real number, i.e., - Rfloor (- x) *)
@@ -149,70 +147,83 @@ Proof. exact: sup_adherent_subdef. Qed.
149147Section IsInt.
150148Context {R : realFieldType}.
151149
150+ #[deprecated(since="mathcomp-analysis 1.17.0", note="use `Num.int` instead")]
152151Definition Rint_pred := fun x : R => `[< exists z, x == z%:~R >].
153- Arguments Rint_pred _ /.
154- Definition Rint := [qualify a x | Rint_pred x].
152+ #[warning="-deprecated"] Arguments Rint_pred _ /.
155153
154+ #[deprecated(since="mathcomp-analysis 1.17.0", note="use `Num.int` instead")]
155+ #[warning="-deprecated"] Definition Rint := [qualify a x | Rint_pred x].
156+
157+ #[deprecated(since="mathcomp-analysis 1.17.0", note="use `Num.int` instead")]
158+ #[warning="-deprecated"]
156159Lemma Rint_def x : (x \is a Rint) = (`[< exists z, x == z%:~R >]).
157160Proof . by []. Qed .
158161
162+ #[deprecated(since="mathcomp-analysis 1.17.0", note="use `intrP` instead")]
163+ #[warning="-deprecated"]
159164Lemma RintP x : reflect (exists z, x = z%:~R) (x \in Rint).
160165Proof .
161166by apply/(iffP idP) => [/asboolP[z /eqP]|[z]] ->; [|apply/asboolP]; exists z.
162167Qed .
163168
164- Lemma RintC z : z%:~R \is a Rint.
165- Proof . by apply/RintP; exists z. Qed .
169+ #[deprecated(since="mathcomp-analysis 1.17.0", note="use `intr_int` instead")]
170+ #[warning="-deprecated"] Lemma RintC z : z%:~R \is a Rint.
171+ Proof . #[warning="-deprecated"] by apply/RintP; exists z. Qed .
166172
167- Lemma Rint0 : 0 \is a Rint.
168- Proof . by rewrite -[0](mulr0z 1) RintC. Qed .
173+ #[deprecated(since="mathcomp-analysis 1.17.0", note="use `int_num0` instead")]
174+ #[warning="-deprecated"] Lemma Rint0 : 0 \is a Rint.
175+ Proof . #[warning="-deprecated"] by rewrite -[0](mulr0z 1) RintC. Qed .
169176
170- Lemma Rint1 : 1 \is a Rint.
171- Proof . by rewrite -[1]mulr1z RintC. Qed .
177+ #[deprecated(since="mathcomp-analysis 1.17.0", note="use `int_num1` instead")]
178+ #[warning="-deprecated"] Lemma Rint1 : 1 \is a Rint.
179+ Proof . #[warning="-deprecated"] by rewrite -[1]mulr1z RintC. Qed .
172180
173- Hint Resolve Rint0 Rint1 RintC : core.
181+ #[warning="-deprecated"] Hint Resolve Rint0 Rint1 RintC : core.
174182
175- Lemma Rint_subring_closed : subring_closed Rint.
183+ #[deprecated(since="mathcomp-analysis 1.17.0", note="use `int_num_subring` instead")]
184+ #[warning="-deprecated"] Lemma Rint_subring_closed : subring_closed Rint.
176185Proof .
177- split=> // _ _ /RintP[x ->] /RintP[y ->]; apply/RintP.
186+ #[warning="-deprecated"] split=> // _ _ /RintP[x ->] /RintP[y ->]; apply/RintP.
178187by exists (x - y); rewrite rmorphB. by exists (x * y); rewrite rmorphM.
179188Qed .
180189
181- HB.instance Definition _ := GRing.isSubringClosed.Build R Rint_pred
190+ #[warning="-deprecated"] HB.instance Definition _ := GRing.isSubringClosed.Build R Rint_pred
182191 Rint_subring_closed.
183192
184- Lemma Rint_ler_addr1 (x y : R) : x \is a Rint -> y \is a Rint ->
193+ #[deprecated(since="mathcomp-analysis 1.17.0", note="use `lezD1` instead")]
194+ #[warning="-deprecated"] Lemma Rint_ler_addr1 (x y : R) : x \is a Rint -> y \is a Rint ->
185195 (x + 1 <= y) = (x < y).
186196Proof .
187- move=> /RintP[xi ->] /RintP[yi ->]; rewrite -{2}[1]mulr1z.
197+ #[warning="-deprecated"] move=> /RintP[xi ->] /RintP[yi ->]; rewrite -{2}[1]mulr1z.
188198by rewrite -intrD !(ltr_int, ler_int) lezD1.
189199Qed .
190200
191- Lemma Rint_ltr_addr1 (x y : R) : x \is a Rint -> y \is a Rint ->
201+ #[deprecated(since="mathcomp-analysis 1.17.0", note="use `ltzD1` instead")]
202+ #[warning="-deprecated"] Lemma Rint_ltr_addr1 (x y : R) : x \is a Rint -> y \is a Rint ->
192203 (x < y + 1) = (x <= y).
193204Proof .
194- move=> /RintP[xi ->] /RintP[yi ->]; rewrite -{3}[1]mulr1z.
205+ #[warning="-deprecated"] move=> /RintP[xi ->] /RintP[yi ->]; rewrite -{3}[1]mulr1z.
195206by rewrite -intrD !(ltr_int, ler_int) ltzD1.
196207Qed .
197208
198209End IsInt.
199- Arguments Rint_pred _ _ /.
210+ #[warning="-deprecated"] Arguments Rint_pred _ _ /.
200211
201212(* -------------------------------------------------------------------- *)
213+
202214Section ToInt.
203215Context {R : realType}.
204-
205216Implicit Types x y : R.
206217
207218Definition Rtoint (x : R) : int :=
208- if insub x : {? x | x \is a Rint } is Some Px then
209- xchoose (asboolP _ (tagged Px ))
219+ if insub x : {? x | x \is a Num.int } is Some Px then
220+ xchoose (ex_eqP (elimT intrP (tagged (Px : {x : R | x \is a Num.int})) ))
210221 else 0.
211222
212- Lemma RtointK (x : R): x \is a Rint -> (Rtoint x)%:~R = x.
223+ Lemma RtointK (x : R): x \is a Num.int -> (Rtoint x)%:~R = x.
213224Proof .
214- move=> Ix; rewrite /Rtoint insubT /= [RHS](eqP (xchooseP (asboolP _ Ix))) .
215- by congr _ %:~R; apply/eq_xchoose .
225+ move=> Ix; rewrite /Rtoint insubT//=; case: ex_eqP => //= i xi .
226+ by rewrite -(eqP (xchooseP (ex_intro (fun i => x == i %:~R) i xi))) .
216227Qed .
217228
218229Lemma Rtointz (z : int): Rtoint z%:~R = z.
@@ -221,10 +232,10 @@ Proof. by apply/eqP; rewrite -(@eqr_int R) RtointK ?rpred_int. Qed.
221232Lemma Rtointn (n : nat): Rtoint n%:R = n%:~R.
222233Proof . by rewrite -{1}mulrz_nat Rtointz. Qed .
223234
224- Lemma inj_Rtoint : {in Rint &, injective Rtoint}.
235+ Lemma inj_Rtoint : {in Num.int &, injective Rtoint}.
225236Proof . by move=> x y Ix Iy /= /(congr1 (@intmul R 1)); rewrite !RtointK. Qed .
226237
227- Lemma RtointN x : x \is a Rint -> Rtoint (- x) = - Rtoint x.
238+ Lemma RtointN x : x \is a Num.int -> Rtoint (- x) = - Rtoint x.
228239Proof .
229240move=> Ir; apply/eqP.
230241by rewrite -(@eqr_int R) RtointK // ?rpredN // mulrNz RtointK.
@@ -238,7 +249,7 @@ Section RealDerivedOps.
238249Variable R : realType.
239250
240251Implicit Types x y : R.
241- Definition floor_set x := [set y : R | (y \is a Rint ) && (y <= x)].
252+ Definition floor_set x := [set y : R | (y \is a Num.int ) && (y <= x)].
242253
243254Definition Rfloor x : R := (Num.floor x)%:~R.
244255
@@ -456,15 +467,15 @@ move/sup_adherent=> -/(_ e) []; first by rewrite subr_gt0.
456467move=> z Fz; rewrite /= subKr => lt_yz.
457468have /sup_upper_bound /ubP /(_ _ Fz) := has_sup_floor_set x.
458469rewrite -(lerD2r (-y)) => /le_lt_trans /(_ lt1_FxBy).
459- case/andP: Fy Fz lt_yz=> /RintP [yi -> _].
460- case/andP=> /RintP [zi -> _]; rewrite -rmorphB /= ltrz1 ltr_int.
470+ case/andP: Fy Fz lt_yz => /intrP [yi -> _].
471+ case/andP => /intrP [zi -> _]; rewrite -rmorphB /= ltrz1 ltr_int.
461472rewrite lt_neqAle => /andP[ne_yz le_yz].
462473rewrite -[_-_]gez0_abs ?subr_ge0 // ltz_nat ltnS leqn0.
463474by rewrite absz_eq0 subr_eq0 eq_sym (negbTE ne_yz).
464475Qed .
465476
466- Lemma isint_Rfloor x : Rfloor x \is a Rint .
467- Proof . by rewrite inE ; exists (Num.floor x). Qed .
477+ Lemma isint_Rfloor x : Rfloor x \is a Num.int .
478+ Proof . by apply/intrP ; exists (Num.floor x). Qed .
468479
469480Lemma RfloorE x : Rfloor x = (Num.floor x)%:~R.
470481Proof . by []. Qed .
@@ -534,8 +545,8 @@ Variable R : realType.
534545
535546Implicit Types x y : R.
536547
537- Lemma isint_Rceil x : Rceil x \is a Rint .
538- Proof . by rewrite /Rceil RintC . Qed .
548+ Lemma isint_Rceil x : Rceil x \is a Num.int .
549+ Proof . by rewrite /Rceil intr_int . Qed .
539550
540551Lemma Rceil0 : Rceil 0 = 0 :> R.
541552Proof . by rewrite /Rceil ceil0. Qed .
0 commit comments