-
Notifications
You must be signed in to change notification settings - Fork 9
HumanEval155 #165
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
HumanEval155 #165
Conversation
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.
How about a theorem that expresses evenOddCount (10 * n + d) in terms of evenOddCount n and d % 2?
|
@TwoFX Do you mean something like this? instance : Add (Nat × Nat) where
add | (l₁, r₁), (l₂, r₂) => (l₁ + l₂, r₁ + r₂)
instance : Sub (Nat × Nat) where
sub | (l₁, r₁), (l₂, r₂) => (l₁ - l₂, r₁ - r₂)
theorem evenOddCount_decompose :
evenOddCount (10 * n + d) = evenOddCount n + evenOddCount (d % 10) :=
sorry |
|
@marcusrossel I guess I was thinking of theorem evenOddCount_decompose {n : Int} {d : Nat} (hd : d < 10) :
evenOddCount (10 * n + d) = evenOddCount n + (d % 2, 1 - d % 2) :=
sorry |
|
@TwoFX this PR will again depend on another PR (to batteries), as I added some material to batteries which I use in this PR. I'm guessing it might be somewhat common to add theorems to core/std/batteries when solving tasks in this repo. Would it therefore be possible to add labels like |
As stated in the readme, this project will not have Batteries as a dependency, as the idea is to test out Lean's out-of-the-box experience. The fact that the lemmas are missing from core important to document! Not making any promises regarding the timeline, but the FRO will periodically be looking at the files in this repo to see which general lemmas people had to prove themselves and extend the standard library to cover these use cases. So while I think it's good that you have made the Batteries PR, I would suggest you just copy the lemmas you need into your file with a comment explaining that they are part of Batteries. I will clarify the readme to explain this.
This a good idea! Will do. |
Unfortunately this comes with the caveat that either the given theorems need to be Other than that, all theorems in this PR are now completed. |
This is a fair point. In #176 I have added an axiom If the proofs can be copy-pasted without having to redo them, I still think that copying them is better. |
|
Turns out I didn't need to |
TwoFX
left a comment
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.
Very nice, thanks!
Any ideas for other theorems?