Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG_UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
`closed_ball_closed`, `closed_ball_subset`, `nbhs_closedballP`, `subset_closed_ball`

- in `normedtype.v`, lemmas `nbhs0_lt`, `nbhs'0_lt`, `interior_closed_ballE`, open_nbhs_closed_ball`
- in `classical_sets.v`, lemmas `subset_has_lbound`, `subset_has_ubound`

- in `reals.v`, lemmas `sup_setU`, `inf_setU`

### Changed

Expand Down
6 changes: 6 additions & 0 deletions theories/classical_sets.v
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,12 @@ Definition has_sup E := E !=set0 /\ has_ubound E.
Definition has_lbound E := lbound E !=set0.
Definition has_inf E := E !=set0 /\ has_lbound E.

Lemma subset_has_lbound A B : A `<=` B -> has_lbound B -> has_lbound A.
Proof. by move=> AB [l Bl]; exists l => a Aa; apply/Bl/AB. Qed.

Lemma subset_has_ubound A B : A `<=` B -> has_ubound B -> has_ubound A.
Proof. by move=> AB [l Bl]; exists l => a Aa; apply/Bl/AB. Qed.

Lemma has_ub_set1 x : has_ubound [set x].
Proof. by exists x; rewrite ub_set1. Qed.

Expand Down
19 changes: 19 additions & 0 deletions theories/reals.v
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,17 @@ move=> nzE; split=> [/asboolPn|/has_ubPn h [_]] //.
by rewrite asbool_and (asboolT nzE) /= => /asboolP/has_ubPn.
Qed.

Lemma sup_setU (A B : set R) : has_sup B ->
(forall a b, A a -> B b -> a <= b) -> sup (A `|` B) = sup B.
Proof.
move=> [B0 [l Bl]] AB; apply/eqP; rewrite eq_le; apply/andP; split.
- apply sup_le_ub => [|x [Ax|]]; first by apply: subset_nonempty B0 => ?; right.
by case: B0 => b Bb; rewrite (le_trans (AB _ _ Ax Bb)) // sup_ub //; exists l.
- by move=> Bx; rewrite sup_ub //; exists l.
- apply sup_le_ub => // b Bb; apply sup_ub; last by right.
by exists l => x [Ax|Bx]; [rewrite (le_trans (AB _ _ Ax Bb)) // Bl|exact: Bl].
Qed.

End RealLemmas.

(* -------------------------------------------------------------------- *)
Expand Down Expand Up @@ -454,6 +465,14 @@ move=> nzE; split=> [/asboolPn|/has_lbPn h [_] //].
by rewrite asbool_and (asboolT nzE) /= => /asboolP/has_lbPn.
Qed.

Lemma inf_setU (A B : set R) : has_inf A ->
(forall a b, A a -> B b -> a <= b) -> inf (A `|` B) = inf A.
Proof.
move=> hiA AB; congr (- _).
rewrite image_setU setUC sup_setU //; first exact/has_inf_supN.
by move=> _ _ [] b Bb <-{} [] a Aa <-{}; rewrite ler_oppl opprK; apply AB.
Qed.

End InfTheory.

(* -------------------------------------------------------------------- *)
Expand Down