Skip to content

Commit

Permalink
chore(data/fintype/basic): set.to_finset_univ generalization (#11174)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmill committed Jan 4, 2022
1 parent 037147e commit 49cbce2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/combinatorics/simple_graph/basic.lean
Expand Up @@ -817,10 +817,7 @@ lemma card_common_neighbors_top [decidable_eq V] {v w : V} (h : v ≠ w) :
begin
simp only [common_neighbors_top_eq, ← set.to_finset_card, set.to_finset_sdiff],
rw finset.card_sdiff,
{ congr' 1,
{ simp_rw [← finset.card_univ, ← set.to_finset_univ],
congr, },
{ simp [h], } },
{ simp [finset.card_univ, h], },
{ simp only [←set.subset_iff_to_finset_subset, set.subset_univ] },
end

Expand Down
4 changes: 2 additions & 2 deletions src/data/fintype/basic.lean
Expand Up @@ -1303,8 +1303,8 @@ by { ext, simp [finset.mem_powerset_len] }
fintype.card {s : finset α // s.card = k} = nat.choose (fintype.card α) k :=
by simp [fintype.subtype_card, finset.card_univ]

@[simp] lemma set.to_finset_univ [fintype α] :
(set.univ : set α).to_finset = finset.univ :=
@[simp] lemma set.to_finset_univ [hu : fintype (set.univ : set α)] [fintype α] :
@set.to_finset _ (set.univ : set α) hu = finset.univ :=
by { ext, simp only [set.mem_univ, mem_univ, set.mem_to_finset] }

@[simp] lemma set.to_finset_eq_empty_iff {s : set α} [fintype s] :
Expand Down
3 changes: 1 addition & 2 deletions src/group_theory/specific_groups/cyclic.lean
Expand Up @@ -257,8 +257,7 @@ lemma is_cyclic.image_range_order_of (ha : ∀ x : α, x ∈ zpowers a) :
finset.image (λ i, a ^ i) (range (order_of a)) = univ :=
begin
simp_rw [←set_like.mem_coe] at ha,
simp only [image_range_order_of, set.eq_univ_iff_forall.mpr ha],
convert set.to_finset_univ
simp only [image_range_order_of, set.eq_univ_iff_forall.mpr ha, set.to_finset_univ],
end

@[to_additive]
Expand Down

0 comments on commit 49cbce2

Please sign in to comment.