Skip to content

Commit

Permalink
fix: do not abuse Set.Ioo as a predicate (#9027)
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-wieser committed Dec 14, 2023
1 parent bb973d5 commit 62d40c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Mathlib/Data/Polynomial/UnitTrinomial.lean
Expand Up @@ -222,7 +222,7 @@ namespace IsUnitTrinomial
theorem irreducible_aux1 {k m n : ℕ} (hkm : k < m) (hmn : m < n) (u v w : Units ℤ)
(hp : p = trinomial k m n (u : ℤ) v w) :
C (v : ℤ) * (C (u : ℤ) * X ^ (m + n) + C (w : ℤ) * X ^ (n - m + k + n)) =
⟨Finsupp.filter (Set.Ioo (k + n) (n + n)) (p * p.mirror).toFinsupp⟩ := by
⟨Finsupp.filter (· ∈ Set.Ioo (k + n) (n + n)) (p * p.mirror).toFinsupp⟩ := by
have key : n - m + k < n := by rwa [← lt_tsub_iff_right, tsub_lt_tsub_iff_left_of_le hmn.le]
rw [hp, trinomial_mirror hkm hmn u.ne_zero w.ne_zero]
simp_rw [trinomial_def, C_mul_X_pow_eq_monomial, add_mul, mul_add, monomial_mul_monomial,
Expand Down Expand Up @@ -257,7 +257,7 @@ theorem irreducible_aux1 {k m n : ℕ} (hkm : k < m) (hmn : m < n) (u v w : Unit
theorem irreducible_aux2 {k m m' n : ℕ} (hkm : k < m) (hmn : m < n) (hkm' : k < m') (hmn' : m' < n)
(u v w : Units ℤ) (hp : p = trinomial k m n (u : ℤ) v w) (hq : q = trinomial k m' n (u : ℤ) v w)
(h : p * p.mirror = q * q.mirror) : q = p ∨ q = p.mirror := by
let f : ℤ[X] → ℤ[X] := fun p => ⟨Finsupp.filter (Set.Ioo (k + n) (n + n)) p.toFinsupp⟩
let f : ℤ[X] → ℤ[X] := fun p => ⟨Finsupp.filter (· ∈ Set.Ioo (k + n) (n + n)) p.toFinsupp⟩
replace h := congr_arg f h
replace h := (irreducible_aux1 hkm hmn u v w hp).trans h
replace h := h.trans (irreducible_aux1 hkm' hmn' u v w hq).symm
Expand Down

0 comments on commit 62d40c8

Please sign in to comment.