-
Notifications
You must be signed in to change notification settings - Fork 9
HumanEval8 #206
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
base: master
Are you sure you want to change the base?
HumanEval8 #206
Conversation
datokrat
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.
Thanks for your help! :)
| case vc1.step pref x suff h' result hi => | ||
| obtain ⟨ hi₀, hi₁⟩ := hi | ||
| constructor | ||
| rw [hi₀, List.sum_append] | ||
| change List.sum pref + x = List.sum pref + (x + 0) | ||
| omega | ||
| rw [hi₁, List.product_append] | ||
| change List.product pref * x = List.product pref * (x * 1) | ||
| rw [Int.mul_one] | ||
| case vc3.a.post.success result h' => | ||
| obtain ⟨ left, right ⟩ := h' | ||
| rw [left, right] | ||
| rfl |
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.
If you want, you could also use grind, which saves you some of the annoying manual changes:
| case vc1.step pref x suff h' result hi => | |
| obtain ⟨ hi₀, hi₁⟩ := hi | |
| constructor | |
| rw [hi₀, List.sum_append] | |
| change List.sum pref + x = List.sum pref + (x + 0) | |
| omega | |
| rw [hi₁, List.product_append] | |
| change List.product pref * x = List.product pref * (x * 1) | |
| rw [Int.mul_one] | |
| case vc3.a.post.success result h' => | |
| obtain ⟨ left, right ⟩ := h' | |
| rw [left, right] | |
| rfl | |
| case vc1.step pref x suff h' result hi => | |
| rw [List.sum_append, List.product_append] | |
| grind [List.product] | |
| case vc3.a.post.success result h' => | |
| grind [sumProduct] |
| theorem List.sum_append (xs : List Int) (ys : List Int) | ||
| : sum (xs ++ ys) = sum xs + sum ys := by |
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 is just a very minor remark, but in this repository we usually put the colon at the end of the line:
| theorem List.sum_append (xs : List Int) (ys : List Int) | |
| : sum (xs ++ ys) = sum xs + sum ys := by | |
| theorem List.sum_append (xs : List Int) (ys : List Int) : | |
| sum (xs ++ ys) = sum xs + sum ys := by |
| theorem List.product_append (xs : List Int) (ys : List Int) | ||
| : product (xs ++ ys) = product xs * product ys := by |
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.
Similarly:
| theorem List.product_append (xs : List Int) (ys : List Int) | |
| : product (xs ++ ys) = product xs * product ys := by | |
| theorem List.product_append (xs : List Int) (ys : List Int) : | |
| product (xs ++ ys) = product xs * product ys := by |
No description provided.