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
4 changes: 2 additions & 2 deletions CHANGELOG_UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

### Added

- in `boolp.v`, lemmas for classical reasoning `existsNP`, `existsP`,
`forallNP`, `forallP`, `imply_classic`, `orC`.
- in `boolp.v`, lemmas for classical reasoning `existsNP`, `existsPN`,
`forallNP`, `forallPN`, `Nimply`, `orC`.
- in `classical_sets.v`, definitions for supremums: `ul`, `lb`,
`supremum`
- in `ereal.v`:
Expand Down
9 changes: 4 additions & 5 deletions theories/boolp.v
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ Qed.
Lemma gen_choiceMixin {T : Type} : Choice.mixin_of T.
Proof. by case: classic. Qed.


Lemma pdegen (P : Prop): P = True \/ P = False.
Proof. by have [p|Np] := pselect P; [left|right]; rewrite propeqE. Qed.

Expand Down Expand Up @@ -561,7 +560,7 @@ split => [[x Px h]|/asboolP]; [exact: Px|].
by rewrite asbool_neg => /existsp_asboolPn.
Qed.

Lemma existsP (T : Type) (P : T -> Prop) :
Lemma existsPN (T : Type) (P : T -> Prop) :
(exists x : T, P x) <-> (~ forall x : T, ~ P x).
Proof.
split => [[x Px h]|/asboolP]; [exact: (h x)|].
Expand All @@ -575,16 +574,16 @@ split => [h [x Px]|/asboolP]; [exact: (h x)|].
by rewrite asbool_neg => /forallp_asboolPn.
Qed.

Lemma forallP (T : Type) (P : T -> Prop) :
Lemma forallPN (T : Type) (P : T -> Prop) :
(forall x : T, P x) <-> (~ exists x : T, ~ P x).
Proof.
split => [h [x px]|]; [exact/px/h|move=> /forallNP h x].
by move/contrapT : (h x).
Qed.

Lemma imply_classic (P Q : Prop) : (P /\ ~ Q) <-> ~ (P -> Q).
Lemma Nimply (P Q : Prop) : ~ (P -> Q) <-> (P /\ ~ Q).
Proof.
split => [[p nq pq]|/asboolP]; [exact/nq/pq|].
split=> [/asboolP|[p nq pq]]; [|exact/nq/pq].
by rewrite asbool_neg => /imply_asboolPn.
Qed.

Expand Down
4 changes: 2 additions & 2 deletions theories/ereal.v
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ have [Spoo|Spoo] := pselect (S +oo).
by exists +oo; split; [apply/ereal_ub_pinfty | apply/lbP => /= y /ubP; apply].
have [r Sr] : exists r, S r%:E.
move: S0 Snoo Spoo => [[r Sr _ _|//|Snoo Snoo1 Spoo]]; first by exists r.
apply/existsP => nS; move: Snoo1; apply; apply/eqP; rewrite predeqE.
apply/existsPN => nS; move: Snoo1; apply; apply/eqP; rewrite predeqE.
by case=> // r; split => // /nS.
set U := [set x | (real_of_er_def r @` S) x ].
have [ubU|/set0P/negP] := pselect (ub U !=set0); last first.
Expand Down Expand Up @@ -545,7 +545,7 @@ have : ~ ub S (ereal_sup S - e%:num%:E)%E.
move/ub_ereal_sup; apply/negP.
by rewrite -ltNge Sr lte_subl_addr lte_fin ltr_addl.
move/asboolP; rewrite asbool_neg; case/existsp_asboolPn => /= x.
case/imply_classic => ? ?; exists x; split => //.
case/Nimply => ? ?; exists x; split => //.
by rewrite ltNge; apply/negP.
Qed.

Expand Down
2 changes: 1 addition & 1 deletion theories/reals.v
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ split; last first.
move=> h [x] /ubP hle; case/(_ x): h => y /hle.
by rewrite leNgt => /negbTE ->.
move/forallNP => h x; have {h} := h x.
move=> /ubP /existsNP => -[y /imply_classic[Ey /negP]].
move=> /ubP /existsNP => -[y /Nimply[Ey /negP]].
by rewrite -ltNge => ltx; exists y.
Qed.

Expand Down