Theorem: RatFunc.num_div_denom
File: Mathlib/FieldTheory/RatFunc/Basic.lean

tactic: induction' x using RatFunc.induction_on with p q hq
state_before: K : Type u
inst✝ : Field K
x : RatFunc K
⊢ (algebraMap K[X] (RatFunc K)) x.num / (algebraMap K[X] (RatFunc K)) x.denom = x
state_after: case f
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ (algebraMap K[X] (RatFunc K)) ((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q).num /
      (algebraMap K[X] (RatFunc K)) ((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q).denom =
    (algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q

tactic: have q_div_ne_zero : q / gcd p q ≠ 0 := right_div_gcd_ne_zero hq
state_before: case f
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ (algebraMap K[X] (RatFunc K)) ((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q).num /
      (algebraMap K[X] (RatFunc K)) ((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q).denom =
    (algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q
state_after: case f
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ (algebraMap K[X] (RatFunc K)) ((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q).num /
      (algebraMap K[X] (RatFunc K)) ((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q).denom =
    (algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q

tactic: rw [num_div p q, denom_div p hq, RingHom.map_mul, RingHom.map_mul, mul_div_mul_left,
  div_eq_div_iff, ← RingHom.map_mul, ← RingHom.map_mul, mul_comm _ q, ←
  EuclideanDomain.mul_div_assoc, ← EuclideanDomain.mul_div_assoc, mul_comm]
state_before: case f
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ (algebraMap K[X] (RatFunc K)) ((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q).num /
      (algebraMap K[X] (RatFunc K)) ((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q).denom =
    (algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q
state_after: case f.h
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ gcd p q ∣ q

case f.h
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ gcd p q ∣ p

case f.hb
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ (algebraMap K[X] (RatFunc K)) (q / gcd p q) ≠ 0

case f.hd
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ (algebraMap K[X] (RatFunc K)) q ≠ 0

case f.hc
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ (algebraMap K[X] (RatFunc K)) (C (q / gcd p q).leadingCoeff⁻¹) ≠ 0

tactic: apply gcd_dvd_right
state_before: case f.h
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ gcd p q ∣ q
state_after: no goals

tactic: apply gcd_dvd_left
state_before: case f.h
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ gcd p q ∣ p
state_after: no goals

tactic: exact algebraMap_ne_zero q_div_ne_zero
state_before: case f.hb
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ (algebraMap K[X] (RatFunc K)) (q / gcd p q) ≠ 0
state_after: no goals

tactic: exact algebraMap_ne_zero hq
state_before: case f.hd
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ (algebraMap K[X] (RatFunc K)) q ≠ 0
state_after: no goals

tactic: refine algebraMap_ne_zero (mt Polynomial.C_eq_zero.mp ?_)
state_before: case f.hc
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ (algebraMap K[X] (RatFunc K)) (C (q / gcd p q).leadingCoeff⁻¹) ≠ 0
state_after: case f.hc
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ ¬(q / gcd p q).leadingCoeff⁻¹ = 0

tactic: exact inv_ne_zero (Polynomial.leadingCoeff_ne_zero.mpr q_div_ne_zero)
state_before: case f.hc
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
q_div_ne_zero : q / gcd p q ≠ 0
⊢ ¬(q / gcd p q).leadingCoeff⁻¹ = 0
state_after: no goals