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

Commit 1e6b748

Browse files
committed
chore(combinatorics/*): Fix lint (#16031)
Fix the linting errors coming from `fintype_finite`, `to_additive_doc` and `doc_blame`. Pull out a `[projective_plane P L]` assumption to a `variables` declaration in `combinatorics.configuration`.
1 parent 1ec4876 commit 1e6b748

File tree

8 files changed

+73
-51
lines changed

8 files changed

+73
-51
lines changed

src/combinatorics/additive/salem_spencer.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ is a set such that the average of any two distinct elements is not in the set."]
5757
def mul_salem_spencer : Prop := ∀ ⦃a b c⦄, a ∈ s → b ∈ s → c ∈ s → a * b = c * c → a = b
5858

5959
/-- Whether a given finset is Salem-Spencer is decidable. -/
60-
@[to_additive]
60+
@[to_additive "Whether a given finset is Salem-Spencer is decidable."]
6161
instance {α : Type*} [decidable_eq α] [monoid α] {s : finset α} :
6262
decidable (mul_salem_spencer (s : set α)) :=
6363
decidable_of_iff (∀ a ∈ s, ∀ b ∈ s, ∀ c ∈ s, a * b = c * c → a = b)

src/combinatorics/configuration.lean

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def dual := P
4545

4646
instance [this : inhabited P] : inhabited (dual P) := this
4747

48+
instance [finite P] : finite (dual P) := ‹finite P›
4849
instance [this : fintype P] : fintype (dual P) := this
4950

5051
instance : has_mem (dual L) (dual P) :=
@@ -166,11 +167,12 @@ end
166167
variables {P L}
167168

168169
lemma has_lines.point_count_le_line_count [has_lines P L] {p : P} {l : L} (h : p ∉ l)
169-
[fintype {l : L // p ∈ l}] : point_count P l ≤ line_count L p :=
170+
[finite {l : L // p ∈ l}] : point_count P l ≤ line_count L p :=
170171
begin
171172
by_cases hf : infinite {p : P // p ∈ l},
172173
{ exactI (le_of_eq nat.card_eq_zero_of_infinite).trans (zero_le (line_count L p)) },
173174
haveI := fintype_of_not_infinite hf,
175+
casesI nonempty_fintype {l : L // p ∈ l},
174176
rw [line_count, point_count, nat.card_eq_fintype_card, nat.card_eq_fintype_card],
175177
have : ∀ p' : {p // p ∈ l}, p ≠ p' := λ p' hp', h ((congr_arg (∈ l) hp').mpr p'.2),
176178
exact fintype.card_le_of_injective (λ p', ⟨mk_line (this p'), (mk_line_ax (this p')).1⟩)
@@ -180,7 +182,7 @@ begin
180182
end
181183

182184
lemma has_points.line_count_le_point_count [has_points P L] {p : P} {l : L} (h : p ∉ l)
183-
[hf : fintype {p : P // p ∈ l}] : line_count L p ≤ point_count P l :=
185+
[hf : finite {p : P // p ∈ l}] : line_count L p ≤ point_count P l :=
184186
@has_lines.point_count_le_line_count (dual L) (dual P) _ _ l p h hf
185187

186188
variables (P L)
@@ -323,7 +325,9 @@ instance has_points [h : projective_plane P L] : has_points P L := { .. h }
323325
@[priority 100] -- see Note [lower instance priority]
324326
instance has_lines [h : projective_plane P L] : has_lines P L := { .. h }
325327

326-
instance [projective_plane P L] : projective_plane (dual L) (dual P) :=
328+
variables [projective_plane P L]
329+
330+
instance : projective_plane (dual L) (dual P) :=
327331
{ mk_line := @mk_point P L _ _,
328332
mk_line_ax := λ _ _, mk_point_ax,
329333
mk_point := @mk_line P L _ _,
@@ -336,19 +340,19 @@ instance [projective_plane P L] : projective_plane (dual L) (dual P) :=
336340

337341
/-- The order of a projective plane is one less than the number of lines through an arbitrary point.
338342
Equivalently, it is one less than the number of points on an arbitrary line. -/
339-
noncomputable def order [projective_plane P L] : ℕ :=
343+
noncomputable def order : ℕ :=
340344
line_count L (classical.some (@exists_config P L _ _)) - 1
341345

342-
variables [fintype P] [fintype L]
343-
344-
lemma card_points_eq_card_lines [projective_plane P L] : fintype.card P = fintype.card L :=
346+
lemma card_points_eq_card_lines [fintype P] [fintype L] : fintype.card P = fintype.card L :=
345347
le_antisymm (has_lines.card_le P L) (has_points.card_le P L)
346348

347349
variables {P} (L)
348350

349-
lemma line_count_eq_line_count [projective_plane P L] (p q : P) :
351+
lemma line_count_eq_line_count [finite P] [finite L] (p q : P) :
350352
line_count L p = line_count L q :=
351353
begin
354+
casesI nonempty_fintype P,
355+
casesI nonempty_fintype L,
352356
obtain ⟨p₁, p₂, p₃, l₁, l₂, l₃, h₁₂, h₁₃, h₂₁, h₂₂, h₂₃, h₃₁, h₃₂, h₃₃⟩ := exists_config,
353357
have h := card_points_eq_card_lines P L,
354358
let n := line_count L p₂,
@@ -366,45 +370,48 @@ end
366370

367371
variables (P) {L}
368372

369-
lemma point_count_eq_point_count [projective_plane P L] (l m : L) :
373+
lemma point_count_eq_point_count [finite P] [finite L] (l m : L) :
370374
point_count P l = point_count P m :=
371375
line_count_eq_line_count (dual P) l m
372376

373377
variables {P L}
374378

375-
lemma line_count_eq_point_count [projective_plane P L] (p : P) (l : L) :
379+
lemma line_count_eq_point_count [finite P] [finite L] (p : P) (l : L) :
376380
line_count L p = point_count P l :=
377-
exists.elim (exists_point l) (λ q hq, (line_count_eq_line_count L p q).trans
378-
(has_lines.line_count_eq_point_count (card_points_eq_card_lines P L) hq))
381+
exists.elim (exists_point l) $ λ q hq, (line_count_eq_line_count L p q).trans $
382+
by { casesI nonempty_fintype P, casesI nonempty_fintype L,
383+
exact has_lines.line_count_eq_point_count (card_points_eq_card_lines P L) hq }
379384

380385
variables (P L)
381386

382-
lemma dual.order [projective_plane P L] : order (dual L) (dual P) = order P L :=
387+
lemma dual.order [finite P] [finite L] : order (dual L) (dual P) = order P L :=
383388
congr_arg (λ n, n - 1) (line_count_eq_point_count _ _)
384389

385390
variables {P} (L)
386391

387-
lemma line_count_eq [projective_plane P L] (p : P) : line_count L p = order P L + 1 :=
392+
lemma line_count_eq [finite P] [finite L] (p : P) : line_count L p = order P L + 1 :=
388393
begin
389394
classical,
390395
obtain ⟨q, -, -, l, -, -, -, -, h, -⟩ := classical.some_spec (@exists_config P L _ _),
396+
casesI nonempty_fintype {l : L // q ∈ l},
391397
rw [order, line_count_eq_line_count L p q, line_count_eq_line_count L (classical.some _) q,
392398
line_count, nat.card_eq_fintype_card, nat.sub_add_cancel],
393399
exact fintype.card_pos_iff.mpr ⟨⟨l, h⟩⟩,
394400
end
395401

396402
variables (P) {L}
397403

398-
lemma point_count_eq [projective_plane P L] (l : L) : point_count P l = order P L + 1 :=
404+
lemma point_count_eq [finite P] [finite L] (l : L) : point_count P l = order P L + 1 :=
399405
(line_count_eq (dual P) l).trans (congr_arg (λ n, n + 1) (dual.order P L))
400406

401407
variables (P L)
402408

403-
lemma one_lt_order [projective_plane P L] : 1 < order P L :=
409+
lemma one_lt_order [finite P] [finite L] : 1 < order P L :=
404410
begin
405411
obtain ⟨p₁, p₂, p₃, l₁, l₂, l₃, -, -, h₂₁, h₂₂, h₂₃, h₃₁, h₃₂, h₃₃⟩ := @exists_config P L _ _,
406412
classical,
407-
rw [←add_lt_add_iff_right, ←point_count_eq, point_count, nat.card_eq_fintype_card],
413+
casesI nonempty_fintype {p : P // p ∈ l₂},
414+
rw [←add_lt_add_iff_right, ←point_count_eq _ l₂, point_count, nat.card_eq_fintype_card],
408415
simp_rw [fintype.two_lt_card_iff, ne, subtype.ext_iff],
409416
have h := mk_point_ax (λ h, h₂₁ ((congr_arg _ h).mpr h₂₂)),
410417
exact ⟨⟨mk_point _, h.2⟩, ⟨p₂, h₂₂⟩, ⟨p₃, h₃₂⟩,
@@ -413,18 +420,19 @@ end
413420

414421
variables {P} (L)
415422

416-
lemma two_lt_line_count [projective_plane P L] (p : P) : 2 < line_count L p :=
423+
lemma two_lt_line_count [finite P] [finite L] (p : P) : 2 < line_count L p :=
417424
by simpa only [line_count_eq L p, nat.succ_lt_succ_iff] using one_lt_order P L
418425

419426
variables (P) {L}
420427

421-
lemma two_lt_point_count [projective_plane P L] (l : L) : 2 < point_count P l :=
428+
lemma two_lt_point_count [finite P] [finite L] (l : L) : 2 < point_count P l :=
422429
by simpa only [point_count_eq P l, nat.succ_lt_succ_iff] using one_lt_order P L
423430

424431
variables (P) (L)
425432

426-
lemma card_points [projective_plane P L] : fintype.card P = order P L ^ 2 + order P L + 1 :=
433+
lemma card_points [fintype P] [finite L] : fintype.card P = order P L ^ 2 + order P L + 1 :=
427434
begin
435+
casesI nonempty_fintype L,
428436
obtain ⟨p, -⟩ := @exists_config P L _ _,
429437
let ϕ : {q // q ≠ p} ≃ Σ (l : {l : L // p ∈ l}), {q // q ∈ l.1 ∧ q ≠ p} :=
430438
{ to_fun := λ q, ⟨⟨mk_line q.2, (mk_line_ax q.2).2⟩, q, (mk_line_ax q.2).1, q.2⟩,
@@ -447,7 +455,8 @@ begin
447455
rw [←nat.card_eq_fintype_card, ←line_count, line_count_eq, smul_eq_mul, nat.succ_mul, sq],
448456
end
449457

450-
lemma card_lines [projective_plane P L] : fintype.card L = order P L ^ 2 + order P L + 1 :=
458+
lemma card_lines [finite P] [fintype L] :
459+
fintype.card L = order P L ^ 2 + order P L + 1 :=
451460
(card_points (dual L) (dual P)).trans (congr_arg (λ n, n ^ 2 + n + 1) (dual.order P L))
452461

453462
end projective_plane

src/combinatorics/hales_jewett.lean

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ by simp_rw [line.apply, line.diagonal, option.get_or_else_none]
172172
/-- The Hales-Jewett theorem. This version has a restriction on universe levels which is necessary
173173
for the proof. See `exists_mono_in_high_dimension` for a fully universe-polymorphic version. -/
174174
private theorem exists_mono_in_high_dimension' :
175-
∀ (α : Type u) [fintype α] (κ : Type (max v u)) [fintype κ],
175+
∀ (α : Type u) [fintype α] (κ : Type (max v u)) [finite κ],
176176
∃ (ι : Type) (_ : fintype ι), ∀ C : (ι → α) → κ, ∃ l : line α ι, l.is_mono C :=
177177
-- The proof proceeds by induction on `α`.
178178
fintype.induction_empty_option
@@ -188,6 +188,7 @@ begin -- This deals with the degenerate case where `α` is empty.
188188
end
189189
begin -- Now we have to show that the theorem holds for `option α` if it holds for `α`.
190190
introsI α _ ihα κ _,
191+
casesI nonempty_fintype κ,
191192
-- Later we'll need `α` to be nonempty. So we first deal with the trivial case where `α` is empty.
192193
-- Then `option α` has only one element, so any line is monochromatic.
193194
by_cases h : nonempty α,
@@ -267,7 +268,7 @@ end
267268

268269
/-- The Hales-Jewett theorem: for any finite types `α` and `κ`, there exists a finite type `ι` such
269270
that whenever the hypercube `ι → α` is `κ`-colored, there is a monochromatic combinatorial line. -/
270-
theorem exists_mono_in_high_dimension (α : Type u) [fintype α] (κ : Type v) [fintype κ] :
271+
theorem exists_mono_in_high_dimension (α : Type u) [fintype α] (κ : Type v) [finite κ] :
271272
∃ (ι : Type) [fintype ι], ∀ C : (ι → α) → κ, ∃ l : line α ι, l.is_mono C :=
272273
let ⟨ι, ιfin, hι⟩ := exists_mono_in_high_dimension' α (ulift κ)
273274
in ⟨ι, ιfin, λ C, let ⟨l, c, hc⟩ := hι (ulift.up ∘ C) in ⟨l, c.down, λ x, by rw ←hc⟩ ⟩
@@ -276,8 +277,8 @@ end line
276277

277278
/-- A generalization of Van der Waerden's theorem: if `M` is a finitely colored commutative
278279
monoid, and `S` is a finite subset, then there exists a monochromatic homothetic copy of `S`. -/
279-
theorem exists_mono_homothetic_copy
280-
{M κ} [add_comm_monoid M] (S : finset M) [fintype κ] (C : M → κ) :
280+
theorem exists_mono_homothetic_copy {M κ : Type*} [add_comm_monoid M] (S : finset M) [finite κ]
281+
(C : M → κ) :
281282
∃ (a > 0) (b : M) (c : κ), ∀ s ∈ S, C (a • s + b) = c :=
282283
begin
283284
obtain ⟨ι, _inst, hι⟩ := line.exists_mono_in_high_dimension S κ,

src/combinatorics/hall/finite.lean

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import data.set.finite
1111
1212
This module proves the basic form of Hall's theorem.
1313
In constrast to the theorem described in `combinatorics.hall.basic`, this
14-
version requires that the indexed family `t : ι → finset α` have `ι` be a `fintype`.
14+
version requires that the indexed family `t : ι → finset α` have `ι` be finite.
1515
The `combinatorics.hall.basic` module applies a compactness argument to this version
16-
to remove the `fintype` constraint on `ι`.
16+
to remove the `finite` constraint on `ι`.
1717
1818
The modules are split like this since the generalized statement
1919
depends on the topology and category theory libraries, but the finite
@@ -38,7 +38,10 @@ universes u v
3838

3939
namespace hall_marriage_theorem
4040

41-
variables {ι : Type u} {α : Type v} [fintype ι] {t : ι → finset α} [decidable_eq α]
41+
variables {ι : Type u} {α : Type v} [decidable_eq α] {t : ι → finset α}
42+
43+
section fintype
44+
variables [fintype ι]
4245

4346
lemma hall_cond_of_erase {x : ι} (a : α)
4447
(ha : ∀ (s : finset ι), s.nonempty → s ≠ univ → s.card < (s.bUnion t).card)
@@ -211,6 +214,11 @@ begin
211214
{ exact sdiff_subset _ _ (hsf'' ⟨x, h⟩) } }
212215
end
213216

217+
218+
end fintype
219+
220+
variables [finite ι]
221+
214222
/--
215223
Here we combine the two inductive steps into a full strong induction proof,
216224
completing the proof the harder direction of **Hall's Marriage Theorem**.
@@ -219,6 +227,7 @@ theorem hall_hard_inductive
219227
(ht : ∀ (s : finset ι), s.card ≤ (s.bUnion t).card) :
220228
∃ (f : ι → α), function.injective f ∧ ∀ x, f x ∈ t x :=
221229
begin
230+
casesI nonempty_fintype ι,
222231
unfreezingI
223232
{ induction hn : fintype.card ι using nat.strong_induction_on with n ih generalizing ι },
224233
rcases n with _|_,
@@ -229,7 +238,7 @@ begin
229238
(∀ (s' : finset ι'), s'.card ≤ (s'.bUnion t').card) →
230239
∃ (f : ι' → α), function.injective f ∧ ∀ x, f x ∈ t' x,
231240
{ introsI ι' _ _ hι' ht',
232-
exact ih _ (nat.lt_succ_of_le hι') ht' rfl, },
241+
exact ih _ (nat.lt_succ_of_le hι') ht' _ rfl },
233242
by_cases h : ∀ (s : finset ι), s.nonempty → s ≠ univ → s.card < (s.bUnion t).card,
234243
{ exact hall_hard_inductive_step_A hn ht ih' h, },
235244
{ push_neg at h,
@@ -241,15 +250,15 @@ end hall_marriage_theorem
241250

242251
/--
243252
This is the version of **Hall's Marriage Theorem** in terms of indexed
244-
families of finite sets `t : ι → finset α` with `ι` a `fintype`.
253+
families of finite sets `t : ι → finset α` with `ι` finite.
245254
It states that there is a set of distinct representatives if and only
246255
if every union of `k` of the sets has at least `k` elements.
247256
248257
See `finset.all_card_le_bUnion_card_iff_exists_injective` for a version
249-
where the `fintype ι` constraint is removed.
258+
where the `finite ι` constraint is removed.
250259
-/
251260
theorem finset.all_card_le_bUnion_card_iff_exists_injective'
252-
{ι α : Type*} [fintype ι] [decidable_eq α] (t : ι → finset α) :
261+
{ι α : Type*} [finite ι] [decidable_eq α] (t : ι → finset α) :
253262
(∀ (s : finset ι), s.card ≤ (s.bUnion t).card) ↔
254263
(∃ (f : ι → α), function.injective f ∧ ∀ x, f x ∈ t x) :=
255264
begin

src/combinatorics/hindman.lean

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ inductive FP {M} [semigroup M] : stream M → set M
9191

9292
/-- If `m` and `m'` are finite products in `M`, then so is `m * m'`, provided that `m'` is obtained
9393
from a subsequence of `M` starting sufficiently late. -/
94-
@[to_additive]
94+
@[to_additive "If `m` and `m'` are finite sums in `M`, then so is `m + m'`, provided that `m'`
95+
is obtained from a subsequence of `M` starting sufficiently late."]
9596
lemma FP.mul {M} [semigroup M] {a : stream M} {m : M} (hm : m ∈ FP a) :
9697
∃ n, ∀ m' ∈ FP (a.drop n), m * m' ∈ FP a :=
9798
begin
@@ -165,7 +166,8 @@ end
165166

166167
/-- The strong form of **Hindman's theorem**: in any finite cover of an FP-set, one the parts
167168
contains an FP-set. -/
168-
@[to_additive FS_partition_regular]
169+
@[to_additive FS_partition_regular "The strong form of **Hindman's theorem**: in any finite cover of
170+
an FS-set, one the parts contains an FS-set."]
169171
lemma FP_partition_regular {M} [semigroup M] (a : stream M) (s : set (set M)) (sfin : s.finite)
170172
(scov : FP a ⊆ ⋃₀ s) : ∃ (c ∈ s) (b : stream M), FP b ⊆ c :=
171173
let ⟨U, idem, aU⟩ := exists_idempotent_ultrafilter_le_FP a in
@@ -174,7 +176,8 @@ let ⟨c, cs, hc⟩ := (ultrafilter.finite_sUnion_mem_iff sfin).mp (mem_of_super
174176

175177
/-- The weak form of **Hindman's theorem**: in any finite cover of a nonempty semigroup, one of the
176178
parts contains an FP-set. -/
177-
@[to_additive exists_FS_of_finite_cover]
179+
@[to_additive exists_FS_of_finite_cover "The weak form of **Hindman's theorem**: in any finite cover
180+
of a nonempty additive semigroup, one of the parts contains an FS-set."]
178181
lemma exists_FP_of_finite_cover {M} [semigroup M] [nonempty M] (s : set (set M))
179182
(sfin : s.finite) (scov : ⊤ ⊆ ⋃₀ s) : ∃ (c ∈ s) (a : stream M), FP a ⊆ c :=
180183
let ⟨U, hU⟩ := exists_idempotent_of_compact_t2_of_continuous_mul_left

src/combinatorics/simple_graph/coloring.lean

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ setoid.is_partition_classes (setoid.ker C)
9999
lemma coloring.mem_color_classes {v : V} : C.color_class (C v) ∈ C.color_classes :=
100100
⟨v, rfl⟩
101101

102-
lemma coloring.color_classes_finite_of_fintype [fintype α] : C.color_classes.finite :=
103-
by { rw set.finite_def, apply setoid.nonempty_fintype_classes_ker, }
102+
lemma coloring.color_classes_finite [finite α] : C.color_classes.finite :=
103+
set.finite_coe_iff.1 $ setoid.finite_classes_ker _
104104

105105
lemma coloring.card_color_classes_le [fintype α] [fintype C.color_classes] :
106106
fintype.card C.color_classes ≤ fintype.card α :=
@@ -255,9 +255,9 @@ begin
255255
exact colorable_set_nonempty_of_colorable hc,
256256
end
257257

258-
lemma colorable_chromatic_number_of_fintype (G : simple_graph V) [fintype V] :
258+
lemma colorable_chromatic_number_of_fintype (G : simple_graph V) [finite V] :
259259
G.colorable G.chromatic_number :=
260-
colorable_chromatic_number G.colorable_of_fintype
260+
by { casesI nonempty_fintype V, exact colorable_chromatic_number G.colorable_of_fintype }
261261

262262
lemma chromatic_number_le_one_of_subsingleton (G : simple_graph V) [subsingleton V] :
263263
G.chromatic_number ≤ 1 :=
@@ -279,7 +279,7 @@ begin
279279
apply colorable_of_is_empty,
280280
end
281281

282-
lemma is_empty_of_chromatic_number_eq_zero (G : simple_graph V) [fintype V]
282+
lemma is_empty_of_chromatic_number_eq_zero (G : simple_graph V) [finite V]
283283
(h : G.chromatic_number = 0) : is_empty V :=
284284
begin
285285
have h' := G.colorable_chromatic_number_of_fintype,
@@ -436,11 +436,12 @@ begin
436436
simp,
437437
end
438438

439-
-- TODO eliminate `fintype V` constraint once chromatic numbers are refactored.
439+
-- TODO eliminate `finite V` constraint once chromatic numbers are refactored.
440440
-- This is just to ensure the chromatic number exists.
441-
lemma is_clique.card_le_chromatic_number [fintype V] {s : finset V} (h : G.is_clique s) :
441+
lemma is_clique.card_le_chromatic_number [finite V] {s : finset V} (h : G.is_clique s) :
442442
s.card ≤ G.chromatic_number :=
443-
h.card_le_of_colorable G.colorable_chromatic_number_of_fintype
443+
by { casesI nonempty_fintype V,
444+
exact h.card_le_of_colorable G.colorable_chromatic_number_of_fintype }
444445

445446
protected
446447
lemma colorable.clique_free {n m : ℕ} (hc : G.colorable n) (hm : n < m) : G.clique_free m :=
@@ -451,9 +452,9 @@ begin
451452
exact nat.lt_le_antisymm hm (h.card_le_of_colorable hc),
452453
end
453454

454-
-- TODO eliminate `fintype V` constraint once chromatic numbers are refactored.
455+
-- TODO eliminate `finite V` constraint once chromatic numbers are refactored.
455456
-- This is just to ensure the chromatic number exists.
456-
lemma clique_free_of_chromatic_number_lt [fintype V] {n : ℕ} (hc : G.chromatic_number < n) :
457+
lemma clique_free_of_chromatic_number_lt [finite V] {n : ℕ} (hc : G.chromatic_number < n) :
457458
G.clique_free n :=
458459
G.colorable_chromatic_number_of_fintype.clique_free hc
459460

src/combinatorics/simple_graph/partition.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ begin
129129
rw set.finite.card_to_finset at h,
130130
apply P.to_colorable.mono h, },
131131
{ rintro ⟨C⟩,
132-
refine ⟨C.to_partition, C.color_classes_finite_of_fintype, le_trans _ (fintype.card_fin n).le⟩,
132+
refine ⟨C.to_partition, C.color_classes_finite, le_trans _ (fintype.card_fin n).le⟩,
133133
generalize_proofs h,
134-
haveI : fintype C.color_classes := C.color_classes_finite_of_fintype.fintype,
134+
haveI : fintype C.color_classes := C.color_classes_finite.fintype,
135135
rw h.card_to_finset,
136136
exact C.card_color_classes_le },
137137
end

src/data/setoid/partition.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ lemma classes_ker_subset_fiber_set {β : Type*} (f : α → β) :
6767
(setoid.ker f).classes ⊆ set.range (λ y, {x | f x = y}) :=
6868
by { rintro s ⟨x, rfl⟩, rw set.mem_range, exact ⟨f x, rfl⟩ }
6969

70-
lemma nonempty_fintype_classes_ker {α β : Type*} [fintype β] (f : α → β) :
71-
nonempty (fintype (setoid.ker f).classes) :=
72-
by { classical, exact ⟨set.fintype_subset _ (classes_ker_subset_fiber_set f)⟩ }
70+
lemma finite_classes_ker {α β : Type*} [finite β] (f : α → β) : finite (setoid.ker f).classes :=
71+
by { classical, exact finite.set.subset _ (classes_ker_subset_fiber_set f) }
7372

7473
lemma card_classes_ker_le {α β : Type*} [fintype β]
7574
(f : α → β) [fintype (setoid.ker f).classes] :

0 commit comments

Comments
 (0)