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: the nth symmetric power is equivalent to maps of total mass n. #11360

Closed
wants to merge 4 commits into from

Conversation

ocfnash
Copy link
Contributor

@ocfnash ocfnash commented Mar 13, 2024


Open in Gitpod

@ocfnash ocfnash added awaiting-review The author would like community review of the PR awaiting-CI t-combinatorics Combinatorics labels Mar 13, 2024
Comment on lines 287 to 289
noncomputable def equivNatSumOfFintype [Fintype α] :
Sym α n ≃ {P : α → ℕ // ∑ i, P i = n} :=
(equivNatSum α n).trans <| (Finsupp.equivFunOnFinite.image _).trans <| Equiv.Set.ofEq <| by
Copy link
Member

Choose a reason for hiding this comment

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

If you pass this through DFinsupp.equivFunOnFintype and Finsupp.toDFinsupp, then it would be computable, which is nice for #eval

Copy link
Contributor Author

@ocfnash ocfnash Mar 13, 2024

Choose a reason for hiding this comment

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

If it could be rendered computable for free I would do it, but I think even the low price of having to depend on DFinsupp.equivFunOnFintype (incidentally not imported in this file) makes it not worth it for me (especially as it's really just accident that we have computable DFinsupp.equivFunOnFintype and noncomputable Finsupp.equivFunOnFinite).

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps the better resolution here is to have a Multiset.countEquiv or similar that is the Fintype analog to Multiset.toFinsupp, with a nice defeq for the summation. I'll let you decide if that sounds out of scope

bors d+

Copy link
Contributor Author

@ocfnash ocfnash Mar 14, 2024

Choose a reason for hiding this comment

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

I guess we should probably have this somewhere:

def Multiset.countAddEquiv (α : Type*) [Fintype α] [DecidableEq α] :
    Multiset α ≃+ (α → ℕ) where
  toFun s := s.count
  invFun P := ∑ a, P a • {a}
  map_add' s t := by ext; simp
  left_inv s := by
    ext a
    change count a (sum _) = _
    rw [count_sum]
    simp [count_singleton]
  right_inv P := by
    ext a
    change count a (sum _) = _
    rw [count_sum]
    simp [count_singleton]

I'll try to come back to this (in a separate PR).

ocfnash and others added 2 commits March 13, 2024 21:19
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@mathlib-bors
Copy link

mathlib-bors bot commented Mar 13, 2024

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

The `simps`-generated lemma is rejected by the linter because it
generates a LHS which is simplified by `Sym.val_eq_coe`.
@ocfnash
Copy link
Contributor Author

ocfnash commented Mar 14, 2024

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Mar 14, 2024
…n`. (#11360)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Mar 14, 2024
@mathlib-bors
Copy link

mathlib-bors bot commented Mar 14, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: the nth symmetric power is equivalent to maps of total mass n. [Merged by Bors] - feat: the nth symmetric power is equivalent to maps of total mass n. Mar 14, 2024
@mathlib-bors mathlib-bors bot closed this Mar 14, 2024
@mathlib-bors mathlib-bors bot deleted the ocfnash/sym_equiv branch March 14, 2024 12:16
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
…n`. (#11360)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
utensil pushed a commit that referenced this pull request Mar 26, 2024
…n`. (#11360)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Louddy pushed a commit that referenced this pull request Apr 15, 2024
…n`. (#11360)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
uniwuni pushed a commit that referenced this pull request Apr 19, 2024
…n`. (#11360)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
callesonne pushed a commit that referenced this pull request Apr 22, 2024
…n`. (#11360)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
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-combinatorics Combinatorics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants