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

Commit cca22d7

Browse files
committed
feat(data/polynomial/degree/trailing_degree): Trailing degree of multiplication by X^n (#6425)
A lemma about the trailing degree of a shifted polynomial. (this PR is part of the irreducibility saga)
1 parent 24ed74a commit cca22d7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/data/polynomial/degree/trailing_degree.lean

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,21 @@ begin
249249
{ exact le_nat_degree_of_ne_zero (mt trailing_coeff_eq_zero.mp hp) },
250250
end
251251

252+
lemma nat_trailing_degree_mul_X_pow {p : polynomial R} (hp : p ≠ 0) (n : ℕ) :
253+
(p * X ^ n).nat_trailing_degree = p.nat_trailing_degree + n :=
254+
begin
255+
apply le_antisymm,
256+
{ refine nat_trailing_degree_le_of_ne_zero (λ h, mt trailing_coeff_eq_zero.mp hp _),
257+
rwa [trailing_coeff, ←coeff_mul_X_pow] },
258+
{ rw [nat_trailing_degree_eq_support_min' (λ h, hp (mul_X_pow_eq_zero h)), finset.le_min'_iff],
259+
intros y hy,
260+
have key : n ≤ y,
261+
{ rw [mem_support_iff_coeff_ne_zero, coeff_mul_X_pow'] at hy,
262+
exact by_contra (λ h, hy (if_neg h)) },
263+
rw [mem_support_iff_coeff_ne_zero, coeff_mul_X_pow', if_pos key] at hy,
264+
exact (nat.add_le_to_le_sub _ key).mpr (nat_trailing_degree_le_of_ne_zero hy) },
265+
end
266+
252267
end semiring
253268

254269
section nonzero_semiring

0 commit comments

Comments
 (0)