Skip to content

Conversation

@shaazib-tanvir
Copy link

No description provided.

@shaazib-tanvir shaazib-tanvir mentioned this pull request Jan 8, 2026
Copy link
Collaborator

@datokrat datokrat left a 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! :)

Comment on lines +50 to +62
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
Copy link
Collaborator

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:

Suggested change
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]

Comment on lines +21 to +22
theorem List.sum_append (xs : List Int) (ys : List Int)
: sum (xs ++ ys) = sum xs + sum ys := by
Copy link
Collaborator

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:

Suggested change
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

Comment on lines +32 to +33
theorem List.product_append (xs : List Int) (ys : List Int)
: product (xs ++ ys) = product xs * product ys := by
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly:

Suggested change
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants