Skip to content

Commit

Permalink
feat(data/polynomial): is_unit_C (#2812)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHughes24 committed May 25, 2020
1 parent 3e0668e commit 52b839f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/data/polynomial.lean
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,18 @@ by rw [ne.def, ← degree_eq_bot];
by rw [coeff_mul, nat.antidiagonal_zero];
simp only [polynomial.coeff_X_zero, finset.sum_singleton, mul_zero]

lemma is_unit_C {x : R} : is_unit (C x) ↔ is_unit x :=
begin
rw [is_unit_iff_dvd_one, is_unit_iff_dvd_one],
split,
{ rintros ⟨g, hg⟩,
replace hg := congr_arg (eval 0) hg,
rw [eval_one, eval_mul, eval_C] at hg,
exact ⟨g.eval 0, hg⟩ },
{ rintros ⟨y, hy⟩,
exact ⟨C y, by rw [← C_mul, ← hy, C_1]⟩ }
end

end comm_semiring

instance subsingleton [subsingleton R] [comm_semiring R] : subsingleton (polynomial R) :=
Expand Down

0 comments on commit 52b839f

Please sign in to comment.