-
Notifications
You must be signed in to change notification settings - Fork 87
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: Remove ext
attribute on Rat
#611
Conversation
awaiting-review |
Could you summarize the Zulip discussion here? |
The discussion was essentially that In the specific case, calling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved after minor change.
In the process of fixing Thus, I propose to add also this lemma, but not tagging it with theorem Rat.ext (p q : ℚ) (hn : p.num = q.num) (hd : p.den = q.den) : p = q := by
cases p; cases q; subst hn hd; rfl If this is reasonable, then I will add it to this PR. Also, the proof of I am happy to do a pre-emptive PR to Mathlib to make explicit use of the |
Yes, please add the manual |
Does it work to use |
@digama0,
|
sorry, the syntax is |
@digama0 I'll try it, but tomorrow, although I'm sure that it will work, since you suggested it! I imagine that this means to revert all the remaining changes, right? |
I think Mario meant the file on Mathlib, not this file. Could you unrevert the changes? |
No I did mean to use |
But the generated @[local ext] theorem Rat.ext : {p q : Rat} → p.num = q.num → p.den = q.den → p = q
| ⟨_,_,_,_⟩, ⟨_,_,_,_⟩, rfl, rfl => rfl The changes Damiano had made were all simplifications of the original and ultimately showed that this ext lemma is not necessary even in this file. |
in that case we should fix |
Yes, it's an issue in |
I still don't want to lose the simpler ext-free proofs that Damiano had proposed. |
Also, as far as I understand, the reason there was no need to use |
In addition to the sub-optimal binders, there is another bug in |
I don't want this PR to depend on fixing @[local ext] theorem Rat.ext : {p q : Rat} → p.num = q.num → p.den = q.den → p = q
| ⟨_,_,_,_⟩, ⟨_,_,_,_⟩, rfl, rfl => rfl at the top of the lemma file is the best option. In the future, this should be replaced by |
Std/Data/Rat/Lemmas.lean
Outdated
@@ -11,6 +11,8 @@ import Std.Tactic.SeqFocus | |||
|
|||
namespace Rat | |||
|
|||
attribute [local ext] Rat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This currently doesn't work as intended. See #618.
@fgdorais I agree with you: in a file that imports another one containing @digama0 I can revert this PR to its original form, where I had simply removed the |
Following this discussion, I would like to remove the
ext
attribute fromRat
.This is my first Std PR: I hope that I am doing things correctly!