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] - chore(Data/Finsupp/Fin): add Finsupp.cons_support #10192

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Mathlib/Data/Finsupp/Fin.lean
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,11 @@ theorem cons_ne_zero_iff : cons y s ≠ 0 ↔ y ≠ 0 ∨ s ≠ 0 := by
rw [h', c, Finsupp.cons_zero_zero]
#align finsupp.cons_ne_zero_iff Finsupp.cons_ne_zero_iff

lemma cons_support : (s.cons y).support ⊆ insert 0 (s.support.map (Fin.succEmb n).toEmbedding) := by
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 a similar lemma about Fin.cons? IMHO, lemmas about Finsupp.cons should be mod_cast (lemma about Fin.cons), if possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

What would the lemma about Fin.cons be? The ingredients in the statement seem quite Finsupp-specific.

intro i hi
suffices i = 0 ∨ ∃ a, ¬s a = 0 ∧ a.succ = i by simpa
apply (Fin.eq_zero_or_eq_succ i).imp id (Exists.imp _)
rintro i rfl
simpa [Finsupp.mem_support_iff] using hi

end Finsupp
Loading