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: Add proof to proof_wanted theorems of Array get?_size and get?_push #412

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

casavaca
Copy link
Contributor

@casavaca casavaca commented Dec 1, 2023

No description provided.

Comment on lines 98 to 102
· 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)
Copy link
Collaborator

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.

Copy link
Collaborator

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.)

Copy link
Collaborator

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?

Copy link
Contributor Author

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?

Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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

Copy link
Collaborator

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 :-)

@fgdorais fgdorais added the awaiting-review This PR is ready for review; the author thinks it is ready to be merged. label Dec 2, 2023
@joehendrix joehendrix added will-merge-soon PR will be merged soon. Any concerns should be raised quickly. and removed awaiting-review This PR is ready for review; the author thinks it is ready to be merged. labels Dec 4, 2023
@digama0 digama0 merged commit 1f24793 into leanprover-community:main Dec 4, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
will-merge-soon PR will be merged soon. Any concerns should be raised quickly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants