-
Notifications
You must be signed in to change notification settings - Fork 65
add itv_closureE, itv_interiorE, and helper lemmas
#1848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,10 +55,7 @@ Implicit Types (i j : interval T) (x y : T) (a : itv_bound T). | |
| Definition neitv i := [set` i] != set0. | ||
|
|
||
| Lemma neitv_lt_bnd i : neitv i -> (i.1 < i.2)%O. | ||
| Proof. | ||
| case: i => a b; apply: contraNT => /= /itv_ge ab0. | ||
| by apply/eqP; rewrite predeqE => t; split => //=; rewrite ab0. | ||
| Qed. | ||
| Proof. case: i => a b /set0P[] ?; exact: itv_boundlr_lt. Qed. | ||
|
|
||
| Lemma set_itvP i j : [set` i] = [set` j] :> set _ <-> i =i j. | ||
| Proof. | ||
|
|
@@ -182,38 +179,66 @@ Definition set_itvE := (set_itv1, set_itvoo0, set_itvoc0, set_itvco0, set_itvoo, | |
| Lemma set_itvxx a : [set` Interval a a] = set0. | ||
| Proof. by move: a => [[|] a |[|]]; rewrite !set_itvE. Qed. | ||
|
|
||
| Lemma setUitv1 a x : (a <= BLeft x)%O -> | ||
| [set` Interval a (BLeft x)] `|` [set x] = [set` Interval a (BRight x)]. | ||
| Let setUitv1_gen a x b : (a <= BLeft x)%O -> | ||
| [set` Interval a (BSide b x)] `|` [set x] = [set` Interval a (BRight x)]. | ||
| Proof. | ||
| move=> ax; apply/predeqP => z /=; rewrite itv_splitU1// [in X in _ <-> X]inE. | ||
| move=> ax; case: b; last first. | ||
| by apply: setUidl => ? /= ->; rewrite itv_boundlr ax lexx. | ||
| apply/predeqP => z /=; rewrite itv_splitU1// [in X in _ <-> X]inE. | ||
| by rewrite (rwP eqP) (rwP orP) orbC. | ||
| Qed. | ||
|
|
||
| Let setU1itv_gen a x b : (BRight x <= a)%O -> | ||
| x |` [set` Interval (BSide b x) a] = [set` Interval (BLeft x) a]. | ||
| Proof. | ||
| move=> ax; case: b. | ||
| by apply: setUidr => ? /= ->; rewrite itv_boundlr ax lexx. | ||
| apply/predeqP => z /=; rewrite itv_split1U// [in X in _ <-> X]inE. | ||
| by rewrite (rwP eqP) (rwP orP) orbC. | ||
| Qed. | ||
|
|
||
| Lemma setUitv1 a x : (a <= BLeft x)%O -> | ||
| [set` Interval a (BLeft x)] `|` [set x] = [set` Interval a (BRight x)]. | ||
| Proof. exact: setUitv1_gen. Qed. | ||
|
|
||
| Lemma setU1itv a x : (BRight x <= a)%O -> | ||
| x |` [set` Interval (BRight x) a] = [set` Interval (BLeft x) a]. | ||
| Proof. exact: setU1itv_gen. Qed. | ||
|
|
||
| Lemma setUitv2 x y b1 b2 : | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this lemma will have the same usability problem as |
||
| (x <= y)%O -> | ||
| [set` Interval (BSide b1 x) (BSide b2 y)] `|` [set x; y] = `[x, y]%classic. | ||
| Proof. | ||
| move=> ax; apply/predeqP => z /=; rewrite itv_split1U// [in X in _ <-> X]inE. | ||
| by rewrite (rwP eqP) (rwP orP) orbC. | ||
| rewrite le_eqVlt => /orP [/eqP->|xy]. | ||
| by case: b1; case: b2; rewrite !set_itvE !setUid // set0U. | ||
| rewrite setUCA setUitv1_gen; last by case: b1; rewrite bnd_simp// ltW. | ||
| by rewrite setU1itv_gen// bnd_simp ltW. | ||
| Qed. | ||
|
|
||
| Lemma setDitv1r a x : | ||
| [set` Interval a (BRight x)] `\ x = [set` Interval a (BLeft x)]. | ||
| Lemma setDitv1r a x b : | ||
| [set` Interval a (BSide b x)] `\ x = [set` Interval a (BLeft x)]. | ||
| Proof. | ||
| case: b; first by apply: not_setD1; rewrite /= in_itv/= ltxx andbF. | ||
| apply/seteqP; split => [z|z] /=; rewrite !in_itv/=. | ||
| by move=> [/andP[-> /= zx] /eqP xz]; rewrite lt_neqAle xz. | ||
| by rewrite lt_neqAle => /andP[-> /andP[/eqP ? ->]]. | ||
| Qed. | ||
|
|
||
| Lemma setDitv1l a x : | ||
| [set` Interval (BLeft x) a] `\ x = [set` Interval (BRight x) a]. | ||
| Lemma setDitv1l a x b : | ||
| [set` Interval (BSide b x) a] `\ x = [set` Interval (BRight x) a]. | ||
| Proof. | ||
| case: b; last by apply: not_setD1; rewrite /= in_itv/= ltxx. | ||
| apply/seteqP; split => [z|z] /=; rewrite !in_itv/=. | ||
| move=> [/andP[xz ->]]; rewrite andbT => /eqP. | ||
| by rewrite lt_neqAle eq_sym => ->. | ||
| move=> /andP[]; rewrite lt_neqAle => /andP[xz zx ->]. | ||
| by rewrite andbT; split => //; exact/nesym/eqP. | ||
| Qed. | ||
|
|
||
| Lemma setDitv2 x y b1 b2 : | ||
| [set` Interval (BSide b1 x) (BSide b2 y)] `\` [set x; y] = `]x, y[%classic. | ||
| Proof. by rewrite -setDDl setDitv1l setDitv1r. Qed. | ||
|
|
||
| End set_itv_porderType. | ||
| Arguments neitv {disp T} _. | ||
| #[deprecated(since="mathcomp-analysis 1.10.0", note="renamed to `set_itvNyy`")] | ||
|
|
@@ -314,6 +339,96 @@ move=> cab; apply/seteqP; split => [x /= [xab /eqP]|x[|]]/=. | |
| by apply/eqP; rewrite gt_eqF. | ||
| Qed. | ||
|
|
||
| Lemma setDitvoo (x y : T) (b1 b2 : bool) : | ||
| neitv (Interval (BSide b1 x) (BSide b2 y)) -> | ||
| [set` Interval (BSide b1 x) (BSide b2 y)] `\` `]x, y[ = | ||
| (if b1 then [set x] else set0) `|` (if b2 then set0 else [set y]). | ||
| Proof. | ||
| move=> /neitv_lt_bnd/= xy. | ||
| apply/seteqP; split => z/=; rewrite !in_itv/=; last first. | ||
| move: b1 b2 xy. | ||
| case=> -[]; rewrite !bnd_simp/= => + []// -> => ->; rewrite ?lexx ?ltxx//. | ||
| by rewrite andbF. | ||
| case=> /[swap] /negP; rewrite negb_and. | ||
| move: b1 b2 {xy}. | ||
| case=> -[]/= + /andP[]; rewrite ?ltNge !negbK => /orP[]; try move=> -> //. | ||
| - by case; move=> ? ? ?; left; apply/le_anti/andP; split. | ||
| - by case; move=> ? ? ?; left; apply/le_anti/andP; split. | ||
| - by case; move=> ? ? ?; right; apply/le_anti/andP; split. | ||
| - by case; move=> ? ? ?; right; apply/le_anti/andP; split. | ||
| Qed. | ||
|
|
||
| Lemma setDccitv (x y : T) (b1 b2 : bool) : | ||
| neitv `[x, y] -> | ||
| `[x, y] `\` [set` Interval (BSide b1 x) (BSide b2 y)] = | ||
| (if b1 then set0 else [set x]) `|` (if b2 then [set y] else set0). | ||
| Proof. | ||
| move=> /neitv_lt_bnd/= xy. | ||
| apply/seteqP; split => z/=; rewrite !in_itv/=; last first. | ||
| move: b1 b2 xy. | ||
| case=> -[]; rewrite !bnd_simp/= => + []// -> => ->; rewrite ?lexx ?ltxx//. | ||
| by rewrite andbF. | ||
| case=> /[swap] /negP; rewrite negb_and. | ||
| move: b1 b2 {xy}. | ||
| case=> -[]/= /orP[] + /andP[]; rewrite -?leNgt; try move=> /negPf -> //. | ||
| - by move=> ? ? ?; right; apply/le_anti/andP; split. | ||
| - by move=> ? ? ?; left; apply/le_anti/andP; split. | ||
| - by move=> ? ? ?; right; apply/le_anti/andP; split. | ||
| - by move=> ? ? ?; left; apply/le_anti/andP; split. | ||
| Qed. | ||
|
|
||
| Lemma setDitvoy a (x : T) (b : bool) : | ||
| neitv (Interval (BSide b x) a) -> | ||
| [set` Interval (BSide b x) a] `\` `]x, +oo[ = | ||
| (if b then [set x] else set0). | ||
| Proof. | ||
| case/set0P => u xau. | ||
| apply/seteqP; split => z/=; rewrite !in_itv/=; last first. | ||
| move: xau; case: b; rewrite //= => /[swap] <-. | ||
| by case: a => [[]?|[]] /itv_boundlr_lt; rewrite /= !bnd_simp. | ||
| clear xau; case: b; rewrite /= andbT; last by case=> /andP[] ->. | ||
| by case=> /andP[] ? _ /negP; rewrite -leNgt => ?; apply/le_anti/andP; split. | ||
| Qed. | ||
|
|
||
| Lemma setDitvNyo a (x : T) (b : bool) : | ||
| neitv (Interval a (BSide b x)) -> | ||
| [set` Interval a (BSide b x)] `\` `]-oo, x[ = | ||
| (if b then set0 else [set x]). | ||
| Proof. | ||
| case/set0P => u xau. | ||
| apply/seteqP; split => z/=; rewrite !in_itv/=; last first. | ||
| move: xau; case: b => //= /[swap] <-. | ||
| by case: a => [[]?|[]] /itv_boundlr_lt; rewrite /= !bnd_simp// andbT. | ||
| clear xau; case: b => /=; first by case=> /andP[] _ ->. | ||
| by case=> /andP[] _ ? /negP; rewrite -leNgt => ?; apply/le_anti/andP; split. | ||
| Qed. | ||
|
|
||
| Lemma setDcitvy a (x : T) (b : bool) : | ||
| neitv (Interval (BLeft x) a) -> | ||
| [set` Interval (BLeft x) a] `\` [set` Interval (BSide b x) +oo%O] = | ||
| (if b then set0 else [set x]). | ||
| Proof. | ||
| case/set0P => u xau. | ||
| apply/seteqP; split => z/=; rewrite !in_itv/=; last first. | ||
| move: xau; case: b => //= /[swap] <-. | ||
| by case: a => [[]?|[]] /itv_boundlr_lt; rewrite /= !bnd_simp. | ||
| clear xau; case: b; rewrite /= andbT; first by case=> /andP[] ->. | ||
| by case=> /andP[] ? _ /negP; rewrite -leNgt => ?; apply/le_anti/andP; split. | ||
| Qed. | ||
|
|
||
| Lemma setDcitvNy a (x : T) (b : bool) : | ||
| neitv (Interval a (BRight x)) -> | ||
| [set` Interval a (BRight x)] `\` [set` Interval -oo%O (BSide b x)] = | ||
| (if b then [set x] else set0). | ||
| Proof. | ||
| case/set0P => u xau. | ||
| apply/seteqP; split => z/=; rewrite !in_itv/=; last first. | ||
| move: xau; case: b; rewrite //= => /[swap] <-. | ||
| by case: a => [[]?|[]] /itv_boundlr_lt; rewrite /= !bnd_simp// andbT. | ||
| clear xau; case: b => /=; last by case=> /andP[] _ ->. | ||
| by case=> /andP[] _ ? /negP; rewrite -leNgt => ?; apply/le_anti/andP; split. | ||
| Qed. | ||
|
|
||
| End set_itv_orderType. | ||
|
|
||
| Lemma set_itv_ge disp [T : porderType disp] [b1 b2 : itv_bound T] : | ||
|
|
@@ -893,3 +1008,38 @@ Lemma itv_setI {d} {T : orderType d} (i j : interval T) : | |
| Proof. | ||
| by rewrite eqEsubset; split => z; rewrite /in_mem/= /pred_of_itv/= lexI=> /andP. | ||
| Qed. | ||
|
|
||
| Lemma itv_open_endsPn {d} {T : porderType d} (l r : itv_bound T) : | ||
| (l < r)%O -> | ||
| reflect | ||
| (exists x : T , l = BLeft x \/ r = BRight x) | ||
| (~~ itv_open_ends (Interval l r)). | ||
| Proof. | ||
| move=> lr. | ||
| apply: (iffP idP); last first. | ||
| by clear lr; case=> x [] -> //; case: l => [[] ?|[]]. | ||
| move: lr; case: l => [[] L|[]] //; case: r => [[] R|[]]//= ? ?. | ||
| all: try (by exists L; left); by exists R; right. | ||
| Qed. | ||
|
|
||
| Lemma itv_closed_endsPn {d} {T : porderType d} (l r : itv_bound T) : | ||
| (l < r)%O -> | ||
| reflect | ||
| (exists x : T , l = BRight x \/ r = BLeft x) | ||
| (~~ itv_closed_ends (Interval l r)). | ||
| Proof. | ||
| move=> lr. | ||
| apply: (iffP idP); last first. | ||
| by clear lr; case=> x [] -> //; case: l => [[] ?|[]]. | ||
| move: lr; case: l => [[] L|[]] //; case: r => [[] R|[]]//= ? ?. | ||
| all: try (by exists L; left); by exists R; right. | ||
| Qed. | ||
|
|
||
| Lemma itv_open_ends_boundlr {d} {T : porderType d} (bl br : itv_bound T) (x : T) : | ||
| itv_open_ends (Interval bl br) -> | ||
| (x \in Interval bl br) = (bl < BLeft x)%O && (BRight x < br)%O. | ||
| Proof. | ||
| rewrite itv_boundlr !le_eqVlt. | ||
| have [->|_] := eqVneq bl (BLeft x); first by move/itv_open_ends_lside. | ||
| by have [->|_] := eqVneq br (BRight x); first by move/itv_open_ends_rside. | ||
| Qed. | ||
Uh oh!
There was an error while loading. Please reload this page.