Skip to content

Commit

Permalink
feat(data/polynomial/*): Specific root sets (#7510)
Browse files Browse the repository at this point in the history
Adds lemmas for the root sets of a couple specific polynomials.
  • Loading branch information
tb65536 committed May 6, 2021
1 parent 6f27ef7 commit e00d6e0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/data/polynomial/field_division.lean
Expand Up @@ -280,6 +280,24 @@ lemma mem_root_set [field k] [algebra R k] {x : k} (hp : p ≠ 0) :
x ∈ p.root_set k ↔ aeval x p = 0 :=
iff.trans multiset.mem_to_finset (mem_roots_map hp)

lemma root_set_C_mul_X_pow {R S : Type*} [field R] [field S] [algebra R S]
{n : ℕ} (hn : n ≠ 0) {a : R} (ha : a ≠ 0) : (C a * X ^ n).root_set S = {0} :=
begin
ext x,
rw [set.mem_singleton_iff, mem_root_set, aeval_mul, aeval_C, aeval_X_pow, mul_eq_zero],
{ simp_rw [ring_hom.map_eq_zero, pow_eq_zero_iff (nat.pos_of_ne_zero hn), or_iff_right_iff_imp],
exact λ ha', (ha ha').elim },
{ exact mul_ne_zero (mt C_eq_zero.mp ha) (pow_ne_zero n X_ne_zero) },
end

lemma root_set_monomial {R S : Type*} [field R] [field S] [algebra R S]
{n : ℕ} (hn : n ≠ 0) {a : R} (ha : a ≠ 0) : (monomial n a).root_set S = {0} :=
by rw [←C_mul_X_pow_eq_monomial, root_set_C_mul_X_pow hn ha]

lemma root_set_X_pow {R S : Type*} [field R] [field S] [algebra R S]
{n : ℕ} (hn : n ≠ 0) : (X ^ n : polynomial R).root_set S = {0} :=
by { rw [←one_mul (X ^ n : polynomial R), ←C_1, root_set_C_mul_X_pow hn], exact one_ne_zero }

lemma exists_root_of_degree_eq_one (h : degree p = 1) : ∃ x, is_root p x :=
⟨-(p.coeff 0 / p.coeff 1),
have p.coeff 10,
Expand Down
3 changes: 3 additions & 0 deletions src/data/polynomial/ring_division.lean
Expand Up @@ -534,6 +534,9 @@ rfl
(0 : polynomial R).root_set S = ∅ :=
by rw [root_set_def, polynomial.map_zero, roots_zero, to_finset_zero, finset.coe_empty]

@[simp] lemma root_set_C [integral_domain S] [algebra R S] (a : R) : (C a).root_set S = ∅ :=
by rw [root_set_def, map_C, roots_C, multiset.to_finset_zero, finset.coe_empty]

instance root_set_fintype {R : Type*} [integral_domain R] (p : polynomial R) (S : Type*)
[integral_domain S] [algebra R S] : fintype (p.root_set S) :=
finset_coe.fintype _
Expand Down

0 comments on commit e00d6e0

Please sign in to comment.