Polynomial.prod_X_sub_C_eq_C_mul_prod_one_sub
Separate the scalar factor from the linear factors at nonzero roots.
Source context 3 commands
Surrounding namespaces, section variables, and local commands at this declaration.
@[expose] public section
namespace Polynomial
variable {L : Type*} [Field L]Lean source · full declaration
theorem prod_X_sub_C_eq_C_mul_prod_one_sub (s : Multiset L) (hs : ∀ ρ ∈ s, ρ ≠ 0) :
(s.map fun ρ => (X - C ρ : L[X])).prod =
C (s.map fun ρ => -ρ).prod *
((s.map fun ρ => ρ⁻¹).map fun r => (1 - C r * X : L[X])).prod := by
rw [map_multiset_prod C, Multiset.map_map, Multiset.map_map, ← Multiset.prod_map_mul]
refine congr_arg _ (Multiset.map_congr rfl fun ρ hρ => ?_)
simp only [Function.comp_apply]
have hρ0 : ρ ≠ 0 := hs ρ hρ
have : C (-ρ) * (1 - C ρ⁻¹ * X) = X - C ρ := by
have h1 : C ρ * C ρ⁻¹ = (1 : L[X]) := by rw [← C_mul, mul_inv_cancel₀ hρ0, C_1]
rw [C_neg]
linear_combination X * h1
exact this.symm