l3lab/ntp-mathlib huggingface dataset:
theorem isUnit_of_isUnit_leadingCoeff_of_isUnit_map {f : R[X]} (hf : IsUnit f.leadingCoeff)
    (H : IsUnit (map φ f)) : IsUnit f := by
  have dz := degree_eq_zero_of_isUnit H
  rw [degree_map_eq_of_leadingCoeff_ne_zero] at dz
  · rw [eq_C_of_degree_eq_zero dz]
    refine' IsUnit.map C _
    convert hf
    change coeff f 0 = coeff f (natDegree f)
    rw [(degree_eq_iff_natDegree_eq _).1 dz]
    

Proof state:
case h.e'_3
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝² : Semiring R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
hf : IsUnit (leadingCoeff f)
H : IsUnit (map φ f)
dz : degree f = 0
⊢ coeff f 0 = coeff f Zero.zero
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝² : Semiring R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
hf : IsUnit (leadingCoeff f)
H : IsUnit (map φ f)
dz : degree f = 0
⊢ f ≠ 0

Next tactic:
rfl
theorem isUnit_of_isUnit_leadingCoeff_of_isUnit_map {f : R[X]} (hf : IsUnit f.leadingCoeff)
    (H : IsUnit (map φ f)) : IsUnit f := by
  have dz := degree_eq_zero_of_isUnit H
  rw [degree_map_eq_of_leadingCoeff_ne_zero] at dz
  · rw [eq_C_of_degree_eq_zero dz]
    refine' IsUnit.map C _
    convert hf
    change coeff f 0 = coeff f (natDegree f)
    rw [(degree_eq_iff_natDegree_eq _).1 dz]
    rfl
    

Proof state:
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝² : Semiring R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
hf : IsUnit (leadingCoeff f)
H : IsUnit (map φ f)
dz : degree f = 0
⊢ f ≠ 0

Next tactic:
rintro rfl
theorem isUnit_of_isUnit_leadingCoeff_of_isUnit_map {f : R[X]} (hf : IsUnit f.leadingCoeff)
    (H : IsUnit (map φ f)) : IsUnit f := by
  have dz := degree_eq_zero_of_isUnit H
  rw [degree_map_eq_of_leadingCoeff_ne_zero] at dz
  · rw [eq_C_of_degree_eq_zero dz]
    refine' IsUnit.map C _
    convert hf
    change coeff f 0 = coeff f (natDegree f)
    rw [(degree_eq_iff_natDegree_eq _).1 dz]
    rfl
    rintro rfl
    

Proof state:
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝² : Semiring R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
hf : IsUnit (leadingCoeff 0)
H : IsUnit (map φ 0)
dz : degree 0 = 0
⊢ False

Next tactic:
simp at H
theorem isUnit_of_isUnit_leadingCoeff_of_isUnit_map {f : R[X]} (hf : IsUnit f.leadingCoeff)
    (H : IsUnit (map φ f)) : IsUnit f := by
  have dz := degree_eq_zero_of_isUnit H
  rw [degree_map_eq_of_leadingCoeff_ne_zero] at dz
  · rw [eq_C_of_degree_eq_zero dz]
    refine' IsUnit.map C _
    convert hf
    change coeff f 0 = coeff f (natDegree f)
    rw [(degree_eq_iff_natDegree_eq _).1 dz]
    rfl
    rintro rfl
    simp at H
  · 

Proof state:
case hf
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝² : Semiring R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
hf : IsUnit (leadingCoeff f)
H : IsUnit (map φ f)
dz : degree (map φ f) = 0
⊢ φ (leadingCoeff f) ≠ 0

Next tactic:
intro h
theorem isUnit_of_isUnit_leadingCoeff_of_isUnit_map {f : R[X]} (hf : IsUnit f.leadingCoeff)
    (H : IsUnit (map φ f)) : IsUnit f := by
  have dz := degree_eq_zero_of_isUnit H
  rw [degree_map_eq_of_leadingCoeff_ne_zero] at dz
  · rw [eq_C_of_degree_eq_zero dz]
    refine' IsUnit.map C _
    convert hf
    change coeff f 0 = coeff f (natDegree f)
    rw [(degree_eq_iff_natDegree_eq _).1 dz]
    rfl
    rintro rfl
    simp at H
  · intro h
    

