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

[Merged by Bors] - fix(data/set/function): do not use reducible #12377

Closed
wants to merge 1 commit into from

Conversation

gebner
Copy link
Member

@gebner gebner commented Mar 1, 2022

Reducible should only be used if the definition if it occurs as an explicit argument in a type class and must reduce during type class search, or if it is a type that should inherit instances. Propositions should only be reducible if they are trivial variants (< and > for example).

These reducible attributes here will cause issues in Lean 4. In Lean 4, the simplifier unfold reducible definitions in simp lemmas. This means that tagging an inj_on-theorem with @[simp] creates the simp lemma ?a = ?b (i.e. match anything).


Open in Gitpod

@gebner gebner added the awaiting-CI The author would like to see what CI has to say before doing more work. label Mar 1, 2022
@gebner
Copy link
Member Author

gebner commented Mar 1, 2022

See also leanprover-community/mathport#118

@gebner gebner added the mathport For compatibility with Lean 4 changes, to simplify porting label Mar 1, 2022
@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Mar 1, 2022
@gebner gebner added the awaiting-review The author would like community review of the PR label Mar 1, 2022
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors merge

@leanprover-community-bot-assistant leanprover-community-bot-assistant added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Mar 3, 2022
bors bot pushed a commit that referenced this pull request Mar 3, 2022
Reducible should only be used if the definition if it occurs as an explicit argument in a type class and must reduce during type class search, or if it is a type that should inherit instances.  Propositions should only be reducible if they are trivial variants (`<` and `>` for example).

These reducible attributes here will cause issues in Lean 4.  In Lean 4, the simplifier unfold reducible definitions in simp lemmas.  This means that tagging an `inj_on`-theorem with `@[simp]` creates the simp lemma `?a = ?b` (i.e. match anything).
@bors
Copy link

bors bot commented Mar 3, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title fix(data/set/function): do not use reducible [Merged by Bors] - fix(data/set/function): do not use reducible Mar 3, 2022
@bors bors bot closed this Mar 3, 2022
@bors bors bot deleted the inj_semired branch March 3, 2022 21:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
mathport For compatibility with Lean 4 changes, to simplify porting ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants