Theorem: Polynomial.isUnit_primPart_C
File: Mathlib/RingTheory/Polynomial/Content.lean

tactic: by_cases h0 : r = 0
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
r : R
⊢ IsUnit (primPart (↑C r))

tactic: unfold IsUnit
state_before: case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
r : R
h0 : ¬r = 0
⊢ IsUnit (primPart (↑C r))

tactic: refine'
  ⟨⟨C ↑(normUnit r)⁻¹, C ↑(normUnit r), by rw [← RingHom.map_mul, Units.inv_mul, C_1], by
      rw [← RingHom.map_mul, Units.mul_inv, C_1]⟩,
    _⟩
state_before: case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
r : R
h0 : ¬r = 0
⊢ ∃ u, ↑u = primPart (↑C r)

tactic: rw [← normalize_eq_zero, ← C_eq_zero] at h0
state_before: case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
r : R
h0 : ¬r = 0
⊢ ↑{ val := ↑C ↑(normUnit r)⁻¹, inv := ↑C ↑(normUnit r), val_inv := (_ : ↑C ↑(normUnit r)⁻¹ * ↑C ↑(normUnit r) = 1),
        inv_val := (_ : ↑C ↑(normUnit r) * ↑C ↑(normUnit r)⁻¹ = 1) } =
    primPart (↑C r)

tactic: apply mul_left_cancel₀ h0
state_before: case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
r : R
h0✝ : ¬r = 0
h0 : ¬↑C (↑normalize r) = 0
⊢ ↑{ val := ↑C ↑(normUnit r)⁻¹, inv := ↑C ↑(normUnit r), val_inv := (_ : ↑C ↑(normUnit r)⁻¹ * ↑C ↑(normUnit r) = 1),
        inv_val := (_ : ↑C ↑(normUnit r) * ↑C ↑(normUnit r)⁻¹ = 1) } =
    primPart (↑C r)

tactic: conv_rhs => rw [← content_C, ← (C r).eq_C_content_mul_primPart]
state_before: case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
r : R
h0✝ : ¬r = 0
h0 : ¬↑C (↑normalize r) = 0
⊢ ↑C (↑normalize r) *
      ↑{ val := ↑C ↑(normUnit r)⁻¹, inv := ↑C ↑(normUnit r), val_inv := (_ : ↑C ↑(normUnit r)⁻¹ * ↑C ↑(normUnit r) = 1),
          inv_val := (_ : ↑C ↑(normUnit r) * ↑C ↑(normUnit r)⁻¹ = 1) } =
    ↑C (↑normalize r) * primPart (↑C r)

tactic: simp only [Units.val_mk, normalize_apply, RingHom.map_mul]
state_before: case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
r : R
h0✝ : ¬r = 0
h0 : ¬↑C (↑normalize r) = 0
⊢ ↑C (↑normalize r) *
      ↑{ val := ↑C ↑(normUnit r)⁻¹, inv := ↑C ↑(normUnit r), val_inv := (_ : ↑C ↑(normUnit r)⁻¹ * ↑C ↑(normUnit r) = 1),
          inv_val := (_ : ↑C ↑(normUnit r) * ↑C ↑(normUnit r)⁻¹ = 1) } =
    ↑C r

tactic: rw [mul_assoc, ← RingHom.map_mul, Units.mul_inv, C_1, mul_one]
state_before: case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
r : R
h0✝ : ¬r = 0
h0 : ¬↑C (↑normalize r) = 0
⊢ ↑C r * ↑C ↑(normUnit r) * ↑C ↑(normUnit r)⁻¹ = ↑C r

tactic: simp [h0]
state_before: case pos
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
r : R
h0 : r = 0
⊢ IsUnit (primPart (↑C r))

tactic: rw [← RingHom.map_mul, Units.inv_mul, C_1]
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
r : R
h0 : ¬r = 0
⊢ ↑C ↑(normUnit r)⁻¹ * ↑C ↑(normUnit r) = 1

tactic: rw [← RingHom.map_mul, Units.mul_inv, C_1]
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : NormalizedGCDMonoid R
r : R
h0 : ¬r = 0
⊢ ↑C ↑(normUnit r) * ↑C ↑(normUnit r)⁻¹ = 1