Proof state:
case hf
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝² : Semiring R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
hf : IsUnit (leadingCoeff f)
H : IsUnit (map φ f)
dz : degree (map φ f) = 0
h : φ (leadingCoeff f) = 0
⊢ False

Next tactic:
have u : IsUnit (φ f.leadingCoeff) := IsUnit.map φ hf
theorem isUnit_of_isUnit_leadingCoeff_of_isUnit_map {f : R[X]} (hf : IsUnit f.leadingCoeff)
    (H : IsUnit (map φ f)) : IsUnit f := by
  have dz := degree_eq_zero_of_isUnit H
  rw [degree_map_eq_of_leadingCoeff_ne_zero] at dz
  · rw [eq_C_of_degree_eq_zero dz]
    refine' IsUnit.map C _
    convert hf
    change coeff f 0 = coeff f (natDegree f)
    rw [(degree_eq_iff_natDegree_eq _).1 dz]
    rfl
    rintro rfl
    simp at H
  · intro h
    have u : IsUnit (φ f.leadingCoeff) := IsUnit.map φ hf
    

Proof state:
case hf
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝² : Semiring R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
hf : IsUnit (leadingCoeff f)
H : IsUnit (map φ f)
dz : degree (map φ f) = 0
h : φ (leadingCoeff f) = 0
u : IsUnit (φ (leadingCoeff f))
⊢ False

Next tactic:
rw [h] at u
theorem isUnit_of_isUnit_leadingCoeff_of_isUnit_map {f : R[X]} (hf : IsUnit f.leadingCoeff)
    (H : IsUnit (map φ f)) : IsUnit f := by
  have dz := degree_eq_zero_of_isUnit H
  rw [degree_map_eq_of_leadingCoeff_ne_zero] at dz
  · rw [eq_C_of_degree_eq_zero dz]
    refine' IsUnit.map C _
    convert hf
    change coeff f 0 = coeff f (natDegree f)
    rw [(degree_eq_iff_natDegree_eq _).1 dz]
    rfl
    rintro rfl
    simp at H
  · intro h
    have u : IsUnit (φ f.leadingCoeff) := IsUnit.map φ hf
    rw [h] at u
    

Proof state:
case hf
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝² : Semiring R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
hf : IsUnit (leadingCoeff f)
H : IsUnit (map φ f)
dz : degree (map φ f) = 0
h : φ (leadingCoeff f) = 0
u : IsUnit 0
⊢ False

Next tactic:
simp at u
/-- A polynomial over an integral domain `R` is irreducible if it is monic and
  irreducible after mapping into an integral domain `S`.

A special case of this lemma is that a polynomial over `ℤ` is irreducible if
  it is monic and irreducible over `ℤ/pℤ` for some prime `p`.
-/
theorem Monic.irreducible_of_irreducible_map (f : R[X]) (h_mon : Monic f)
    (h_irr : Irreducible (Polynomial.map φ f)) : Irreducible f := by
  

Proof state:
R : Type u
S : Type v
T : Type w
a b : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Monic f
h_irr : Irreducible (Polynomial.map φ f)
⊢ Irreducible f

Next tactic:
refine' ⟨h_irr.not_unit ∘ IsUnit.map (mapRingHom φ), fun a b h => _⟩
/-- A polynomial over an integral domain `R` is irreducible if it is monic and
  irreducible after mapping into an integral domain `S`.

A special case of this lemma is that a polynomial over `ℤ` is irreducible if
  it is monic and irreducible over `ℤ/pℤ` for some prime `p`.
