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

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

Open
vihdzp wants to merge 3 commits into
masterfrom
forall_exists_rel
Open

feat(logic/relation): auxiliary forall_exists_rel relation#18713
vihdzp wants to merge 3 commits into
masterfrom
forall_exists_rel

Conversation

@vihdzp

@vihdzp vihdzp commented Apr 2, 2023

Copy link
Copy Markdown
Collaborator

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

Co-authored-by: @negiizhao egresf@gmail.com


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 astrainfinita April 2, 2023 02:24
Comment thread src/logic/relation.lean
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
Copy Markdown
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
Copy Markdown
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.

@YaelDillies YaelDillies left a comment

Copy link
Copy Markdown
Collaborator

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