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

Commit 614849c

Browse files
committed
feat(data/fintype/basic): a type is infinite if it admits an injective map to a proper subset (#17204)
1 parent e8ecfea commit 614849c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/data/fintype/basic.lean

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2057,6 +2057,23 @@ namespace infinite
20572057

20582058
lemma of_not_fintype (h : fintype α → false) : infinite α := is_empty_fintype.mp ⟨h⟩
20592059

2060+
/-- If `s : set α` is a proper subset of `α` and `f : α → s` is injective, then `α` is infinite. -/
2061+
lemma of_injective_to_set {s : set α} (hs : s ≠ set.univ) {f : α → s} (hf : injective f) :
2062+
infinite α :=
2063+
of_not_fintype $ λ h, begin
2064+
resetI, classical,
2065+
refine lt_irrefl (fintype.card α) _,
2066+
calc fintype.card α ≤ fintype.card s : fintype.card_le_of_injective f hf
2067+
... = s.to_finset.card : s.to_finset_card.symm
2068+
... < fintype.card α : finset.card_lt_card $
2069+
by rwa [set.to_finset_ssubset_univ, set.ssubset_univ_iff]
2070+
end
2071+
2072+
/-- If `s : set α` is a proper subset of `α` and `f : s → α` is surjective, then `α` is infinite. -/
2073+
lemma of_surjective_from_set {s : set α} (hs : s ≠ set.univ) {f : s → α} (hf : surjective f) :
2074+
infinite α :=
2075+
of_injective_to_set hs (injective_surj_inv hf)
2076+
20602077
lemma exists_not_mem_finset [infinite α] (s : finset α) : ∃ x, x ∉ s :=
20612078
not_forall.1 $ λ h, fintype.false ⟨s, h⟩
20622079

0 commit comments

Comments
 (0)