-/
theorem Monic.irreducible_of_irreducible_map (f : R[X]) (h_mon : Monic f)
    (h_irr : Irreducible (Polynomial.map φ f)) : Irreducible f := by
  refine' ⟨h_irr.not_unit ∘ IsUnit.map (mapRingHom φ), fun a b h => _⟩
  

Proof state:
R : Type u
S : Type v
T : Type w
a✝ b✝ : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Monic f
h_irr : Irreducible (Polynomial.map φ f)
a b : R[X]
h : f = a * b
⊢ IsUnit a ∨ IsUnit b

Next tactic:
dsimp [Monic] at h_mon
/-- A polynomial over an integral domain `R` is irreducible if it is monic and
  irreducible after mapping into an integral domain `S`.

A special case of this lemma is that a polynomial over `ℤ` is irreducible if
  it is monic and irreducible over `ℤ/pℤ` for some prime `p`.
-/
theorem Monic.irreducible_of_irreducible_map (f : R[X]) (h_mon : Monic f)
    (h_irr : Irreducible (Polynomial.map φ f)) : Irreducible f := by
  refine' ⟨h_irr.not_unit ∘ IsUnit.map (mapRingHom φ), fun a b h => _⟩
  dsimp [Monic] at h_mon
  

Proof state:
R : Type u
S : Type v
T : Type w
a✝ b✝ : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Polynomial.leadingCoeff f = 1
h_irr : Irreducible (Polynomial.map φ f)
a b : R[X]
h : f = a * b
⊢ IsUnit a ∨ IsUnit b

Next tactic:
have q := (leadingCoeff_mul a b).symm
/-- A polynomial over an integral domain `R` is irreducible if it is monic and
  irreducible after mapping into an integral domain `S`.

A special case of this lemma is that a polynomial over `ℤ` is irreducible if
  it is monic and irreducible over `ℤ/pℤ` for some prime `p`.
-/
theorem Monic.irreducible_of_irreducible_map (f : R[X]) (h_mon : Monic f)
    (h_irr : Irreducible (Polynomial.map φ f)) : Irreducible f := by
  refine' ⟨h_irr.not_unit ∘ IsUnit.map (mapRingHom φ), fun a b h => _⟩
  dsimp [Monic] at h_mon
  have q := (leadingCoeff_mul a b).symm
  

Proof state:
R : Type u
S : Type v
T : Type w
a✝ b✝ : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Polynomial.leadingCoeff f = 1
h_irr : Irreducible (Polynomial.map φ f)
a b : R[X]
h : f = a * b
q : Polynomial.leadingCoeff a * Polynomial.leadingCoeff b = Polynomial.leadingCoeff (a * b)
⊢ IsUnit a ∨ IsUnit b

Next tactic:
rw [← h, h_mon] at q
/-- A polynomial over an integral domain `R` is irreducible if it is monic and
  irreducible after mapping into an integral domain `S`.

A special case of this lemma is that a polynomial over `ℤ` is irreducible if
  it is monic and irreducible over `ℤ/pℤ` for some prime `p`.
-/
theorem Monic.irreducible_of_irreducible_map (f : R[X]) (h_mon : Monic f)
    (h_irr : Irreducible (Polynomial.map φ f)) : Irreducible f := by
  refine' ⟨h_irr.not_unit ∘ IsUnit.map (mapRingHom φ), fun a b h => _⟩
  dsimp [Monic] at h_mon
  have q := (leadingCoeff_mul a b).symm
  rw [← h, h_mon] at q
  

Proof state:
R : Type u
S : Type v
T : Type w
a✝ b✝ : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Polynomial.leadingCoeff f = 1
h_irr : Irreducible (Polynomial.map φ f)
a b : R[X]
h : f = a * b
q : Polynomial.leadingCoeff a * Polynomial.leadingCoeff b = 1
⊢ IsUnit a ∨ IsUnit b

Next tactic:
refine' (h_irr.isUnit_or_isUnit <|
    (congr_arg (Polynomial.map φ) h).trans (Polynomial.map_mul φ)).imp _ _
/-- A polynomial over an integral domain `R` is irreducible if it is monic and
  irreducible after mapping into an integral domain `S`.

A special case of this lemma is that a polynomial over `ℤ` is irreducible if
  it is monic and irreducible over `ℤ/pℤ` for some prime `p`.
-/
theorem Monic.irreducible_of_irreducible_map (f : R[X]) (h_mon : Monic f)
    (h_irr : Irreducible (Polynomial.map φ f)) : Irreducible f := by
  refine' ⟨h_irr.not_unit ∘ IsUnit.map (mapRingHom φ), fun a b h => _⟩
  dsimp [Monic] at h_mon
  have q := (leadingCoeff_mul a b).symm
  rw [← h, h_mon] at q
  refine' (h_irr.isUnit_or_isUnit <|
    (congr_arg (Polynomial.map φ) h).trans (Polynomial.map_mul φ)).imp _ _ <;>
      

Proof state:
case refine'_1
R : Type u
S : Type v
T : Type w
a✝ b✝ : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Polynomial.leadingCoeff f = 1
h_irr : Irreducible (Polynomial.map φ f)
a b : R[X]
h : f = a * b
q : Polynomial.leadingCoeff a * Polynomial.leadingCoeff b = 1
⊢ IsUnit (Polynomial.map φ a) → IsUnit a

Next tactic:
apply isUnit_of_isUnit_leadingCoeff_of_isUnit_map
/-- A polynomial over an integral domain `R` is irreducible if it is monic and
  irreducible after mapping into an integral domain `S`.

A special case of this lemma is that a polynomial over `ℤ` is irreducible if
  it is monic and irreducible over `ℤ/pℤ` for some prime `p`.
-/
theorem Monic.irreducible_of_irreducible_map (f : R[X]) (h_mon : Monic f)
    (h_irr : Irreducible (Polynomial.map φ f)) : Irreducible f := by
  refine' ⟨h_irr.not_unit ∘ IsUnit.map (mapRingHom φ), fun a b h => _⟩
  dsimp [Monic] at h_mon
  have q := (leadingCoeff_mul a b).symm
  rw [← h, h_mon] at q
  refine' (h_irr.isUnit_or_isUnit <|
    (congr_arg (Polynomial.map φ) h).trans (Polynomial.map_mul φ)).imp _ _ <;>
      

Proof state:
case refine'_2
R : Type u
S : Type v
T : Type w
a✝ b✝ : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Polynomial.leadingCoeff f = 1
h_irr : Irreducible (Polynomial.map φ f)
a b : R[X]
h : f = a * b
q : Polynomial.leadingCoeff a * Polynomial.leadingCoeff b = 1
⊢ IsUnit (Polynomial.map φ b) → IsUnit b

Next tactic:
apply isUnit_of_isUnit_leadingCoeff_of_isUnit_map
/-- A polynomial over an integral domain `R` is irreducible if it is monic and
  irreducible after mapping into an integral domain `S`.

A special case of this lemma is that a polynomial over `ℤ` is irreducible if
  it is monic and irreducible over `ℤ/pℤ` for some prime `p`.
-/
theorem Monic.irreducible_of_irreducible_map (f : R[X]) (h_mon : Monic f)
    (h_irr : Irreducible (Polynomial.map φ f)) : Irreducible f := by
  refine' ⟨h_irr.not_unit ∘ IsUnit.map (mapRingHom φ), fun a b h => _⟩
  dsimp [Monic] at h_mon
  have q := (leadingCoeff_mul a b).symm
  rw [← h, h_mon] at q
  refine' (h_irr.isUnit_or_isUnit <|
    (congr_arg (Polynomial.map φ) h).trans (Polynomial.map_mul φ)).imp _ _ <;>
      apply isUnit_of_isUnit_leadingCoeff_of_isUnit_map <;>
    

Proof state:
case refine'_1.hf
R : Type u
S : Type v
T : Type w
a✝ b✝ : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Polynomial.leadingCoeff f = 1
h_irr : Irreducible (Polynomial.map φ f)
a b : R[X]
h : f = a * b
q : Polynomial.leadingCoeff a * Polynomial.leadingCoeff b = 1
⊢ IsUnit (Polynomial.leadingCoeff a)

Next tactic:
apply isUnit_of_mul_eq_one
/-- A polynomial over an integral domain `R` is irreducible if it is monic and
  irreducible after mapping into an integral domain `S`.

A special case of this lemma is that a polynomial over `ℤ` is irreducible if
  it is monic and irreducible over `ℤ/pℤ` for some prime `p`.
-/
theorem Monic.irreducible_of_irreducible_map (f : R[X]) (h_mon : Monic f)
    (h_irr : Irreducible (Polynomial.map φ f)) : Irreducible f := by
  refine' ⟨h_irr.not_unit ∘ IsUnit.map (mapRingHom φ), fun a b h => _⟩
  dsimp [Monic] at h_mon
  have q := (leadingCoeff_mul a b).symm
  rw [← h, h_mon] at q
  refine' (h_irr.isUnit_or_isUnit <|
    (congr_arg (Polynomial.map φ) h).trans (Polynomial.map_mul φ)).imp _ _ <;>
      apply isUnit_of_isUnit_leadingCoeff_of_isUnit_map <;>
    

Proof state:
case refine'_2.hf
R : Type u
S : Type v
T : Type w
a✝ b✝ : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Polynomial.leadingCoeff f = 1
h_irr : Irreducible (Polynomial.map φ f)
a b : R[X]
h : f = a * b
q : Polynomial.leadingCoeff a * Polynomial.leadingCoeff b = 1
⊢ IsUnit (Polynomial.leadingCoeff b)

Next tactic:
apply isUnit_of_mul_eq_one
/-- A polynomial over an integral domain `R` is irreducible if it is monic and
  irreducible after mapping into an integral domain `S`.

A special case of this lemma is that a polynomial over `ℤ` is irreducible if
  it is monic and irreducible over `ℤ/pℤ` for some prime `p`.
-/
theorem Monic.irreducible_of_irreducible_map (f : R[X]) (h_mon : Monic f)
    (h_irr : Irreducible (Polynomial.map φ f)) : Irreducible f := by
  refine' ⟨h_irr.not_unit ∘ IsUnit.map (mapRingHom φ), fun a b h => _⟩
  dsimp [Monic] at h_mon
  have q := (leadingCoeff_mul a b).symm
  rw [← h, h_mon] at q
  refine' (h_irr.isUnit_or_isUnit <|
    (congr_arg (Polynomial.map φ) h).trans (Polynomial.map_mul φ)).imp _ _ <;>
      apply isUnit_of_isUnit_leadingCoeff_of_isUnit_map <;>
    apply isUnit_of_mul_eq_one
  · 

Proof state:
case refine'_1.hf.h
R : Type u
S : Type v
T : Type w
a✝ b✝ : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Polynomial.leadingCoeff f = 1
h_irr : Irreducible (Polynomial.map φ f)
a b : R[X]
h : f = a * b
q : Polynomial.leadingCoeff a * Polynomial.leadingCoeff b = 1
⊢ Polynomial.leadingCoeff a * ?refine'_1.hf.b = 1

Next tactic:
exact q
/-- A polynomial over an integral domain `R` is irreducible if it is monic and
  irreducible after mapping into an integral domain `S`.

A special case of this lemma is that a polynomial over `ℤ` is irreducible if
  it is monic and irreducible over `ℤ/pℤ` for some prime `p`.
