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

Commit 57fda28

Browse files
committed
refactor(data/polynomial/degree/definitions): Remove hypothesis of nat_degree_X_pow_sub_C (#6628)
The lemma `nat_degree_X_pow_sub_C ` had an unnecessary hypothesis.
1 parent 41f1196 commit 57fda28

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/data/polynomial/degree/definitions.lean

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,9 +866,13 @@ theorem zero_nmem_multiset_map_X_sub_C {α : Type*} (m : multiset α) (f : α
866866
(0 : polynomial R) ∉ m.map (λ a, X - C (f a)) :=
867867
λ mem, let ⟨a, _, ha⟩ := multiset.mem_map.mp mem in X_sub_C_ne_zero _ ha
868868

869-
lemma nat_degree_X_pow_sub_C {n : ℕ} (hn : 0 < n) {r : R} :
869+
lemma nat_degree_X_pow_sub_C {n : ℕ} {r : R} :
870870
(X ^ n - C r).nat_degree = n :=
871-
by { apply nat_degree_eq_of_degree_eq_some, simp [degree_X_pow_sub_C hn], }
871+
begin
872+
by_cases hn : n = 0,
873+
{ rw [hn, pow_zero, ←C_1, ←ring_hom.map_sub, nat_degree_C] },
874+
{ exact nat_degree_eq_of_degree_eq_some (degree_X_pow_sub_C (pos_iff_ne_zero.mpr hn) r) },
875+
end
872876

873877
end nonzero_ring
874878

src/ring_theory/polynomial/cyclotomic.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ begin
145145
have hmonic : (X ^ n - C (1 : K)).monic := monic_X_pow_sub_C (1 : K) (ne_of_lt hpos).symm,
146146
symmetry,
147147
apply prod_multiset_X_sub_C_of_monic_of_roots_card_eq hmonic,
148-
rw [@nat_degree_X_pow_sub_C K _ _ n hpos 1, ← nth_roots],
148+
rw [@nat_degree_X_pow_sub_C K _ _ n 1, ← nth_roots],
149149
exact is_primitive_root.card_nth_roots h
150150
end
151151

@@ -165,7 +165,6 @@ begin
165165
{ simp only [hzero, ring_hom.map_one, splits_zero, pow_zero, sub_self] },
166166
rw [splits_iff_card_roots, ← nth_roots, is_primitive_root.card_nth_roots h,
167167
nat_degree_X_pow_sub_C],
168-
exact nat.pos_of_ne_zero hzero
169168
end
170169

171170
/-- If there is a primitive `n`-th root of unity in `K`, then

0 commit comments

Comments
 (0)