@@ -5,8 +5,8 @@ Author: Mario Carneiro
5
5
6
6
Finite types.
7
7
-/
8
- import data.finset.sort
9
8
import data.finset.powerset
9
+ import data.finset.lattice
10
10
import data.finset.pi
11
11
import data.array.lemmas
12
12
@@ -144,18 +144,6 @@ quot.rec_on_subsingleton (@univ α _).1
144
144
theorem exists_equiv_fin (α) [fintype α] : ∃ n, nonempty (α ≃ fin n) :=
145
145
by haveI := classical.dec_eq α; exact ⟨card α, nonempty_of_trunc (equiv_fin α)⟩
146
146
147
- /-- Given a linearly ordered fintype `α` of cardinal `k`, the equiv `mono_equiv_of_fin α h`
148
- is the increasing bijection between `fin k` and `α`. Here, `h` is a proof that
149
- the cardinality of `s` is `k`. We use this instead of a map `fin s.card → α` to avoid
150
- casting issues in further uses of this function. -/
151
- noncomputable def mono_equiv_of_fin (α) [fintype α] [decidable_linear_order α] {k : ℕ}
152
- (h : fintype.card α = k) : fin k ≃ α :=
153
- equiv.of_bijective (mono_of_fin univ h) begin
154
- apply set.bijective_iff_bij_on_univ.2 ,
155
- rw ← @coe_univ α _,
156
- exact mono_of_fin_bij_on (univ : finset α) h
157
- end
158
-
159
147
instance (α : Type *) : subsingleton (fintype α) :=
160
148
⟨λ ⟨s₁, h₁⟩ ⟨s₂, h₂⟩, by congr; simp [finset.ext_iff, h₁, h₂]⟩
161
149
@@ -266,7 +254,7 @@ lemma finset.card_univ_diff [fintype α] [decidable_eq α] (s : finset α) :
266
254
finset.card_sdiff (subset_univ s)
267
255
268
256
instance (n : ℕ) : fintype (fin n) :=
269
- ⟨⟨list .fin_range n, list.nodup_fin_range n⟩, list .mem_fin_range⟩
257
+ ⟨finset .fin_range n, finset .mem_fin_range⟩
270
258
271
259
@[simp] theorem fintype.card_fin (n : ℕ) : fintype.card (fin n) = n :=
272
260
list.length_fin_range n
@@ -295,21 +283,6 @@ begin
295
283
exact fin.eq_last_of_not_lt h }
296
284
end
297
285
298
- /-- Any increasing map between `fin k` and a finset of cardinality `k` has to coincide with
299
- the increasing bijection `mono_of_fin s h`. -/
300
- lemma finset.mono_of_fin_unique' [decidable_linear_order α] {s : finset α} {k : ℕ} (h : s.card = k)
301
- {f : fin k → α} (fmap : set.maps_to f set.univ ↑s) (hmono : strict_mono f) :
302
- f = s.mono_of_fin h :=
303
- begin
304
- have finj : set.inj_on f set.univ := hmono.injective.inj_on _,
305
- apply mono_of_fin_unique h (set.bij_on.mk fmap finj (λ y hy, _)) hmono,
306
- simp only [set.image_univ, set.mem_range],
307
- rcases surj_on_of_inj_on_of_card_le (λ i (hi : i ∈ finset.univ), f i)
308
- (λ i hi, fmap (set.mem_univ i)) (λ i j hi hj hij, finj (set.mem_univ i) (set.mem_univ j) hij)
309
- (by simp [h]) y hy with ⟨x, _, hx⟩,
310
- exact ⟨x, hx.symm⟩
311
- end
312
-
313
286
@[instance, priority 10 ] def unique.fintype {α : Type *} [unique α] : fintype α :=
314
287
fintype.of_subsingleton (default α)
315
288
0 commit comments