-/
theorem Monic.irreducible_of_irreducible_map (f : R[X]) (h_mon : Monic f)
    (h_irr : Irreducible (Polynomial.map φ f)) : Irreducible f := by
  refine' ⟨h_irr.not_unit ∘ IsUnit.map (mapRingHom φ), fun a b h => _⟩
  dsimp [Monic] at h_mon
  have q := (leadingCoeff_mul a b).symm
  rw [← h, h_mon] at q
  refine' (h_irr.isUnit_or_isUnit <|
    (congr_arg (Polynomial.map φ) h).trans (Polynomial.map_mul φ)).imp _ _ <;>
      apply isUnit_of_isUnit_leadingCoeff_of_isUnit_map <;>
    apply isUnit_of_mul_eq_one
  · exact q;
  · 

Proof state:
case refine'_2.hf.h
R : Type u
S : Type v
T : Type w
a✝ b✝ : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Polynomial.leadingCoeff f = 1
h_irr : Irreducible (Polynomial.map φ f)
a b : R[X]
h : f = a * b
q : Polynomial.leadingCoeff a * Polynomial.leadingCoeff b = 1
⊢ Polynomial.leadingCoeff b * ?refine'_2.hf.b = 1

Next tactic:
rw [mul_comm]
/-- A polynomial over an integral domain `R` is irreducible if it is monic and
  irreducible after mapping into an integral domain `S`.

A special case of this lemma is that a polynomial over `ℤ` is irreducible if
  it is monic and irreducible over `ℤ/pℤ` for some prime `p`.
-/
theorem Monic.irreducible_of_irreducible_map (f : R[X]) (h_mon : Monic f)
    (h_irr : Irreducible (Polynomial.map φ f)) : Irreducible f := by
  refine' ⟨h_irr.not_unit ∘ IsUnit.map (mapRingHom φ), fun a b h => _⟩
  dsimp [Monic] at h_mon
  have q := (leadingCoeff_mul a b).symm
  rw [← h, h_mon] at q
  refine' (h_irr.isUnit_or_isUnit <|
    (congr_arg (Polynomial.map φ) h).trans (Polynomial.map_mul φ)).imp _ _ <;>
      apply isUnit_of_isUnit_leadingCoeff_of_isUnit_map <;>
    apply isUnit_of_mul_eq_one
  · exact q;
  · rw [mul_comm]
    

Proof state:
case refine'_2.hf.h
R : Type u
S : Type v
T : Type w
a✝ b✝ : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Polynomial.leadingCoeff f = 1
h_irr : Irreducible (Polynomial.map φ f)
a b : R[X]
h : f = a * b
q : Polynomial.leadingCoeff a * Polynomial.leadingCoeff b = 1
⊢ ?refine'_2.hf.h.b * Polynomial.leadingCoeff b = 1
case refine'_2.hf.h.b
R : Type u
S : Type v
T : Type w
a✝ b✝ : R
n : ℕ
inst✝³ : CommRing R
inst✝² : IsDomain R
inst✝¹ : CommRing S
inst✝ : IsDomain S
φ : R →+* S
f : R[X]
h_mon : Polynomial.leadingCoeff f = 1
h_irr : Irreducible (Polynomial.map φ f)
a b : R[X]
h : f = a * b
q : Polynomial.leadingCoeff a * Polynomial.leadingCoeff b = 1
⊢ R

Next tactic:
exact q
@[to_additive (attr := simp)]
theorem inv_smul_smul (c : α) (x : β) : c⁻¹ • c • x = x := by 

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝¹ : Group α
inst✝ : MulAction α β
c : α
x : β
⊢ c⁻¹ • c • x = x

Next tactic:
rw [smul_smul, mul_left_inv, one_smul]
@[to_additive (attr := simp)]
theorem smul_inv_smul (c : α) (x : β) : c • c⁻¹ • x = x := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝¹ : Group α
inst✝ : MulAction α β
c : α
x : β
⊢ c • c⁻¹ • x = x

Next tactic:
rw [smul_smul, mul_right_inv, one_smul]
theorem smul_inv [Group β] [SMulCommClass α β β] [IsScalarTower α β β] (c : α) (x : β) :
    (c • x)⁻¹ = c⁻¹ • x⁻¹ := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝⁴ : Group α
inst✝³ : MulAction α β
inst✝² : Group β
inst✝¹ : SMulCommClass α β β
inst✝ : IsScalarTower α β β
c : α
x : β
⊢ (c • x)⁻¹ = c⁻¹ • x⁻¹

Next tactic:
rw [inv_eq_iff_mul_eq_one, smul_mul_smul, mul_right_inv, mul_right_inv, one_smul]
theorem smul_zpow [Group β] [SMulCommClass α β β] [IsScalarTower α β β] (c : α) (x : β) (p : ℤ) :
    (c • x) ^ p = c ^ p • x ^ p := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝⁴ : Group α
inst✝³ : MulAction α β
inst✝² : Group β
inst✝¹ : SMulCommClass α β β
inst✝ : IsScalarTower α β β
c : α
x : β
p : ℤ
⊢ (c • x) ^ p = c ^ p • x ^ p

Next tactic:
cases p
theorem smul_zpow [Group β] [SMulCommClass α β β] [IsScalarTower α β β] (c : α) (x : β) (p : ℤ) :
    (c • x) ^ p = c ^ p • x ^ p := by
  cases p <;>
  

Proof state:
case ofNat
α : Type u
β : Type v
γ : Type w
inst✝⁴ : Group α
inst✝³ : MulAction α β
inst✝² : Group β
inst✝¹ : SMulCommClass α β β
inst✝ : IsScalarTower α β β
c : α
x : β
a✝ : ℕ
⊢ (c • x) ^ Int.ofNat a✝ = c ^ Int.ofNat a✝ • x ^ Int.ofNat a✝

Next tactic:
simp [smul_pow, smul_inv]
theorem smul_zpow [Group β] [SMulCommClass α β β] [IsScalarTower α β β] (c : α) (x : β) (p : ℤ) :
    (c • x) ^ p = c ^ p • x ^ p := by
  cases p <;>
  

Proof state:
case negSucc
α : Type u
β : Type v
γ : Type w
inst✝⁴ : Group α
inst✝³ : MulAction α β
inst✝² : Group β
inst✝¹ : SMulCommClass α β β
inst✝ : IsScalarTower α β β
c : α
x : β
a✝ : ℕ
⊢ (c • x) ^ Int.negSucc a✝ = c ^ Int.negSucc a✝ • x ^ Int.negSucc a✝

Next tactic:
simp [smul_pow, smul_inv]
@[simp]
theorem Commute.smul_left_iff [Mul β] [SMulCommClass α β β] [IsScalarTower α β β] {a b : β}
    (r : α) : Commute (r • a) b ↔ Commute a b := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝⁴ : Group α
inst✝³ : MulAction α β
inst✝² : Mul β
inst✝¹ : SMulCommClass α β β
inst✝ : IsScalarTower α β β
a b : β
r : α
⊢ Commute (r • a) b ↔ Commute a b

Next tactic:
rw [Commute.symm_iff, Commute.smul_right_iff, Commute.symm_iff]
theorem inv_smul_eq_iff₀ {a : α} (ha : a ≠ 0) {x y : β} : a⁻¹ • x = y ↔ x = a • y :=
  ⟨fun h => by 

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝¹ : GroupWithZero α
inst✝ : MulAction α β
a✝ a : α
ha : a ≠ 0
x y : β
h : a⁻¹ • x = y
⊢ x = a • y

Next tactic:
rw [← h, smul_inv_smul₀ ha]
theorem inv_smul_eq_iff₀ {a : α} (ha : a ≠ 0) {x y : β} : a⁻¹ • x = y ↔ x = a • y :=
  ⟨fun h => by rw [← h, smul_inv_smul₀ ha], fun h => by 

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝¹ : GroupWithZero α
inst✝ : MulAction α β
a✝ a : α
ha : a ≠ 0
x y : β
h : x = a • y
⊢ a⁻¹ • x = y

