Skip to content

Commit

Permalink
chore(Data/Finsupp/Fin): add Finsupp.cons_support (#10192)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcommelin authored and atarnoam committed Feb 9, 2024
1 parent 9860584 commit 555effe
Showing 1 changed file with 7 additions and 0 deletions.
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
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

0 comments on commit 555effe

Please sign in to comment.