Skip to content
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

[Merged by Bors] - feat(Algebra/BigOperators/Order): prod_lt_prod #7844

Closed
wants to merge 3 commits into from

Conversation

FLDutchmann
Copy link
Collaborator

Add a product variant of mul_lt_mul, following the pattern of Finset.prod_lt_prod'. This fills in a gap between Finset.prod_le_prod, Finset.prod_le_prod' and Finset.prod_lt_prod'.


Open in Gitpod

@FLDutchmann FLDutchmann added awaiting-review The author would like community review of the PR awaiting-CI t-algebra Algebra (groups, rings, fields etc) labels Oct 22, 2023
variable [StrictOrderedCommSemiring R] [Nontrivial R] {f : ι → R} {s : Finset ι}
variable [StrictOrderedCommSemiring R] {f : ι → R} {s : Finset ι}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nontrivial is implied by StrictOrderedCommSemiring

Copy link
Member

@fpvandoorn fpvandoorn left a comment

Choose a reason for hiding this comment

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

LGTM

two suggestions, if you think they're useful.


-- This is also true for an ordered commutative multiplicative monoid with zero
theorem prod_pos (h0 : ∀ i ∈ s, 0 < f i) : 0 < ∏ i in s, f i :=
prod_induction f (fun x ↦ 0 < x) (fun _ _ ha hb ↦ mul_pos ha hb) zero_lt_one h0
#align finset.prod_pos Finset.prod_pos

theorem prod_lt_prod {t : Finset ℕ} {f g : ℕ → R} (hf : ∀ i ∈ t, 0 < f i)
(hfg : ∀ i ∈ t, f i ≤ g i) (hlt : ∃ i ∈ t, f i < g i) :
∏ i in t, f i < ∏ i in t, g i := by
Copy link
Member

Choose a reason for hiding this comment

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

I think this lemma could be a bit more useful as an iff: ∏ i in t, f i < ∏ i in t, g i ↔ ∃ i ∈ t, f i < g i

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I could see this being nicer, but surely we'd want to be consistent with Finset.prod_lt_prod'. In my mind we could either

  1. Leave it as is
  2. change prod_lt_prod' too and fix any breakage
  3. also add this variant as prod_lt_prod_iff (and prod_lt_prod_iff')
  4. let the two be inconsistent.

In my mind 1 or 3 seem preferable but I'd love to know what others think.


theorem prod_lt_prod_of_nonempty {t : Finset ℕ} {f g : ℕ → R} (hf : ∀ i ∈ t, 0 < f i)
(hfg : ∀ i ∈ t, f i < g i) (h_ne : t.Nonempty) :
∏ i in t, f i < ∏ i in t, g i := by
Copy link
Member

Choose a reason for hiding this comment

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

maybe ∏ i in t, f i < ∏ i in t, g i ↔ t.Nonempty

@fpvandoorn
Copy link
Member

I'm fine with both options 1 and 3. Let's merge this now, and feel free to open a new PR doing 3.

bors merge

@bors
Copy link

bors bot commented Oct 25, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat(Algebra/BigOperators/Order): prod_lt_prod [Merged by Bors] - feat(Algebra/BigOperators/Order): prod_lt_prod Oct 25, 2023
@bors bors bot closed this Oct 25, 2023
@bors bors bot deleted the arend/prod_lt_prod branch October 25, 2023 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants