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/{finset,finsupp,multiset}): more assorted lemmas #4006

Closed
wants to merge 247 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
247 commits
Select commit Hold shift + click to select a range
f8b72d9
Fixing a bunch of easy errors
jcommelin May 7, 2020
4394942
WIP
jcommelin May 7, 2020
65bdaef
WIP
jcommelin May 7, 2020
cdab689
Almost compiling again
jcommelin May 7, 2020
e30645b
WIP
jcommelin May 8, 2020
dfd0ea3
Fixing a bunch of easy errors
jcommelin May 7, 2020
aa89fa9
WIP
jcommelin May 7, 2020
281256d
WIP
jcommelin May 7, 2020
9560ead
Almost compiling again
jcommelin May 7, 2020
6dcfd57
WIP
jcommelin May 8, 2020
44ccd7e
WIP
jcommelin May 12, 2020
6fe53ae
Comment out stuff that is now in mathlib
jcommelin May 12, 2020
5d67587
Merge branch 'witt-vectors2' of github.com:leanprover-community/mathl…
jcommelin May 12, 2020
7654579
Merge branch 'master' into witt-vectors2
jcommelin May 19, 2020
091e47f
WIP
jcommelin May 19, 2020
d9206ac
Merge branch 'master' into witt-vectors2
jcommelin May 21, 2020
0c9ee51
WIP
jcommelin May 21, 2020
e4553bc
Merge branch 'master' into witt-vectors2
jcommelin May 28, 2020
ce6cb6e
Merge branch 'master' into witt-vectors2
jcommelin May 28, 2020
aebec4b
WIP
jcommelin May 29, 2020
5ad3676
Hooray\! The hard part compiles again\!
jcommelin May 30, 2020
ce7c469
clean up lots of ugly dead code
jcommelin May 30, 2020
fc70754
Witt vectors are a ring again!
jcommelin May 30, 2020
a3f9813
Merge branch 'master' into witt-vectors2
jcommelin Jun 1, 2020
b00e0a3
Bunch of cleanups
jcommelin Jun 1, 2020
99efd43
WIP
jcommelin Jun 1, 2020
8d80d66
chore(data/mv_polynomial): swap the order of mv_polynomial.ext_iff
jcommelin Jun 1, 2020
ee243c2
More cleanup, and also merge branch 'mv-poly-ext-iff' into witt-vectors2
jcommelin Jun 1, 2020
864eb19
Minor changes
jcommelin Jun 1, 2020
ff30075
Yet more clean up
jcommelin Jun 1, 2020
b2f090e
Prove Teichmuller_mul
jcommelin Jun 1, 2020
aef0d90
Little cleanups
jcommelin Jun 2, 2020
5b66452
Merge branch 'master' into witt-vectors2
jcommelin Jun 2, 2020
238b651
WIP
jcommelin Jun 3, 2020
d33a674
Merge branch 'master' into witt-vectors2
jcommelin Jun 3, 2020
12a009f
Cleanup things that are now in mathlib
jcommelin Jun 3, 2020
e9279d6
More abstraction
jcommelin Jun 4, 2020
3946411
Merge branch 'master' into witt-vectors2
jcommelin Jun 6, 2020
48345d9
WIP
jcommelin Jun 6, 2020
09ac1af
trivial
jcommelin Jun 8, 2020
d6ee2e1
Merge branch 'master' into witt-vectors2
jcommelin Jul 20, 2020
f03e5bb
fix build, mostly
jcommelin Jul 20, 2020
7cbae02
Merge branch 'master' into witt-vectors2
jcommelin Jul 21, 2020
9608140
Generalize preps to semirings, speedup, fix bug
jcommelin Jul 21, 2020
c142c03
dead/pred code
robertylewis Jul 21, 2020
7e08f49
Start on witt_package
jcommelin Jul 21, 2020
99e735c
Use tactic macro
jcommelin Jul 21, 2020
1782921
Merge remote-tracking branch 'blessed/master' into witt-vectors2
robertylewis Jul 21, 2020
7080d65
merge master, remove aeval mess
robertylewis Jul 21, 2020
26bd3fb
WIP
jcommelin Jul 22, 2020
6824032
Merge remote-tracking branch 'blessed/master' into witt-vectors2
robertylewis Jul 24, 2020
efd0e24
generalize alg_hom_ext
robertylewis Jul 24, 2020
bb38062
add general add_monoid_algebra.alg_hom_ext
robertylewis Jul 24, 2020
af6b17e
mv_polynomial.{ring,alg}_hom_ext
robertylewis Jul 24, 2020
e20db58
updates
robertylewis Jul 24, 2020
bd2985a
Merge remote-tracking branch 'blessed/master' into witt-vectors2
robertylewis Aug 2, 2020
7514f18
Merge branch 'master' into witt-vectors2
jcommelin Aug 8, 2020
395fa70
Fix the preps file
jcommelin Aug 8, 2020
46493e3
Fix main witt vector file
jcommelin Aug 8, 2020
4a036d6
clean up unused prime arguments
robertylewis Aug 13, 2020
7233f17
Still inexplicably slow... timeouts
jcommelin Aug 17, 2020
c2bae34
Stuff still times out
jcommelin Aug 17, 2020
2824771
Now it's ok
jcommelin Aug 17, 2020
95e554d
messy wip on Z dense in Z_p
robertylewis Aug 17, 2020
cf01965
wip
jcommelin Aug 18, 2020
ef40313
wip
jcommelin Aug 18, 2020
7ef5311
Merge branch 'master' into witt-vectors2
jcommelin Aug 18, 2020
1ea5055
wip
jcommelin Aug 18, 2020
5751d3c
wip
jcommelin Aug 18, 2020
f27ad1b
fill sorry
robertylewis Aug 18, 2020
fa85de0
wip
jcommelin Aug 18, 2020
4703194
victory (for now)
jcommelin Aug 18, 2020
bc01f19
Hooray (for now)
jcommelin Aug 18, 2020
519147b
move lemmas and clean up
robertylewis Aug 18, 2020
32d3b26
We have a ring hom to zmod
jcommelin Aug 18, 2020
4c5be82
Merge remote-tracking branch 'blessed/witt-merge-conflict' into witt-…
robertylewis Aug 18, 2020
43bfc17
fix
robertylewis Aug 18, 2020
934bdb9
little cleanup
robertylewis Aug 18, 2020
4352066
Cleanup
jcommelin Aug 18, 2020
9624e88
docs
robertylewis Aug 18, 2020
de01786
temporary hacks to quiet witt_package
robertylewis Aug 18, 2020
ce0856b
foobar
jcommelin Aug 18, 2020
7415aae
preliminary work on foobar_spec
robertylewis Aug 18, 2020
e4e22f8
foobar_lt
jcommelin Aug 18, 2020
81ead88
quux
jcommelin Aug 18, 2020
3af1821
close?
robertylewis Aug 18, 2020
655c331
congr lemmas
jcommelin Aug 18, 2020
b56200c
finally
robertylewis Aug 18, 2020
48d3b18
fill in sorries
jcommelin Aug 19, 2020
d667c4e
micro-cleanup
jcommelin Aug 19, 2020
48a9f94
probably useless attempts at ring hom lemmas
robertylewis Aug 19, 2020
a51b21e
maps to zmod (p ^ n), 1 sorry left
jcommelin Aug 20, 2020
fc47677
sorry-free
robertylewis Aug 20, 2020
92352f4
exit in witt-package to shut up ci
robertylewis Aug 20, 2020
5ea768e
start cleanup
robertylewis Aug 20, 2020
9197163
docs
robertylewis Aug 20, 2020
b7458f6
rename nth_appr to appr, flip it's arguments
jcommelin Aug 20, 2020
9a62a2b
lint
robertylewis Aug 20, 2020
4141125
syncing the proofs
jcommelin Aug 20, 2020
4c440ee
remove dup rules in zmod
robertylewis Aug 20, 2020
aed3b79
kernel lemmas
jcommelin Aug 20, 2020
0479e45
fix docstring
jcommelin Aug 20, 2020
97727a1
factor out ring hom construction
robertylewis Aug 20, 2020
bdf906f
lint
robertylewis Aug 20, 2020
b6731ea
renaming
robertylewis Aug 20, 2020
8cc3589
delete dead code
robertylewis Aug 20, 2020
c3e245b
tiny style fixes
robertylewis Aug 20, 2020
0ea81ca
tiny fixes
jcommelin Aug 21, 2020
457b9fe
towards a proof that to_zmod_pow homs are compatible
jcommelin Aug 21, 2020
3fa3ee9
Merge remote-tracking branch 'blessed/master' into witt-vectors2
robertylewis Aug 21, 2020
d2d393b
feat(order/rel_iso): a new definition of order_iso, using preorder in…
awainverse Aug 21, 2020
a64fa27
Bump master, uncomment code
jcommelin Aug 21, 2020
e79db07
sketch universal property
robertylewis Aug 24, 2020
196e5db
progress
robertylewis Aug 24, 2020
c4d0b9a
wip
jcommelin Aug 24, 2020
27bc4c4
wip
jcommelin Aug 24, 2020
ef59adf
finish sorry
robertylewis Aug 24, 2020
4f560b7
Merge branch 'witt-vectors2' of github.com:leanprover-community/mathl…
robertylewis Aug 24, 2020
590d960
cleanup
robertylewis Aug 24, 2020
b1a98f7
wip
jcommelin Aug 24, 2020
7fe0095
finish add
robertylewis Aug 24, 2020
c3845e8
wip
jcommelin Aug 24, 2020
8016978
aux lemma
robertylewis Aug 24, 2020
c9a8e0d
messy work
robertylewis Aug 24, 2020
dbb2001
wip
jcommelin Aug 25, 2020
5b5dd32
progress
robertylewis Aug 25, 2020
2de0838
one sorry down
robertylewis Aug 25, 2020
1646990
more
robertylewis Aug 25, 2020
e27bae7
wip
jcommelin Aug 25, 2020
b6fc07a
a total mess
robertylewis Aug 25, 2020
d95ab2a
wip
jcommelin Aug 25, 2020
00f048e
real progress
robertylewis Aug 25, 2020
05b301d
wip
jcommelin Aug 26, 2020
b7cee8a
sorry-free
jcommelin Aug 26, 2020
8f86b0a
wip
jcommelin Aug 26, 2020
2870252
merge master
jcommelin Aug 26, 2020
ebea309
cleanup, move things, rename, docstrings
jcommelin Aug 26, 2020
b821a42
more module docstring headers
jcommelin Aug 26, 2020
40e8f56
golf
robertylewis Aug 26, 2020
0a66886
fix section end
robertylewis Aug 26, 2020
b12ffe5
oops, fix
jcommelin Aug 26, 2020
f07fb94
factor ring homs into new file
robertylewis Aug 26, 2020
b9ce786
move text from one module doc to other (temp)
robertylewis Aug 26, 2020
938f436
Comment out witt_package.lean
jcommelin Aug 26, 2020
e2a5dbf
move witt stuff into a directory
jcommelin Aug 26, 2020
49685cb
renaming, docs
robertylewis Aug 26, 2020
f85b9f0
lint
robertylewis Aug 26, 2020
95389af
minor cleanup
robertylewis Aug 26, 2020
239c43c
basic module doc
robertylewis Aug 26, 2020
16a51a7
fix mathjax
robertylewis Aug 26, 2020
fd8ea5a
fix witt_vector import
robertylewis Aug 26, 2020
962db80
minor tweaks
jcommelin Aug 26, 2020
915c974
verschiebung
jcommelin Aug 26, 2020
6ac69dc
delete dead code
robertylewis Aug 27, 2020
18ee05b
wip
robertylewis Aug 27, 2020
75641b0
lots of moving
robertylewis Aug 27, 2020
55d5517
more moving
robertylewis Aug 27, 2020
97e4293
fix two proofs
robertylewis Aug 28, 2020
9fd7ccd
Restructuring
jcommelin Aug 28, 2020
2a9c99a
wip
jcommelin Aug 28, 2020
e7f93bb
teichmuller done
jcommelin Aug 28, 2020
c063cd0
improve ghost_boo
robertylewis Aug 28, 2020
1b91d40
fix sectioning mistake
robertylewis Aug 28, 2020
0aa8b5a
wip
jcommelin Aug 28, 2020
8f30fcc
improve verschiebung
jcommelin Aug 28, 2020
3aa8b72
statement using vars
jcommelin Aug 28, 2020
6b713c6
TODOs on vars
jcommelin Aug 29, 2020
22b25a2
fix blur'
jcommelin Aug 29, 2020
9d9ac40
some stuff on vars, witt_polynomial in terms of monomial
jcommelin Aug 29, 2020
6c260a1
fix build
jcommelin Aug 29, 2020
249c29d
use bind
jcommelin Aug 29, 2020
6578fc8
wip
jcommelin Aug 29, 2020
7c154ac
eval₂_hom_eq_constant_coeff_of_vars
jcommelin Aug 29, 2020
d70c696
fill in some sorrys
robertylewis Aug 30, 2020
fcd9d83
another down
robertylewis Aug 30, 2020
fda24af
a bit more
robertylewis Aug 30, 2020
9e7bffe
more sorries
robertylewis Aug 31, 2020
4d51f49
more sorries
robertylewis Aug 31, 2020
6111f90
wip
jcommelin Aug 31, 2020
0a39f82
progress
robertylewis Aug 31, 2020
24ea22a
remove repetition
robertylewis Aug 31, 2020
3ef2563
wip
robertylewis Aug 31, 2020
0d9d156
wip
jcommelin Aug 31, 2020
8522c1c
bit more
robertylewis Aug 31, 2020
d12e9f9
little bit
robertylewis Aug 31, 2020
e124db1
le_degrees_add
jcommelin Aug 31, 2020
2855d5c
another sorry gone
jcommelin Aug 31, 2020
0de4b70
remove check
jcommelin Aug 31, 2020
699b305
wip
jcommelin Aug 31, 2020
f860631
move stuff to mv_polynomial
robertylewis Aug 31, 2020
6267c1b
fix(set_theory/game): remove stray #lint introduced in #3939 (#3948)
TwoFX Aug 26, 2020
7b3e701
feat(finsupp/basic): add hom_ext (#3941)
kbuzzard Aug 26, 2020
2a8fe0c
chore(*): trivial golfing using dec_trivial tactic (#3949)
jcommelin Aug 26, 2020
7c9682e
feat(*/category/*): add coe_of simp lemmas (#3938)
semorrison Aug 26, 2020
e717944
feat(set/basic): additions to prod (#3943)
fpvandoorn Aug 26, 2020
0db8211
feat(ring_theory/noetherian): maximal among set iff Noetherian (#3846)
jalex-stark Aug 26, 2020
f58bb09
feat(ring_theory/bundled_subring): add bundled subrings (#3886)
kbuzzard Aug 26, 2020
7445585
feat(topology/algebra/ordered): conditions for a strictly monotone fu…
hrmacbeth Aug 26, 2020
4236a83
feat(ring_theory/ideal/basic): R/I is an ID iff I is prime (#3951)
kbuzzard Aug 26, 2020
2554b85
feat(algebra/category/*/limits): don't rely on definitions (#3873)
semorrison Aug 26, 2020
acc4bdf
feat(category_theory/adjunction): uniqueness of adjunctions (#3940)
b-mehta Aug 26, 2020
b545cbf
feat(algebra/big_operators): sum of two products (#3944)
fpvandoorn Aug 26, 2020
b77dc15
feat(data/fin): flesh out API for fin (#3769)
pechersky Aug 26, 2020
74beeb3
chore(scripts): update nolints.txt (#3954)
leanprover-community-bot Aug 27, 2020
f39bfb2
refactor(analysis/normed_space/real_inner_product,geometry/euclidean)…
jsm28 Aug 27, 2020
795216b
feat(combinatorics/adjacency_matrix): defines adjacency matrices of s…
jalex-stark Aug 27, 2020
b5c74e3
feat(data/nat): commutativity of bitwise operations (#3956)
TwoFX Aug 27, 2020
68f77bd
feat(geometry/euclidean/basic): reflection (#3932)
jsm28 Aug 27, 2020
54d2d4d
feat(topology/sheaves): the sheaf condition for functions satisfying …
semorrison Aug 28, 2020
5193f25
feat(topology/sheaves): checking the sheaf condition under a forgetfu…
semorrison Aug 28, 2020
3f27eac
feat(category_theory/filtered): filtered categories, and filtered col…
semorrison Aug 28, 2020
65f8f7a
feat(tactic/congr): additions to the congr' tactic (#3936)
fpvandoorn Aug 28, 2020
05f35e8
feat(category_theory/limits): add kernel pairs (#3925)
b-mehta Aug 28, 2020
aeb40c5
doc(representation_theory/maschke): fix latex (#3965)
gebner Aug 28, 2020
0026c68
chore(group_theory/perm/sign): speed up proofs (#3963)
shingtaklam1324 Aug 28, 2020
23d9da4
feat(linear_algebra): eigenspaces of linear maps (#3927)
abentkamp Aug 28, 2020
f264454
chore(scripts): update nolints.txt (#3969)
leanprover-community-bot Aug 29, 2020
e8666d3
chore(algebra/group_with_zero): adjust some instance priorities (#3968)
rwbarton Aug 29, 2020
897520f
feat(analysis/convex): add correspondence between convex cones and or…
dupuisf Aug 29, 2020
683571f
refactor(set_theory/game): make impartial a class (#3974)
TwoFX Aug 29, 2020
e5459ac
feat(algebraic_geometry): structure sheaf on Spec R (#3907)
semorrison Aug 29, 2020
1a05828
chore(*): bump to lean 3.19.0c, fin is now a subtype (#3955)
jcommelin Aug 29, 2020
a330f3e
chore(topology/sheaves/sheaf_of_functions): rely less on defeq (#3972)
semorrison Aug 29, 2020
47f0e0d
feat(data/nat): API for test_bit and bitwise operations (#3964)
TwoFX Aug 29, 2020
751d47a
doc(topology/sheaves): update module docs (#3971)
semorrison Aug 29, 2020
bf6cb06
feat(linear_algebra): determinant of vectors in a basis (#3919)
PatrickMassot Aug 29, 2020
909d5ff
feat(linear_algebra/char_poly/coeff,*): prerequisites for friendship …
jalex-stark Aug 29, 2020
41273b5
feat(data/fin): nontrivial instance (#3979)
jsm28 Aug 30, 2020
d5c6a8c
feat(set_theory/game): computation of grundy_value (nim n + nim m) (#…
TwoFX Aug 30, 2020
45ab03a
feat(data/complex/is_R_or_C): add typeclass for real or complex (#3934)
dupuisf Aug 30, 2020
9612c74
feat(meta/widget): Add css classes for indentation as required by gro…
DanielFabian Aug 30, 2020
0037968
feat(logic/nontrivial): function.injective.exists_ne (#3983)
jsm28 Aug 30, 2020
6753cf6
feat(topology/tactic): optionally make `continuity` verbose with `?` …
Aug 30, 2020
b70d0a9
feat(widget): add go to definition button. (#3982)
EdAyers Aug 30, 2020
bbf1932
feat(data/finset/sort): range_mono_of_fin (#3987)
jsm28 Aug 30, 2020
255ee6e
feature(algebraic_geometry/Scheme): the category of schemes (#3961)
semorrison Aug 31, 2020
7162d57
fix(algebraic_geometry/Spec): inline TeX in heading (#3992)
bryangingechen Aug 31, 2020
5a832a4
feat(measure_theory): induction principles in measure theory (#3978)
fpvandoorn Aug 31, 2020
30b6afe
feat(data/fin): simplify fin.mk (#3996)
jsm28 Aug 31, 2020
2820f9e
chore(category_theory/limits): some simp lemmas (#3993)
semorrison Aug 31, 2020
95112a0
feat(algebra/field, ring_theory/ideal/basic): an ideal is maximal iff…
AlexandruBosinta Aug 31, 2020
7989123
fix(widget): workaround for webview rendering bug (#3997)
EdAyers Aug 31, 2020
d9faed0
move more lemmas
robertylewis Aug 31, 2020
1e58785
more moving
robertylewis Aug 31, 2020
939c075
delete changes
robertylewis Aug 31, 2020
62cf7cd
Delete more changes
robertylewis Aug 31, 2020
c78c894
Merge remote-tracking branch 'blessed/master' into multiset-etc
robertylewis Aug 31, 2020
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
30 changes: 30 additions & 0 deletions src/data/finset/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ theorem subset_union_left (s₁ s₂ : finset α) : s₁ ⊆ s₁ ∪ s₂ := λ

theorem subset_union_right (s₁ s₂ : finset α) : s₂ ⊆ s₁ ∪ s₂ := λ x, mem_union_right _

lemma union_subset_union {s1 t1 s2 t2 : finset α} (h1 : s1 ⊆ t1) (h2 : s2 ⊆ t2) :
s1 ∪ s2 ⊆ t1 ∪ t2 :=
by { intros x hx, rw finset.mem_union at hx ⊢, tauto }

theorem union_comm (s₁ s₂ : finset α) : s₁ ∪ s₂ = s₂ ∪ s₁ :=
ext $ λ x, by simp only [mem_union, or_comm]

Expand Down Expand Up @@ -1203,9 +1207,17 @@ finset.ext $ by simp
to_finset (s ∩ t) = to_finset s ∩ to_finset t :=
finset.ext $ by simp

@[simp] lemma to_finset_union (s t : multiset α) :
(s ∪ t).to_finset = s.to_finset ∪ t.to_finset :=
by ext; simp

theorem to_finset_eq_empty {m : multiset α} : m.to_finset = ∅ ↔ m = 0 :=
finset.val_inj.symm.trans multiset.erase_dup_eq_zero

@[simp] lemma to_finset_subset (m1 m2 : multiset α) :
m1.to_finset ⊆ m2.to_finset ↔ m1 ⊆ m2 :=
by simp only [finset.subset_iff, multiset.subset_iff, multiset.mem_to_finset]

end multiset

namespace list
Expand Down Expand Up @@ -2099,3 +2111,21 @@ theorem to_finset_card_of_nodup {l : list α} (h : l.nodup) : l.to_finset.card =
congr_arg card $ (@multiset.erase_dup_eq_self α _ l).2 h

end list

namespace multiset

lemma disjoint_to_finset [decidable_eq α] (m1 m2 : multiset α) :
_root_.disjoint m1.to_finset m2.to_finset ↔ m1.disjoint m2 :=
begin
rw finset.disjoint_iff_ne,
split,
{ intro h,
intros a ha1 ha2,
rw ← multiset.mem_to_finset at ha1 ha2,
exact h _ ha1 _ ha2 rfl },
{ rintros h a ha b hb rfl,
rw multiset.mem_to_finset at ha hb,
exact h ha hb }
end

end multiset
14 changes: 14 additions & 0 deletions src/data/finset/fold.lean
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ end

omit hc ha

@[simp]
lemma fold_union_empty_singleton [decidable_eq α] (s : finset α) :
finset.fold (∪) ∅ singleton s = s :=
begin
apply finset.induction_on s,
{ simp only [fold_empty], },
{ intros a s has ih, rw [fold_insert has, ih, insert_eq], }
end

@[simp]
lemma fold_sup_bot_singleton [decidable_eq α] (s : finset α) :
finset.fold (⊔) ⊥ singleton s = s :=
fold_union_empty_singleton s

section order
variables [decidable_linear_order β] (c : β)

Expand Down
30 changes: 30 additions & 0 deletions src/data/finset/lattice.lean
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,36 @@ theorem subset_range_sup_succ (s : finset ℕ) : s ⊆ range (s.sup id).succ :=
theorem exists_nat_subset_range (s : finset ℕ) : ∃n : ℕ, s ⊆ range n :=
⟨_, s.subset_range_sup_succ⟩

lemma mem_sup {α β} [decidable_eq β] {s : finset α} {f : α → multiset β}
{x : β} : x ∈ s.sup f ↔ ∃ v ∈ s, x ∈ f v :=
begin
classical,
apply s.induction_on,
{ simp },
{ intros a s has hxs,
rw [finset.sup_insert, multiset.sup_eq_union, multiset.mem_union],
split,
{ intro hxi,
cases hxi with hf hf,
{ refine ⟨a, _, hf⟩,
simp only [true_or, eq_self_iff_true, finset.mem_insert] },
{ rcases hxs.mp hf with ⟨v, hv, hfv⟩,
refine ⟨v, _, hfv⟩,
simp only [hv, or_true, finset.mem_insert] } },
{ rintros ⟨v, hv, hfv⟩,
rw [finset.mem_insert] at hv,
rcases hv with rfl | hv,
{ exact or.inl hfv },
{ refine or.inr (hxs.mpr ⟨v, hv, hfv⟩) } } },
end

lemma sup_subset {α β} [semilattice_sup_bot β] {s t : finset α} (hst : s ⊆ t) (f : α → β) :
s.sup f ≤ t.sup f :=
by classical;
calc t.sup f = (s ∪ t).sup f : by rw [finset.union_eq_right_iff_subset.mpr hst]
... = s.sup f ⊔ t.sup f : by rw finset.sup_union
... ≥ s.sup f : le_sup_left

end sup

lemma sup_eq_supr [complete_lattice β] (s : finset α) (f : α → β) : s.sup f = (⨆a∈s, f a) :=
Expand Down
4 changes: 4 additions & 0 deletions src/data/finsupp/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,10 @@ lemma mem_support_single [has_zero β] (a a' : α) (b : β) :
else ⟨by rw if_neg h at H; exact mem_singleton.1 H, h⟩,
λ ⟨h1, h2⟩, show a ∈ ite _ _ _, by rw [if_neg h2]; exact mem_singleton.2 h1⟩

@[simp] lemma mem_to_multiset (f : α →₀ ℕ) (i : α) :
i ∈ f.to_multiset ↔ i ∈ f.support :=
by rw [← multiset.count_ne_zero, finsupp.count_to_multiset, finsupp.mem_support_iff]

end multiset

/-! ### Declarations about `curry` and `uncurry` -/
Expand Down
3 changes: 3 additions & 0 deletions src/data/multiset/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,9 @@ by_contradiction $ λ h', h $ count_pos.1 (nat.pos_of_ne_zero h')
theorem count_eq_zero {a : α} {s : multiset α} : count a s = 0 ↔ a ∉ s :=
iff_not_comm.1 $ count_pos.symm.trans pos_iff_ne_zero

theorem count_ne_zero {a : α} {s : multiset α} : count a s ≠ 0 ↔ a ∈ s :=
by simp [ne.def, count_eq_zero]

@[simp] theorem count_repeat (a : α) (n : ℕ) : count a (repeat a n) = n :=
by simp [repeat]

Expand Down