Skip to content

[Merged by Bors] - feat: a product of indicators is the indicator of the product#17964

Closed
YaelDillies wants to merge 4 commits intomasterfrom
prod_indicator
Closed

[Merged by Bors] - feat: a product of indicators is the indicator of the product#17964
YaelDillies wants to merge 4 commits intomasterfrom
prod_indicator

Conversation

@YaelDillies
Copy link
Copy Markdown
Contributor


Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 20, 2024

PR summary a16521e9bd

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.Algebra.BigOperators.Pi 532 534 +2 (+0.38%)
Import changes for all files
Files Import difference
Mathlib.Algebra.Order.Star.Conjneg Mathlib.Algebra.Star.Conjneg 1
Mathlib.Algebra.BigOperators.Pi 2

Declarations diff

+ mem_inf'
+ mem_sup'
+ prod_indicator
+ prod_indicator_apply
+ prod_indicator_const
+ prod_indicator_const_apply
+ prod_sub

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 script/declarations_diff.sh contains some details about this script.

@YaelDillies YaelDillies added the t-algebra Algebra (groups, rings, fields, etc) label Oct 20, 2024
Authors: Simon Hudon, Patrick Massot
-/
import Mathlib.Algebra.BigOperators.Group.Finset
import Mathlib.Algebra.BigOperators.GroupWithZero.Finset
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I was gonna ask Yaël if this was okay, but I guess it is 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Algebra.BigOperators.Pi hasn't yet been split up according to Group/GroupWithZero/Ring, so I just don't care yet 😁

@Ruben-VandeVelde Ruben-VandeVelde added the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 27, 2024
@Ruben-VandeVelde
Copy link
Copy Markdown
Contributor

(No need to block on me giving this another look)

@YaelDillies YaelDillies removed the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 27, 2024
· obtain ⟨i, hi, hj⟩ := by simpa using hj
exact Finset.prod_eq_zero hi <| Set.indicator_of_not_mem hj _

lemma prod_indicator (s : Finset ι) (f : ι → Set κ) (g : ι → κ → α) :
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you also add the version of this where f is constant (for rewrite chains, so the rhs is nice)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you did the g constant one instead... Oh well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh sorry! But the constant f version already has other lemmas for it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, where are they?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually looks like we have Finset.indicator_sum and Finset.mulIndicator_prod, but not Finset.indicator_prod.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you elaborate on this? The commented line does contain the statement. It includes f, in particular it includes the f which I wanted you to make constant. Is there a reason that g is more noticeable here than f?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I mean, my advice above is a general advice. But here specifically I thought "Ah! Bhavik wants me to make the function constant" and I didn't think of f as the function (because it's set-valued) but g instead (because it's function-valued)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm still not quite sure I follow. The line I highlighted was a deliberate choice, because it's where f is declared. The function f is a set-valued function, which is the one I wanted you to make constant. What would you have preferred here? Is there a way you'd prefer me to refer to a function other than by its name and pointing to the place where it's declared?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, you can comment on all the lines of the statement. Here L. 75-76. Multiline comments have been available on github for the past 2-3 years or so

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to clarify, your advice here is that it's less ambiguous to refer to changing the type of a function if I additionally highlight things which are not the type of the function? And that referring to an input f by its name and declaration line is not sufficiently clear, and you'd prefer seeing things other than inputs in a suggestion to amend an input?
Can you clarify why you'd prefer this? And could you explain where the ambiguity arises, for my future reference? If there is a way to refer to a variable in a lemma by something other than its name and type, I would be very happy to hear it.
I appreciate the information about multiline comments on github, indeed I have been using them for the last 4-5 years or so.

Copy link
Copy Markdown
Contributor

@b-mehta b-mehta left a comment

Choose a reason for hiding this comment

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

bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Oct 27, 2024

✌️ YaelDillies can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@ghost ghost added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Oct 27, 2024
@b-mehta b-mehta added awaiting-author A reviewer has asked the author a question or requested changes. and removed delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). labels Oct 27, 2024
@YaelDillies YaelDillies removed the awaiting-author A reviewer has asked the author a question or requested changes. label Oct 27, 2024
@YaelDillies
Copy link
Copy Markdown
Contributor Author

bors merge

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Oct 27, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: a product of indicators is the indicator of the product [Merged by Bors] - feat: a product of indicators is the indicator of the product Oct 27, 2024
@mathlib-bors mathlib-bors bot closed this Oct 27, 2024
@mathlib-bors mathlib-bors bot deleted the prod_indicator branch October 27, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-algebra Algebra (groups, rings, fields, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants