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

Commit 540fb94

Browse files
committed
feat(data/fintype/basic): bijection preserves cardinality (#9473)
We don't seem to have this lemma yet, so I've added it.
1 parent 456db24 commit 540fb94

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/data/fintype/basic.lean

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,11 +992,14 @@ have injective (e.symm ∘ f) ↔ surjective (e.symm ∘ f), from injective_iff_
992992
λ hsurj, by simpa [function.comp] using
993993
e.injective.comp (this.2 (e.symm.surjective.comp hsurj))⟩
994994

995+
lemma card_of_bijective {f : α → β} (hf : bijective f) : card α = card β :=
996+
card_congr (equiv.of_bijective f hf)
997+
995998
lemma bijective_iff_injective_and_card (f : α → β) :
996999
bijective f ↔ injective f ∧ card α = card β :=
9971000
begin
9981001
split,
999-
{ intro h, exact ⟨h.1, card_congr (equiv.of_bijective f h)⟩ },
1002+
{ intro h, exact ⟨h.1, card_of_bijective h⟩ },
10001003
{ rintro ⟨hf, h⟩,
10011004
refine ⟨hf, _⟩,
10021005
rwa ←injective_iff_surjective_of_equiv (equiv_of_card_eq h) }
@@ -1006,7 +1009,7 @@ lemma bijective_iff_surjective_and_card (f : α → β) :
10061009
bijective f ↔ surjective f ∧ card α = card β :=
10071010
begin
10081011
split,
1009-
{ intro h, exact ⟨h.2, card_congr (equiv.of_bijective f h)⟩, },
1012+
{ intro h, exact ⟨h.2, card_of_bijective h⟩ },
10101013
{ rintro ⟨hf, h⟩,
10111014
refine ⟨_, hf⟩,
10121015
rwa injective_iff_surjective_of_equiv (equiv_of_card_eq h) }

0 commit comments

Comments
 (0)