File tree Expand file tree Collapse file tree 6 files changed +13
-11
lines changed Expand file tree Collapse file tree 6 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ Authors: Yaël Dillies
5
5
-/
6
6
import Mathlib.Algebra.Order.Monoid.Defs
7
7
import Mathlib.Data.Finset.Lattice.Fold
8
- import Mathlib.Data.Fintype.Card
8
+ import Mathlib.Data.Fintype.Basic
9
9
10
10
/-!
11
11
# Lemmas about (finite domain) functions into fields.
Original file line number Diff line number Diff line change @@ -118,6 +118,10 @@ theorem Function.Bijective.finite_iff {f : α → β} (h : Bijective f) : Finite
118
118
theorem Finite.ofBijective [Finite α] {f : α → β} (h : Bijective f) : Finite β :=
119
119
h.finite_iff.mp ‹_›
120
120
121
+ variable (α) in
122
+ theorem Finite.nonempty_decidableEq [Finite α] : Nonempty (DecidableEq α) :=
123
+ let ⟨_n, ⟨e⟩⟩ := Finite.exists_equiv_fin α; ⟨e.decidableEq⟩
124
+
121
125
instance [Finite α] : Finite (PLift α) :=
122
126
Finite.of_equiv α Equiv.plift.symm
123
127
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ Authors: Yury Kudryashov
5
5
-/
6
6
import Mathlib.Data.Finset.Max
7
7
import Mathlib.Data.Finset.Sigma
8
- import Mathlib.Data.Fintype.Card
8
+ import Mathlib.Data.Fintype.Basic
9
9
10
10
/-!
11
11
# Induction principles for `∀ i, Finset (α i)`
Original file line number Diff line number Diff line change @@ -777,6 +777,11 @@ instance Fin.fintype (n : ℕ) : Fintype (Fin n) :=
777
777
theorem Fin.univ_def (n : ℕ) : (univ : Finset (Fin n)) = ⟨List.finRange n, List.nodup_finRange n⟩ :=
778
778
rfl
779
779
780
+ /-- See also `nonempty_encodable`, `nonempty_denumerable`. -/
781
+ theorem nonempty_fintype (α : Type *) [Finite α] : Nonempty (Fintype α) := by
782
+ rcases Finite.exists_equiv_fin α with ⟨n, ⟨e⟩⟩
783
+ exact ⟨.ofEquiv _ e.symm⟩
784
+
780
785
@[simp] theorem List.toFinset_finRange (n : ℕ) : (List.finRange n).toFinset = Finset.univ := by
781
786
ext; simp
782
787
Original file line number Diff line number Diff line change @@ -378,14 +378,7 @@ instance (priority := 900) Finite.of_fintype (α : Type*) [Fintype α] : Finite
378
378
Fintype.finite ‹_›
379
379
380
380
theorem finite_iff_nonempty_fintype (α : Type *) : Finite α ↔ Nonempty (Fintype α) :=
381
- ⟨fun h =>
382
- let ⟨_k, ⟨e⟩⟩ := @Finite.exists_equiv_fin α h
383
- ⟨Fintype.ofEquiv _ e.symm⟩,
384
- fun ⟨_⟩ => inferInstance⟩
385
-
386
- /-- See also `nonempty_encodable`, `nonempty_denumerable`. -/
387
- theorem nonempty_fintype (α : Type *) [Finite α] : Nonempty (Fintype α) :=
388
- (finite_iff_nonempty_fintype α).mp ‹_›
381
+ ⟨fun _ => nonempty_fintype α, fun ⟨_⟩ => inferInstance⟩
389
382
390
383
/-- Noncomputably get a `Fintype` instance from a `Finite` instance. This is not an
391
384
instance because we want `Fintype` instances to be useful for computations. -/
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved.
3
3
Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Mario Carneiro
5
5
-/
6
- import Mathlib.Data.Fintype.Card
7
6
import Mathlib.Data.Finset.Max
7
+ import Mathlib.Data.Fintype.Basic
8
8
9
9
/-!
10
10
# Lemmas relating fintypes and order/lattice structure.
You can’t perform that action at this time.
0 commit comments