-
Notifications
You must be signed in to change notification settings - Fork 839
feat(Analysis/SpecialFunctions/Log): log_prod for Multiset #30681
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?
feat(Analysis/SpecialFunctions/Log): log_prod for Multiset #30681
Conversation
PR summary d95168ed4dImport changes for modified filesNo significant changes to the import graph Import changes for all files
Declarations diff
You can run this locally as follows## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit> The doc-module for No changes to technical debt.You can run this locally as
|
log (∏ i ∈ s, f i) = ∑ i ∈ s, log (f i) := by | ||
induction s using Finset.cons_induction_on with | ||
open Multiset in | ||
lemma log_prod' {α : Type*} {s : Multiset α} {f : α → ℝ} (hf : ∀ x ∈ s, f x ≠ 0) : |
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.
I am pretty sure the convention is that the bla_prod
lemma refers to finsets (as here), and the multiset version is called something like bla_multiset_prod
.
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.
Could you add the List
version while you're at it? The multiset version should be provable in one or two lines in terms of it.
induction s using Finset.cons_induction_on with | ||
open Multiset in | ||
lemma log_prod' {α : Type*} {s : Multiset α} {f : α → ℝ} (hf : ∀ x ∈ s, f x ≠ 0) : | ||
log (s.map f).prod = (s.map (fun x ↦ log (f x))).sum := 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.
Or should this be the simpler
log (s.map f).prod = (s.map (fun x ↦ log (f x))).sum := by | |
log s.prod = (s.map log).sum := by |
We add
which generalizes