feat: add List.prod, Array.prod, and Vector.prod#13200
Open
kim-em wants to merge 1 commit intoleanprover:masterfrom
Open
feat: add List.prod, Array.prod, and Vector.prod#13200kim-em wants to merge 1 commit intoleanprover:masterfrom
List.prod, Array.prod, and Vector.prod#13200kim-em wants to merge 1 commit intoleanprover:masterfrom
Conversation
This PR adds `prod` (multiplicative fold) for `List`, `Array`, and `Vector`, mirroring the existing `sum` API. Includes basic simp lemmas (`prod_nil`, `prod_cons`, `prod_append`, `prod_singleton`, `prod_reverse`, `prod_push`, `prod_eq_foldl`), Nat-specialized lemmas (`prod_pos_iff_forall_pos_nat`, `prod_eq_zero_iff_exists_zero_nat`, `prod_replicate_nat`), Int-specialized lemmas (`prod_replicate_int`), cross-type lemmas (`prod_toArray`, `prod_toList`), and `Perm.prod_nat` with grind patterns. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
TwoFX
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds
prod(multiplicative fold) forList,Array, andVector, mirroring the existingsumAPI. Includes basic simp lemmas (prod_nil,prod_cons,prod_append,prod_singleton,prod_reverse,prod_push,prod_eq_foldl), Nat-specialized lemmas (prod_pos_iff_forall_pos_nat,prod_eq_zero_iff_exists_zero_nat,prod_replicate_nat), Int-specialized lemmas (prod_replicate_int), cross-type lemmas (prod_toArray,prod_toList), andPerm.prod_natwith grind patterns.The min/max pigeonhole-style bounds from the
sumNat/Int files are omitted as they don't have natural multiplicative analogues.🤖 Prepared with Claude Code