Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 96dc1f7

Browse files
committed
chore(data/fintype/basic): generalize some lemmas to Sort* (#17503)
Also add `function.embedding.nonempty_iff_card_le`.
1 parent 2181b22 commit 96dc1f7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/data/fintype/basic.lean

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,10 @@ lemma nonempty_of_card_le [fintype α] [fintype β]
14431443
(h : fintype.card α ≤ fintype.card β) : nonempty (α ↪ β) :=
14441444
by { classical, exact (trunc_of_card_le h).nonempty }
14451445

1446+
lemma nonempty_iff_card_le [fintype α] [fintype β] :
1447+
nonempty (α ↪ β) ↔ fintype.card α ≤ fintype.card β :=
1448+
⟨λ ⟨e⟩, fintype.card_le_of_embedding e, nonempty_of_card_le⟩
1449+
14461450
lemma exists_of_card_le_finset [fintype α] {s : finset β} (h : fintype.card α ≤ s.card) :
14471451
∃ (f : α ↪ β), set.range f ⊆ s :=
14481452
begin
@@ -2102,10 +2106,10 @@ let ⟨y, hy⟩ := exists_not_mem_finset ({x} : finset α) in
21022106
protected lemma nonempty (α : Type*) [infinite α] : nonempty α :=
21032107
by apply_instance
21042108

2105-
lemma of_injective [infinite β] (f : β → α) (hf : injective f) : infinite α :=
2109+
lemma of_injective {α β} [infinite β] (f : β → α) (hf : injective f) : infinite α :=
21062110
⟨λ I, by exactI (finite.of_injective f hf).false⟩
21072111

2108-
lemma of_surjective [infinite β] (f : α → β) (hf : surjective f) : infinite α :=
2112+
lemma of_surjective {α β} [infinite β] (f : α → β) (hf : surjective f) : infinite α :=
21092113
⟨λ I, by exactI (finite.of_surjective f hf).false⟩
21102114

21112115
end infinite
@@ -2264,7 +2268,7 @@ begin
22642268
exact key.false,
22652269
end
22662270

2267-
lemma not_surjective_finite_infinite [finite α] [infinite β] (f : α → β) : ¬ surjective f :=
2271+
lemma not_surjective_finite_infinite {α β} [finite α] [infinite β] (f : α → β) : ¬ surjective f :=
22682272
λ hf, (infinite.of_surjective f hf).not_finite ‹_›
22692273

22702274
section trunc

0 commit comments

Comments
 (0)