Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(data/set_like/basic): add a congr lemma #10643

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

Conversation

eric-wieser
Copy link
Member


Open in Gitpod

@eric-wieser eric-wieser added the WIP Work in progress label Dec 6, 2021
for dome discussion about this lemma. It can occasionally result in `simp, simp` being needed. -/
@[congr] lemma dep_congr {ι α} [set_like A B]
{p : ι → A} (f : Π i, p i → α) :
∀ {i j} (x : p i) (h : i = j), f i x = f j ⟨x, h ▸ x.prop⟩
Copy link
Member

Choose a reason for hiding this comment

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

As discussed in that Zulip thread, this should not be a congr lemma because it 1) does higher-order matching, 2) it does it on every subterm (since the head symbol is a variable and thus indexing bails out), and 3) it can't rewrite at x.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm curious to see whether mathlib builds anyway.

Copy link
Member

Choose a reason for hiding this comment

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

If I understand @gebner correctly, this is not the correct solution. Instead, core should be fixed. But I don't know if anyone wants to pour energy in that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's my understanding too. It would be great if we could check if lean4 core works for this type of case, if we decide no one has the energy to make it work in lean3

@eric-wieser eric-wieser added awaiting-review The author would like community review of the PR RFC Request for comment and removed WIP Work in progress labels Dec 10, 2021
Comment on lines +166 to +167
See [this Zulip thred](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/simp.20simp/near/263872040)
for dome discussion about this lemma. It can occasionally result in `simp, simp` being needed. -/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
See [this Zulip thred](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/simp.20simp/near/263872040)
for dome discussion about this lemma. It can occasionally result in `simp, simp` being needed. -/
See [this Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/simp.20simp/near/263872040)
for some discussion about this lemma. It can occasionally result in `simp, simp` being needed. -/

Hopefully the simp fixes can be done in some version of Lean!

@jcommelin jcommelin removed the awaiting-review The author would like community review of the PR label Jan 3, 2022
@jcommelin
Copy link
Member

Removing awaiting-review for now. Might need more experimentation.

@semorrison semorrison added the too-late This PR was ready too late for inclusion in mathlib3 label Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Request for comment 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.

None yet

5 participants