Skip to content

Commit

Permalink
chore(algebra/char_p): remove some decidable_eq assumptions (#1492)
Browse files Browse the repository at this point in the history
* chore(algebra/char_p): remove some decidable_eq assumptions

*  fix build
  • Loading branch information
ChrisHughes24 authored and mergify[bot] committed Sep 27, 2019
1 parent ce7c94f commit 74f09d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/algebra/char_p.lean
Expand Up @@ -122,10 +122,10 @@ lemma cast_eq_mod (p : ℕ) [char_p α p] (k : ℕ) : (k : α) = (k % p : ℕ) :
calc (k : α) = ↑(k % p + p * (k / p)) : by rw [nat.mod_add_div]
... = ↑(k % p) : by simp[cast_eq_zero]

theorem char_ne_zero_of_fintype (p : ℕ) [hc : char_p α p] [fintype α] [decidable_eq α] : p ≠ 0 :=
theorem char_ne_zero_of_fintype (p : ℕ) [hc : char_p α p] [fintype α] : p ≠ 0 :=
assume h : p = 0,
have char_zero α := @char_p_to_char_zero α _ (h ▸ hc),
absurd (@nat.cast_injective α _ _ this) (@set.not_injective_nat_fintype α _ _ _)
absurd (@nat.cast_injective α _ _ this) (@set.not_injective_nat_fintype α _ _)

end

Expand Down Expand Up @@ -164,7 +164,7 @@ match p, hc with
| (m+2), hc := or.inl (@char_is_prime_of_ge_two α _ (m+2) hc (nat.le_add_left 2 m))
end

theorem char_is_prime [fintype α] [decidable_eq α] (p : ℕ) [char_p α p] : nat.prime p :=
theorem char_is_prime [fintype α] (p : ℕ) [char_p α p] : nat.prime p :=
or.resolve_right (char_is_prime_or_zero α p) (char_ne_zero_of_fintype α p)

end integral_domain
Expand Down
4 changes: 2 additions & 2 deletions src/data/set/finite.lean
Expand Up @@ -391,14 +391,14 @@ let ⟨n, hn⟩ := finset.exists_nat_subset_range h.to_finset in
have n ∈ finset.range n, from finset.subset_iff.mpr hn $ by simp,
by simp * at *

lemma not_injective_nat_fintype [fintype α] [decidable_eq α] {f : ℕ → α} : ¬ injective f :=
lemma not_injective_nat_fintype [fintype α] {f : ℕ → α} : ¬ injective f :=
assume (h : injective f),
have finite (f '' univ),
from finite_subset (finset.finite_to_set $ fintype.elems α) (assume a h, fintype.complete a),
have finite (univ : set ℕ), from finite_of_finite_image (set.inj_on_of_injective _ h) this,
infinite_univ_nat this

lemma not_injective_int_fintype [fintype α] [decidable_eq α] {f : ℤ → α} : ¬ injective f :=
lemma not_injective_int_fintype [fintype α] {f : ℤ → α} : ¬ injective f :=
assume hf,
have injective (f ∘ (coe : ℕ → ℤ)), from injective_comp hf $ assume i j, int.of_nat_inj,
not_injective_nat_fintype this
Expand Down

0 comments on commit 74f09d0

Please sign in to comment.