Next tactic:
rw [h, inv_smul_smul₀ ha]
theorem smul_eq_zero_iff_eq (a : α) {x : β} : a • x = 0 ↔ x = 0 :=
  ⟨fun h => by 

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : Group α
inst✝¹ : AddMonoid β
inst✝ : DistribMulAction α β
a : α
x : β
h : a • x = 0
⊢ x = 0

Next tactic:
rw [← inv_smul_smul a x, h, smul_zero]
/-- If `G` acts on `A`, then it acts also on `A → B`, by `(g • F) a = F (g⁻¹ • a)`. -/
@[to_additive (attr := simps) arrowAddAction
      "If `G` acts on `A`, then it acts also on `A → B`, by `(g +ᵥ F) a = F (g⁻¹ +ᵥ a)`"]
def arrowAction {G A B : Type*} [DivisionMonoid G] [MulAction G A] : MulAction G (A → B) where
  smul g F a := F (g⁻¹ • a)
  one_smul := by
    

Proof state:
α : Type u
β : Type v
γ : Type w
G : Type u_1
A : Type u_2
B : Type u_3
inst✝¹ : DivisionMonoid G
inst✝ : MulAction G A
⊢ ∀ (b : A → B), 1 • b = b

Next tactic:
intro f
/-- If `G` acts on `A`, then it acts also on `A → B`, by `(g • F) a = F (g⁻¹ • a)`. -/
@[to_additive (attr := simps) arrowAddAction
      "If `G` acts on `A`, then it acts also on `A → B`, by `(g +ᵥ F) a = F (g⁻¹ +ᵥ a)`"]
def arrowAction {G A B : Type*} [DivisionMonoid G] [MulAction G A] : MulAction G (A → B) where
  smul g F a := F (g⁻¹ • a)
  one_smul := by
    intro f
    

Proof state:
α : Type u
β : Type v
γ : Type w
G : Type u_1
A : Type u_2
B : Type u_3
inst✝¹ : DivisionMonoid G
inst✝ : MulAction G A
f : A → B
⊢ 1 • f = f

Next tactic:
show (fun x => f ((1 : G)⁻¹ • x)) = f
/-- If `G` acts on `A`, then it acts also on `A → B`, by `(g • F) a = F (g⁻¹ • a)`. -/
@[to_additive (attr := simps) arrowAddAction
      "If `G` acts on `A`, then it acts also on `A → B`, by `(g +ᵥ F) a = F (g⁻¹ +ᵥ a)`"]
def arrowAction {G A B : Type*} [DivisionMonoid G] [MulAction G A] : MulAction G (A → B) where
  smul g F a := F (g⁻¹ • a)
  one_smul := by
    intro f
    show (fun x => f ((1 : G)⁻¹ • x)) = f
    

Proof state:
α : Type u
β : Type v
γ : Type w
G : Type u_1
A : Type u_2
B : Type u_3
inst✝¹ : DivisionMonoid G
inst✝ : MulAction G A
f : A → B
⊢ (fun x => f (1⁻¹ • x)) = f

Next tactic:
simp only [inv_one, one_smul]
/-- If `G` acts on `A`, then it acts also on `A → B`, by `(g • F) a = F (g⁻¹ • a)`. -/
@[to_additive (attr := simps) arrowAddAction
      "If `G` acts on `A`, then it acts also on `A → B`, by `(g +ᵥ F) a = F (g⁻¹ +ᵥ a)`"]
def arrowAction {G A B : Type*} [DivisionMonoid G] [MulAction G A] : MulAction G (A → B) where
  smul g F a := F (g⁻¹ • a)
  one_smul := by
    intro f
    show (fun x => f ((1 : G)⁻¹ • x)) = f
    simp only [inv_one, one_smul]
  mul_smul := by
    

Proof state:
α : Type u
β : Type v
γ : Type w
G : Type u_1
A : Type u_2
B : Type u_3
inst✝¹ : DivisionMonoid G
inst✝ : MulAction G A
⊢ ∀ (x y : G) (b : A → B), (x * y) • b = x • y • b

Next tactic:
intros x y f