Skip to content

Commit

Permalink
Merge pull request #388 from proux01/image-notation2
Browse files Browse the repository at this point in the history
Make set image a (only parsing) notation, 2nd take
  • Loading branch information
CohenCyril authored Jun 11, 2021
2 parents ea52244 + 242daac commit 804a5e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions theories/classical_sets.v
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,18 @@ Arguments mkset _ _ _ /.

Notation "[ 'set' x : T | P ]" := (mkset (fun x : T => P)) : classical_set_scope.
Notation "[ 'set' x | P ]" := [set x : _ | P] : classical_set_scope.

Definition image {T rT} (A : set T) (f : T -> rT) :=
[set y | exists2 x, A x & f x = y].
Arguments image _ _ _ _ _ /.
Notation "[ 'set' E | x 'in' A ]" :=
[set y | exists2 x, A x & E = y] : classical_set_scope.
(image A (fun x => E)) : classical_set_scope.

Definition image2 {TA TB rT} (A : set TA) (B : set TB) (f : TA -> TB -> rT) :=
[set z | exists2 x, A x & exists2 y, B y & f x y = z].
Arguments image2 _ _ _ _ _ _ _ /.
Notation "[ 'set' E | x 'in' A & y 'in' B ]" :=
[set z | exists2 x, A x & exists2 y, B y & E = z] : classical_set_scope.
(image2 A B (fun x y => E)) : classical_set_scope.

Section basic_definitions.
Context {T rT : Type}.
Expand Down Expand Up @@ -280,7 +288,7 @@ Notation "A `<` B" := (proper A B) : classical_set_scope.

Notation "A `<=>` B" := ((A `<=` B) /\ (B `<=` A)) : classical_set_scope.
Notation "f @^-1` A" := (preimage f A) : classical_set_scope.
Notation "f @` A" := [set f x | x in A] (only parsing) : classical_set_scope.
Notation "f @` A" := (image A f) (only parsing) : classical_set_scope.
Notation "A !=set0" := (nonempty A) : classical_set_scope.

Lemma eq_set T (P Q : T -> Prop) : (forall x : T, P x = Q x) ->
Expand Down
2 changes: 1 addition & 1 deletion theories/normedtype.v
Original file line number Diff line number Diff line change
Expand Up @@ -3544,7 +3544,7 @@ move=> C D FC f_D; have {}f_D :
move=> g Pg; apply: sED => i j; rewrite ord1 row_simpl'.
by have /getPex [_ /(_ _ (Pg j))] := exPj j.
split; last by move=> j; have /getPex [[]] := exPj j.
exists [set [set g | forall j, get (Pj j) (g j)] | k in 'I_n.+1];
exists [set [set g | forall j, get (Pj j) (g j)] | k in [set x | 'I_n.+1 x]];
last first.
rewrite predeqE => g; split; first by move=> [_ [_ _ <-]].
move=> Pg; exists [set g | forall j, get (Pj j) (g j)] => //.
Expand Down

0 comments on commit 804a5e0

Please sign in to comment.