Theorem: RatFunc.eval_add
File: Mathlib/FieldTheory/RatFunc.lean

tactic: unfold eval
state_before: K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
x y : RatFunc K
hx : Polynomial.eval₂ f a (denom x) ≠ 0
hy : Polynomial.eval₂ f a (denom y) ≠ 0
⊢ eval f a (x + y) = eval f a x + eval f a y

tactic: by_cases hxy : Polynomial.eval₂ f a (denom (x + y)) = 0
state_before: K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
x y : RatFunc K
hx : Polynomial.eval₂ f a (denom x) ≠ 0
hy : Polynomial.eval₂ f a (denom y) ≠ 0
⊢ Polynomial.eval₂ f a (num (x + y)) / Polynomial.eval₂ f a (denom (x + y)) =
    Polynomial.eval₂ f a (num x) / Polynomial.eval₂ f a (denom x) +
      Polynomial.eval₂ f a (num y) / Polynomial.eval₂ f a (denom y)

tactic: rw [div_add_div _ _ hx hy, eq_div_iff (mul_ne_zero hx hy), div_eq_mul_inv, mul_right_comm, ←
  div_eq_mul_inv, div_eq_iff hxy]
state_before: case neg
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
x y : RatFunc K
hx : Polynomial.eval₂ f a (denom x) ≠ 0
hy : Polynomial.eval₂ f a (denom y) ≠ 0
hxy : ¬Polynomial.eval₂ f a (denom (x + y)) = 0
⊢ Polynomial.eval₂ f a (num (x + y)) / Polynomial.eval₂ f a (denom (x + y)) =
    Polynomial.eval₂ f a (num x) / Polynomial.eval₂ f a (denom x) +
      Polynomial.eval₂ f a (num y) / Polynomial.eval₂ f a (denom y)

tactic: simp only [← Polynomial.eval₂_mul, ← Polynomial.eval₂_add]
state_before: case neg
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
x y : RatFunc K
hx : Polynomial.eval₂ f a (denom x) ≠ 0
hy : Polynomial.eval₂ f a (denom y) ≠ 0
hxy : ¬Polynomial.eval₂ f a (denom (x + y)) = 0
⊢ Polynomial.eval₂ f a (num (x + y)) * (Polynomial.eval₂ f a (denom x) * Polynomial.eval₂ f a (denom y)) =
    (Polynomial.eval₂ f a (num x) * Polynomial.eval₂ f a (denom y) +
        Polynomial.eval₂ f a (denom x) * Polynomial.eval₂ f a (num y)) *
      Polynomial.eval₂ f a (denom (x + y))

tactic: congr 1
state_before: case neg
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
x y : RatFunc K
hx : Polynomial.eval₂ f a (denom x) ≠ 0
hy : Polynomial.eval₂ f a (denom y) ≠ 0
hxy : ¬Polynomial.eval₂ f a (denom (x + y)) = 0
⊢ Polynomial.eval₂ f a (num (x + y) * (denom x * denom y)) =
    Polynomial.eval₂ f a ((num x * denom y + denom x * num y) * denom (x + y))

tactic: apply num_denom_add
state_before: case neg.e_p
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
x y : RatFunc K
hx : Polynomial.eval₂ f a (denom x) ≠ 0
hy : Polynomial.eval₂ f a (denom y) ≠ 0
hxy : ¬Polynomial.eval₂ f a (denom (x + y)) = 0
⊢ num (x + y) * (denom x * denom y) = (num x * denom y + denom x * num y) * denom (x + y)

tactic: have := Polynomial.eval₂_eq_zero_of_dvd_of_eval₂_eq_zero f a (denom_add_dvd x y) hxy
state_before: case pos
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
x y : RatFunc K
hx : Polynomial.eval₂ f a (denom x) ≠ 0
hy : Polynomial.eval₂ f a (denom y) ≠ 0
hxy : Polynomial.eval₂ f a (denom (x + y)) = 0
⊢ Polynomial.eval₂ f a (num (x + y)) / Polynomial.eval₂ f a (denom (x + y)) =
    Polynomial.eval₂ f a (num x) / Polynomial.eval₂ f a (denom x) +
      Polynomial.eval₂ f a (num y) / Polynomial.eval₂ f a (denom y)

tactic: rw [Polynomial.eval₂_mul] at this
state_before: case pos
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
x y : RatFunc K
hx : Polynomial.eval₂ f a (denom x) ≠ 0
hy : Polynomial.eval₂ f a (denom y) ≠ 0
hxy : Polynomial.eval₂ f a (denom (x + y)) = 0
this : Polynomial.eval₂ f a (denom x * denom y) = 0
⊢ Polynomial.eval₂ f a (num (x + y)) / Polynomial.eval₂ f a (denom (x + y)) =
    Polynomial.eval₂ f a (num x) / Polynomial.eval₂ f a (denom x) +
      Polynomial.eval₂ f a (num y) / Polynomial.eval₂ f a (denom y)

tactic: cases mul_eq_zero.mp this <;> contradiction
state_before: case pos
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
x y : RatFunc K
hx : Polynomial.eval₂ f a (denom x) ≠ 0
hy : Polynomial.eval₂ f a (denom y) ≠ 0
hxy : Polynomial.eval₂ f a (denom (x + y)) = 0
this : Polynomial.eval₂ f a (denom x) * Polynomial.eval₂ f a (denom y) = 0
⊢ Polynomial.eval₂ f a (num (x + y)) / Polynomial.eval₂ f a (denom (x + y)) =
    Polynomial.eval₂ f a (num x) / Polynomial.eval₂ f a (denom x) +
      Polynomial.eval₂ f a (num y) / Polynomial.eval₂ f a (denom y)