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(data/finsupp/basic): add support_nonempty_iff and nonzero_iff_exists #6530

Closed
wants to merge 1 commit into from

Conversation

adomani
Copy link
Collaborator

@adomani adomani commented Mar 4, 2021

Add two lemmas to work with finsupps with non-empty support.

Zulip:
https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/finsupp.2Enonzero_iff_exists


@adomani adomani added the awaiting-review The author would like community review of the PR label Mar 4, 2021
Copy link
Collaborator

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

bors r+

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Mar 4, 2021
Comment on lines +153 to +154
lemma nonzero_iff_exists {f : α →₀ M} : f ≠ 0 ↔ ∃ a : α, f a ≠ 0 :=
by simp [finsupp.support_eq_empty.symm, finset.eq_empty_iff_forall_not_mem]
Copy link
Member

Choose a reason for hiding this comment

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

Do we have this statement somewhere?

lemma pi.nonzero_iff_exists {f : α → M} : f ≠ 0 ↔ ∃ a : α, f a ≠ 0 :=
sorry

Copy link
Member

Choose a reason for hiding this comment

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

And also add_monoid_hom.nonzero_iff_exists, monoid_hom.nonzero_iff_exists, ring_hom.nonzero_iff_exists, linear_map.nonzero_iff_exists, alg_hom.nonzero_iff_exists, ...

Copy link
Member

Choose a reason for hiding this comment

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

This is #4985 all over again, of course.

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 do not know if these are there, but if you do not know about them, then I doubt it!

In any case, I do not know what the namespace pi stands for: is it a synonym for set?

Copy link
Member

Choose a reason for hiding this comment

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

pi is the type of dependent functions - both of these can be thought of as pi types:

variables (α : Sort*) (β : α → Sort*) (γ : Sort*)
#check (Π a, β a)
#check (Π a : α, γ) -- aka α → γ

Mathlib is inconsistent when it comes to using the pi and function namespaces.

Copy link
Member

Choose a reason for hiding this comment

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

Note that if you prove the pi version, finsupp.nonzero_iff_exists becomes simply coe_fn_injective.eq_iff.trans the_pi_version, possibly with some .symms

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Eric, thank you for explaining the pi stuff!

While I understand that these pi lemmas should be there as well, I am not sure that I am willing to risk another growth of this PR like what happened in the past! Would it be ok if I left it at that? Maybe this issue can go in a TODO list?

Copy link
Member

Choose a reason for hiding this comment

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

Definitely no need to grow this PR :)

bors bot pushed a commit that referenced this pull request Mar 4, 2021
@bors
Copy link

bors bot commented Mar 4, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(data/finsupp/basic): add support_nonempty_iff and nonzero_iff_exists [Merged by Bors] - feat(data/finsupp/basic): add support_nonempty_iff and nonzero_iff_exists Mar 4, 2021
@bors bors bot closed this Mar 4, 2021
@bors bors bot deleted the finsupp.support_nonempty_iff_2 branch March 4, 2021 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants