-
Notifications
You must be signed in to change notification settings - Fork 89
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: Add proof to proof_wanted theorems of Array get?_size and get?_push #412
Conversation
Std/Data/Array/Lemmas.lean
Outdated
· next hne => simp only [getElem?, size_push] | ||
split <;> split <;> try simp only [*, get_push_lt] | ||
· next p q => have tmp := Nat.le_of_lt_succ p | ||
apply Or.elim (Nat.eq_or_lt_of_le tmp) <;> assumption | ||
· next p q => exact p (Nat.lt.step q) |
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.
Please just two extra space when adding indenting: no need to line up with anything on the previous line.
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.
(Newlines immediately after =>
are also good.)
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.
Is that really a good simp lemma, with the if-then-else on the other side? It kinda blows up the term.
My (incomplete, tainted by Isabelle's simp) intuition is that you'd want the conditional two lemmas above as simp lemmas, if any at all?
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.
Here, trichotomy of Nat is needed, but it's tricky to derive that from very limited theorems from lean4 itself.
Thus, I just called split
all the way and then looked for contradictions.
Only split / simp only / exact / rw are used. So, it won't blow up the term, right?
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.
Sorry, I wasn't clear, I'm wondering if the @[simp]
annotation is a good default
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.
I see. I have no idea about that.
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.
In that case maybe just leave it out in this PR
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.
Sorry, I misread the diff, the @[simp]
is on the, well, simpler theorem. All good then :-)
No description provided.