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

Commit b78cf50

Browse files
committed
chore(group_theory/*): Fix lint (#16095)
Fix the linting errors coming from `fintype_finite` and `to_additive_doc` in the `group_theory` folder (+ some in `data` and `combinatorics`). Remove the decidability assumptions to `decidable_powers`/`decidable_zpowers` because they are already noncomputable. ## Lemma renames * `fintype` → `finite` in lemmas that used to assume `fintype` and now only assume `finite` * `fintype.induction_empty_option'` → `fintype.induction_empty_option`
1 parent 753ef90 commit b78cf50

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+418
-372
lines changed

archive/sensitivity.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ begin
393393
rw set.mem_to_finset,
394394
exact (dual_pair_e_ε _).mem_of_mem_span y_mem_H p p_in },
395395
obtain ⟨q, H_max⟩ : ∃ q : Q (m+1), ∀ q' : Q (m+1), |(ε q' : _) y| ≤ |ε q y|,
396-
from fintype.exists_max _,
396+
from finite.exists_max _,
397397
have H_q_pos : 0 < |ε q y|,
398398
{ contrapose! y_ne,
399399
exact epsilon_total (λ p, abs_nonpos_iff.mp (le_trans (H_max p) y_ne)) },

docs/overview.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ Combinatorics:
405405
adjacency matrix: 'simple_graph.adj_matrix'
406406
Pigeonhole principles:
407407
finite: 'fintype.exists_ne_map_eq_of_card_lt'
408-
infinite: 'fintype.exists_infinite_fiber'
408+
infinite: 'finite.exists_infinite_fiber'
409409
strong pigeonhole principle: 'fintype.exists_lt_card_fiber_of_mul_lt_card'
410410
Transversals:
411411
Hall's marriage theorem: 'finset.all_card_le_bUnion_card_iff_exists_injective'

src/algebra/char_p/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ begin
354354
unfreezingI { rintro rfl },
355355
haveI : char_zero R := char_p_to_char_zero R,
356356
casesI nonempty_fintype R,
357-
exact absurd nat.cast_injective (not_injective_infinite_fintype (coe : ℕ → R))
357+
exact absurd nat.cast_injective (not_injective_infinite_finite (coe : ℕ → R))
358358
end
359359

360360
lemma ring_char_ne_zero_of_finite [finite R] : ring_char R ≠ 0 :=

src/combinatorics/hales_jewett.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ 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)) [finite κ],
175+
∀ (α : Type u) [finite α] (κ : Type (max v u)) [finite κ],
176176
∃ (ι : Type) (_ : fintype ι), ∀ C : (ι → α) → κ, ∃ l : line α ι, l.is_mono C :=
177177
-- The proof proceeds by induction on `α`.
178-
fintype.induction_empty_option
178+
finite.induction_empty_option
179179
-- We have to show that the theorem is invariant under `α ≃ α'` for the induction to work.
180180
(λ α α' e, forall_imp $ λ κ, forall_imp $ λ _, Exists.imp $ λ ι, Exists.imp $ λ _ h C,
181181
let ⟨l, c, lc⟩ := h (λ v, C (e ∘ v)) in
@@ -268,7 +268,7 @@ end
268268

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

src/combinatorics/pigeonhole.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ following locations:
2323
2424
* `data.finset.basic` has `finset.exists_ne_map_eq_of_card_lt_of_maps_to`
2525
* `data.fintype.basic` has `fintype.exists_ne_map_eq_of_card_lt`
26-
* `data.fintype.basic` has `fintype.exists_ne_map_eq_of_infinite`
27-
* `data.fintype.basic` has `fintype.exists_infinite_fiber`
26+
* `data.fintype.basic` has `finite.exists_ne_map_eq_of_infinite`
27+
* `data.fintype.basic` has `finite.exists_infinite_fiber`
2828
* `data.set.finite` has `set.infinite.exists_ne_map_eq_of_maps_to`
2929
3030
This module gives access to these pigeonhole principles along with 20 more.

src/combinatorics/simple_graph/coloring.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ end
365365
begin
366366
apply chromatic_number_eq_card_of_forall_surj (self_coloring _),
367367
intro C,
368-
rw ←fintype.injective_iff_surjective,
368+
rw ←finite.injective_iff_surjective,
369369
intros v w,
370370
contrapose,
371371
intro h,

src/computability/primrec.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ theorem list_index_of₁ [decidable_eq α] (l : list α) :
648648
primrec (λ a, l.index_of a) := list_find_index₁ primrec.eq l
649649

650650
theorem dom_fintype [fintype α] (f : α → σ) : primrec f :=
651-
let ⟨l, nd, m⟩ := fintype.exists_univ_list α in
651+
let ⟨l, nd, m⟩ := finite.exists_univ_list α in
652652
option_some_iff.1 $ begin
653653
haveI := decidable_eq_of_encodable α,
654654
refine ((list_nth₁ (l.map f)).comp (list_index_of₁ l)).of_eq (λ a, _),

src/data/W/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ lemma infinite_of_nonempty_of_is_empty (a b : α) [ha : nonempty (β a)]
9090
begin
9191
introsI hf,
9292
have hba : b ≠ a, from λ h, ha.elim (is_empty.elim' (show is_empty (β a), from h ▸ he)),
93-
refine not_injective_infinite_fintype
93+
refine not_injective_infinite_finite
9494
(λ n : ℕ, show W_type β, from nat.rec_on n
9595
⟨b, is_empty.elim' he⟩
9696
(λ n ih, ⟨a, λ _, ih⟩)) _,

src/data/finite/basic.lean

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,38 +42,15 @@ open_locale classical
4242

4343
variables {α β γ : Type*}
4444

45-
lemma not_finite_iff_infinite {α : Type*} : ¬ finite α ↔ infinite α :=
46-
by rw [← is_empty_fintype, finite_iff_nonempty_fintype, not_nonempty_iff]
47-
4845
lemma finite_or_infinite (α : Type*) :
4946
finite α ∨ infinite α :=
5047
begin
5148
rw ← not_finite_iff_infinite,
5249
apply em
5350
end
5451

55-
lemma not_finite (α : Type*) [h1 : infinite α] [h2 : finite α] : false :=
56-
not_finite_iff_infinite.mpr h1 h2
57-
58-
lemma finite.of_not_infinite {α : Type*} (h : ¬ infinite α) : finite α :=
59-
by rwa [← not_finite_iff_infinite, not_not] at h
60-
61-
lemma infinite.of_not_finite {α : Type*} (h : ¬ finite α) : infinite α :=
62-
not_finite_iff_infinite.mp h
63-
64-
lemma not_infinite_iff_finite {α : Type*} : ¬ infinite α ↔ finite α :=
65-
not_finite_iff_infinite.not_right.symm
66-
6752
namespace finite
6853

69-
lemma exists_max [finite α] [nonempty α] [linear_order β] (f : α → β) :
70-
∃ x₀ : α, ∀ x, f x ≤ f x₀ :=
71-
by { haveI := fintype.of_finite α, exact fintype.exists_max f }
72-
73-
lemma exists_min [finite α] [nonempty α] [linear_order β] (f : α → β) :
74-
∃ x₀ : α, ∀ x, f x₀ ≤ f x :=
75-
by { haveI := fintype.of_finite α, exact fintype.exists_min f }
76-
7754
@[priority 100] -- see Note [lower instance priority]
7855
instance of_subsingleton {α : Sort*} [subsingleton α] : finite α :=
7956
of_injective (function.const α ()) $ function.injective_of_subsingleton _
@@ -108,6 +85,8 @@ by { letI := fintype.of_finite α, letI := λ a, fintype.of_finite (β a), apply
10885
instance {ι : Sort*} {π : ι → Sort*} [finite ι] [Π i, finite (π i)] : finite (Σ' i, π i) :=
10986
of_equiv _ (equiv.psigma_equiv_sigma_plift π).symm
11087

88+
instance [finite α] : finite (set α) := by { casesI nonempty_fintype α, apply_instance }
89+
11190
end finite
11291

11392
/-- This instance also provides `[finite s]` for `s : set α`. -/

0 commit comments

Comments
 (0)