From a01d1bfb653267ed2a5203e8d985498bd32e21c2 Mon Sep 17 00:00:00 2001 From: Kazuhiko Sakaguchi Date: Fri, 29 Nov 2024 15:44:52 +0100 Subject: [PATCH] Fix some deprecation warnings about ceil_ge --- reals/real_interval.v | 7 +++---- reals/reals.v | 4 ++-- theories/lebesgue_integral.v | 32 +++++++++++++------------------- theories/lebesgue_measure.v | 4 ++-- theories/normedtype.v | 2 +- theories/realfun.v | 7 +++---- 6 files changed, 24 insertions(+), 32 deletions(-) diff --git a/reals/real_interval.v b/reals/real_interval.v index 15db5ad76..f0a72307f 100644 --- a/reals/real_interval.v +++ b/reals/real_interval.v @@ -298,9 +298,8 @@ Proof. apply/seteqP; split=> y; rewrite /= !in_itv/= andbT; last first. by move=> [k _ /=]; move: b => [|] /=; rewrite in_itv/= => /andP[//] /ltW. move=> xy; exists `|ceil (y - x)|%N => //=; rewrite in_itv/= xy/= -lerBlDl. -rewrite !natr_absz/= ger0_norm -?ceil_ge0 ?ceil_ge//. -rewrite (lt_le_trans (ltrN10 R))// subr_ge0. -by case: b xy => //= /ltW. +rewrite natr_absz ger0_norm ?ceil_ge//. +by rewrite -ceil_ge0 (lt_le_trans (ltrN10 R))// subr_ge0 (lteifW xy). Qed. Lemma itv_infty_bnd_bigcup (R : realType) b (x : R) : @@ -310,7 +309,7 @@ Proof. have /(congr1 (fun x => -%R @` x)) := itv_bnd_infty_bigcup (~~ b) (- x). rewrite opp_itv_bnd_infty negbK opprK => ->; rewrite image_bigcup. apply eq_bigcupr => k _; apply/seteqP; split=> [_ /= -[r rbxk <-]|y/= yxkb]. - by rewrite oppr_itv/= opprB addrC. + by rewrite oppr_itv/= opprB addrC. by exists (- y); [rewrite oppr_itv/= negbK opprD opprK|rewrite opprK]. Qed. diff --git a/reals/reals.v b/reals/reals.v index bc9d85ce1..2b1fd3ad1 100644 --- a/reals/reals.v +++ b/reals/reals.v @@ -116,9 +116,9 @@ End has_bound_lemmas. (* -------------------------------------------------------------------- *) HB.mixin Record ArchimedeanField_isReal R of Num.ArchiField R := { - sup_upper_bound_subdef : forall E : set [the archiFieldType of R], + sup_upper_bound_subdef : forall E : set R, has_sup E -> ubound E (supremum 0 E) ; - sup_adherent_subdef : forall (E : set [the archiFieldType of R]) (eps : R), + sup_adherent_subdef : forall (E : set R) (eps : R), 0 < eps -> has_sup E -> exists2 e : R, E e & (supremum 0 E - eps) < e }. diff --git a/theories/lebesgue_integral.v b/theories/lebesgue_integral.v index c9b2bbfaf..646ac8331 100644 --- a/theories/lebesgue_integral.v +++ b/theories/lebesgue_integral.v @@ -1548,19 +1548,15 @@ move=> Dx fxoo; have approx_x n : approx n x = n%:R. by rewrite fgen_A0 // ?mulr0 // fxoo leey. case/cvg_ex => /= l; have [l0|l0] := leP 0%R l. - move=> /cvgrPdist_lt/(_ _ ltr01) -[n _]. - move=> /(_ (`|ceil l|.+1 + n)%N) /= /(_ (leq_addl _ _)). - rewrite approx_x. - apply/negP; rewrite -leNgt distrC (le_trans _ (lerB_normD _ _)) //. - rewrite normrN lerBrDl addSnnS [leRHS]ger0_norm ?ler0n//. - rewrite natrD lerD// ?ler1n// ger0_norm // (le_trans (ceil_ge _)) //. - by rewrite -(@gez0_abs (ceil _)) // -ceil_ge0 (lt_le_trans _ l0). + move=> /(_ (`|ceil l|.+1 + n)%N) /= /(_ (leq_addl _ _)); apply/negP. + rewrite -leNgt approx_x distrC (le_trans _ (lerB_normD _ _))// normrN. + rewrite lerBrDl addSnnS natrD [leRHS]ger0_norm// lerD ?ler1n// natr_absz. + by rewrite !ger0_norm ?le_ceil// -ceil_ge0; apply: lt_le_trans l0. - move=> /cvgrPdist_lt/(_ _ ltr01)[n _]. move=> /(_ (`|floor l|.+1 + n)%N)/(_ (leq_addl _ _)); apply/negP. - rewrite approx_x -leNgt distrC (le_trans _ (lerB_normD _ _))//. - rewrite normrN lerBrDl addSnnS [leRHS]ger0_norm ?ler0n//. - rewrite natrD lerD ?ler1n// ltr0_norm// (@le_trans _ _ (- floor l)%:~R)//. - by rewrite mulrNz lerNl opprK ge_floor. - by rewrite -(@lez0_abs (floor _))// -floor_le0// (lt_le_trans l0). + rewrite approx_x -leNgt distrC (le_trans _ (lerB_normD _ _))// normrN. + rewrite lerBrDl addSnnS natrD [leRHS]ger0_norm// lerD ?ler1n// natr_absz. + by rewrite !ltr0_norm -?floor_lt0// mulrNz lerN2 ge_floor. Qed. Lemma ecvg_approx (f0 : forall x, D x -> (0 <= f x)%E) x : @@ -2330,22 +2326,20 @@ transitivity (\int[mu]_(x in D) limn (g^~ x)). - rewrite gt0_mulye//; apply/cvgeyPgey; near=> M. have M0 : (0 <= M)%R by []. rewrite /g; case: (f x) fx0 => [r r0|_|//]; last first. - exists 1%N => // m /= m0. - by rewrite mulry gtr0_sg// ?mul1e ?leey// ltr0n. + by exists 1%N => // m /= m0; rewrite mulry gtr0_sg// ?ltr0n// mul1e leey. near=> n; rewrite lee_fin -ler_pdivrMr//. near: n; exists `|ceil (M / r)|%N => // m /=. rewrite -(ler_nat R); apply: le_trans. - rewrite natr_absz ger0_norm ?ceil_ge// -ceil_ge0// (lt_le_trans (ltrN10 _))//. - by rewrite divr_ge0// ?ltW. + rewrite natr_absz ger0_norm ?ceil_ge// -ceil_ge0 (lt_le_trans (ltrN10 _))//. + by rewrite divr_ge0// ltW. - rewrite lt0_mulye//; apply/cvgeNyPleNy; near=> M; have M0 : (M <= 0)%R by []. rewrite /g; case: (f x) fx0 => [r r0|//|_]; last first. - exists 1%N => // m /= m0. - by rewrite mulrNy gtr0_sg// ?ltr0n// mul1e ?leNye. + by exists 1%N => // m /= m0; rewrite mulrNy gtr0_sg// ?ltr0n// mul1e leNye. near=> n; rewrite lee_fin -ler_ndivrMr//. near: n; exists `|ceil (M / r)|%N => // m /=. rewrite -(ler_nat R); apply: le_trans. - rewrite natr_absz ger0_norm ?ceil_ge// -ceil_ge0// (lt_le_trans (ltrN10 _))//. + rewrite natr_absz ger0_norm ?ceil_ge// -ceil_ge0 (lt_le_trans (ltrN10 _))//. by rewrite -mulrNN mulr_ge0// lerNr oppr0// ltW// invr_lt0. - rewrite -fx0 mule0 /g -fx0. under eq_fun do rewrite mule0/=. (*TODO: notation broken*) @@ -3745,7 +3739,7 @@ move=> mf; split=> [iDf0|Df0]. rewrite invrK /m -natr1 natr_absz ger0_norm; last first. by rewrite -ceil_ge0// (lt_le_trans (ltrN10 _)). rewrite (@le_trans _ _ ((fine `|f t|)^-1 + 1)%R) ?lerDl//. - by rewrite lerD2r// ceil_ge. + by rewrite lerD2r// le_ceil. by split => //; apply: contraTN nft => /eqP ->; rewrite abse0 -ltNge. transitivity (limn (fun n => mu (D `&` [set x | `|f x| >= n.+1%:R^-1%:E]))). apply/esym/cvg_lim => //; apply: nondecreasing_cvg_mu. diff --git a/theories/lebesgue_measure.v b/theories/lebesgue_measure.v index 5fbc202ca..ae28ae682 100644 --- a/theories/lebesgue_measure.v +++ b/theories/lebesgue_measure.v @@ -718,7 +718,7 @@ rewrite eqEsubset; split=> [_ -> i _/=|]; first by rewrite in_itv /= ltry. move=> [r| |/(_ O Logic.I)] // /(_ `|ceil r|%N Logic.I); rewrite /= in_itv /=. rewrite andbT lte_fin ltNge. have [r0|r0] := ltP 0%R r; last by rewrite (le_trans r0). -by rewrite natr_absz gtr0_norm// ?ceil_ge// -ceil_gt0. +by rewrite natr_absz gtr0_norm// ?le_ceil// -ceil_gt0. Qed. End erealwithrays. @@ -2856,7 +2856,7 @@ have finite_set_F i : finite_set (F i). apply/negP; rewrite -ltNge lebesgue_measure_ball// lte_fin. rewrite -(@natr1 _ `| _ |%N) natr_absz ger0_norm; last first. by rewrite -ceil_ge0// (lt_le_trans (ltrN10 _)). - by rewrite -ltr_pdivrMr// -ltrBlDr (lt_le_trans _ (ceil_ge _))// ltrBlDr ltrDl. + by rewrite -ltr_pdivrMr// -ltrBlDr (lt_le_trans _ (le_ceil _))// ltrBlDr ltrDl. have mur2_fin_num_ : mu (ball (0:R) (r%:num + 2))%R < +oo. by rewrite lebesgue_measure_ball// ltry. have FE : \sum_(n [/cvgryPge|/cvgnyPge] Foo. by apply/cvgnyPge => A; near do rewrite -(@ler_nat R); apply: Foo. apply/cvgryPgey; near=> A; near=> n. -rewrite (le_trans (@ceil_ge R A))// (ler_int _ _ (f n)) [ceil _]intEsign. +rewrite pmulrn ceil_le_int// [ceil _]intEsign. by rewrite le_gtF ?expr0 ?mul1r ?lez_nat -?ceil_ge0//; near: n; apply: Foo. Unshelve. all: by end_near. Qed. diff --git a/theories/realfun.v b/theories/realfun.v index b11415d1c..dc0b0de70 100644 --- a/theories/realfun.v +++ b/theories/realfun.v @@ -249,10 +249,9 @@ have y_p : y_ n @[n --> \oo] --> p. rewrite ltrBlDr => /lt_le_trans; apply. rewrite addrC lerD2r -(invrK e) lef_pV2// ?posrE ?invr_gt0//. near: t. - exists `|ceil e^-1|%N => // k /= ek. - rewrite (le_trans (ceil_ge _))// (@le_trans _ _ `|ceil e^-1|%:~R)//. - by rewrite ger0_norm -?ceil_ge0// (lt_le_trans (ltrN10 _))// invr_ge0// ltW. - by move: ek;rewrite -(leq_add2r 1) !addn1 -(ltr_nat R) => /ltW. + exists `|ceil e^-1|%N => // k /=; rewrite -lez_nat abszE ger0_norm. + by rewrite -ceil_le_int//= => /le_trans; apply; rewrite ler_nat. + by rewrite -?ceil_ge0 (lt_le_trans (ltrN10 _))// invr_ge0// ltW. have /fine_cvgP[[m _ mfy_] /= _] := h _ (conj py_ y_p). near \oo => n. have mn : (m <= n)%N by near: n; exists m.