Theorem: Polynomial.splits_of_exists_multiset
File: Mathlib/Data/Polynomial/Splits.lean

tactic: rw [irreducible_iff_prime] at hp
state_before: F : Type u
K : Type v
L : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field F
i : K →+* L
f : K[X]
s : Multiset L
hs : map i f = ↑C (↑i (leadingCoeff f)) * Multiset.prod (Multiset.map (fun a => X - ↑C a) s)
hf0 : ¬f = 0
p : L[X]
hp : Irreducible p
hdp : p ∣ map i f
⊢ degree p = 1

tactic: rw [hs, ← Multiset.prod_toList] at hdp
state_before: F : Type u
K : Type v
L : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field F
i : K →+* L
f : K[X]
s : Multiset L
hs : map i f = ↑C (↑i (leadingCoeff f)) * Multiset.prod (Multiset.map (fun a => X - ↑C a) s)
hf0 : ¬f = 0
p : L[X]
hp : Prime p
hdp : p ∣ map i f
⊢ degree p = 1

tactic: obtain hd | hd := hp.2.2 _ _ hdp
state_before: F : Type u
K : Type v
L : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field F
i : K →+* L
f : K[X]
s : Multiset L
hs : map i f = ↑C (↑i (leadingCoeff f)) * Multiset.prod (Multiset.map (fun a => X - ↑C a) s)
hf0 : ¬f = 0
p : L[X]
hp : Prime p
hdp : p ∣ ↑C (↑i (leadingCoeff f)) * List.prod (Multiset.toList (Multiset.map (fun a => X - ↑C a) s))
⊢ degree p = 1

tactic: refine' (hp.2.1 <| isUnit_of_dvd_unit hd _).elim
state_before: case inl
F : Type u
K : Type v
L : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field F
i : K →+* L
f : K[X]
s : Multiset L
hs : map i f = ↑C (↑i (leadingCoeff f)) * Multiset.prod (Multiset.map (fun a => X - ↑C a) s)
hf0 : ¬f = 0
p : L[X]
hp : Prime p
hdp : p ∣ ↑C (↑i (leadingCoeff f)) * List.prod (Multiset.toList (Multiset.map (fun a => X - ↑C a) s))
hd : p ∣ ↑C (↑i (leadingCoeff f))
⊢ degree p = 1

tactic: exact isUnit_C.2 ((leadingCoeff_ne_zero.2 hf0).isUnit.map i)
state_before: case inl
F : Type u
K : Type v
L : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field F
i : K →+* L
f : K[X]
s : Multiset L
hs : map i f = ↑C (↑i (leadingCoeff f)) * Multiset.prod (Multiset.map (fun a => X - ↑C a) s)
hf0 : ¬f = 0
p : L[X]
hp : Prime p
hdp : p ∣ ↑C (↑i (leadingCoeff f)) * List.prod (Multiset.toList (Multiset.map (fun a => X - ↑C a) s))
hd : p ∣ ↑C (↑i (leadingCoeff f))
⊢ IsUnit (↑C (↑i (leadingCoeff f)))

tactic: obtain ⟨q, hq, hd⟩ := hp.dvd_prod_iff.1 hd
state_before: case inr
F : Type u
K : Type v
L : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field F
i : K →+* L
f : K[X]
s : Multiset L
hs : map i f = ↑C (↑i (leadingCoeff f)) * Multiset.prod (Multiset.map (fun a => X - ↑C a) s)
hf0 : ¬f = 0
p : L[X]
hp : Prime p
hdp : p ∣ ↑C (↑i (leadingCoeff f)) * List.prod (Multiset.toList (Multiset.map (fun a => X - ↑C a) s))
hd : p ∣ List.prod (Multiset.toList (Multiset.map (fun a => X - ↑C a) s))
⊢ degree p = 1

tactic: obtain ⟨a, _, rfl⟩ := Multiset.mem_map.1 (Multiset.mem_toList.1 hq)
state_before: case inr.intro.intro
F : Type u
K : Type v
L : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field F
i : K →+* L
f : K[X]
s : Multiset L
hs : map i f = ↑C (↑i (leadingCoeff f)) * Multiset.prod (Multiset.map (fun a => X - ↑C a) s)
hf0 : ¬f = 0
p : L[X]
hp : Prime p
hdp : p ∣ ↑C (↑i (leadingCoeff f)) * List.prod (Multiset.toList (Multiset.map (fun a => X - ↑C a) s))
hd✝ : p ∣ List.prod (Multiset.toList (Multiset.map (fun a => X - ↑C a) s))
q : L[X]
hq : q ∈ Multiset.toList (Multiset.map (fun a => X - ↑C a) s)
hd : p ∣ q
⊢ degree p = 1

tactic: rw [degree_eq_degree_of_associated ((hp.dvd_prime_iff_associated <| prime_X_sub_C a).1 hd)]
state_before: case inr.intro.intro.intro.intro
F : Type u
K : Type v
L : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field F
i : K →+* L
f : K[X]
s : Multiset L
hs : map i f = ↑C (↑i (leadingCoeff f)) * Multiset.prod (Multiset.map (fun a => X - ↑C a) s)
hf0 : ¬f = 0
p : L[X]
hp : Prime p
hdp : p ∣ ↑C (↑i (leadingCoeff f)) * List.prod (Multiset.toList (Multiset.map (fun a => X - ↑C a) s))
hd✝ : p ∣ List.prod (Multiset.toList (Multiset.map (fun a => X - ↑C a) s))
a : L
left✝ : a ∈ s
hq : X - ↑C a ∈ Multiset.toList (Multiset.map (fun a => X - ↑C a) s)
hd : p ∣ X - ↑C a
⊢ degree p = 1

tactic: exact degree_X_sub_C a
state_before: case inr.intro.intro.intro.intro
F : Type u
K : Type v
L : Type w
inst✝² : Field K
inst✝¹ : Field L
inst✝ : Field F
i : K →+* L
f : K[X]
s : Multiset L
hs : map i f = ↑C (↑i (leadingCoeff f)) * Multiset.prod (Multiset.map (fun a => X - ↑C a) s)
hf0 : ¬f = 0
p : L[X]
hp : Prime p
hdp : p ∣ ↑C (↑i (leadingCoeff f)) * List.prod (Multiset.toList (Multiset.map (fun a => X - ↑C a) s))
hd✝ : p ∣ List.prod (Multiset.toList (Multiset.map (fun a => X - ↑C a) s))
a : L
left✝ : a ∈ s
hq : X - ↑C a ∈ Multiset.toList (Multiset.map (fun a => X - ↑C a) s)
hd : p ∣ X - ↑C a
⊢ degree (X - ↑C a) = 1