Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

feat(logic/relation): auxiliary forall_exists_rel relation #18713

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

vihdzp
Copy link
Collaborator

@vihdzp vihdzp commented Apr 2, 2023

This can be used to golf both the pre-game API and the ZFC set API.

Co-authored-by: @negiizhao [email protected]


Open in Gitpod

@vihdzp vihdzp added awaiting-review The author would like community review of the PR modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. labels Apr 2, 2023
@vihdzp vihdzp requested a review from FR-vdash-bot April 2, 2023 02:24
Comment on lines +658 to +666
/--
`forall_exists_rel r s t` says that for every `s i` there is some `t j` such that `r (s i) (t j)`,
and for every `t j` there is some `s i` such that `r (s i) (t j)`.

This finds use as an auxilary definition when defining relations on quotients of families `ι → α` by
extensionality.
-/
def forall_exists_rel {ι₁ ι₂ α₁ α₂ : Type*} (r : α₁ → α₂ → Prop) (s : ι₁ → α₁) (t : ι₂ → α₂) :=
(∀ i, ∃ j, r (s i) (t j)) ∧ ∀ j, ∃ i, r (s i) (t j)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know about relator.bi_total?

Suggested change
/--
`forall_exists_rel r s t` says that for every `s i` there is some `t j` such that `r (s i) (t j)`,
and for every `t j` there is some `s i` such that `r (s i) (t j)`.
This finds use as an auxilary definition when defining relations on quotients of families `ια` by
extensionality.
-/
def forall_exists_rel {ι₁ ι₂ α₁ α₂ : Type*} (r : α₁ → α₂ → Prop) (s : ι₁ → α₁) (t : ι₂ → α₂) :=
(∀ i, ∃ j, r (s i) (t j)) ∧ ∀ j, ∃ i, r (s i) (t j)
/--
`forall_exists_rel r s t` says that for every `s i` there is some `t j` such that `r (s i) (t j)`,
and for every `t j` there is some `s i` such that `r (s i) (t j)`.
This finds use as an auxilary definition when defining relations on quotients of families `ια` by
extensionality.
-/
def forall_exists_rel {ι₁ ι₂ α₁ α₂ : Type*} (r : α₁ → α₂ → Prop) (s : ι₁ → α₁) (t : ι₂ → α₂) :=
relator.bi_total $ λ i j, r (s i) (t j)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know about it. All of these lemmas could probably be turned into simpler lemmas for bi_total. I'll try to clean up the file and add these results.

Copy link
Collaborator

@YaelDillies YaelDillies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you don't need to introduce a new definition.

@eric-wieser eric-wieser added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Apr 2, 2023
@kim-em kim-em added the too-late This PR was ready too late for inclusion in mathlib3 label Jul 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting-author A reviewer has asked the author a question or requested changes modifies-synchronized-file This PR touches a files that has already been ported to mathlib4, and may need a synchronization PR. too-late This PR was ready too late for inclusion in mathlib3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants