Skip to content

[Merged by Bors] - chore: uncomment cons_injective and cons_inj in Data/List/Basic.lean#372

Closed
dwrensha wants to merge 3 commits intoleanprover-community:masterfrom
dwrensha:list-basic
Closed

[Merged by Bors] - chore: uncomment cons_injective and cons_inj in Data/List/Basic.lean#372
dwrensha wants to merge 3 commits intoleanprover-community:masterfrom
dwrensha:list-basic

Conversation

@dwrensha
Copy link
Copy Markdown
Member

@dwrensha dwrensha commented Aug 19, 2022

@digama0
Copy link
Copy Markdown
Member

digama0 commented Aug 19, 2022

nolints are almost never the right thing to do in response to a linter warning. In this case the issue is that injective is reducible, I don't think it was in lean 3. (The reason it was omitted from #22 is because injective didn't exist at the time.)

@dwrensha
Copy link
Copy Markdown
Member Author

Should we remove the @[reducible] attribute from injective?

@gebner
Copy link
Copy Markdown
Member

gebner commented Aug 22, 2022

Yes, injective should not be reducible. See also leanprover-community/mathport#118

@gebner
Copy link
Copy Markdown
Member

gebner commented Aug 22, 2022

Please also follow the commit message guidelines and title this PR chore: uncomment cons_injective and cons_inj

@dwrensha
Copy link
Copy Markdown
Member Author

@gebner
Copy link
Copy Markdown
Member

gebner commented Aug 22, 2022

@dwrensha dwrensha changed the title [Data/List/Basic] uncomment some cons_injective and cons_inj chore(Data/List/Basic): uncomment cons_injective and cons_inj Aug 22, 2022
@dwrensha
Copy link
Copy Markdown
Member Author

Updated the PR title (subject) and summary (body) to conform with the conventions.

@gebner
Copy link
Copy Markdown
Member

gebner commented Aug 22, 2022

Can you please remove the @[reducible] from injective instead?

@gebner
Copy link
Copy Markdown
Member

gebner commented Aug 22, 2022

And please follow the new conventions. (Which no longer have the (Data/List/Basic) part.)

@gebner gebner added the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 22, 2022
@dwrensha
Copy link
Copy Markdown
Member Author

Removing @[reducible] from Function.injective causes these errors:

./././Mathlib/Order/Basic.lean:317:2: error: @[ext] attribute only applies to structures or lemmas proving x = y, got injective (@toLE ?α)
./././Mathlib/Order/Basic.lean:339:2: error: @[ext] attribute only applies to structures or lemmas proving x = y, got injective (@toPreorder ?α)
./././Mathlib/Order/Basic.lean:347:2: error: @[ext] attribute only applies to structures or lemmas proving x = y, got injective (@toPartialOrder ?α)
./././Mathlib/Order/Basic.lean:361:2: error: tactic 'introN' failed, insufficient number of binders
α✝ : Type u
β : Type v
γ : Type w
r : α✝ → α✝ → Prop
α : Type u_1
A B : Preorder α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ A = B
./././Mathlib/Order/Basic.lean:366:2: error: tactic 'introN' failed, insufficient number of binders
α✝ : Type u
β : Type v
γ : Type w
r : α✝ → α✝ → Prop
α : Type u_1
A B : PartialOrder α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ A = B
./././Mathlib/Order/Basic.lean:372:2: error: tactic 'introN' failed, insufficient number of binders
α✝ : Type u
β : Type v
γ : Type w
r : α✝ → α✝ → Prop
α : Type u_1
A B : LinearOrder α
H : ∀ (x y : α), x ≤ y ↔ x ≤ y
⊢ A = B

These didn't look trivial to fix, so I thought it would it would make sense to land this with the comment instead.
I'll look into fixing them...

@dwrensha dwrensha changed the title chore(Data/List/Basic): uncomment cons_injective and cons_inj chore: uncomment cons_injective and cons_inj in Data/List/Basic.lean Aug 22, 2022
bors bot pushed a commit that referenced this pull request Aug 22, 2022
In mathlib3, [`function.injective`](https://github.com/leanprover-community/lean/blob/4b58f26becf336a50cf037c3e2894b6f2938956e/library/init/function.lean#L73) is not reducible, so `Function.injective` should not be reducible here either.

To avoid errors in `Order/Basic` ("@[ext] attribute only applies to structures or lemmas proving x = y"), we need to adjust `extAttribute` too.

Fixes some problems seen in #372.
@gebner
Copy link
Copy Markdown
Member

gebner commented Aug 22, 2022

bors r+

@bors
Copy link
Copy Markdown

bors bot commented Aug 22, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title chore: uncomment cons_injective and cons_inj in Data/List/Basic.lean [Merged by Bors] - chore: uncomment cons_injective and cons_inj in Data/List/Basic.lean Aug 22, 2022
@bors bors bot closed this Aug 22, 2022
@dwrensha dwrensha deleted the list-basic branch August 22, 2022 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants