[GOAL]
K : Type u
inst✝ : CommRing K
x y : FractionRing K[X]
xy : { toFractionRing := x }.toFractionRing = { toFractionRing := y }.toFractionRing
⊢ { toFractionRing := x } = { toFractionRing := y }
[PROOFSTEP]
subst xy
[GOAL]
K : Type u
inst✝ : CommRing K
x : FractionRing K[X]
⊢ { toFractionRing := x } = { toFractionRing := { toFractionRing := x }.toFractionRing }
[PROOFSTEP]
rfl
[GOAL]
K : Type u
inst✝ : CommRing K
P : Sort v
x : RatFunc K
f : K[X] → K[X] → P
H : ∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q'
⊢ P
[PROOFSTEP]
refine Localization.liftOn (toFractionRing x) (fun p q => f p q) ?_
[GOAL]
K : Type u
inst✝ : CommRing K
P : Sort v
x : RatFunc K
f : K[X] → K[X] → P
H : ∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q'
⊢ ∀ {a c : K[X]} {b d : { x // x ∈ K[X]⁰ }},
    ↑(Localization.r K[X]⁰) (a, b) (c, d) → (fun p q => f p ↑q) a b = (fun p q => f p ↑q) c d
[PROOFSTEP]
intros p p' q q' h
[GOAL]
K : Type u
inst✝ : CommRing K
P : Sort v
x : RatFunc K
f : K[X] → K[X] → P
H : ∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q'
p p' : K[X]
q q' : { x // x ∈ K[X]⁰ }
h : ↑(Localization.r K[X]⁰) (p, q) (p', q')
⊢ (fun p q => f p ↑q) p q = (fun p q => f p ↑q) p' q'
[PROOFSTEP]
exact
  H q.2 q'.2
    (let ⟨⟨c, hc⟩, mul_eq⟩ := Localization.r_iff_exists.mp h
    mul_cancel_left_coe_nonZeroDivisors.mp mul_eq)
      -- porting note: the definition above was as follows
      --    (-- Fix timeout by manipulating elaboration order
      --    fun p q => f p q)
      --    fun p p' q q' h => by
      --    exact H q.2 q'.2
      --      (let ⟨⟨c, hc⟩, mul_eq⟩ := Localization.r_iff_exists.mp h
      --      mul_cancel_left_coe_nonZeroDivisors.mp mul_eq)
[GOAL]
K : Type u
inst✝ : CommRing K
P : Sort v
n : K[X]
d : { x // x ∈ K[X]⁰ }
f : K[X] → K[X] → P
H : ∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q'
⊢ RatFunc.liftOn { toFractionRing := Localization.mk n d } f H = f n ↑d
[PROOFSTEP]
rw [RatFunc.liftOn]
[GOAL]
K : Type u
inst✝ : CommRing K
P : Sort v
n : K[X]
d : { x // x ∈ K[X]⁰ }
f : K[X] → K[X] → P
H : ∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q'
⊢ Localization.liftOn { toFractionRing := Localization.mk n d }.toFractionRing (fun p q => f p ↑q)
      (_ : ∀ {p p' : K[X]} {q q' : { x // x ∈ K[X]⁰ }}, ↑(Localization.r K[X]⁰) (p, q) (p', q') → f p ↑q = f p' ↑q') =
    f n ↑d
[PROOFSTEP]
exact Localization.liftOn_mk _ _ _ _
[GOAL]
K : Type u
inst✝ : CommRing K
P : Sort v
f : K[X] → K[X] → P
H : ∀ {p q a : K[X]}, q ≠ 0 → a ≠ 0 → f (a * p) (a * q) = f p q
p q p' q' : K[X]
hq : q ≠ 0
hq' : q' ≠ 0
h : q' * p = q * p'
⊢ f (q' * p) (q' * q) = f (q * p') (q * q')
[PROOFSTEP]
rw [h, mul_comm q']
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p q : K[X]
⊢ RatFunc.mk p q =
    { toFractionRing := ↑(algebraMap K[X] (FractionRing K[X])) p / ↑(algebraMap K[X] (FractionRing K[X])) q }
[PROOFSTEP]
rw [RatFunc.mk]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p : K[X]
⊢ RatFunc.mk p 0 = { toFractionRing := 0 }
[PROOFSTEP]
rw [mk_eq_div', RingHom.map_zero, div_zero]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p : K[X]
q : { x // x ∈ K[X]⁰ }
⊢ RatFunc.mk p ↑q = { toFractionRing := IsLocalization.mk' (FractionRing K[X]) p q }
[PROOFSTEP]
simp only [mk_eq_div', ← Localization.mk_eq_mk', FractionRing.mk_eq_div]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p q : K[X]
hq : q ∈ K[X]⁰
⊢ RatFunc.mk p q = { toFractionRing := IsLocalization.mk' (FractionRing K[X]) p { val := q, property := hq } }
[PROOFSTEP]
simp only [← mk_coe_def]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p q : K[X]
hq : q ≠ 0
⊢ RatFunc.mk p q = { toFractionRing := Localization.mk p { val := q, property := (_ : q ∈ K[X]⁰) } }
[PROOFSTEP]
rw [mk_def_of_ne, Localization.mk_eq_mk']
[GOAL]
case hq
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p q : K[X]
hq : q ≠ 0
⊢ q ≠ 0
[PROOFSTEP]
exact hq
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p : K[X]
⊢ RatFunc.mk p 1 = { toFractionRing := ↑(algebraMap K[X] (FractionRing K[X])) p }
[PROOFSTEP]
rw [← IsLocalization.mk'_one (M := K[X]⁰) (FractionRing K[X]) p, ← mk_coe_def, Submonoid.coe_one]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p q p' q' : K[X]
hq : q ≠ 0
hq' : q' ≠ 0
⊢ RatFunc.mk p q = RatFunc.mk p' q' ↔ p * q' = p' * q
[PROOFSTEP]
rw [mk_def_of_ne _ hq, mk_def_of_ne _ hq', ofFractionRing_injective.eq_iff, IsLocalization.mk'_eq_iff_eq',
  -- porting note: removed `[anonymous], [anonymous]`(IsFractionRing.injective K[X] (FractionRing K[X])).eq_iff]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
P : Sort v
p q : K[X]
f : K[X] → K[X] → P
f0 : ∀ (p : K[X]), f p 0 = f 0 1
H' : ∀ {p q p' q' : K[X]}, q ≠ 0 → q' ≠ 0 → q' * p = q * p' → f p q = f p' q'
H :
  optParam (∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q')
    (_ : ∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q')
⊢ RatFunc.liftOn (RatFunc.mk p q) f H = f p q
[PROOFSTEP]
by_cases hq : q = 0
[GOAL]
case pos
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
P : Sort v
p q : K[X]
f : K[X] → K[X] → P
f0 : ∀ (p : K[X]), f p 0 = f 0 1
H' : ∀ {p q p' q' : K[X]}, q ≠ 0 → q' ≠ 0 → q' * p = q * p' → f p q = f p' q'
H :
  optParam (∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q')
    (_ : ∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q')
hq : q = 0
⊢ RatFunc.liftOn (RatFunc.mk p q) f H = f p q
[PROOFSTEP]
subst hq
[GOAL]
case pos
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
P : Sort v
p : K[X]
f : K[X] → K[X] → P
f0 : ∀ (p : K[X]), f p 0 = f 0 1
H' : ∀ {p q p' q' : K[X]}, q ≠ 0 → q' ≠ 0 → q' * p = q * p' → f p q = f p' q'
H :
  optParam (∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q')
    (_ : ∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q')
⊢ RatFunc.liftOn (RatFunc.mk p 0) f H = f p 0
[PROOFSTEP]
simp only [mk_zero, f0, ← Localization.mk_zero 1, Localization.liftOn_mk, liftOn_ofFractionRing_mk, Submonoid.coe_one]
[GOAL]
case neg
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
P : Sort v
p q : K[X]
f : K[X] → K[X] → P
f0 : ∀ (p : K[X]), f p 0 = f 0 1
H' : ∀ {p q p' q' : K[X]}, q ≠ 0 → q' ≠ 0 → q' * p = q * p' → f p q = f p' q'
H :
  optParam (∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q')
    (_ : ∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q')
hq : ¬q = 0
⊢ RatFunc.liftOn (RatFunc.mk p q) f H = f p q
[PROOFSTEP]
simp only [mk_eq_localization_mk _ hq, Localization.liftOn_mk, liftOn_ofFractionRing_mk]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
P : Sort v
p q : K[X]
f : K[X] → K[X] → P
f0 : ∀ (p : K[X]), f p 0 = f 0 1
H : ∀ {p q a : K[X]}, q ≠ 0 → a ≠ 0 → f (a * p) (a * q) = f p q
⊢ RatFunc.liftOn' (RatFunc.mk p q) f H = f p q
[PROOFSTEP]
rw [RatFunc.liftOn', RatFunc.liftOn_mk _ _ _ f0]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
P : Sort v
p q : K[X]
f : K[X] → K[X] → P
f0 : ∀ (p : K[X]), f p 0 = f 0 1
H : ∀ {p q a : K[X]}, q ≠ 0 → a ≠ 0 → f (a * p) (a * q) = f p q
⊢ ∀ {p q p' q' : K[X]}, q ≠ 0 → q' ≠ 0 → q' * p = q * p' → f p q = f p' q'
[PROOFSTEP]
apply lift_on_condition_of_lift_on'_condition H
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
P : RatFunc K → Prop
x : FractionRing K[X]
f : ∀ (p q : K[X]), q ≠ 0 → P (RatFunc.mk p q)
x✝ : K[X] × { x // x ∈ K[X]⁰ }
p : K[X]
q : { x // x ∈ K[X]⁰ }
⊢ P { toFractionRing := Localization.mk (p, q).fst (p, q).snd }
[PROOFSTEP]
simpa only [mk_coe_def, Localization.mk_eq_mk'] using f p q (mem_nonZeroDivisors_iff_ne_zero.mp q.2)
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ { toFractionRing := 0 } = 0
[PROOFSTEP]
simp only [Zero.zero, OfNat.ofNat, RatFunc.zero]
[GOAL]
K : Type u
inst✝ : CommRing K
p q : FractionRing K[X]
⊢ { toFractionRing := p + q } = { toFractionRing := p } + { toFractionRing := q }
[PROOFSTEP]
simp only [HAdd.hAdd, Add.add, RatFunc.add]
[GOAL]
K : Type u
inst✝ : CommRing K
p q : FractionRing K[X]
⊢ { toFractionRing := p - q } = { toFractionRing := p } - { toFractionRing := q }
[PROOFSTEP]
simp only [Sub.sub, HSub.hSub, RatFunc.sub]
[GOAL]
K : Type u
inst✝ : CommRing K
p : FractionRing K[X]
⊢ { toFractionRing := -p } = -{ toFractionRing := p }
[PROOFSTEP]
simp only [Neg.neg, RatFunc.neg]
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ { toFractionRing := 1 } = 1
[PROOFSTEP]
simp only [One.one, OfNat.ofNat, RatFunc.one]
[GOAL]
K : Type u
inst✝ : CommRing K
p q : FractionRing K[X]
⊢ { toFractionRing := p * q } = { toFractionRing := p } * { toFractionRing := q }
[PROOFSTEP]
simp only [Mul.mul, HMul.hMul, RatFunc.mul]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p q : FractionRing K[X]
⊢ { toFractionRing := p / q } = { toFractionRing := p } / { toFractionRing := q }
[PROOFSTEP]
simp only [Div.div, HDiv.hDiv, RatFunc.div]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p : FractionRing K[X]
⊢ { toFractionRing := p⁻¹ } = { toFractionRing := p }⁻¹
[PROOFSTEP]
simp only [Inv.inv, RatFunc.inv]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p : FractionRing K[X]
h : { toFractionRing := p } ≠ 0
⊢ { toFractionRing := p } * { toFractionRing := p }⁻¹ = 1
[PROOFSTEP]
have : p ≠ 0 := fun hp => h <| by rw [hp, ofFractionRing_zero]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p : FractionRing K[X]
h : { toFractionRing := p } ≠ 0
hp : p = 0
⊢ { toFractionRing := p } = 0
[PROOFSTEP]
rw [hp, ofFractionRing_zero]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p : FractionRing K[X]
h : { toFractionRing := p } ≠ 0
this : p ≠ 0
⊢ { toFractionRing := p } * { toFractionRing := p }⁻¹ = 1
[PROOFSTEP]
simpa only [← ofFractionRing_inv, ← ofFractionRing_mul, ← ofFractionRing_one, ofFractionRing.injEq] using
  -- porting note: `ofFractionRing.injEq` was not present_root_.mul_inv_cancel this
[GOAL]
K : Type u
inst✝¹ : CommRing K
R : Type u_1
inst✝ : SMul R (FractionRing K[X])
c : R
p : FractionRing K[X]
⊢ { toFractionRing := c • p } = c • { toFractionRing := p }
[PROOFSTEP]
simp only [SMul.smul, HSMul.hSMul, RatFunc.smul]
[GOAL]
K : Type u
inst✝¹ : CommRing K
R : Type u_1
inst✝ : SMul R (FractionRing K[X])
c : R
p : RatFunc K
⊢ (c • p).toFractionRing = c • p.toFractionRing
[PROOFSTEP]
cases p
[GOAL]
case ofFractionRing
K : Type u
inst✝¹ : CommRing K
R : Type u_1
inst✝ : SMul R (FractionRing K[X])
c : R
toFractionRing✝ : FractionRing K[X]
⊢ (c • { toFractionRing := toFractionRing✝ }).toFractionRing = c • { toFractionRing := toFractionRing✝ }.toFractionRing
[PROOFSTEP]
rw [← ofFractionRing_smul]
[GOAL]
K : Type u
inst✝ : CommRing K
R : Type u_1
x : RatFunc K
r : K
⊢ r • x = ↑Polynomial.C r • x
[PROOFSTEP]
cases' x with x
[GOAL]
case ofFractionRing
K : Type u
inst✝ : CommRing K
R : Type u_1
r : K
x : FractionRing K[X]
⊢ r • { toFractionRing := x } = ↑Polynomial.C r • { toFractionRing := x }
[PROOFSTEP]
induction x using Localization.induction_on
[GOAL]
case ofFractionRing.H
K : Type u
inst✝ : CommRing K
R : Type u_1
r : K
y✝ : K[X] × { x // x ∈ K[X]⁰ }
⊢ r • { toFractionRing := Localization.mk y✝.fst y✝.snd } =
    ↑Polynomial.C r • { toFractionRing := Localization.mk y✝.fst y✝.snd }
[PROOFSTEP]
rw [← ofFractionRing_smul, ← ofFractionRing_smul, Localization.smul_mk, Localization.smul_mk, smul_eq_mul,
  Polynomial.smul_eq_C_mul]
[GOAL]
K : Type u
inst✝⁴ : CommRing K
R : Type u_1
inst✝³ : IsDomain K
inst✝² : Monoid R
inst✝¹ : DistribMulAction R K[X]
inst✝ : IsScalarTower R K[X] K[X]
c : R
p q : K[X]
⊢ RatFunc.mk (c • p) q = c • RatFunc.mk p q
[PROOFSTEP]
by_cases hq : q = 0
[GOAL]
case pos
K : Type u
inst✝⁴ : CommRing K
R : Type u_1
inst✝³ : IsDomain K
inst✝² : Monoid R
inst✝¹ : DistribMulAction R K[X]
inst✝ : IsScalarTower R K[X] K[X]
c : R
p q : K[X]
hq : q = 0
⊢ RatFunc.mk (c • p) q = c • RatFunc.mk p q
[PROOFSTEP]
rw [hq, mk_zero, mk_zero, ← ofFractionRing_smul, smul_zero]
[GOAL]
case neg
K : Type u
inst✝⁴ : CommRing K
R : Type u_1
inst✝³ : IsDomain K
inst✝² : Monoid R
inst✝¹ : DistribMulAction R K[X]
inst✝ : IsScalarTower R K[X] K[X]
c : R
p q : K[X]
hq : ¬q = 0
⊢ RatFunc.mk (c • p) q = c • RatFunc.mk p q
[PROOFSTEP]
rw [mk_eq_localization_mk _ hq, mk_eq_localization_mk _ hq, ← Localization.smul_mk, ← ofFractionRing_smul]
[GOAL]
K : Type u
inst✝⁴ : CommRing K
R : Type u_1
inst✝³ : IsDomain K
inst✝² : Monoid R
inst✝¹ : DistribMulAction R K[X]
inst✝ : IsScalarTower R K[X] K[X]
⊢ ∀ (x : R) (y : K[X]) (z : RatFunc K), (x • y) • z = x • y • z
[PROOFSTEP]
intros c p q
[GOAL]
K : Type u
inst✝⁴ : CommRing K
R : Type u_1
inst✝³ : IsDomain K
inst✝² : Monoid R
inst✝¹ : DistribMulAction R K[X]
inst✝ : IsScalarTower R K[X] K[X]
c : R
p : K[X]
q : RatFunc K
⊢ (c • p) • q = c • p • q
[PROOFSTEP]
apply q.induction_on' fun q r _ => by rw [← mk_smul, smul_assoc, mk_smul, mk_smul]
[GOAL]
K : Type u
inst✝⁴ : CommRing K
R : Type u_1
inst✝³ : IsDomain K
inst✝² : Monoid R
inst✝¹ : DistribMulAction R K[X]
inst✝ : IsScalarTower R K[X] K[X]
c : R
p : K[X]
q✝ : RatFunc K
q r : K[X]
x✝ : r ≠ 0
⊢ (c • p) • RatFunc.mk q r = c • p • RatFunc.mk q r
[PROOFSTEP]
rw [← mk_smul, smul_assoc, mk_smul, mk_smul]
[GOAL]
K : Type u
inst✝ : CommRing K
x✝¹ x✝ : RatFunc K
toFractionRing✝¹ toFractionRing✝ : FractionRing K[X]
⊢ Equiv.toFun
      { toFun := toFractionRing, invFun := ofFractionRing,
        left_inv := (_ : ∀ (x : RatFunc K), { toFractionRing := x.toFractionRing } = x),
        right_inv :=
          (_ :
            ∀ (x : FractionRing K[X]),
              { toFractionRing := x }.toFractionRing = { toFractionRing := x }.toFractionRing) }
      ({ toFractionRing := toFractionRing✝¹ } * { toFractionRing := toFractionRing✝ }) =
    Equiv.toFun
        { toFun := toFractionRing, invFun := ofFractionRing,
          left_inv := (_ : ∀ (x : RatFunc K), { toFractionRing := x.toFractionRing } = x),
          right_inv :=
            (_ :
              ∀ (x : FractionRing K[X]),
                { toFractionRing := x }.toFractionRing = { toFractionRing := x }.toFractionRing) }
        { toFractionRing := toFractionRing✝¹ } *
      Equiv.toFun
        { toFun := toFractionRing, invFun := ofFractionRing,
          left_inv := (_ : ∀ (x : RatFunc K), { toFractionRing := x.toFractionRing } = x),
          right_inv :=
            (_ :
              ∀ (x : FractionRing K[X]),
                { toFractionRing := x }.toFractionRing = { toFractionRing := x }.toFractionRing) }
        { toFractionRing := toFractionRing✝ }
[PROOFSTEP]
simp [← ofFractionRing_mul]
[GOAL]
K : Type u
inst✝ : CommRing K
x✝¹ x✝ : RatFunc K
toFractionRing✝¹ toFractionRing✝ : FractionRing K[X]
⊢ Equiv.toFun
      { toFun := toFractionRing, invFun := ofFractionRing,
        left_inv := (_ : ∀ (x : RatFunc K), { toFractionRing := x.toFractionRing } = x),
        right_inv :=
          (_ :
            ∀ (x : FractionRing K[X]),
              { toFractionRing := x }.toFractionRing = { toFractionRing := x }.toFractionRing) }
      ({ toFractionRing := toFractionRing✝¹ } + { toFractionRing := toFractionRing✝ }) =
    Equiv.toFun
        { toFun := toFractionRing, invFun := ofFractionRing,
          left_inv := (_ : ∀ (x : RatFunc K), { toFractionRing := x.toFractionRing } = x),
          right_inv :=
            (_ :
              ∀ (x : FractionRing K[X]),
                { toFractionRing := x }.toFractionRing = { toFractionRing := x }.toFractionRing) }
        { toFractionRing := toFractionRing✝¹ } +
      Equiv.toFun
        { toFun := toFractionRing, invFun := ofFractionRing,
          left_inv := (_ : ∀ (x : RatFunc K), { toFractionRing := x.toFractionRing } = x),
          right_inv :=
            (_ :
              ∀ (x : FractionRing K[X]),
                { toFractionRing := x }.toFractionRing = { toFractionRing := x }.toFractionRing) }
        { toFractionRing := toFractionRing✝ }
[PROOFSTEP]
simp [← ofFractionRing_add]
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (a b c : RatFunc K), a * b * c = a * (b * c)
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (a : RatFunc K), 1 * a = a
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (a : RatFunc K), a * 1 = a
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (a b : RatFunc K), a * b = b * a
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (a b c : RatFunc K), a + b + c = a + (b + c)
[PROOFSTEP]
frac_tac
  -- porting note: `by frac_tac` didn't work:
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (a : RatFunc K), 0 + a = a
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (a : RatFunc K), a + 0 = a
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (x : RatFunc K), (fun x x_1 => x • x_1) 0 x = 0
[PROOFSTEP]
smul_tac
[GOAL]
K : Type u
inst✝ : CommRing K
x✝ : ℕ
⊢ ∀ (x : RatFunc K), (fun x x_1 => x • x_1) (x✝ + 1) x = x + (fun x x_1 => x • x_1) x✝ x
[PROOFSTEP]
smul_tac
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (a b : RatFunc K), a - b = a + -b
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (a : RatFunc K), (fun x x_1 => x • x_1) 0 a = 0
[PROOFSTEP]
smul_tac
[GOAL]
K : Type u
inst✝ : CommRing K
x✝ : ℕ
⊢ ∀ (a : RatFunc K), (fun x x_1 => x • x_1) (Int.ofNat (Nat.succ x✝)) a = a + (fun x x_1 => x • x_1) (Int.ofNat x✝) a
[PROOFSTEP]
smul_tac
[GOAL]
K : Type u
inst✝ : CommRing K
x✝ : ℕ
⊢ ∀ (a : RatFunc K), (fun x x_1 => x • x_1) (Int.negSucc x✝) a = -(fun x x_1 => x • x_1) (↑(Nat.succ x✝)) a
[PROOFSTEP]
smul_tac
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (a : RatFunc K), -a + a = 0
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (a b : RatFunc K), a + b = b + a
[PROOFSTEP]
repeat rintro (⟨⟩ : RatFunc _) <;> simp only [← ofFractionRing_add, add_comm]
[GOAL]
K : Type u
inst✝ : CommRing K
⊢ ∀ (a b : RatFunc K), a + b = b + a
[PROOFSTEP]
rintro (⟨⟩ : RatFunc _)
[GOAL]
case ofFractionRing
K : Type u
inst✝ : CommRing K
toFractionRing✝ : FractionRing K[X]
⊢ ∀ (b : RatFunc K), { toFractionRing := toFractionRing✝ } + b = b + { toFractionRing := toFractionRing✝ }
[PROOFSTEP]
simp only [← ofFractionRing_add, add_comm]
[GOAL]
case ofFractionRing
K : Type u
inst✝ : CommRing K
toFractionRing✝ : FractionRing K[X]
⊢ ∀ (b : RatFunc K), { toFractionRing := toFractionRing✝ } + b = b + { toFractionRing := toFractionRing✝ }
[PROOFSTEP]
rintro (⟨⟩ : RatFunc _)
[GOAL]
case ofFractionRing.ofFractionRing
K : Type u
inst✝ : CommRing K
toFractionRing✝¹ toFractionRing✝ : FractionRing K[X]
⊢ { toFractionRing := toFractionRing✝¹ } + { toFractionRing := toFractionRing✝ } =
    { toFractionRing := toFractionRing✝ } + { toFractionRing := toFractionRing✝¹ }
[PROOFSTEP]
simp only [← ofFractionRing_add, add_comm]
[GOAL]
K : Type u
inst✝ : CommRing K
src✝¹ : CommMonoid (RatFunc K) := instCommMonoid K
src✝ : AddCommGroup (RatFunc K) := instAddCommGroup K
⊢ ∀ (a b c : RatFunc K), a * (b + c) = a * b + a * c
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝ : CommRing K
src✝¹ : CommMonoid (RatFunc K) := instCommMonoid K
src✝ : AddCommGroup (RatFunc K) := instAddCommGroup K
⊢ ∀ (a b c : RatFunc K), (a + b) * c = a * c + b * c
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝ : CommRing K
src✝¹ : CommMonoid (RatFunc K) := instCommMonoid K
src✝ : AddCommGroup (RatFunc K) := instAddCommGroup K
⊢ ∀ (a : RatFunc K), 0 * a = 0
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝ : CommRing K
src✝¹ : CommMonoid (RatFunc K) := instCommMonoid K
src✝ : AddCommGroup (RatFunc K) := instAddCommGroup K
⊢ ∀ (a : RatFunc K), a * 0 = 0
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ (fun n d =>
        if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
      p q =
    (fun n d =>
        if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
      p' q'
[PROOFSTEP]
dsimp only
  -- porting note: force the function to be applied
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } } else 0) =
    if h : ↑φ q' ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } } else 0
[PROOFSTEP]
rw [dif_pos, dif_pos]
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := ?hc } } =
    { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := ?hc } }
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q' ∈ S[X]⁰
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q ∈ S[X]⁰
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q ∈ S[X]⁰
[PROOFSTEP]
congr 1
  -- porting note: this was a `rw [ofFractionRing.inj_eq]` which was overkill anyway
[GOAL]
case e_toFractionRing
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ Localization.mk (↑φ p) { val := ↑φ q, property := ?hc } = Localization.mk (↑φ p') { val := ↑φ q', property := ?hc }
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q' ∈ S[X]⁰
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q ∈ S[X]⁰
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q ∈ S[X]⁰
[PROOFSTEP]
rw [Localization.mk_eq_mk_iff]
[GOAL]
case e_toFractionRing
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑(Localization.r S[X]⁰) (↑φ p, { val := ↑φ q, property := ?hc }) (↑φ p', { val := ↑φ q', property := ?hc })
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q ∈ S[X]⁰
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q' ∈ S[X]⁰
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q' ∈ S[X]⁰
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q ∈ S[X]⁰
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q ∈ S[X]⁰
[PROOFSTEP]
rotate_left
[GOAL]
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q ∈ S[X]⁰
[PROOFSTEP]
exact hφ hq
[GOAL]
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑φ q' ∈ S[X]⁰
[PROOFSTEP]
exact hφ hq'
[GOAL]
case e_toFractionRing
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑(Localization.r S[X]⁰) (↑φ p, { val := ↑φ q, property := (_ : q ∈ Submonoid.comap φ S[X]⁰) })
    (↑φ p', { val := ↑φ q', property := (_ : q' ∈ Submonoid.comap φ S[X]⁰) })
[PROOFSTEP]
refine' Localization.r_of_eq _
[GOAL]
case e_toFractionRing
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ ↑(↑φ p', { val := ↑φ q', property := (_ : q' ∈ Submonoid.comap φ S[X]⁰) }).snd *
      (↑φ p, { val := ↑φ q, property := (_ : q ∈ Submonoid.comap φ S[X]⁰) }).fst =
    ↑(↑φ p, { val := ↑φ q, property := (_ : q ∈ Submonoid.comap φ S[X]⁰) }).snd *
      (↑φ p', { val := ↑φ q', property := (_ : q' ∈ Submonoid.comap φ S[X]⁰) }).fst
[PROOFSTEP]
simpa only [map_mul] using congr_arg φ h
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
⊢ (fun f =>
        RatFunc.liftOn f
          (fun n d =>
            if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
          (_ :
            ∀ {p q p' q' : R[X]},
              q ∈ R[X]⁰ →
                q' ∈ R[X]⁰ →
                  q' * p = q * p' →
                    (fun n d =>
                          if h : ↑φ d ∈ S[X]⁰ then
                            { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                          else 0)
                        p q =
                      (fun n d =>
                          if h : ↑φ d ∈ S[X]⁰ then
                            { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                          else 0)
                        p' q'))
      1 =
    1
[PROOFSTEP]
dsimp only
  -- porting note: force the function to be applied
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
⊢ RatFunc.liftOn 1
      (fun n d =>
        if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
      (_ :
        ∀ {p q p' q' : R[X]},
          q ∈ R[X]⁰ →
            q' ∈ R[X]⁰ →
              q' * p = q * p' →
                (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                  else 0) =
                  if h : ↑φ q' ∈ S[X]⁰ then
                    { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                  else 0) =
    1
[PROOFSTEP]
rw [← ofFractionRing_one, ← Localization.mk_one, liftOn_ofFractionRing_mk, dif_pos]
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
⊢ { toFractionRing := Localization.mk (↑φ 1) { val := ↑φ ↑1, property := ?hc } } = 1
[PROOFSTEP]
simpa using ofFractionRing_one
[GOAL]
case hc
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
⊢ ↑φ ↑1 ∈ S[X]⁰
[PROOFSTEP]
simpa using Submonoid.one_mem _
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
x y : RatFunc R
⊢ OneHom.toFun
      {
        toFun := fun f =>
          RatFunc.liftOn f
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (fun n d =>
                            if h : ↑φ d ∈ S[X]⁰ then
                              { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                            else 0)
                          p q =
                        (fun n d =>
                            if h : ↑φ d ∈ S[X]⁰ then
                              { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                            else 0)
                          p' q'),
        map_one' :=
          (_ :
            (fun f =>
                  RatFunc.liftOn f
                    (fun n d =>
                      if h : ↑φ d ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                      else 0)
                    (_ :
                      ∀ {p q p' q' : R[X]},
                        q ∈ R[X]⁰ →
                          q' ∈ R[X]⁰ →
                            q' * p = q * p' →
                              (fun n d =>
                                    if h : ↑φ d ∈ S[X]⁰ then
                                      { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                                    else 0)
                                  p q =
                                (fun n d =>
                                    if h : ↑φ d ∈ S[X]⁰ then
                                      { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                                    else 0)
                                  p' q'))
                1 =
              1) }
      (x * y) =
    OneHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f
              (fun n d =>
                if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                else 0)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ →
                      q' * p = q * p' →
                        (fun n d =>
                              if h : ↑φ d ∈ S[X]⁰ then
                                { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                              else 0)
                            p q =
                          (fun n d =>
                              if h : ↑φ d ∈ S[X]⁰ then
                                { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                              else 0)
                            p' q'),
          map_one' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f
                      (fun n d =>
                        if h : ↑φ d ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                        else 0)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' →
                                (fun n d =>
                                      if h : ↑φ d ∈ S[X]⁰ then
                                        { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                                      else 0)
                                    p q =
                                  (fun n d =>
                                      if h : ↑φ d ∈ S[X]⁰ then
                                        { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                                      else 0)
                                    p' q'))
                  1 =
                1) }
        x *
      OneHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f
              (fun n d =>
                if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                else 0)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ →
                      q' * p = q * p' →
                        (fun n d =>
                              if h : ↑φ d ∈ S[X]⁰ then
                                { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                              else 0)
                            p q =
                          (fun n d =>
                              if h : ↑φ d ∈ S[X]⁰ then
                                { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                              else 0)
                            p' q'),
          map_one' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f
                      (fun n d =>
                        if h : ↑φ d ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                        else 0)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' →
                                (fun n d =>
                                      if h : ↑φ d ∈ S[X]⁰ then
                                        { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                                      else 0)
                                    p q =
                                  (fun n d =>
                                      if h : ↑φ d ∈ S[X]⁰ then
                                        { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
                                      else 0)
                                    p' q'))
                  1 =
                1) }
        y
[PROOFSTEP]
dsimp only
  -- porting note: force the function to be applied
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
x y : RatFunc R
⊢ RatFunc.liftOn (x * y)
      (fun n d =>
        if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
      (_ :
        ∀ {p q p' q' : R[X]},
          q ∈ R[X]⁰ →
            q' ∈ R[X]⁰ →
              q' * p = q * p' →
                (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                  else 0) =
                  if h : ↑φ q' ∈ S[X]⁰ then
                    { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                  else 0) =
    RatFunc.liftOn x
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0) *
      RatFunc.liftOn y
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0)
[PROOFSTEP]
cases' x with x
[GOAL]
case ofFractionRing
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
y : RatFunc R
x : FractionRing R[X]
⊢ RatFunc.liftOn ({ toFractionRing := x } * y)
      (fun n d =>
        if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
      (_ :
        ∀ {p q p' q' : R[X]},
          q ∈ R[X]⁰ →
            q' ∈ R[X]⁰ →
              q' * p = q * p' →
                (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                  else 0) =
                  if h : ↑φ q' ∈ S[X]⁰ then
                    { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                  else 0) =
    RatFunc.liftOn { toFractionRing := x }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0) *
      RatFunc.liftOn y
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0)
[PROOFSTEP]
cases' y with y
[GOAL]
case ofFractionRing.ofFractionRing
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
x y : FractionRing R[X]
⊢ RatFunc.liftOn ({ toFractionRing := x } * { toFractionRing := y })
      (fun n d =>
        if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
      (_ :
        ∀ {p q p' q' : R[X]},
          q ∈ R[X]⁰ →
            q' ∈ R[X]⁰ →
              q' * p = q * p' →
                (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                  else 0) =
                  if h : ↑φ q' ∈ S[X]⁰ then
                    { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                  else 0) =
    RatFunc.liftOn { toFractionRing := x }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0) *
      RatFunc.liftOn { toFractionRing := y }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0)
[PROOFSTEP]
induction' x using Localization.rec with p q
[GOAL]
case ofFractionRing.ofFractionRing.f
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
y : FractionRing R[X]
p : R[X]
q : { x // x ∈ R[X]⁰ }
⊢ RatFunc.liftOn ({ toFractionRing := Localization.mk p q } * { toFractionRing := y })
      (fun n d =>
        if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
      (_ :
        ∀ {p q p' q' : R[X]},
          q ∈ R[X]⁰ →
            q' ∈ R[X]⁰ →
              q' * p = q * p' →
                (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                  else 0) =
                  if h : ↑φ q' ∈ S[X]⁰ then
                    { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                  else 0) =
    RatFunc.liftOn { toFractionRing := Localization.mk p q }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0) *
      RatFunc.liftOn { toFractionRing := y }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0)
case ofFractionRing.ofFractionRing.H
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
x y : FractionRing R[X]
a✝ c✝ : R[X]
b✝ d✝ : { x // x ∈ R[X]⁰ }
h✝ : ↑(Localization.r R[X]⁰) (a✝, b✝) (c✝, d✝)
⊢ (_ :
      RatFunc.liftOn ({ toFractionRing := Localization.mk c✝ d✝ } * { toFractionRing := y })
          (fun n d =>
            if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
          (_ :
            ∀ {p q p' q' : R[X]},
              q ∈ R[X]⁰ →
                q' ∈ R[X]⁰ →
                  q' * p = q * p' →
                    (if h : ↑φ q ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                      else 0) =
                      if h : ↑φ q' ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                      else 0) =
        RatFunc.liftOn { toFractionRing := Localization.mk c✝ d✝ }
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (if h : ↑φ q ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                        else 0) =
                        if h : ↑φ q' ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                        else 0) *
          RatFunc.liftOn { toFractionRing := y }
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (if h : ↑φ q ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                        else 0) =
                        if h : ↑φ q' ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                        else 0)) =
    (_ :
      RatFunc.liftOn ({ toFractionRing := Localization.mk c✝ d✝ } * { toFractionRing := y })
          (fun n d =>
            if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
          (_ :
            ∀ {p q p' q' : R[X]},
              q ∈ R[X]⁰ →
                q' ∈ R[X]⁰ →
                  q' * p = q * p' →
                    (if h : ↑φ q ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                      else 0) =
                      if h : ↑φ q' ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                      else 0) =
        RatFunc.liftOn { toFractionRing := Localization.mk c✝ d✝ }
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (if h : ↑φ q ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                        else 0) =
                        if h : ↑φ q' ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                        else 0) *
          RatFunc.liftOn { toFractionRing := y }
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (if h : ↑φ q ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                        else 0) =
                        if h : ↑φ q' ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                        else 0))
[PROOFSTEP]
induction' y using Localization.rec with p' q'
[GOAL]
case ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ RatFunc.liftOn ({ toFractionRing := Localization.mk p q } * { toFractionRing := Localization.mk p' q' })
      (fun n d =>
        if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
      (_ :
        ∀ {p q p' q' : R[X]},
          q ∈ R[X]⁰ →
            q' ∈ R[X]⁰ →
              q' * p = q * p' →
                (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                  else 0) =
                  if h : ↑φ q' ∈ S[X]⁰ then
                    { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                  else 0) =
    RatFunc.liftOn { toFractionRing := Localization.mk p q }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0) *
      RatFunc.liftOn { toFractionRing := Localization.mk p' q' }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0)
[PROOFSTEP]
have hq : φ q ∈ S[X]⁰ := hφ q.prop
[GOAL]
case ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
hq : ↑φ ↑q ∈ S[X]⁰
⊢ RatFunc.liftOn ({ toFractionRing := Localization.mk p q } * { toFractionRing := Localization.mk p' q' })
      (fun n d =>
        if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
      (_ :
        ∀ {p q p' q' : R[X]},
          q ∈ R[X]⁰ →
            q' ∈ R[X]⁰ →
              q' * p = q * p' →
                (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                  else 0) =
                  if h : ↑φ q' ∈ S[X]⁰ then
                    { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                  else 0) =
    RatFunc.liftOn { toFractionRing := Localization.mk p q }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0) *
      RatFunc.liftOn { toFractionRing := Localization.mk p' q' }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0)
[PROOFSTEP]
have hq' : φ q' ∈ S[X]⁰ := hφ q'.prop
[GOAL]
case ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
hq : ↑φ ↑q ∈ S[X]⁰
hq' : ↑φ ↑q' ∈ S[X]⁰
⊢ RatFunc.liftOn ({ toFractionRing := Localization.mk p q } * { toFractionRing := Localization.mk p' q' })
      (fun n d =>
        if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
      (_ :
        ∀ {p q p' q' : R[X]},
          q ∈ R[X]⁰ →
            q' ∈ R[X]⁰ →
              q' * p = q * p' →
                (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                  else 0) =
                  if h : ↑φ q' ∈ S[X]⁰ then
                    { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                  else 0) =
    RatFunc.liftOn { toFractionRing := Localization.mk p q }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0) *
      RatFunc.liftOn { toFractionRing := Localization.mk p' q' }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0)
[PROOFSTEP]
have hqq' : φ ↑(q * q') ∈ S[X]⁰ := by simpa using Submonoid.mul_mem _ hq hq'
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
hq : ↑φ ↑q ∈ S[X]⁰
hq' : ↑φ ↑q' ∈ S[X]⁰
⊢ ↑φ ↑(q * q') ∈ S[X]⁰
[PROOFSTEP]
simpa using Submonoid.mul_mem _ hq hq'
[GOAL]
case ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
hq : ↑φ ↑q ∈ S[X]⁰
hq' : ↑φ ↑q' ∈ S[X]⁰
hqq' : ↑φ ↑(q * q') ∈ S[X]⁰
⊢ RatFunc.liftOn ({ toFractionRing := Localization.mk p q } * { toFractionRing := Localization.mk p' q' })
      (fun n d =>
        if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
      (_ :
        ∀ {p q p' q' : R[X]},
          q ∈ R[X]⁰ →
            q' ∈ R[X]⁰ →
              q' * p = q * p' →
                (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                  else 0) =
                  if h : ↑φ q' ∈ S[X]⁰ then
                    { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                  else 0) =
    RatFunc.liftOn { toFractionRing := Localization.mk p q }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0) *
      RatFunc.liftOn { toFractionRing := Localization.mk p' q' }
        (fun n d =>
          if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
        (_ :
          ∀ {p q p' q' : R[X]},
            q ∈ R[X]⁰ →
              q' ∈ R[X]⁰ →
                q' * p = q * p' →
                  (if h : ↑φ q ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                    else 0) =
                    if h : ↑φ q' ∈ S[X]⁰ then
                      { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                    else 0)
[PROOFSTEP]
simp_rw [← ofFractionRing_mul, Localization.mk_mul, liftOn_ofFractionRing_mk, dif_pos hq, dif_pos hq', dif_pos hqq', ←
  ofFractionRing_mul, Submonoid.coe_mul, map_mul, Localization.mk_mul, Submonoid.mk_mul_mk]
[GOAL]
case ofFractionRing.ofFractionRing.f.H
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
y : FractionRing R[X]
p : R[X]
q : { x // x ∈ R[X]⁰ }
a✝ c✝ : R[X]
b✝ d✝ : { x // x ∈ R[X]⁰ }
h✝ : ↑(Localization.r R[X]⁰) (a✝, b✝) (c✝, d✝)
⊢ (_ :
      RatFunc.liftOn ({ toFractionRing := Localization.mk p q } * { toFractionRing := Localization.mk c✝ d✝ })
          (fun n d =>
            if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
          (_ :
            ∀ {p q p' q' : R[X]},
              q ∈ R[X]⁰ →
                q' ∈ R[X]⁰ →
                  q' * p = q * p' →
                    (if h : ↑φ q ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                      else 0) =
                      if h : ↑φ q' ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                      else 0) =
        RatFunc.liftOn { toFractionRing := Localization.mk p q }
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (if h : ↑φ q ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                        else 0) =
                        if h : ↑φ q' ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                        else 0) *
          RatFunc.liftOn { toFractionRing := Localization.mk c✝ d✝ }
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (if h : ↑φ q ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                        else 0) =
                        if h : ↑φ q' ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                        else 0)) =
    (_ :
      RatFunc.liftOn ({ toFractionRing := Localization.mk p q } * { toFractionRing := Localization.mk c✝ d✝ })
          (fun n d =>
            if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
          (_ :
            ∀ {p q p' q' : R[X]},
              q ∈ R[X]⁰ →
                q' ∈ R[X]⁰ →
                  q' * p = q * p' →
                    (if h : ↑φ q ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                      else 0) =
                      if h : ↑φ q' ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                      else 0) =
        RatFunc.liftOn { toFractionRing := Localization.mk p q }
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (if h : ↑φ q ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                        else 0) =
                        if h : ↑φ q' ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                        else 0) *
          RatFunc.liftOn { toFractionRing := Localization.mk c✝ d✝ }
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (if h : ↑φ q ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                        else 0) =
                        if h : ↑φ q' ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                        else 0))
[PROOFSTEP]
rfl
[GOAL]
case ofFractionRing.ofFractionRing.H
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
x y : FractionRing R[X]
a✝ c✝ : R[X]
b✝ d✝ : { x // x ∈ R[X]⁰ }
h✝ : ↑(Localization.r R[X]⁰) (a✝, b✝) (c✝, d✝)
⊢ (_ :
      RatFunc.liftOn ({ toFractionRing := Localization.mk c✝ d✝ } * { toFractionRing := y })
          (fun n d =>
            if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
          (_ :
            ∀ {p q p' q' : R[X]},
              q ∈ R[X]⁰ →
                q' ∈ R[X]⁰ →
                  q' * p = q * p' →
                    (if h : ↑φ q ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                      else 0) =
                      if h : ↑φ q' ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                      else 0) =
        RatFunc.liftOn { toFractionRing := Localization.mk c✝ d✝ }
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (if h : ↑φ q ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                        else 0) =
                        if h : ↑φ q' ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                        else 0) *
          RatFunc.liftOn { toFractionRing := y }
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (if h : ↑φ q ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                        else 0) =
                        if h : ↑φ q' ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                        else 0)) =
    (_ :
      RatFunc.liftOn ({ toFractionRing := Localization.mk c✝ d✝ } * { toFractionRing := y })
          (fun n d =>
            if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } } else 0)
          (_ :
            ∀ {p q p' q' : R[X]},
              q ∈ R[X]⁰ →
                q' ∈ R[X]⁰ →
                  q' * p = q * p' →
                    (if h : ↑φ q ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                      else 0) =
                      if h : ↑φ q' ∈ S[X]⁰ then
                        { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                      else 0) =
        RatFunc.liftOn { toFractionRing := Localization.mk c✝ d✝ }
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (if h : ↑φ q ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                        else 0) =
                        if h : ↑φ q' ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                        else 0) *
          RatFunc.liftOn { toFractionRing := y }
            (fun n d =>
              if h : ↑φ d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ d, property := h } }
              else 0)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ →
                    q' * p = q * p' →
                      (if h : ↑φ q ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p) { val := ↑φ q, property := h } }
                        else 0) =
                        if h : ↑φ q' ∈ S[X]⁰ then
                          { toFractionRing := Localization.mk (↑φ p') { val := ↑φ q', property := h } }
                        else 0))
[PROOFSTEP]
rfl
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
n : R[X]
d : { x // x ∈ R[X]⁰ }
⊢ ↑(map φ hφ) { toFractionRing := Localization.mk n d } =
    { toFractionRing := Localization.mk (↑φ n) { val := ↑φ ↑d, property := (_ : ↑d ∈ Submonoid.comap φ S[X]⁰) } }
[PROOFSTEP]
refine (liftOn_ofFractionRing_mk n _ _ _).trans ?_
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
n : R[X]
d : { x // x ∈ R[X]⁰ }
⊢ (if h : ↑φ ↑d ∈ S[X]⁰ then { toFractionRing := Localization.mk (↑φ n) { val := ↑φ ↑d, property := h } } else 0) =
    { toFractionRing := Localization.mk (↑φ n) { val := ↑φ ↑d, property := (_ : ↑d ∈ Submonoid.comap φ S[X]⁰) } }
[PROOFSTEP]
rw [dif_pos]
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
hf : Function.Injective ↑φ
⊢ Function.Injective ↑(map φ hφ)
[PROOFSTEP]
rintro ⟨x⟩ ⟨y⟩ h
[GOAL]
case ofFractionRing.ofFractionRing
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
hf : Function.Injective ↑φ
x y : FractionRing R[X]
h : ↑(map φ hφ) { toFractionRing := x } = ↑(map φ hφ) { toFractionRing := y }
⊢ { toFractionRing := x } = { toFractionRing := y }
[PROOFSTEP]
induction x using Localization.induction_on
[GOAL]
case ofFractionRing.ofFractionRing.H
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
hf : Function.Injective ↑φ
y : FractionRing R[X]
y✝ : R[X] × { x // x ∈ R[X]⁰ }
h : ↑(map φ hφ) { toFractionRing := Localization.mk y✝.fst y✝.snd } = ↑(map φ hφ) { toFractionRing := y }
⊢ { toFractionRing := Localization.mk y✝.fst y✝.snd } = { toFractionRing := y }
[PROOFSTEP]
induction y using Localization.induction_on
[GOAL]
case ofFractionRing.ofFractionRing.H.H
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : MonoidHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
hf : Function.Injective ↑φ
y✝¹ y✝ : R[X] × { x // x ∈ R[X]⁰ }
h :
  ↑(map φ hφ) { toFractionRing := Localization.mk y✝¹.fst y✝¹.snd } =
    ↑(map φ hφ) { toFractionRing := Localization.mk y✝.fst y✝.snd }
⊢ { toFractionRing := Localization.mk y✝¹.fst y✝¹.snd } = { toFractionRing := Localization.mk y✝.fst y✝.snd }
[PROOFSTEP]
simpa only [map_apply_ofFractionRing_mk, ofFractionRing_injective.eq_iff, Localization.mk_eq_mk_iff,
  Localization.r_iff_exists, mul_cancel_left_coe_nonZeroDivisors, exists_const, ← map_mul, hf.eq_iff] using h
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : RingHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
src✝ : RatFunc R →* RatFunc S := map φ hφ
⊢ OneHom.toFun
      (↑{ toOneHom := ↑src✝,
          map_mul' :=
            (_ : ∀ (x y : RatFunc R), OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
      0 =
    0
[PROOFSTEP]
simp_rw [MonoidHom.toFun_eq_coe, ← ofFractionRing_zero, ← Localization.mk_zero (1 : R[X]⁰), ←
  Localization.mk_zero (1 : S[X]⁰), map_apply_ofFractionRing_mk, map_zero, Localization.mk_eq_mk',
  IsLocalization.mk'_zero]
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : RingHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
src✝ : RatFunc R →* RatFunc S := map φ hφ
⊢ ∀ (x y : RatFunc R),
    OneHom.toFun
        (↑{ toOneHom := ↑src✝,
            map_mul' :=
              (_ :
                ∀ (x y : RatFunc R), OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
        (x + y) =
      OneHom.toFun
          (↑{ toOneHom := ↑src✝,
              map_mul' :=
                (_ :
                  ∀ (x y : RatFunc R),
                    OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
          x +
        OneHom.toFun
          (↑{ toOneHom := ↑src✝,
              map_mul' :=
                (_ :
                  ∀ (x y : RatFunc R),
                    OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
          y
[PROOFSTEP]
rintro ⟨x⟩
  ⟨y⟩
      -- porting note: had to hint `induction` which induction principle to use
[GOAL]
case ofFractionRing.ofFractionRing
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : RingHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
src✝ : RatFunc R →* RatFunc S := map φ hφ
x y : FractionRing R[X]
⊢ OneHom.toFun
      (↑{ toOneHom := ↑src✝,
          map_mul' :=
            (_ : ∀ (x y : RatFunc R), OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
      ({ toFractionRing := x } + { toFractionRing := y }) =
    OneHom.toFun
        ↑{ toOneHom := ↑src✝,
            map_mul' :=
              (_ :
                ∀ (x y : RatFunc R), OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
        { toFractionRing := x } +
      OneHom.toFun
        ↑{ toOneHom := ↑src✝,
            map_mul' :=
              (_ :
                ∀ (x y : RatFunc R), OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
        { toFractionRing := y }
[PROOFSTEP]
induction x using Localization.rec
[GOAL]
case ofFractionRing.ofFractionRing.f
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : RingHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
src✝ : RatFunc R →* RatFunc S := map φ hφ
y : FractionRing R[X]
a✝ : R[X]
b✝ : { x // x ∈ R[X]⁰ }
⊢ OneHom.toFun
      (↑{ toOneHom := ↑src✝,
          map_mul' :=
            (_ : ∀ (x y : RatFunc R), OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
      ({ toFractionRing := Localization.mk a✝ b✝ } + { toFractionRing := y }) =
    OneHom.toFun
        ↑{ toOneHom := ↑src✝,
            map_mul' :=
              (_ :
                ∀ (x y : RatFunc R), OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
        { toFractionRing := Localization.mk a✝ b✝ } +
      OneHom.toFun
        ↑{ toOneHom := ↑src✝,
            map_mul' :=
              (_ :
                ∀ (x y : RatFunc R), OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
        { toFractionRing := y }
case ofFractionRing.ofFractionRing.H
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : RingHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
src✝ : RatFunc R →* RatFunc S := map φ hφ
x y : FractionRing R[X]
a✝ c✝ : R[X]
b✝ d✝ : { x // x ∈ R[X]⁰ }
h✝ : ↑(Localization.r R[X]⁰) (a✝, b✝) (c✝, d✝)
⊢ (_ :
      OneHom.toFun
          (↑{ toOneHom := ↑src✝,
              map_mul' :=
                (_ :
                  ∀ (x y : RatFunc R),
                    OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
          ({ toFractionRing := Localization.mk c✝ d✝ } + { toFractionRing := y }) =
        OneHom.toFun
            ↑{ toOneHom := ↑src✝,
                map_mul' :=
                  (_ :
                    ∀ (x y : RatFunc R),
                      OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
            { toFractionRing := Localization.mk c✝ d✝ } +
          OneHom.toFun
            ↑{ toOneHom := ↑src✝,
                map_mul' :=
                  (_ :
                    ∀ (x y : RatFunc R),
                      OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
            { toFractionRing := y }) =
    (_ :
      OneHom.toFun
          (↑{ toOneHom := ↑src✝,
              map_mul' :=
                (_ :
                  ∀ (x y : RatFunc R),
                    OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
          ({ toFractionRing := Localization.mk c✝ d✝ } + { toFractionRing := y }) =
        OneHom.toFun
            ↑{ toOneHom := ↑src✝,
                map_mul' :=
                  (_ :
                    ∀ (x y : RatFunc R),
                      OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
            { toFractionRing := Localization.mk c✝ d✝ } +
          OneHom.toFun
            ↑{ toOneHom := ↑src✝,
                map_mul' :=
                  (_ :
                    ∀ (x y : RatFunc R),
                      OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
            { toFractionRing := y })
[PROOFSTEP]
induction y using Localization.rec
[GOAL]
case ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : RingHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
src✝ : RatFunc R →* RatFunc S := map φ hφ
a✝¹ : R[X]
b✝¹ : { x // x ∈ R[X]⁰ }
a✝ : R[X]
b✝ : { x // x ∈ R[X]⁰ }
⊢ OneHom.toFun
      (↑{ toOneHom := ↑src✝,
          map_mul' :=
            (_ : ∀ (x y : RatFunc R), OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
      ({ toFractionRing := Localization.mk a✝¹ b✝¹ } + { toFractionRing := Localization.mk a✝ b✝ }) =
    OneHom.toFun
        ↑{ toOneHom := ↑src✝,
            map_mul' :=
              (_ :
                ∀ (x y : RatFunc R), OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
        { toFractionRing := Localization.mk a✝¹ b✝¹ } +
      OneHom.toFun
        ↑{ toOneHom := ↑src✝,
            map_mul' :=
              (_ :
                ∀ (x y : RatFunc R), OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
        { toFractionRing := Localization.mk a✝ b✝ }
[PROOFSTEP]
simp only [← ofFractionRing_add, Localization.add_mk, map_add, map_mul, MonoidHom.toFun_eq_coe,
  map_apply_ofFractionRing_mk, Submonoid.coe_mul]
  -- Porting note: `Submonoid.mk_mul_mk` couldn't be applied: motive incorrect,
          -- even though it is a rfl lemma.
[GOAL]
case ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : RingHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
src✝ : RatFunc R →* RatFunc S := map φ hφ
a✝¹ : R[X]
b✝¹ : { x // x ∈ R[X]⁰ }
a✝ : R[X]
b✝ : { x // x ∈ R[X]⁰ }
⊢ {
      toFractionRing :=
        Localization.mk (↑φ ↑b✝¹ * ↑φ a✝ + ↑φ ↑b✝ * ↑φ a✝¹)
          { val := ↑φ ↑b✝¹ * ↑φ ↑b✝, property := (_ : (fun x => x ∈ S[X]⁰) (↑φ ↑b✝¹ * ↑φ ↑b✝)) } } =
    {
      toFractionRing :=
        Localization.mk (↑φ ↑b✝¹ * ↑φ a✝ + ↑φ ↑b✝ * ↑φ a✝¹)
          ({ val := ↑φ ↑b✝¹, property := (_ : ↑b✝¹ ∈ Submonoid.comap φ S[X]⁰) } *
            { val := ↑φ ↑b✝, property := (_ : ↑b✝ ∈ Submonoid.comap φ S[X]⁰) }) }
[PROOFSTEP]
rfl
[GOAL]
case ofFractionRing.ofFractionRing.f.H
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : RingHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
src✝ : RatFunc R →* RatFunc S := map φ hφ
y : FractionRing R[X]
a✝¹ : R[X]
b✝¹ : { x // x ∈ R[X]⁰ }
a✝ c✝ : R[X]
b✝ d✝ : { x // x ∈ R[X]⁰ }
h✝ : ↑(Localization.r R[X]⁰) (a✝, b✝) (c✝, d✝)
⊢ (_ :
      OneHom.toFun
          (↑{ toOneHom := ↑src✝,
              map_mul' :=
                (_ :
                  ∀ (x y : RatFunc R),
                    OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
          ({ toFractionRing := Localization.mk a✝¹ b✝¹ } + { toFractionRing := Localization.mk c✝ d✝ }) =
        OneHom.toFun
            ↑{ toOneHom := ↑src✝,
                map_mul' :=
                  (_ :
                    ∀ (x y : RatFunc R),
                      OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
            { toFractionRing := Localization.mk a✝¹ b✝¹ } +
          OneHom.toFun
            ↑{ toOneHom := ↑src✝,
                map_mul' :=
                  (_ :
                    ∀ (x y : RatFunc R),
                      OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
            { toFractionRing := Localization.mk c✝ d✝ }) =
    (_ :
      OneHom.toFun
          (↑{ toOneHom := ↑src✝,
              map_mul' :=
                (_ :
                  ∀ (x y : RatFunc R),
                    OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
          ({ toFractionRing := Localization.mk a✝¹ b✝¹ } + { toFractionRing := Localization.mk c✝ d✝ }) =
        OneHom.toFun
            ↑{ toOneHom := ↑src✝,
                map_mul' :=
                  (_ :
                    ∀ (x y : RatFunc R),
                      OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
            { toFractionRing := Localization.mk a✝¹ b✝¹ } +
          OneHom.toFun
            ↑{ toOneHom := ↑src✝,
                map_mul' :=
                  (_ :
                    ∀ (x y : RatFunc R),
                      OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
            { toFractionRing := Localization.mk c✝ d✝ })
[PROOFSTEP]
rfl
[GOAL]
case ofFractionRing.ofFractionRing.H
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : RingHomClass F R[X] S[X]
φ : F
hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰
src✝ : RatFunc R →* RatFunc S := map φ hφ
x y : FractionRing R[X]
a✝ c✝ : R[X]
b✝ d✝ : { x // x ∈ R[X]⁰ }
h✝ : ↑(Localization.r R[X]⁰) (a✝, b✝) (c✝, d✝)
⊢ (_ :
      OneHom.toFun
          (↑{ toOneHom := ↑src✝,
              map_mul' :=
                (_ :
                  ∀ (x y : RatFunc R),
                    OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
          ({ toFractionRing := Localization.mk c✝ d✝ } + { toFractionRing := y }) =
        OneHom.toFun
            ↑{ toOneHom := ↑src✝,
                map_mul' :=
                  (_ :
                    ∀ (x y : RatFunc R),
                      OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
            { toFractionRing := Localization.mk c✝ d✝ } +
          OneHom.toFun
            ↑{ toOneHom := ↑src✝,
                map_mul' :=
                  (_ :
                    ∀ (x y : RatFunc R),
                      OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
            { toFractionRing := y }) =
    (_ :
      OneHom.toFun
          (↑{ toOneHom := ↑src✝,
              map_mul' :=
                (_ :
                  ∀ (x y : RatFunc R),
                    OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) })
          ({ toFractionRing := Localization.mk c✝ d✝ } + { toFractionRing := y }) =
        OneHom.toFun
            ↑{ toOneHom := ↑src✝,
                map_mul' :=
                  (_ :
                    ∀ (x y : RatFunc R),
                      OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
            { toFractionRing := Localization.mk c✝ d✝ } +
          OneHom.toFun
            ↑{ toOneHom := ↑src✝,
                map_mul' :=
                  (_ :
                    ∀ (x y : RatFunc R),
                      OneHom.toFun (↑src✝) (x * y) = OneHom.toFun (↑src✝) x * OneHom.toFun (↑src✝) y) }
            { toFractionRing := y })
[PROOFSTEP]
rfl
[GOAL]
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
⊢ (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'
[PROOFSTEP]
cases subsingleton_or_nontrivial R
[GOAL]
case inl
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
h✝ : Subsingleton R
⊢ (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'
[PROOFSTEP]
rw [Subsingleton.elim p q, Subsingleton.elim p' q, Subsingleton.elim q' q]
[GOAL]
case inr
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
h✝ : Nontrivial R
⊢ (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'
[PROOFSTEP]
rw [div_eq_div_iff, ← map_mul, mul_comm p, h, map_mul, mul_comm]
[GOAL]
case inr.hb
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
h✝ : Nontrivial R
⊢ ↑φ q ≠ 0
[PROOFSTEP]
exact nonZeroDivisors.ne_zero (hφ ‹_›)
[GOAL]
case inr.hd
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
f : RatFunc R
p q p' q' : R[X]
hq : q ∈ R[X]⁰
hq' : q' ∈ R[X]⁰
h : q' * p = q * p'
h✝ : Nontrivial R
⊢ ↑φ q' ≠ 0
[PROOFSTEP]
exact nonZeroDivisors.ne_zero (hφ ‹_›)
[GOAL]
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
⊢ (fun f =>
        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
          (_ :
            ∀ {p q p' q' : R[X]},
              q ∈ R[X]⁰ → q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
      0 =
    0
[PROOFSTEP]
dsimp only
  -- porting note: force the function to be applied
[GOAL]
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
⊢ RatFunc.liftOn 0 (fun p q => ↑φ p / ↑φ q)
      (_ : ∀ {p q p' q' : R[X]}, q ∈ R[X]⁰ → q' ∈ R[X]⁰ → q' * p = q * p' → ↑φ p / ↑φ q = ↑φ p' / ↑φ q') =
    0
[PROOFSTEP]
rw [← ofFractionRing_zero, ← Localization.mk_zero (1 : R[X]⁰), liftOn_ofFractionRing_mk]
[GOAL]
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
⊢ ↑φ 0 / ↑φ ↑1 = 0
[PROOFSTEP]
simp only [map_zero, zero_div]
[GOAL]
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
⊢ ZeroHom.toFun
      {
        toFun := fun f =>
          RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
        map_zero' :=
          (_ :
            (fun f =>
                  RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                    (_ :
                      ∀ {p q p' q' : R[X]},
                        q ∈ R[X]⁰ →
                          q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                0 =
              0) }
      1 =
    1
[PROOFSTEP]
dsimp only
  -- porting note: force the function to be applied
[GOAL]
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
⊢ RatFunc.liftOn 1 (fun p q => ↑φ p / ↑φ q)
      (_ : ∀ {p q p' q' : R[X]}, q ∈ R[X]⁰ → q' ∈ R[X]⁰ → q' * p = q * p' → ↑φ p / ↑φ q = ↑φ p' / ↑φ q') =
    1
[PROOFSTEP]
rw [← ofFractionRing_one, ← Localization.mk_one, liftOn_ofFractionRing_mk]
[GOAL]
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
⊢ ↑φ 1 / ↑φ ↑1 = 1
[PROOFSTEP]
simp only [map_one, Submonoid.coe_one, div_one]
[GOAL]
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
x y : RatFunc R
⊢ ZeroHom.toFun
      {
        toFun := fun f =>
          RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
        map_zero' :=
          (_ :
            (fun f =>
                  RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                    (_ :
                      ∀ {p q p' q' : R[X]},
                        q ∈ R[X]⁰ →
                          q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                0 =
              0) }
      (x * y) =
    ZeroHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
          map_zero' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                  0 =
                0) }
        x *
      ZeroHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
          map_zero' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                  0 =
                0) }
        y
[PROOFSTEP]
cases' x with x
[GOAL]
case ofFractionRing
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
y : RatFunc R
x : FractionRing R[X]
⊢ ZeroHom.toFun
      {
        toFun := fun f =>
          RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
        map_zero' :=
          (_ :
            (fun f =>
                  RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                    (_ :
                      ∀ {p q p' q' : R[X]},
                        q ∈ R[X]⁰ →
                          q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                0 =
              0) }
      ({ toFractionRing := x } * y) =
    ZeroHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
          map_zero' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                  0 =
                0) }
        { toFractionRing := x } *
      ZeroHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
          map_zero' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                  0 =
                0) }
        y
[PROOFSTEP]
cases' y with y
[GOAL]
case ofFractionRing.ofFractionRing
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
x y : FractionRing R[X]
⊢ ZeroHom.toFun
      {
        toFun := fun f =>
          RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
        map_zero' :=
          (_ :
            (fun f =>
                  RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                    (_ :
                      ∀ {p q p' q' : R[X]},
                        q ∈ R[X]⁰ →
                          q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                0 =
              0) }
      ({ toFractionRing := x } * { toFractionRing := y }) =
    ZeroHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
          map_zero' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                  0 =
                0) }
        { toFractionRing := x } *
      ZeroHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
          map_zero' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                  0 =
                0) }
        { toFractionRing := y }
[PROOFSTEP]
induction' x using Localization.rec with p q
[GOAL]
case ofFractionRing.ofFractionRing.f
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
y : FractionRing R[X]
p : R[X]
q : { x // x ∈ R[X]⁰ }
⊢ ZeroHom.toFun
      {
        toFun := fun f =>
          RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
        map_zero' :=
          (_ :
            (fun f =>
                  RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                    (_ :
                      ∀ {p q p' q' : R[X]},
                        q ∈ R[X]⁰ →
                          q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                0 =
              0) }
      ({ toFractionRing := Localization.mk p q } * { toFractionRing := y }) =
    ZeroHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
          map_zero' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                  0 =
                0) }
        { toFractionRing := Localization.mk p q } *
      ZeroHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
          map_zero' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                  0 =
                0) }
        { toFractionRing := y }
case ofFractionRing.ofFractionRing.H
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
x y : FractionRing R[X]
a✝ c✝ : R[X]
b✝ d✝ : { x // x ∈ R[X]⁰ }
h✝ : ↑(Localization.r R[X]⁰) (a✝, b✝) (c✝, d✝)
⊢ (_ :
      ZeroHom.toFun
          {
            toFun := fun f =>
              RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                (_ :
                  ∀ {p q p' q' : R[X]},
                    q ∈ R[X]⁰ →
                      q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
            map_zero' :=
              (_ :
                (fun f =>
                      RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                        (_ :
                          ∀ {p q p' q' : R[X]},
                            q ∈ R[X]⁰ →
                              q' ∈ R[X]⁰ →
                                q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                    0 =
                  0) }
          ({ toFractionRing := Localization.mk c✝ d✝ } * { toFractionRing := y }) =
        ZeroHom.toFun
            {
              toFun := fun f =>
                RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                  (_ :
                    ∀ {p q p' q' : R[X]},
                      q ∈ R[X]⁰ →
                        q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
              map_zero' :=
                (_ :
                  (fun f =>
                        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                          (_ :
                            ∀ {p q p' q' : R[X]},
                              q ∈ R[X]⁰ →
                                q' ∈ R[X]⁰ →
                                  q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                      0 =
                    0) }
            { toFractionRing := Localization.mk c✝ d✝ } *
          ZeroHom.toFun
            {
              toFun := fun f =>
                RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                  (_ :
                    ∀ {p q p' q' : R[X]},
                      q ∈ R[X]⁰ →
                        q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
              map_zero' :=
                (_ :
                  (fun f =>
                        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                          (_ :
                            ∀ {p q p' q' : R[X]},
                              q ∈ R[X]⁰ →
                                q' ∈ R[X]⁰ →
                                  q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                      0 =
                    0) }
            { toFractionRing := y }) =
    (_ :
      ZeroHom.toFun
          {
            toFun := fun f =>
              RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                (_ :
                  ∀ {p q p' q' : R[X]},
                    q ∈ R[X]⁰ →
                      q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
            map_zero' :=
              (_ :
                (fun f =>
                      RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                        (_ :
                          ∀ {p q p' q' : R[X]},
                            q ∈ R[X]⁰ →
                              q' ∈ R[X]⁰ →
                                q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                    0 =
                  0) }
          ({ toFractionRing := Localization.mk c✝ d✝ } * { toFractionRing := y }) =
        ZeroHom.toFun
            {
              toFun := fun f =>
                RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                  (_ :
                    ∀ {p q p' q' : R[X]},
                      q ∈ R[X]⁰ →
                        q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
              map_zero' :=
                (_ :
                  (fun f =>
                        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                          (_ :
                            ∀ {p q p' q' : R[X]},
                              q ∈ R[X]⁰ →
                                q' ∈ R[X]⁰ →
                                  q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                      0 =
                    0) }
            { toFractionRing := Localization.mk c✝ d✝ } *
          ZeroHom.toFun
            {
              toFun := fun f =>
                RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                  (_ :
                    ∀ {p q p' q' : R[X]},
                      q ∈ R[X]⁰ →
                        q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
              map_zero' :=
                (_ :
                  (fun f =>
                        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                          (_ :
                            ∀ {p q p' q' : R[X]},
                              q ∈ R[X]⁰ →
                                q' ∈ R[X]⁰ →
                                  q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                      0 =
                    0) }
            { toFractionRing := y })
[PROOFSTEP]
induction' y using Localization.rec with p' q'
[GOAL]
case ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ZeroHom.toFun
      {
        toFun := fun f =>
          RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
        map_zero' :=
          (_ :
            (fun f =>
                  RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                    (_ :
                      ∀ {p q p' q' : R[X]},
                        q ∈ R[X]⁰ →
                          q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                0 =
              0) }
      ({ toFractionRing := Localization.mk p q } * { toFractionRing := Localization.mk p' q' }) =
    ZeroHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
          map_zero' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                  0 =
                0) }
        { toFractionRing := Localization.mk p q } *
      ZeroHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
          map_zero' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                  0 =
                0) }
        { toFractionRing := Localization.mk p' q' }
[PROOFSTEP]
rw [← ofFractionRing_mul, Localization.mk_mul]
[GOAL]
case ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ZeroHom.toFun
      {
        toFun := fun f =>
          RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
            (_ :
              ∀ {p q p' q' : R[X]},
                q ∈ R[X]⁰ →
                  q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
        map_zero' :=
          (_ :
            (fun f =>
                  RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                    (_ :
                      ∀ {p q p' q' : R[X]},
                        q ∈ R[X]⁰ →
                          q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                0 =
              0) }
      { toFractionRing := Localization.mk (p * p') (q * q') } =
    ZeroHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
          map_zero' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                  0 =
                0) }
        { toFractionRing := Localization.mk p q } *
      ZeroHom.toFun
        {
          toFun := fun f =>
            RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
              (_ :
                ∀ {p q p' q' : R[X]},
                  q ∈ R[X]⁰ →
                    q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
          map_zero' :=
            (_ :
              (fun f =>
                    RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                      (_ :
                        ∀ {p q p' q' : R[X]},
                          q ∈ R[X]⁰ →
                            q' ∈ R[X]⁰ →
                              q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                  0 =
                0) }
        { toFractionRing := Localization.mk p' q' }
[PROOFSTEP]
simp only [liftOn_ofFractionRing_mk, div_mul_div_comm, map_mul, Submonoid.coe_mul]
[GOAL]
case ofFractionRing.ofFractionRing.f.H
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
y : FractionRing R[X]
p : R[X]
q : { x // x ∈ R[X]⁰ }
a✝ c✝ : R[X]
b✝ d✝ : { x // x ∈ R[X]⁰ }
h✝ : ↑(Localization.r R[X]⁰) (a✝, b✝) (c✝, d✝)
⊢ (_ :
      ZeroHom.toFun
          {
            toFun := fun f =>
              RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                (_ :
                  ∀ {p q p' q' : R[X]},
                    q ∈ R[X]⁰ →
                      q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
            map_zero' :=
              (_ :
                (fun f =>
                      RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                        (_ :
                          ∀ {p q p' q' : R[X]},
                            q ∈ R[X]⁰ →
                              q' ∈ R[X]⁰ →
                                q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                    0 =
                  0) }
          ({ toFractionRing := Localization.mk p q } * { toFractionRing := Localization.mk c✝ d✝ }) =
        ZeroHom.toFun
            {
              toFun := fun f =>
                RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                  (_ :
                    ∀ {p q p' q' : R[X]},
                      q ∈ R[X]⁰ →
                        q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
              map_zero' :=
                (_ :
                  (fun f =>
                        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                          (_ :
                            ∀ {p q p' q' : R[X]},
                              q ∈ R[X]⁰ →
                                q' ∈ R[X]⁰ →
                                  q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                      0 =
                    0) }
            { toFractionRing := Localization.mk p q } *
          ZeroHom.toFun
            {
              toFun := fun f =>
                RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                  (_ :
                    ∀ {p q p' q' : R[X]},
                      q ∈ R[X]⁰ →
                        q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
              map_zero' :=
                (_ :
                  (fun f =>
                        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                          (_ :
                            ∀ {p q p' q' : R[X]},
                              q ∈ R[X]⁰ →
                                q' ∈ R[X]⁰ →
                                  q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                      0 =
                    0) }
            { toFractionRing := Localization.mk c✝ d✝ }) =
    (_ :
      ZeroHom.toFun
          {
            toFun := fun f =>
              RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                (_ :
                  ∀ {p q p' q' : R[X]},
                    q ∈ R[X]⁰ →
                      q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
            map_zero' :=
              (_ :
                (fun f =>
                      RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                        (_ :
                          ∀ {p q p' q' : R[X]},
                            q ∈ R[X]⁰ →
                              q' ∈ R[X]⁰ →
                                q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                    0 =
                  0) }
          ({ toFractionRing := Localization.mk p q } * { toFractionRing := Localization.mk c✝ d✝ }) =
        ZeroHom.toFun
            {
              toFun := fun f =>
                RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                  (_ :
                    ∀ {p q p' q' : R[X]},
                      q ∈ R[X]⁰ →
                        q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
              map_zero' :=
                (_ :
                  (fun f =>
                        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                          (_ :
                            ∀ {p q p' q' : R[X]},
                              q ∈ R[X]⁰ →
                                q' ∈ R[X]⁰ →
                                  q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                      0 =
                    0) }
            { toFractionRing := Localization.mk p q } *
          ZeroHom.toFun
            {
              toFun := fun f =>
                RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                  (_ :
                    ∀ {p q p' q' : R[X]},
                      q ∈ R[X]⁰ →
                        q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
              map_zero' :=
                (_ :
                  (fun f =>
                        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                          (_ :
                            ∀ {p q p' q' : R[X]},
                              q ∈ R[X]⁰ →
                                q' ∈ R[X]⁰ →
                                  q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                      0 =
                    0) }
            { toFractionRing := Localization.mk c✝ d✝ })
[PROOFSTEP]
rfl
[GOAL]
case ofFractionRing.ofFractionRing.H
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →*₀ G₀
hφ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰
x y : FractionRing R[X]
a✝ c✝ : R[X]
b✝ d✝ : { x // x ∈ R[X]⁰ }
h✝ : ↑(Localization.r R[X]⁰) (a✝, b✝) (c✝, d✝)
⊢ (_ :
      ZeroHom.toFun
          {
            toFun := fun f =>
              RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                (_ :
                  ∀ {p q p' q' : R[X]},
                    q ∈ R[X]⁰ →
                      q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
            map_zero' :=
              (_ :
                (fun f =>
                      RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                        (_ :
                          ∀ {p q p' q' : R[X]},
                            q ∈ R[X]⁰ →
                              q' ∈ R[X]⁰ →
                                q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                    0 =
                  0) }
          ({ toFractionRing := Localization.mk c✝ d✝ } * { toFractionRing := y }) =
        ZeroHom.toFun
            {
              toFun := fun f =>
                RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                  (_ :
                    ∀ {p q p' q' : R[X]},
                      q ∈ R[X]⁰ →
                        q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
              map_zero' :=
                (_ :
                  (fun f =>
                        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                          (_ :
                            ∀ {p q p' q' : R[X]},
                              q ∈ R[X]⁰ →
                                q' ∈ R[X]⁰ →
                                  q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                      0 =
                    0) }
            { toFractionRing := Localization.mk c✝ d✝ } *
          ZeroHom.toFun
            {
              toFun := fun f =>
                RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                  (_ :
                    ∀ {p q p' q' : R[X]},
                      q ∈ R[X]⁰ →
                        q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
              map_zero' :=
                (_ :
                  (fun f =>
                        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                          (_ :
                            ∀ {p q p' q' : R[X]},
                              q ∈ R[X]⁰ →
                                q' ∈ R[X]⁰ →
                                  q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                      0 =
                    0) }
            { toFractionRing := y }) =
    (_ :
      ZeroHom.toFun
          {
            toFun := fun f =>
              RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                (_ :
                  ∀ {p q p' q' : R[X]},
                    q ∈ R[X]⁰ →
                      q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
            map_zero' :=
              (_ :
                (fun f =>
                      RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                        (_ :
                          ∀ {p q p' q' : R[X]},
                            q ∈ R[X]⁰ →
                              q' ∈ R[X]⁰ →
                                q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                    0 =
                  0) }
          ({ toFractionRing := Localization.mk c✝ d✝ } * { toFractionRing := y }) =
        ZeroHom.toFun
            {
              toFun := fun f =>
                RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                  (_ :
                    ∀ {p q p' q' : R[X]},
                      q ∈ R[X]⁰ →
                        q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
              map_zero' :=
                (_ :
                  (fun f =>
                        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                          (_ :
                            ∀ {p q p' q' : R[X]},
                              q ∈ R[X]⁰ →
                                q' ∈ R[X]⁰ →
                                  q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                      0 =
                    0) }
            { toFractionRing := Localization.mk c✝ d✝ } *
          ZeroHom.toFun
            {
              toFun := fun f =>
                RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                  (_ :
                    ∀ {p q p' q' : R[X]},
                      q ∈ R[X]⁰ →
                        q' ∈ R[X]⁰ → q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'),
              map_zero' :=
                (_ :
                  (fun f =>
                        RatFunc.liftOn f (fun p q => ↑φ p / ↑φ q)
                          (_ :
                            ∀ {p q p' q' : R[X]},
                              q ∈ R[X]⁰ →
                                q' ∈ R[X]⁰ →
                                  q' * p = q * p' → (fun p q => ↑φ p / ↑φ q) p q = (fun p q => ↑φ p / ↑φ q) p' q'))
                      0 =
                    0) }
            { toFractionRing := y })
[PROOFSTEP]
rfl
[GOAL]
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
⊢ Function.Injective ↑(liftMonoidWithZeroHom φ hφ')
[PROOFSTEP]
rintro ⟨x⟩ ⟨y⟩
[GOAL]
case ofFractionRing.ofFractionRing
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
x y : FractionRing R[X]
⊢ ↑(liftMonoidWithZeroHom φ hφ') { toFractionRing := x } = ↑(liftMonoidWithZeroHom φ hφ') { toFractionRing := y } →
    { toFractionRing := x } = { toFractionRing := y }
[PROOFSTEP]
induction' x using Localization.induction_on with a
[GOAL]
case ofFractionRing.ofFractionRing.H
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
y : FractionRing R[X]
a : R[X] × { x // x ∈ R[X]⁰ }
⊢ ↑(liftMonoidWithZeroHom φ hφ') { toFractionRing := Localization.mk a.fst a.snd } =
      ↑(liftMonoidWithZeroHom φ hφ') { toFractionRing := y } →
    { toFractionRing := Localization.mk a.fst a.snd } = { toFractionRing := y }
[PROOFSTEP]
induction' y using Localization.induction_on with a'
[GOAL]
case ofFractionRing.ofFractionRing.H.H
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
a a' : R[X] × { x // x ∈ R[X]⁰ }
⊢ ↑(liftMonoidWithZeroHom φ hφ') { toFractionRing := Localization.mk a.fst a.snd } =
      ↑(liftMonoidWithZeroHom φ hφ') { toFractionRing := Localization.mk a'.fst a'.snd } →
    { toFractionRing := Localization.mk a.fst a.snd } = { toFractionRing := Localization.mk a'.fst a'.snd }
[PROOFSTEP]
simp_rw [liftMonoidWithZeroHom_apply_ofFractionRing_mk]
[GOAL]
case ofFractionRing.ofFractionRing.H.H
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
a a' : R[X] × { x // x ∈ R[X]⁰ }
⊢ ↑φ a.fst / ↑φ ↑a.snd = ↑φ a'.fst / ↑φ ↑a'.snd →
    { toFractionRing := Localization.mk a.fst a.snd } = { toFractionRing := Localization.mk a'.fst a'.snd }
[PROOFSTEP]
intro h
[GOAL]
case ofFractionRing.ofFractionRing.H.H
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
a a' : R[X] × { x // x ∈ R[X]⁰ }
h : ↑φ a.fst / ↑φ ↑a.snd = ↑φ a'.fst / ↑φ ↑a'.snd
⊢ { toFractionRing := Localization.mk a.fst a.snd } = { toFractionRing := Localization.mk a'.fst a'.snd }
[PROOFSTEP]
congr 1
[GOAL]
case ofFractionRing.ofFractionRing.H.H.e_toFractionRing
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
a a' : R[X] × { x // x ∈ R[X]⁰ }
h : ↑φ a.fst / ↑φ ↑a.snd = ↑φ a'.fst / ↑φ ↑a'.snd
⊢ Localization.mk a.fst a.snd = Localization.mk a'.fst a'.snd
[PROOFSTEP]
refine Localization.mk_eq_mk_iff.mpr (Localization.r_of_eq (M := R[X]) ?_)
[GOAL]
case ofFractionRing.ofFractionRing.H.H.e_toFractionRing
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
a a' : R[X] × { x // x ∈ R[X]⁰ }
h : ↑φ a.fst / ↑φ ↑a.snd = ↑φ a'.fst / ↑φ ↑a'.snd
⊢ ↑(a'.fst, a'.snd).snd * (a.fst, a.snd).fst = ↑(a.fst, a.snd).snd * (a'.fst, a'.snd).fst
[PROOFSTEP]
have := mul_eq_mul_of_div_eq_div _ _ ?_ ?_ h
[GOAL]
case ofFractionRing.ofFractionRing.H.H.e_toFractionRing.refine_3
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
a a' : R[X] × { x // x ∈ R[X]⁰ }
h : ↑φ a.fst / ↑φ ↑a.snd = ↑φ a'.fst / ↑φ ↑a'.snd
this : ↑φ a.fst * ↑φ ↑a'.snd = ↑φ a'.fst * ↑φ ↑a.snd
⊢ ↑(a'.fst, a'.snd).snd * (a.fst, a.snd).fst = ↑(a.fst, a.snd).snd * (a'.fst, a'.snd).fst
case ofFractionRing.ofFractionRing.H.H.e_toFractionRing.refine_1
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
a a' : R[X] × { x // x ∈ R[X]⁰ }
h : ↑φ a.fst / ↑φ ↑a.snd = ↑φ a'.fst / ↑φ ↑a'.snd
⊢ ↑φ ↑a.snd ≠ 0
case ofFractionRing.ofFractionRing.H.H.e_toFractionRing.refine_2
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
a a' : R[X] × { x // x ∈ R[X]⁰ }
h : ↑φ a.fst / ↑φ ↑a.snd = ↑φ a'.fst / ↑φ ↑a'.snd
⊢ ↑φ ↑a'.snd ≠ 0
[PROOFSTEP]
rwa [← map_mul, ← map_mul, hφ.eq_iff, mul_comm, mul_comm a'.fst] at this 
[GOAL]
case ofFractionRing.ofFractionRing.H.H.e_toFractionRing.refine_1
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
a a' : R[X] × { x // x ∈ R[X]⁰ }
h : ↑φ a.fst / ↑φ ↑a.snd = ↑φ a'.fst / ↑φ ↑a'.snd
⊢ ↑φ ↑a.snd ≠ 0
case ofFractionRing.ofFractionRing.H.H.e_toFractionRing.refine_2
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
a a' : R[X] × { x // x ∈ R[X]⁰ }
h : ↑φ a.fst / ↑φ ↑a.snd = ↑φ a'.fst / ↑φ ↑a'.snd
⊢ ↑φ ↑a'.snd ≠ 0
[PROOFSTEP]
all_goals exact map_ne_zero_of_mem_nonZeroDivisors _ hφ (SetLike.coe_mem _)
[GOAL]
case ofFractionRing.ofFractionRing.H.H.e_toFractionRing.refine_1
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
a a' : R[X] × { x // x ∈ R[X]⁰ }
h : ↑φ a.fst / ↑φ ↑a.snd = ↑φ a'.fst / ↑φ ↑a'.snd
⊢ ↑φ ↑a.snd ≠ 0
[PROOFSTEP]
exact map_ne_zero_of_mem_nonZeroDivisors _ hφ (SetLike.coe_mem _)
[GOAL]
case ofFractionRing.ofFractionRing.H.H.e_toFractionRing.refine_2
K : Type u
inst✝⁵ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝⁴ : CommGroupWithZero G₀
inst✝³ : Field L
inst✝² : CommRing R
inst✝¹ : CommRing S
inst✝ : Nontrivial R
φ : R[X] →*₀ G₀
hφ : Function.Injective ↑φ
hφ' : optParam (R[X]⁰ ≤ Submonoid.comap φ G₀⁰) (_ : R[X]⁰ ≤ Submonoid.comap φ G₀⁰)
a a' : R[X] × { x // x ∈ R[X]⁰ }
h : ↑φ a.fst / ↑φ ↑a.snd = ↑φ a'.fst / ↑φ ↑a'.snd
⊢ ↑φ ↑a'.snd ≠ 0
[PROOFSTEP]
exact map_ne_zero_of_mem_nonZeroDivisors _ hφ (SetLike.coe_mem _)
[GOAL]
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
x y : RatFunc R
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : ZeroHom.toFun (↑src✝) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : RatFunc R), ZeroHom.toFun (↑src✝) (x * y) = ZeroHom.toFun (↑src✝) x * ZeroHom.toFun (↑src✝) y) })
      (x + y) =
    OneHom.toFun
        (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : ZeroHom.toFun (↑src✝) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : RatFunc R),
                  ZeroHom.toFun (↑src✝) (x * y) = ZeroHom.toFun (↑src✝) x * ZeroHom.toFun (↑src✝) y) })
        x +
      OneHom.toFun
        (↑{ toOneHom := { toFun := src✝.toFun, map_one' := (_ : ZeroHom.toFun (↑src✝) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : RatFunc R),
                  ZeroHom.toFun (↑src✝) (x * y) = ZeroHom.toFun (↑src✝) x * ZeroHom.toFun (↑src✝) y) })
        y
[PROOFSTEP]
simp only [ZeroHom.toFun_eq_coe, MonoidWithZeroHom.toZeroHom_coe]
[GOAL]
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
x y : RatFunc R
⊢ ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) (x + y) =
    ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) x +
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) y
[PROOFSTEP]
cases subsingleton_or_nontrivial R
[GOAL]
case inl
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
x y : RatFunc R
h✝ : Subsingleton R
⊢ ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) (x + y) =
    ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) x +
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) y
[PROOFSTEP]
rw [Subsingleton.elim (x + y) y, Subsingleton.elim x 0, map_zero, zero_add]
[GOAL]
case inr
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
x y : RatFunc R
h✝ : Nontrivial R
⊢ ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) (x + y) =
    ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) x +
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) y
[PROOFSTEP]
cases' x with x
[GOAL]
case inr.ofFractionRing
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
y : RatFunc R
h✝ : Nontrivial R
x : FractionRing R[X]
⊢ ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) ({ toFractionRing := x } + y) =
    ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := x } +
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) y
[PROOFSTEP]
cases' y with y
[GOAL]
case inr.ofFractionRing.ofFractionRing
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
x y : FractionRing R[X]
⊢ ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) ({ toFractionRing := x } + { toFractionRing := y }) =
    ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := x } +
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := y }
[PROOFSTEP]
induction' x using Localization.rec with p q
[GOAL]
case inr.ofFractionRing.ofFractionRing.f
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
y : FractionRing R[X]
p : R[X]
q : { x // x ∈ R[X]⁰ }
⊢ ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ)
      ({ toFractionRing := Localization.mk p q } + { toFractionRing := y }) =
    ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk p q } +
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := y }
case inr.ofFractionRing.ofFractionRing.H
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝¹ : Nontrivial R
x y : FractionRing R[X]
a✝ c✝ : R[X]
b✝ d✝ : { x // x ∈ R[X]⁰ }
h✝ : ↑(Localization.r R[X]⁰) (a✝, b✝) (c✝, d✝)
⊢ (_ :
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ)
          ({ toFractionRing := Localization.mk c✝ d✝ } + { toFractionRing := y }) =
        ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk c✝ d✝ } +
          ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := y }) =
    (_ :
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ)
          ({ toFractionRing := Localization.mk c✝ d✝ } + { toFractionRing := y }) =
        ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk c✝ d✝ } +
          ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := y })
[PROOFSTEP]
induction' y using Localization.rec with p' q'
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ)
      ({ toFractionRing := Localization.mk p q } + { toFractionRing := Localization.mk p' q' }) =
    ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk p q } +
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk p' q' }
[PROOFSTEP]
rw [← ofFractionRing_add, Localization.add_mk]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ)
      { toFractionRing := Localization.mk (↑q * p' + ↑q' * p) (q * q') } =
    ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk p q } +
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk p' q' }
[PROOFSTEP]
simp only [RingHom.toMonoidWithZeroHom_eq_coe, liftMonoidWithZeroHom_apply_ofFractionRing_mk]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ (↑q * p' + ↑q' * p) / ↑φ ↑(q * q') = ↑φ p / ↑φ ↑q + ↑φ p' / ↑φ ↑q'
[PROOFSTEP]
rw [div_add_div, div_eq_div_iff]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ (↑q * p' + ↑q' * p) * (↑φ ↑q * ↑φ ↑q') = (↑φ p * ↑φ ↑q' + ↑φ ↑q * ↑φ p') * ↑φ ↑(q * q')
[PROOFSTEP]
rw [mul_comm _ p, mul_comm _ p', mul_comm _ (φ p'), add_comm]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ (p * ↑q' + p' * ↑q) * (↑φ ↑q * ↑φ ↑q') = (↑φ p * ↑φ ↑q' + ↑φ p' * ↑φ ↑q) * ↑φ ↑(q * q')
[PROOFSTEP]
simp only [map_add, map_mul, Submonoid.coe_mul]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hb
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑(q * q') ≠ 0
case inr.ofFractionRing.ofFractionRing.f.f.hd
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑q * ↑φ ↑q' ≠ 0
case inr.ofFractionRing.ofFractionRing.f.f.hb
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑q ≠ 0
case inr.ofFractionRing.ofFractionRing.f.f.hd
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑q' ≠ 0
[PROOFSTEP]
all_goals
  try simp only [← map_mul, ← Submonoid.coe_mul]
  exact nonZeroDivisors.ne_zero (hφ (SetLike.coe_mem _))
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hb
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑(q * q') ≠ 0
[PROOFSTEP]
try simp only [← map_mul, ← Submonoid.coe_mul]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hb
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑(q * q') ≠ 0
[PROOFSTEP]
simp only [← map_mul, ← Submonoid.coe_mul]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hb
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑(q * q') ≠ 0
[PROOFSTEP]
exact nonZeroDivisors.ne_zero (hφ (SetLike.coe_mem _))
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hd
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑q * ↑φ ↑q' ≠ 0
[PROOFSTEP]
try simp only [← map_mul, ← Submonoid.coe_mul]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hd
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑q * ↑φ ↑q' ≠ 0
[PROOFSTEP]
simp only [← map_mul, ← Submonoid.coe_mul]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hd
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑(q * q') ≠ 0
[PROOFSTEP]
exact nonZeroDivisors.ne_zero (hφ (SetLike.coe_mem _))
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hb
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑q ≠ 0
[PROOFSTEP]
try simp only [← map_mul, ← Submonoid.coe_mul]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hb
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑q ≠ 0
[PROOFSTEP]
simp only [← map_mul, ← Submonoid.coe_mul]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hb
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑q ≠ 0
[PROOFSTEP]
exact nonZeroDivisors.ne_zero (hφ (SetLike.coe_mem _))
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hd
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑q' ≠ 0
[PROOFSTEP]
try simp only [← map_mul, ← Submonoid.coe_mul]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hd
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑q' ≠ 0
[PROOFSTEP]
simp only [← map_mul, ← Submonoid.coe_mul]
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.f.hd
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝ : Nontrivial R
p : R[X]
q : { x // x ∈ R[X]⁰ }
p' : R[X]
q' : { x // x ∈ R[X]⁰ }
⊢ ↑φ ↑q' ≠ 0
[PROOFSTEP]
exact nonZeroDivisors.ne_zero (hφ (SetLike.coe_mem _))
[GOAL]
case inr.ofFractionRing.ofFractionRing.f.H
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝¹ : Nontrivial R
y : FractionRing R[X]
p : R[X]
q : { x // x ∈ R[X]⁰ }
a✝ c✝ : R[X]
b✝ d✝ : { x // x ∈ R[X]⁰ }
h✝ : ↑(Localization.r R[X]⁰) (a✝, b✝) (c✝, d✝)
⊢ (_ :
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ)
          ({ toFractionRing := Localization.mk p q } + { toFractionRing := Localization.mk c✝ d✝ }) =
        ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk p q } +
          ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk c✝ d✝ }) =
    (_ :
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ)
          ({ toFractionRing := Localization.mk p q } + { toFractionRing := Localization.mk c✝ d✝ }) =
        ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk p q } +
          ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk c✝ d✝ })
[PROOFSTEP]
rfl
[GOAL]
case inr.ofFractionRing.ofFractionRing.H
K : Type u
inst✝⁴ : CommRing K
G₀ : Type u_1
L : Type u_2
R : Type u_3
S : Type u_4
F : Type u_5
inst✝³ : CommGroupWithZero G₀
inst✝² : Field L
inst✝¹ : CommRing R
inst✝ : CommRing S
φ : R[X] →+* L
hφ : R[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc R →*₀ L := liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ
h✝¹ : Nontrivial R
x y : FractionRing R[X]
a✝ c✝ : R[X]
b✝ d✝ : { x // x ∈ R[X]⁰ }
h✝ : ↑(Localization.r R[X]⁰) (a✝, b✝) (c✝, d✝)
⊢ (_ :
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ)
          ({ toFractionRing := Localization.mk c✝ d✝ } + { toFractionRing := y }) =
        ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk c✝ d✝ } +
          ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := y }) =
    (_ :
      ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ)
          ({ toFractionRing := Localization.mk c✝ d✝ } + { toFractionRing := y }) =
        ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := Localization.mk c✝ d✝ } +
          ↑(liftMonoidWithZeroHom (RingHom.toMonoidWithZeroHom φ) hφ) { toFractionRing := y })
[PROOFSTEP]
rfl
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
src✝¹ : CommRing (RatFunc K) := instCommRing K
src✝ : Nontrivial (RatFunc K) := instNontrivial K
⊢ ∀ (a b : RatFunc K), a / b = a * b⁻¹
[PROOFSTEP]
frac_tac
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
src✝¹ : CommRing (RatFunc K) := instCommRing K
src✝ : Nontrivial (RatFunc K) := instNontrivial K
⊢ 0⁻¹ = 0
[PROOFSTEP]
rw [← ofFractionRing_zero, ← ofFractionRing_inv, inv_zero]
[GOAL]
K : Type u
inst✝³ : CommRing K
inst✝² : IsDomain K
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R K[X]
⊢ (fun x => RatFunc.mk (↑(algebraMap R K[X]) x) 1) 1 = 1
[PROOFSTEP]
simp only [mk_one', RingHom.map_one, ofFractionRing_one]
[GOAL]
K : Type u
inst✝³ : CommRing K
inst✝² : IsDomain K
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R K[X]
x y : R
⊢ OneHom.toFun
      { toFun := fun x => RatFunc.mk (↑(algebraMap R K[X]) x) 1,
        map_one' := (_ : RatFunc.mk (↑(algebraMap R K[X]) 1) 1 = 1) }
      (x * y) =
    OneHom.toFun
        { toFun := fun x => RatFunc.mk (↑(algebraMap R K[X]) x) 1,
          map_one' := (_ : RatFunc.mk (↑(algebraMap R K[X]) 1) 1 = 1) }
        x *
      OneHom.toFun
        { toFun := fun x => RatFunc.mk (↑(algebraMap R K[X]) x) 1,
          map_one' := (_ : RatFunc.mk (↑(algebraMap R K[X]) 1) 1 = 1) }
        y
[PROOFSTEP]
simp only [mk_one', RingHom.map_mul, ofFractionRing_mul]
[GOAL]
K : Type u
inst✝³ : CommRing K
inst✝² : IsDomain K
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R K[X]
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun x => RatFunc.mk (↑(algebraMap R K[X]) x) 1,
              map_one' := (_ : RatFunc.mk (↑(algebraMap R K[X]) 1) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : R),
                RatFunc.mk (↑(algebraMap R K[X]) (x * y)) 1 =
                  RatFunc.mk (↑(algebraMap R K[X]) x) 1 * RatFunc.mk (↑(algebraMap R K[X]) y) 1) })
      0 =
    0
[PROOFSTEP]
simp only [mk_one', RingHom.map_zero, ofFractionRing_zero]
[GOAL]
K : Type u
inst✝³ : CommRing K
inst✝² : IsDomain K
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R K[X]
x y : R
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun x => RatFunc.mk (↑(algebraMap R K[X]) x) 1,
              map_one' := (_ : RatFunc.mk (↑(algebraMap R K[X]) 1) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (x y : R),
                RatFunc.mk (↑(algebraMap R K[X]) (x * y)) 1 =
                  RatFunc.mk (↑(algebraMap R K[X]) x) 1 * RatFunc.mk (↑(algebraMap R K[X]) y) 1) })
      (x + y) =
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun x => RatFunc.mk (↑(algebraMap R K[X]) x) 1,
                map_one' := (_ : RatFunc.mk (↑(algebraMap R K[X]) 1) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : R),
                  RatFunc.mk (↑(algebraMap R K[X]) (x * y)) 1 =
                    RatFunc.mk (↑(algebraMap R K[X]) x) 1 * RatFunc.mk (↑(algebraMap R K[X]) y) 1) })
        x +
      OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun x => RatFunc.mk (↑(algebraMap R K[X]) x) 1,
                map_one' := (_ : RatFunc.mk (↑(algebraMap R K[X]) 1) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (x y : R),
                  RatFunc.mk (↑(algebraMap R K[X]) (x * y)) 1 =
                    RatFunc.mk (↑(algebraMap R K[X]) x) 1 * RatFunc.mk (↑(algebraMap R K[X]) y) 1) })
        y
[PROOFSTEP]
simp only [mk_one', RingHom.map_add, ofFractionRing_add]
[GOAL]
K : Type u
inst✝³ : CommRing K
inst✝² : IsDomain K
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R K[X]
c : R
x : (fun x => RatFunc K) c
⊢ c • x =
    ↑{
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun x => RatFunc.mk (↑(algebraMap R K[X]) x) 1,
                    map_one' := (_ : RatFunc.mk (↑(algebraMap R K[X]) 1) 1 = 1) },
                map_mul' :=
                  (_ :
                    ∀ (x y : R),
                      RatFunc.mk (↑(algebraMap R K[X]) (x * y)) 1 =
                        RatFunc.mk (↑(algebraMap R K[X]) x) 1 * RatFunc.mk (↑(algebraMap R K[X]) y) 1) },
            map_zero' := (_ : RatFunc.mk (↑(algebraMap R K[X]) 0) 1 = 0),
            map_add' :=
              (_ :
                ∀ (x y : R),
                  RatFunc.mk (↑(algebraMap R K[X]) (x + y)) 1 =
                    RatFunc.mk (↑(algebraMap R K[X]) x) 1 + RatFunc.mk (↑(algebraMap R K[X]) y) 1) }
        c *
      x
[PROOFSTEP]
induction' x using RatFunc.induction_on' with p q hq
[GOAL]
case _pq
K : Type u
inst✝³ : CommRing K
inst✝² : IsDomain K
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R K[X]
c : R
p q : K[X]
hq : q ≠ 0
⊢ c • RatFunc.mk p q =
    ↑{
            toMonoidHom :=
              {
                toOneHom :=
                  { toFun := fun x => RatFunc.mk (↑(algebraMap R K[X]) x) 1,
                    map_one' := (_ : RatFunc.mk (↑(algebraMap R K[X]) 1) 1 = 1) },
                map_mul' :=
                  (_ :
                    ∀ (x y : R),
                      RatFunc.mk (↑(algebraMap R K[X]) (x * y)) 1 =
                        RatFunc.mk (↑(algebraMap R K[X]) x) 1 * RatFunc.mk (↑(algebraMap R K[X]) y) 1) },
            map_zero' := (_ : RatFunc.mk (↑(algebraMap R K[X]) 0) 1 = 0),
            map_add' :=
              (_ :
                ∀ (x y : R),
                  RatFunc.mk (↑(algebraMap R K[X]) (x + y)) 1 =
                    RatFunc.mk (↑(algebraMap R K[X]) x) 1 + RatFunc.mk (↑(algebraMap R K[X]) y) 1) }
        c *
      RatFunc.mk p q
[PROOFSTEP]
rw [RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk]
[GOAL]
case _pq
K : Type u
inst✝³ : CommRing K
inst✝² : IsDomain K
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R K[X]
c : R
p q : K[X]
hq : q ≠ 0
⊢ c • RatFunc.mk p q = RatFunc.mk (↑(algebraMap R K[X]) c) 1 * RatFunc.mk p q
[PROOFSTEP]
rw [mk_one', ← mk_smul, mk_def_of_ne (c • p) hq, mk_def_of_ne p hq, ← ofFractionRing_mul,
  IsLocalization.mul_mk'_eq_mk'_of_mul, Algebra.smul_def]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
x : K[X]
⊢ { toFractionRing := ↑(algebraMap K[X] (FractionRing K[X])) x } = ↑(algebraMap K[X] (RatFunc K)) x
[PROOFSTEP]
rw [← mk_one, mk_one']
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
p q : K[X]
⊢ RatFunc.mk p q = ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q
[PROOFSTEP]
simp only [mk_eq_div', ofFractionRing_div, ofFractionRing_algebraMap]
[GOAL]
K : Type u
inst✝⁴ : CommRing K
inst✝³ : IsDomain K
R : Type u_1
inst✝² : Monoid R
inst✝¹ : DistribMulAction R K[X]
inst✝ : IsScalarTower R K[X] K[X]
c : R
p q : K[X]
⊢ ↑(algebraMap K[X] (RatFunc K)) (c • p) / ↑(algebraMap K[X] (RatFunc K)) q =
    c • (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q)
[PROOFSTEP]
rw [← mk_eq_div, mk_smul, mk_eq_div]
[GOAL]
K : Type u
inst✝³ : CommRing K
inst✝² : IsDomain K
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R K[X]
x : R
⊢ ↑(algebraMap R (RatFunc K)) x =
    ↑(algebraMap ((fun x => K[X]) x) (RatFunc K)) (↑(algebraMap R K[X]) x) / ↑(algebraMap K[X] (RatFunc K)) 1
[PROOFSTEP]
rw [← mk_eq_div]
[GOAL]
K : Type u
inst✝³ : CommRing K
inst✝² : IsDomain K
R : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Algebra R K[X]
x : R
⊢ ↑(algebraMap R (RatFunc K)) x = RatFunc.mk (↑(algebraMap R K[X]) x) 1
[PROOFSTEP]
rfl
[GOAL]
K : Type u
inst✝⁴ : CommRing K
inst✝³ : IsDomain K
R : Type u_1
F : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : MonoidHomClass F K[X] R[X]
φ : F
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
p q : K[X]
hq : q ≠ 0
⊢ ↑(map φ hφ) (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    ↑(algebraMap ((fun x => R[X]) p) (RatFunc R)) (↑φ p) / ↑(algebraMap ((fun x => R[X]) q) (RatFunc R)) (↑φ q)
[PROOFSTEP]
have hq' : φ q ≠ 0 := nonZeroDivisors.ne_zero (hφ (mem_nonZeroDivisors_iff_ne_zero.mpr hq))
[GOAL]
K : Type u
inst✝⁴ : CommRing K
inst✝³ : IsDomain K
R : Type u_1
F : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : MonoidHomClass F K[X] R[X]
φ : F
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
p q : K[X]
hq : q ≠ 0
hq' : ↑φ q ≠ 0
⊢ ↑(map φ hφ) (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    ↑(algebraMap ((fun x => R[X]) p) (RatFunc R)) (↑φ p) / ↑(algebraMap ((fun x => R[X]) q) (RatFunc R)) (↑φ q)
[PROOFSTEP]
simp only [← mk_eq_div, mk_eq_localization_mk _ hq, map_apply_ofFractionRing_mk, mk_eq_localization_mk _ hq']
[GOAL]
K : Type u
inst✝⁴ : CommRing K
inst✝³ : IsDomain K
R : Type u_1
F : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : MonoidWithZeroHomClass F K[X] R[X]
φ : F
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
p q : K[X]
⊢ ↑(map φ hφ) (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    ↑(algebraMap ((fun x => R[X]) p) (RatFunc R)) (↑φ p) / ↑(algebraMap ((fun x => R[X]) q) (RatFunc R)) (↑φ q)
[PROOFSTEP]
rcases eq_or_ne q 0 with (rfl | hq)
[GOAL]
case inl
K : Type u
inst✝⁴ : CommRing K
inst✝³ : IsDomain K
R : Type u_1
F : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : MonoidWithZeroHomClass F K[X] R[X]
φ : F
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
p : K[X]
⊢ ↑(map φ hφ) (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) 0) =
    ↑(algebraMap ((fun x => R[X]) p) (RatFunc R)) (↑φ p) / ↑(algebraMap ((fun x => R[X]) 0) (RatFunc R)) (↑φ 0)
[PROOFSTEP]
have : (0 : RatFunc K) = algebraMap K[X] _ 0 / algebraMap K[X] _ 1 := by simp
[GOAL]
K : Type u
inst✝⁴ : CommRing K
inst✝³ : IsDomain K
R : Type u_1
F : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : MonoidWithZeroHomClass F K[X] R[X]
φ : F
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
p : K[X]
⊢ 0 = ↑(algebraMap K[X] (RatFunc K)) 0 / ↑(algebraMap K[X] (RatFunc K)) 1
[PROOFSTEP]
simp
[GOAL]
case inl
K : Type u
inst✝⁴ : CommRing K
inst✝³ : IsDomain K
R : Type u_1
F : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : MonoidWithZeroHomClass F K[X] R[X]
φ : F
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
p : K[X]
this : 0 = ↑(algebraMap K[X] (RatFunc K)) 0 / ↑(algebraMap K[X] (RatFunc K)) 1
⊢ ↑(map φ hφ) (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) 0) =
    ↑(algebraMap ((fun x => R[X]) p) (RatFunc R)) (↑φ p) / ↑(algebraMap ((fun x => R[X]) 0) (RatFunc R)) (↑φ 0)
[PROOFSTEP]
rw [map_zero, map_zero, map_zero, div_zero, div_zero, this, map_apply_div_ne_zero, map_one, map_one, div_one, map_zero,
  map_zero]
[GOAL]
case inl
K : Type u
inst✝⁴ : CommRing K
inst✝³ : IsDomain K
R : Type u_1
F : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : MonoidWithZeroHomClass F K[X] R[X]
φ : F
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
p : K[X]
this : 0 = ↑(algebraMap K[X] (RatFunc K)) 0 / ↑(algebraMap K[X] (RatFunc K)) 1
⊢ ↑(algebraMap ((fun x => R[X]) 0) (RatFunc R)) 0 / ↑(algebraMap ((fun x => R[X]) 1) (RatFunc R)) 1 = 0
case inl.hq
K : Type u
inst✝⁴ : CommRing K
inst✝³ : IsDomain K
R : Type u_1
F : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : MonoidWithZeroHomClass F K[X] R[X]
φ : F
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
p : K[X]
this : 0 = ↑(algebraMap K[X] (RatFunc K)) 0 / ↑(algebraMap K[X] (RatFunc K)) 1
⊢ 1 ≠ 0
[PROOFSTEP]
simp only [map_zero, map_one, div_one]
  -- porting note: this `simp` was not needed
[GOAL]
case inl.hq
K : Type u
inst✝⁴ : CommRing K
inst✝³ : IsDomain K
R : Type u_1
F : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : MonoidWithZeroHomClass F K[X] R[X]
φ : F
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
p : K[X]
this : 0 = ↑(algebraMap K[X] (RatFunc K)) 0 / ↑(algebraMap K[X] (RatFunc K)) 1
⊢ 1 ≠ 0
[PROOFSTEP]
exact one_ne_zero
[GOAL]
case inr
K : Type u
inst✝⁴ : CommRing K
inst✝³ : IsDomain K
R : Type u_1
F : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : MonoidWithZeroHomClass F K[X] R[X]
φ : F
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
p q : K[X]
hq : q ≠ 0
⊢ ↑(map φ hφ) (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    ↑(algebraMap ((fun x => R[X]) p) (RatFunc R)) (↑φ p) / ↑(algebraMap ((fun x => R[X]) q) (RatFunc R)) (↑φ q)
[PROOFSTEP]
exact map_apply_div_ne_zero _ _ _ _ hq
[GOAL]
K : Type u
inst✝² : CommRing K
inst✝¹ : IsDomain K
L : Type u_1
inst✝ : CommGroupWithZero L
φ : K[X] →*₀ L
hφ : K[X]⁰ ≤ Submonoid.comap φ L⁰
p q : K[X]
⊢ ↑(liftMonoidWithZeroHom φ hφ) (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) = ↑φ p / ↑φ q
[PROOFSTEP]
rcases eq_or_ne q 0 with (rfl | hq)
[GOAL]
case inl
K : Type u
inst✝² : CommRing K
inst✝¹ : IsDomain K
L : Type u_1
inst✝ : CommGroupWithZero L
φ : K[X] →*₀ L
hφ : K[X]⁰ ≤ Submonoid.comap φ L⁰
p : K[X]
⊢ ↑(liftMonoidWithZeroHom φ hφ) (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) 0) = ↑φ p / ↑φ 0
[PROOFSTEP]
simp only [div_zero, map_zero]
[GOAL]
case inr
K : Type u
inst✝² : CommRing K
inst✝¹ : IsDomain K
L : Type u_1
inst✝ : CommGroupWithZero L
φ : K[X] →*₀ L
hφ : K[X]⁰ ≤ Submonoid.comap φ L⁰
p q : K[X]
hq : q ≠ 0
⊢ ↑(liftMonoidWithZeroHom φ hφ) (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) = ↑φ p / ↑φ q
[PROOFSTEP]
simp only [← mk_eq_div, mk_eq_localization_mk _ hq, liftMonoidWithZeroHom_apply_ofFractionRing_mk]
[GOAL]
K : Type u
inst✝² : CommRing K
inst✝¹ : IsDomain K
L : Type u_1
inst✝ : CommGroupWithZero L
φ : K[X] →*₀ L
hφ : K[X]⁰ ≤ Submonoid.comap φ L⁰
p q : K[X]
⊢ ↑(liftMonoidWithZeroHom φ hφ) (↑(algebraMap K[X] (RatFunc K)) p) /
      ↑(liftMonoidWithZeroHom φ hφ) (↑(algebraMap K[X] (RatFunc K)) q) =
    ↑φ p / ↑φ q
[PROOFSTEP]
rw [← map_div₀, liftMonoidWithZeroHom_apply_div]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
⊢ Function.Injective ↑(algebraMap K[X] (RatFunc K))
[PROOFSTEP]
rw [← ofFractionRing_comp_algebraMap]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
⊢ Function.Injective (ofFractionRing ∘ ↑(algebraMap K[X] (FractionRing K[X])))
[PROOFSTEP]
exact ofFractionRing_injective.comp (IsFractionRing.injective _ _)
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
x : K[X]
hx : x = 0
⊢ ↑(algebraMap K[X] (RatFunc K)) x = 0
[PROOFSTEP]
rw [hx, RingHom.map_zero]
[GOAL]
K : Type u
inst✝⁸ : CommRing K
inst✝⁷ : IsDomain K
L : Type u_1
R : Type u_2
S : Type u_3
inst✝⁶ : Field L
inst✝⁵ : CommRing R
inst✝⁴ : IsDomain R
inst✝³ : CommSemiring S
inst✝² : Algebra S K[X]
inst✝¹ : Algebra S L
inst✝ : Algebra S R[X]
φ✝ : K[X] →ₐ[S] L
hφ✝ : K[X]⁰ ≤ Submonoid.comap φ✝ L⁰
φ : K[X] →ₐ[S] R[X]
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
src✝ : RatFunc K →+* RatFunc R := mapRingHom φ hφ
r : S
⊢ OneHom.toFun
      (↑↑{ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ :
                ∀ (x y : RatFunc K),
                  OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) })
      (↑(algebraMap S (RatFunc K)) r) =
    ↑(algebraMap S (RatFunc R)) r
[PROOFSTEP]
simp_rw [RingHom.toFun_eq_coe, coe_mapRingHom_eq_coe_map, algebraMap_apply r, map_apply_div, map_one, AlgHom.commutes]
[GOAL]
K : Type u
inst✝⁸ : CommRing K
inst✝⁷ : IsDomain K
L : Type u_1
R : Type u_2
S : Type u_3
inst✝⁶ : Field L
inst✝⁵ : CommRing R
inst✝⁴ : IsDomain R
inst✝³ : CommSemiring S
inst✝² : Algebra S K[X]
inst✝¹ : Algebra S L
inst✝ : Algebra S R[X]
φ : K[X] →ₐ[S] L
hφ : K[X]⁰ ≤ Submonoid.comap φ L⁰
src✝ : RatFunc K →+* L := liftRingHom (↑φ) hφ
r : S
⊢ OneHom.toFun
      (↑↑{ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ :
                ∀ (x y : RatFunc K),
                  OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) })
      (↑(algebraMap S (RatFunc K)) r) =
    ↑(algebraMap S L) r
[PROOFSTEP]
simp_rw [RingHom.toFun_eq_coe, AlgHom.toRingHom_eq_coe, algebraMap_apply r, liftRingHom_apply_div, AlgHom.coe_toRingHom,
  map_one, div_one, AlgHom.commutes]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
y : { x // x ∈ K[X]⁰ }
⊢ IsUnit (↑(algebraMap K[X] (RatFunc K)) ↑y)
[PROOFSTEP]
rw [← ofFractionRing_algebraMap]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
y : { x // x ∈ K[X]⁰ }
⊢ IsUnit { toFractionRing := ↑(algebraMap K[X] (FractionRing K[X])) ↑y }
[PROOFSTEP]
exact (toFractionRingRingEquiv K).symm.toRingHom.isUnit_map (IsLocalization.map_units _ y)
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
⊢ ∀ (z : RatFunc K), ∃ x, z * ↑(algebraMap K[X] (RatFunc K)) ↑x.snd = ↑(algebraMap K[X] (RatFunc K)) x.fst
[PROOFSTEP]
rintro ⟨z⟩
[GOAL]
case ofFractionRing
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
z : FractionRing K[X]
⊢ ∃ x, { toFractionRing := z } * ↑(algebraMap K[X] (RatFunc K)) ↑x.snd = ↑(algebraMap K[X] (RatFunc K)) x.fst
[PROOFSTEP]
convert IsLocalization.surj K[X]⁰ z
[GOAL]
case h.e'_2.h.a
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
z : FractionRing K[X]
x✝ : K[X] × { x // x ∈ K[X]⁰ }
⊢ { toFractionRing := z } * ↑(algebraMap K[X] (RatFunc K)) ↑x✝.snd = ↑(algebraMap K[X] (RatFunc K)) x✝.fst ↔
    z * ↑(algebraMap K[X] (FractionRing K[X])) ↑x✝.snd = ↑(algebraMap K[X] (FractionRing K[X])) x✝.fst
[PROOFSTEP]
simp only [← ofFractionRing_algebraMap, Function.comp_apply, ← ofFractionRing_mul]
[GOAL]
case h.e'_2.h.a
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
z : FractionRing K[X]
x✝ : K[X] × { x // x ∈ K[X]⁰ }
⊢ { toFractionRing := z * ↑(algebraMap K[X] (FractionRing K[X])) ↑x✝.snd } =
      { toFractionRing := ↑(algebraMap K[X] (FractionRing K[X])) x✝.fst } ↔
    z * ↑(algebraMap K[X] (FractionRing K[X])) ↑x✝.snd = ↑(algebraMap K[X] (FractionRing K[X])) x✝.fst
[PROOFSTEP]
rw [ofFractionRing.injEq]
  -- porting note: added
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
x y : K[X]
⊢ ↑(algebraMap K[X] (RatFunc K)) x = ↑(algebraMap K[X] (RatFunc K)) y ↔ ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
rw [← ofFractionRing_algebraMap, ← ofFractionRing_algebraMap]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
x y : K[X]
⊢ { toFractionRing := ↑(algebraMap K[X] (FractionRing K[X])) x } =
      { toFractionRing := ↑(algebraMap K[X] (FractionRing K[X])) y } ↔
    ∃ c, ↑c * x = ↑c * y
[PROOFSTEP]
exact (toFractionRingRingEquiv K).symm.injective.eq_iff.trans (IsLocalization.eq_iff_exists _ _)
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
P : Sort v
p q : K[X]
f : K[X] → K[X] → P
f0 : ∀ (p : K[X]), f p 0 = f 0 1
H' : ∀ {p q p' q' : K[X]}, q ≠ 0 → q' ≠ 0 → q' * p = q * p' → f p q = f p' q'
H :
  optParam (∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q')
    (_ : ∀ {p q p' q' : K[X]}, q ∈ K[X]⁰ → q' ∈ K[X]⁰ → q' * p = q * p' → f p q = f p' q')
⊢ RatFunc.liftOn (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) f H = f p q
[PROOFSTEP]
rw [← mk_eq_div, liftOn_mk _ _ f f0 @H']
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
P : Sort v
p q : K[X]
f : K[X] → K[X] → P
f0 : ∀ (p : K[X]), f p 0 = f 0 1
H : ∀ {p q a : K[X]}, q ≠ 0 → a ≠ 0 → f (a * p) (a * q) = f p q
⊢ RatFunc.liftOn' (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) f H = f p q
[PROOFSTEP]
rw [RatFunc.liftOn', liftOn_div _ _ _ f0]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
P : Sort v
p q : K[X]
f : K[X] → K[X] → P
f0 : ∀ (p : K[X]), f p 0 = f 0 1
H : ∀ {p q a : K[X]}, q ≠ 0 → a ≠ 0 → f (a * p) (a * q) = f p q
⊢ ∀ {p q p' q' : K[X]}, q ≠ 0 → q' ≠ 0 → q' * p = q * p' → f p q = f p' q'
[PROOFSTEP]
apply lift_on_condition_of_lift_on'_condition H
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
P : RatFunc K → Prop
x : RatFunc K
f : ∀ (p q : K[X]), q ≠ 0 → P (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q)
p q : K[X]
hq : q ≠ 0
⊢ P (RatFunc.mk p q)
[PROOFSTEP]
simpa using f p q hq
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
x : K[X]
y : { x // x ∈ K[X]⁰ }
⊢ { toFractionRing := IsLocalization.mk' (FractionRing K[X]) x y } = IsLocalization.mk' (RatFunc K) x y
[PROOFSTEP]
rw [IsFractionRing.mk'_eq_div, IsFractionRing.mk'_eq_div, ← mk_eq_div', ← mk_eq_div]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
x✝ : FractionRing K[X]
x : K[X] × { x // x ∈ K[X]⁰ }
⊢ { toFractionRing := Localization.mk x.fst x.snd } =
    ↑(IsLocalization.algEquiv K[X]⁰ (FractionRing K[X]) (RatFunc K)) (Localization.mk x.fst x.snd)
[PROOFSTEP]
simp only [IsLocalization.algEquiv_apply, IsLocalization.ringEquivOfRingEquiv_apply, Localization.mk_eq_mk'_apply,
  IsLocalization.map_mk', ofFractionRing_mk', RingEquiv.coe_toRingHom, RingEquiv.refl_apply, SetLike.eta]
  -- porting note: added following `simp`.  The previous one can be squeezed.
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
x✝ : FractionRing K[X]
x : K[X] × { x // x ∈ K[X]⁰ }
⊢ IsLocalization.mk' (RatFunc K) x.fst x.snd =
    IsLocalization.mk' (RatFunc K) (↑(RingHom.id K[X]) x.fst)
      { val := ↑(RingHom.id K[X]) ↑x.snd, property := (_ : ↑x.snd ∈ Submonoid.comap (RingHom.id K[X]) K[X]⁰) }
[PROOFSTEP]
simp only [IsFractionRing.mk'_eq_div, RingHom.id_apply, Subtype.coe_eta]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
x✝¹ : RatFunc K
x✝ : FractionRing K[X]
x : K[X] × { x // x ∈ K[X]⁰ }
⊢ { toFractionRing := Localization.mk x.fst x.snd }.toFractionRing =
    ↑(IsLocalization.algEquiv K[X]⁰ (RatFunc K) (FractionRing K[X])) { toFractionRing := Localization.mk x.fst x.snd }
[PROOFSTEP]
simp only [Localization.mk_eq_mk'_apply, ofFractionRing_mk', IsLocalization.algEquiv_apply,
  IsLocalization.ringEquivOfRingEquiv_apply, IsLocalization.map_mk', RingEquiv.coe_toRingHom, RingEquiv.refl_apply,
  SetLike.eta]
  -- porting note: added following `simp`.  The previous one can be squeezed.
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
x✝¹ : RatFunc K
x✝ : FractionRing K[X]
x : K[X] × { x // x ∈ K[X]⁰ }
⊢ IsLocalization.mk' (Localization K[X]⁰) x.fst x.snd =
    IsLocalization.mk' (FractionRing K[X]) (↑(RingHom.id K[X]) x.fst)
      { val := ↑(RingHom.id K[X]) ↑x.snd, property := (_ : ↑x.snd ∈ Submonoid.comap (RingHom.id K[X]) K[X]⁰) }
[PROOFSTEP]
simp only [IsFractionRing.mk'_eq_div, RingHom.id_apply, Subtype.coe_eta]
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
⊢ RingEquiv.symm (toFractionRingRingEquiv K) =
    AlgEquiv.toRingEquiv (IsLocalization.algEquiv K[X]⁰ (FractionRing K[X]) (RatFunc K))
[PROOFSTEP]
ext x
[GOAL]
case h
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
x : FractionRing K[X]
⊢ ↑(RingEquiv.symm (toFractionRingRingEquiv K)) x =
    ↑(AlgEquiv.toRingEquiv (IsLocalization.algEquiv K[X]⁰ (FractionRing K[X]) (RatFunc K))) x
[PROOFSTEP]
simp [toFractionRingRingEquiv, ofFractionRing_eq, AlgEquiv.coe_ringEquiv']
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
⊢ ∀ {p q a : K[X]},
    q ≠ 0 →
      a ≠ 0 →
        (fun p q =>
              if q = 0 then (0, 1)
              else
                let r := gcd p q;
                (↑C (leadingCoeff (q / r))⁻¹ * (p / r), ↑C (leadingCoeff (q / r))⁻¹ * (q / r)))
            (a * p) (a * q) =
          (fun p q =>
              if q = 0 then (0, 1)
              else
                let r := gcd p q;
                (↑C (leadingCoeff (q / r))⁻¹ * (p / r), ↑C (leadingCoeff (q / r))⁻¹ * (q / r)))
            p q
[PROOFSTEP]
intros p q a hq ha
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
⊢ (fun p q =>
        if q = 0 then (0, 1)
        else
          let r := gcd p q;
          (↑C (leadingCoeff (q / r))⁻¹ * (p / r), ↑C (leadingCoeff (q / r))⁻¹ * (q / r)))
      (a * p) (a * q) =
    (fun p q =>
        if q = 0 then (0, 1)
        else
          let r := gcd p q;
          (↑C (leadingCoeff (q / r))⁻¹ * (p / r), ↑C (leadingCoeff (q / r))⁻¹ * (q / r)))
      p q
[PROOFSTEP]
dsimp
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
⊢ (if a * q = 0 then (0, 1)
    else
      (↑C (leadingCoeff (a * q / gcd (a * p) (a * q)))⁻¹ * (a * p / gcd (a * p) (a * q)),
        ↑C (leadingCoeff (a * q / gcd (a * p) (a * q)))⁻¹ * (a * q / gcd (a * p) (a * q)))) =
    if q = 0 then (0, 1)
    else (↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q), ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q))
[PROOFSTEP]
rw [if_neg hq, if_neg (mul_ne_zero ha hq)]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
⊢ (↑C (leadingCoeff (a * q / gcd (a * p) (a * q)))⁻¹ * (a * p / gcd (a * p) (a * q)),
      ↑C (leadingCoeff (a * q / gcd (a * p) (a * q)))⁻¹ * (a * q / gcd (a * p) (a * q))) =
    (↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q), ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q))
[PROOFSTEP]
have ha' : a.leadingCoeff ≠ 0 := Polynomial.leadingCoeff_ne_zero.mpr ha
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
⊢ (↑C (leadingCoeff (a * q / gcd (a * p) (a * q)))⁻¹ * (a * p / gcd (a * p) (a * q)),
      ↑C (leadingCoeff (a * q / gcd (a * p) (a * q)))⁻¹ * (a * q / gcd (a * p) (a * q))) =
    (↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q), ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q))
[PROOFSTEP]
have hainv : a.leadingCoeff⁻¹ ≠ 0 := inv_ne_zero ha'
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
⊢ (↑C (leadingCoeff (a * q / gcd (a * p) (a * q)))⁻¹ * (a * p / gcd (a * p) (a * q)),
      ↑C (leadingCoeff (a * q / gcd (a * p) (a * q)))⁻¹ * (a * q / gcd (a * p) (a * q))) =
    (↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q), ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q))
[PROOFSTEP]
simp only [Prod.ext_iff, gcd_mul_left, normalize_apply, Polynomial.coe_normUnit, mul_assoc,
  CommGroupWithZero.coe_normUnit _ ha']
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
⊢ ↑C (leadingCoeff (a * q / (↑normalize a * gcd p q)))⁻¹ * (a * p / (↑normalize a * gcd p q)) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q) ∧
    ↑C (leadingCoeff (a * q / (↑normalize a * gcd p q)))⁻¹ * (a * q / (↑normalize a * gcd p q)) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q)
[PROOFSTEP]
have hdeg : (gcd p q).degree ≤ q.degree := degree_gcd_le_right _ hq
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
⊢ ↑C (leadingCoeff (a * q / (↑normalize a * gcd p q)))⁻¹ * (a * p / (↑normalize a * gcd p q)) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q) ∧
    ↑C (leadingCoeff (a * q / (↑normalize a * gcd p q)))⁻¹ * (a * q / (↑normalize a * gcd p q)) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q)
[PROOFSTEP]
have hdeg' : (Polynomial.C a.leadingCoeff⁻¹ * gcd p q).degree ≤ q.degree :=
  by
  rw [Polynomial.degree_mul, Polynomial.degree_C hainv, zero_add]
  exact hdeg
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
⊢ degree (↑C (leadingCoeff a)⁻¹ * gcd p q) ≤ degree q
[PROOFSTEP]
rw [Polynomial.degree_mul, Polynomial.degree_C hainv, zero_add]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
⊢ degree (gcd p q) ≤ degree q
[PROOFSTEP]
exact hdeg
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
hdeg' : degree (↑C (leadingCoeff a)⁻¹ * gcd p q) ≤ degree q
⊢ ↑C (leadingCoeff (a * q / (↑normalize a * gcd p q)))⁻¹ * (a * p / (↑normalize a * gcd p q)) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q) ∧
    ↑C (leadingCoeff (a * q / (↑normalize a * gcd p q)))⁻¹ * (a * q / (↑normalize a * gcd p q)) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q)
[PROOFSTEP]
have hdivp : Polynomial.C a.leadingCoeff⁻¹ * gcd p q ∣ p := (C_mul_dvd hainv).mpr (gcd_dvd_left p q)
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
hdeg' : degree (↑C (leadingCoeff a)⁻¹ * gcd p q) ≤ degree q
hdivp : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ p
⊢ ↑C (leadingCoeff (a * q / (↑normalize a * gcd p q)))⁻¹ * (a * p / (↑normalize a * gcd p q)) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q) ∧
    ↑C (leadingCoeff (a * q / (↑normalize a * gcd p q)))⁻¹ * (a * q / (↑normalize a * gcd p q)) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q)
[PROOFSTEP]
have hdivq : Polynomial.C a.leadingCoeff⁻¹ * gcd p q ∣ q :=
  (C_mul_dvd hainv).mpr
    (gcd_dvd_right p q)
      -- porting note: added `simp only [...]` and `rw [mul_assoc]`
            -- porting note: note the unfolding of `normalize` and `normUnit`!
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
hdeg' : degree (↑C (leadingCoeff a)⁻¹ * gcd p q) ≤ degree q
hdivp : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ p
hdivq : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ q
⊢ ↑C (leadingCoeff (a * q / (↑normalize a * gcd p q)))⁻¹ * (a * p / (↑normalize a * gcd p q)) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q) ∧
    ↑C (leadingCoeff (a * q / (↑normalize a * gcd p q)))⁻¹ * (a * q / (↑normalize a * gcd p q)) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q)
[PROOFSTEP]
simp only [normalize, normUnit, coe_normUnit, leadingCoeff_eq_zero, MonoidWithZeroHom.coe_mk, ZeroHom.coe_mk, ha,
  dite_false, Units.val_inv_eq_inv_val, Units.val_mk0]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
hdeg' : degree (↑C (leadingCoeff a)⁻¹ * gcd p q) ≤ degree q
hdivp : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ p
hdivq : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ q
⊢ ↑C (leadingCoeff (a * q / (a * ↑C (leadingCoeff a)⁻¹ * gcd p q)))⁻¹ *
        (a * p / (a * ↑C (leadingCoeff a)⁻¹ * gcd p q)) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q) ∧
    ↑C (leadingCoeff (a * q / (a * ↑C (leadingCoeff a)⁻¹ * gcd p q)))⁻¹ *
        (a * q / (a * ↑C (leadingCoeff a)⁻¹ * gcd p q)) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q)
[PROOFSTEP]
rw [mul_assoc]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
hdeg' : degree (↑C (leadingCoeff a)⁻¹ * gcd p q) ≤ degree q
hdivp : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ p
hdivq : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ q
⊢ ↑C (leadingCoeff (a * q / (a * (↑C (leadingCoeff a)⁻¹ * gcd p q))))⁻¹ *
        (a * p / (a * (↑C (leadingCoeff a)⁻¹ * gcd p q))) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q) ∧
    ↑C (leadingCoeff (a * q / (a * (↑C (leadingCoeff a)⁻¹ * gcd p q))))⁻¹ *
        (a * q / (a * (↑C (leadingCoeff a)⁻¹ * gcd p q))) =
      ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q)
[PROOFSTEP]
rw [EuclideanDomain.mul_div_mul_cancel ha hdivp, EuclideanDomain.mul_div_mul_cancel ha hdivq, leadingCoeff_div hdeg,
  leadingCoeff_div hdeg', Polynomial.leadingCoeff_mul, Polynomial.leadingCoeff_C, div_C_mul, div_C_mul, ← mul_assoc, ←
  Polynomial.C_mul, ← mul_assoc, ← Polynomial.C_mul]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
hdeg' : degree (↑C (leadingCoeff a)⁻¹ * gcd p q) ≤ degree q
hdivp : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ p
hdivq : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ q
⊢ ↑C ((leadingCoeff q / ((leadingCoeff a)⁻¹ * leadingCoeff (gcd p q)))⁻¹ * (leadingCoeff a)⁻¹⁻¹) * (p / gcd p q) =
      ↑C (leadingCoeff q / leadingCoeff (gcd p q))⁻¹ * (p / gcd p q) ∧
    ↑C ((leadingCoeff q / ((leadingCoeff a)⁻¹ * leadingCoeff (gcd p q)))⁻¹ * (leadingCoeff a)⁻¹⁻¹) * (q / gcd p q) =
      ↑C (leadingCoeff q / leadingCoeff (gcd p q))⁻¹ * (q / gcd p q)
[PROOFSTEP]
constructor
[GOAL]
case left
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
hdeg' : degree (↑C (leadingCoeff a)⁻¹ * gcd p q) ≤ degree q
hdivp : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ p
hdivq : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ q
⊢ ↑C ((leadingCoeff q / ((leadingCoeff a)⁻¹ * leadingCoeff (gcd p q)))⁻¹ * (leadingCoeff a)⁻¹⁻¹) * (p / gcd p q) =
    ↑C (leadingCoeff q / leadingCoeff (gcd p q))⁻¹ * (p / gcd p q)
[PROOFSTEP]
congr
[GOAL]
case right
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
hdeg' : degree (↑C (leadingCoeff a)⁻¹ * gcd p q) ≤ degree q
hdivp : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ p
hdivq : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ q
⊢ ↑C ((leadingCoeff q / ((leadingCoeff a)⁻¹ * leadingCoeff (gcd p q)))⁻¹ * (leadingCoeff a)⁻¹⁻¹) * (q / gcd p q) =
    ↑C (leadingCoeff q / leadingCoeff (gcd p q))⁻¹ * (q / gcd p q)
[PROOFSTEP]
congr
[GOAL]
case left.e_a.h.e_6.h
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
hdeg' : degree (↑C (leadingCoeff a)⁻¹ * gcd p q) ≤ degree q
hdivp : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ p
hdivq : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ q
⊢ (leadingCoeff q / ((leadingCoeff a)⁻¹ * leadingCoeff (gcd p q)))⁻¹ * (leadingCoeff a)⁻¹⁻¹ =
    (leadingCoeff q / leadingCoeff (gcd p q))⁻¹
[PROOFSTEP]
rw [inv_div, mul_comm, mul_div_assoc, ← mul_assoc, inv_inv, _root_.mul_inv_cancel ha', one_mul, inv_div]
[GOAL]
case right.e_a.h.e_6.h
K : Type u
inst✝ : Field K
x : RatFunc K
p q a : K[X]
hq : q ≠ 0
ha : a ≠ 0
ha' : leadingCoeff a ≠ 0
hainv : (leadingCoeff a)⁻¹ ≠ 0
hdeg : degree (gcd p q) ≤ degree q
hdeg' : degree (↑C (leadingCoeff a)⁻¹ * gcd p q) ≤ degree q
hdivp : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ p
hdivq : ↑C (leadingCoeff a)⁻¹ * gcd p q ∣ q
⊢ (leadingCoeff q / ((leadingCoeff a)⁻¹ * leadingCoeff (gcd p q)))⁻¹ * (leadingCoeff a)⁻¹⁻¹ =
    (leadingCoeff q / leadingCoeff (gcd p q))⁻¹
[PROOFSTEP]
rw [inv_div, mul_comm, mul_div_assoc, ← mul_assoc, inv_inv, _root_.mul_inv_cancel ha', one_mul, inv_div]
[GOAL]
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ numDenom (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    (↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q), ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q))
[PROOFSTEP]
rw [numDenom, liftOn'_div, if_neg hq]
[GOAL]
case f0
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ ∀ (p : K[X]),
    (if 0 = 0 then (0, 1)
      else
        let r := gcd p 0;
        (↑C (leadingCoeff (0 / r))⁻¹ * (p / r), ↑C (leadingCoeff (0 / r))⁻¹ * (0 / r))) =
      if 1 = 0 then (0, 1)
      else
        let r := gcd 0 1;
        (↑C (leadingCoeff (1 / r))⁻¹ * (0 / r), ↑C (leadingCoeff (1 / r))⁻¹ * (1 / r))
[PROOFSTEP]
intro p
[GOAL]
case f0
K : Type u
inst✝ : Field K
p✝ q : K[X]
hq : q ≠ 0
p : K[X]
⊢ (if 0 = 0 then (0, 1)
    else
      let r := gcd p 0;
      (↑C (leadingCoeff (0 / r))⁻¹ * (p / r), ↑C (leadingCoeff (0 / r))⁻¹ * (0 / r))) =
    if 1 = 0 then (0, 1)
    else
      let r := gcd 0 1;
      (↑C (leadingCoeff (1 / r))⁻¹ * (0 / r), ↑C (leadingCoeff (1 / r))⁻¹ * (1 / r))
[PROOFSTEP]
rw [if_pos rfl, if_neg (one_ne_zero' K[X])]
[GOAL]
case f0
K : Type u
inst✝ : Field K
p✝ q : K[X]
hq : q ≠ 0
p : K[X]
⊢ (0, 1) =
    let r := gcd 0 1;
    (↑C (leadingCoeff (1 / r))⁻¹ * (0 / r), ↑C (leadingCoeff (1 / r))⁻¹ * (1 / r))
[PROOFSTEP]
simp
[GOAL]
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ num (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q)
[PROOFSTEP]
rw [num, numDenom_div _ hq]
[GOAL]
K : Type u
inst✝ : Field K
⊢ num 0 = 0
[PROOFSTEP]
convert num_div' (0 : K[X]) one_ne_zero
[GOAL]
case h.e'_2.h.e'_3
K : Type u
inst✝ : Field K
⊢ 0 = ↑(algebraMap K[X] (RatFunc K)) 0 / ↑(algebraMap K[X] (RatFunc K)) 1
[PROOFSTEP]
simp
[GOAL]
case h.e'_3
K : Type u
inst✝ : Field K
⊢ 0 = ↑C (leadingCoeff (1 / gcd 0 1))⁻¹ * (0 / gcd 0 1)
[PROOFSTEP]
simp
[GOAL]
K : Type u
inst✝ : Field K
p q : K[X]
⊢ num (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q)
[PROOFSTEP]
by_cases hq : q = 0
[GOAL]
case pos
K : Type u
inst✝ : Field K
p q : K[X]
hq : q = 0
⊢ num (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q)
[PROOFSTEP]
simp [hq]
[GOAL]
case neg
K : Type u
inst✝ : Field K
p q : K[X]
hq : ¬q = 0
⊢ num (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q)
[PROOFSTEP]
exact num_div' p hq
[GOAL]
K : Type u
inst✝ : Field K
⊢ num 1 = 1
[PROOFSTEP]
convert num_div (1 : K[X]) 1
[GOAL]
case h.e'_2.h.e'_3
K : Type u
inst✝ : Field K
⊢ 1 = ↑(algebraMap K[X] (RatFunc K)) 1 / ↑(algebraMap K[X] (RatFunc K)) 1
[PROOFSTEP]
simp
[GOAL]
case h.e'_3
K : Type u
inst✝ : Field K
⊢ 1 = ↑C (leadingCoeff (1 / gcd 1 1))⁻¹ * (1 / gcd 1 1)
[PROOFSTEP]
simp
[GOAL]
K : Type u
inst✝ : Field K
p : K[X]
⊢ num (↑(algebraMap K[X] (RatFunc K)) p) = p
[PROOFSTEP]
convert num_div p 1
[GOAL]
case h.e'_2.h.e'_3
K : Type u
inst✝ : Field K
p : K[X]
⊢ ↑(algebraMap K[X] (RatFunc K)) p = ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) 1
[PROOFSTEP]
simp
[GOAL]
case h.e'_3
K : Type u
inst✝ : Field K
p : K[X]
⊢ p = ↑C (leadingCoeff (1 / gcd p 1))⁻¹ * (p / gcd p 1)
[PROOFSTEP]
simp
[GOAL]
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ num (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) ∣ p
[PROOFSTEP]
rw [num_div _ q, C_mul_dvd]
[GOAL]
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ p / gcd p q ∣ p
[PROOFSTEP]
exact EuclideanDomain.div_dvd_of_dvd (gcd_dvd_left p q)
[GOAL]
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ (leadingCoeff (q / gcd p q))⁻¹ ≠ 0
[PROOFSTEP]
simpa only [Ne.def, inv_eq_zero, Polynomial.leadingCoeff_eq_zero] using right_div_gcd_ne_zero hq
[GOAL]
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ ↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q) ∣ p
[PROOFSTEP]
simpa using num_div_dvd p hq
[GOAL]
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ denom (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) =
    ↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q)
[PROOFSTEP]
rw [denom, numDenom_div _ hq]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
⊢ Monic (denom x)
[PROOFSTEP]
induction x using RatFunc.induction_on with
| f p q hq =>
  rw [denom_div p hq, mul_comm]
  exact Polynomial.monic_mul_leadingCoeff_inv (right_div_gcd_ne_zero hq)
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
⊢ Monic (denom x)
[PROOFSTEP]
induction x using RatFunc.induction_on with
| f p q hq =>
  rw [denom_div p hq, mul_comm]
  exact Polynomial.monic_mul_leadingCoeff_inv (right_div_gcd_ne_zero hq)
[GOAL]
case f
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ Monic (denom (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q))
[PROOFSTEP]

| f p q hq =>
  rw [denom_div p hq, mul_comm]
  exact Polynomial.monic_mul_leadingCoeff_inv (right_div_gcd_ne_zero hq)
[GOAL]
case f
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ Monic (denom (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q))
[PROOFSTEP]
rw [denom_div p hq, mul_comm]
[GOAL]
case f
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ Monic (q / gcd p q * ↑C (leadingCoeff (q / gcd p q))⁻¹)
[PROOFSTEP]
exact Polynomial.monic_mul_leadingCoeff_inv (right_div_gcd_ne_zero hq)
[GOAL]
K : Type u
inst✝ : Field K
⊢ denom 0 = 1
[PROOFSTEP]
convert denom_div (0 : K[X]) one_ne_zero
[GOAL]
case h.e'_2.h.e'_3
K : Type u
inst✝ : Field K
⊢ 0 = ↑(algebraMap K[X] (RatFunc K)) 0 / ↑(algebraMap K[X] (RatFunc K)) 1
[PROOFSTEP]
simp
[GOAL]
case h.e'_3
K : Type u
inst✝ : Field K
⊢ 1 = ↑C (leadingCoeff (1 / gcd 0 1))⁻¹ * (1 / gcd 0 1)
[PROOFSTEP]
simp
[GOAL]
K : Type u
inst✝ : Field K
⊢ denom 1 = 1
[PROOFSTEP]
convert denom_div (1 : K[X]) one_ne_zero
[GOAL]
case h.e'_2.h.e'_3
K : Type u
inst✝ : Field K
⊢ 1 = ↑(algebraMap K[X] (RatFunc K)) 1 / ↑(algebraMap K[X] (RatFunc K)) 1
[PROOFSTEP]
simp
[GOAL]
case h.e'_3
K : Type u
inst✝ : Field K
⊢ 1 = ↑C (leadingCoeff (1 / gcd 1 1))⁻¹ * (1 / gcd 1 1)
[PROOFSTEP]
simp
[GOAL]
K : Type u
inst✝ : Field K
p : K[X]
⊢ denom (↑(algebraMap K[X] (RatFunc K)) p) = 1
[PROOFSTEP]
convert denom_div p one_ne_zero
[GOAL]
case h.e'_2.h.e'_3
K : Type u
inst✝ : Field K
p : K[X]
⊢ ↑(algebraMap K[X] (RatFunc K)) p = ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) 1
[PROOFSTEP]
simp
[GOAL]
case h.e'_3
K : Type u
inst✝ : Field K
p : K[X]
⊢ 1 = ↑C (leadingCoeff (1 / gcd p 1))⁻¹ * (1 / gcd p 1)
[PROOFSTEP]
simp
[GOAL]
K : Type u
inst✝ : Field K
p q : K[X]
⊢ denom (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) ∣ q
[PROOFSTEP]
by_cases hq : q = 0
[GOAL]
case pos
K : Type u
inst✝ : Field K
p q : K[X]
hq : q = 0
⊢ denom (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) ∣ q
[PROOFSTEP]
simp [hq]
[GOAL]
case neg
K : Type u
inst✝ : Field K
p q : K[X]
hq : ¬q = 0
⊢ denom (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) ∣ q
[PROOFSTEP]
rw [denom_div _ hq, C_mul_dvd]
[GOAL]
case neg
K : Type u
inst✝ : Field K
p q : K[X]
hq : ¬q = 0
⊢ q / gcd p q ∣ q
[PROOFSTEP]
exact EuclideanDomain.div_dvd_of_dvd (gcd_dvd_right p q)
[GOAL]
case neg
K : Type u
inst✝ : Field K
p q : K[X]
hq : ¬q = 0
⊢ (leadingCoeff (q / gcd p q))⁻¹ ≠ 0
[PROOFSTEP]
simpa only [Ne.def, inv_eq_zero, Polynomial.leadingCoeff_eq_zero] using right_div_gcd_ne_zero hq
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
⊢ ↑(algebraMap K[X] (RatFunc K)) (num x) / ↑(algebraMap K[X] (RatFunc K)) (denom x) = x
[PROOFSTEP]
induction' x using RatFunc.induction_on with p q hq
[GOAL]
case f
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ ↑(algebraMap K[X] (RatFunc K)) (num (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q)) /
      ↑(algebraMap K[X] (RatFunc K)) (denom (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q)) =
    ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q
[PROOFSTEP]
have q_div_ne_zero : q / gcd p q ≠ 0 := right_div_gcd_ne_zero hq
[GOAL]
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)) (num (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q)) /
      ↑(algebraMap K[X] (RatFunc K)) (denom (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q)) =
    ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q
[PROOFSTEP]
dsimp only
[GOAL]
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)) (num (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q)) /
      ↑(algebraMap K[X] (RatFunc K)) (denom (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q)) =
    ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q
[PROOFSTEP]
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]
[GOAL]
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
[PROOFSTEP]
apply gcd_dvd_right
[GOAL]
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
[PROOFSTEP]
apply gcd_dvd_left
[GOAL]
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
[PROOFSTEP]
exact algebraMap_ne_zero q_div_ne_zero
[GOAL]
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
[PROOFSTEP]
exact algebraMap_ne_zero hq
[GOAL]
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 (leadingCoeff (q / gcd p q))⁻¹) ≠ 0
[PROOFSTEP]
refine' algebraMap_ne_zero (mt Polynomial.C_eq_zero.mp _)
[GOAL]
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
⊢ ¬(leadingCoeff (q / gcd p q))⁻¹ = 0
[PROOFSTEP]
exact inv_ne_zero (Polynomial.leadingCoeff_ne_zero.mpr q_div_ne_zero)
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
⊢ IsCoprime (num x) (denom x)
[PROOFSTEP]
induction' x using RatFunc.induction_on with p q hq
[GOAL]
case f
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ IsCoprime (num (↑(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))
[PROOFSTEP]
rw [num_div, denom_div _ hq]
[GOAL]
case f
K : Type u
inst✝ : Field K
p q : K[X]
hq : q ≠ 0
⊢ IsCoprime (↑C (leadingCoeff (q / gcd p q))⁻¹ * (p / gcd p q)) (↑C (leadingCoeff (q / gcd p q))⁻¹ * (q / gcd p q))
[PROOFSTEP]
exact
  (isCoprime_mul_unit_left ((leadingCoeff_ne_zero.2 <| right_div_gcd_ne_zero hq).isUnit.inv.map C) _ _).2
    (isCoprime_div_gcd_div_gcd hq)
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
h : num x = 0
⊢ x = 0
[PROOFSTEP]
rw [← num_div_denom x, h, RingHom.map_zero, zero_div]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q : K[X]
hq : q ≠ 0
⊢ num x * q = p * denom x ↔ x = ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q
[PROOFSTEP]
rw [← (algebraMap_injective K).eq_iff, eq_div_iff (algebraMap_ne_zero hq)]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q : K[X]
hq : q ≠ 0
⊢ ↑(algebraMap K[X] (RatFunc K)) (num x * q) = ↑(algebraMap K[X] (RatFunc K)) (p * denom x) ↔
    x * ↑(algebraMap K[X] (RatFunc K)) q = ↑(algebraMap K[X] (RatFunc K)) p
[PROOFSTEP]
conv_rhs => rw [← num_div_denom x]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q : K[X]
hq : q ≠ 0
| x * ↑(algebraMap K[X] (RatFunc K)) q = ↑(algebraMap K[X] (RatFunc K)) p
[PROOFSTEP]
rw [← num_div_denom x]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q : K[X]
hq : q ≠ 0
| x * ↑(algebraMap K[X] (RatFunc K)) q = ↑(algebraMap K[X] (RatFunc K)) p
[PROOFSTEP]
rw [← num_div_denom x]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q : K[X]
hq : q ≠ 0
| x * ↑(algebraMap K[X] (RatFunc K)) q = ↑(algebraMap K[X] (RatFunc K)) p
[PROOFSTEP]
rw [← num_div_denom x]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q : K[X]
hq : q ≠ 0
⊢ ↑(algebraMap K[X] (RatFunc K)) (num x * q) = ↑(algebraMap K[X] (RatFunc K)) (p * denom x) ↔
    ↑(algebraMap K[X] (RatFunc K)) (num x) / ↑(algebraMap K[X] (RatFunc K)) (denom x) *
        ↑(algebraMap K[X] (RatFunc K)) q =
      ↑(algebraMap K[X] (RatFunc K)) p
[PROOFSTEP]
rw [RingHom.map_mul, RingHom.map_mul, div_eq_mul_inv, mul_assoc, mul_comm (Inv.inv _), ← mul_assoc, ← div_eq_mul_inv,
  div_eq_iff]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p q : K[X]
hq : q ≠ 0
⊢ ↑(algebraMap K[X] (RatFunc K)) (denom x) ≠ 0
[PROOFSTEP]
exact algebraMap_ne_zero (denom_ne_zero x)
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ x + y =
    ↑(algebraMap K[X] (RatFunc K)) (num x * denom y + denom x * num y) /
      ↑(algebraMap K[X] (RatFunc K)) (denom x * denom y)
[PROOFSTEP]
conv_lhs => rw [← num_div_denom x, ← num_div_denom y]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
| x + y
[PROOFSTEP]
rw [← num_div_denom x, ← num_div_denom y]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
| x + y
[PROOFSTEP]
rw [← num_div_denom x, ← num_div_denom y]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
| x + y
[PROOFSTEP]
rw [← num_div_denom x, ← num_div_denom y]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ ↑(algebraMap K[X] (RatFunc K)) (num x) / ↑(algebraMap K[X] (RatFunc K)) (denom x) +
      ↑(algebraMap K[X] (RatFunc K)) (num y) / ↑(algebraMap K[X] (RatFunc K)) (denom y) =
    ↑(algebraMap K[X] (RatFunc K)) (num x * denom y + denom x * num y) /
      ↑(algebraMap K[X] (RatFunc K)) (denom x * denom y)
[PROOFSTEP]
rw [div_add_div, RingHom.map_mul, RingHom.map_add, RingHom.map_mul, RingHom.map_mul]
[GOAL]
case hb
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ ↑(algebraMap K[X] (RatFunc K)) (denom x) ≠ 0
[PROOFSTEP]
exact algebraMap_ne_zero (denom_ne_zero x)
[GOAL]
case hd
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ ↑(algebraMap K[X] (RatFunc K)) (denom y) ≠ 0
[PROOFSTEP]
exact algebraMap_ne_zero (denom_ne_zero y)
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
⊢ num (-x) * denom x = -num x * denom (-x)
[PROOFSTEP]
rw [num_mul_eq_mul_denom_iff (denom_ne_zero x), _root_.map_neg, neg_div, num_div_denom]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ x * y = ↑(algebraMap K[X] (RatFunc K)) (num x * num y) / ↑(algebraMap K[X] (RatFunc K)) (denom x * denom y)
[PROOFSTEP]
conv_lhs => rw [← num_div_denom x, ← num_div_denom y, div_mul_div_comm, ← RingHom.map_mul, ← RingHom.map_mul]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
| x * y
[PROOFSTEP]
rw [← num_div_denom x, ← num_div_denom y, div_mul_div_comm, ← RingHom.map_mul, ← RingHom.map_mul]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
| x * y
[PROOFSTEP]
rw [← num_div_denom x, ← num_div_denom y, div_mul_div_comm, ← RingHom.map_mul, ← RingHom.map_mul]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
| x * y
[PROOFSTEP]
rw [← num_div_denom x, ← num_div_denom y, div_mul_div_comm, ← RingHom.map_mul, ← RingHom.map_mul]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
p : K[X]
hp : p ≠ 0
⊢ num x ∣ p ↔ ∃ q hq, x = ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q
[PROOFSTEP]
constructor
[GOAL]
case mp
K : Type u
inst✝ : Field K
x : RatFunc K
p : K[X]
hp : p ≠ 0
⊢ num x ∣ p → ∃ q hq, x = ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q
[PROOFSTEP]
rintro ⟨q, rfl⟩
[GOAL]
case mp.intro
K : Type u
inst✝ : Field K
x : RatFunc K
q : K[X]
hp : num x * q ≠ 0
⊢ ∃ q_1 hq, x = ↑(algebraMap K[X] (RatFunc K)) (num x * q) / ↑(algebraMap K[X] (RatFunc K)) q_1
[PROOFSTEP]
obtain ⟨_hx, hq⟩ := mul_ne_zero_iff.mp hp
[GOAL]
case mp.intro.intro
K : Type u
inst✝ : Field K
x : RatFunc K
q : K[X]
hp : num x * q ≠ 0
_hx : num x ≠ 0
hq : q ≠ 0
⊢ ∃ q_1 hq, x = ↑(algebraMap K[X] (RatFunc K)) (num x * q) / ↑(algebraMap K[X] (RatFunc K)) q_1
[PROOFSTEP]
use denom x * q
[GOAL]
case h
K : Type u
inst✝ : Field K
x : RatFunc K
q : K[X]
hp : num x * q ≠ 0
_hx : num x ≠ 0
hq : q ≠ 0
⊢ ∃ hq, x = ↑(algebraMap K[X] (RatFunc K)) (num x * q) / ↑(algebraMap K[X] (RatFunc K)) (denom x * q)
[PROOFSTEP]
rw [RingHom.map_mul, RingHom.map_mul, ← div_mul_div_comm, div_self, mul_one, num_div_denom]
[GOAL]
case h
K : Type u
inst✝ : Field K
x : RatFunc K
q : K[X]
hp : num x * q ≠ 0
_hx : num x ≠ 0
hq : q ≠ 0
⊢ ∃ hq, x = x
[PROOFSTEP]
exact ⟨mul_ne_zero (denom_ne_zero x) hq, rfl⟩
[GOAL]
case h
K : Type u
inst✝ : Field K
x : RatFunc K
q : K[X]
hp : num x * q ≠ 0
_hx : num x ≠ 0
hq : q ≠ 0
⊢ ↑(algebraMap K[X] (RatFunc K)) q ≠ 0
[PROOFSTEP]
exact algebraMap_ne_zero hq
[GOAL]
case mpr
K : Type u
inst✝ : Field K
x : RatFunc K
p : K[X]
hp : p ≠ 0
⊢ (∃ q hq, x = ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) → num x ∣ p
[PROOFSTEP]
rintro ⟨q, hq, rfl⟩
[GOAL]
case mpr.intro.intro
K : Type u
inst✝ : Field K
p : K[X]
hp : p ≠ 0
q : K[X]
hq : q ≠ 0
⊢ num (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) ∣ p
[PROOFSTEP]
exact num_div_dvd p hq
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
q : K[X]
hq : q ≠ 0
⊢ denom x ∣ q ↔ ∃ p, x = ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q
[PROOFSTEP]
constructor
[GOAL]
case mp
K : Type u
inst✝ : Field K
x : RatFunc K
q : K[X]
hq : q ≠ 0
⊢ denom x ∣ q → ∃ p, x = ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q
[PROOFSTEP]
rintro ⟨p, rfl⟩
[GOAL]
case mp.intro
K : Type u
inst✝ : Field K
x : RatFunc K
p : K[X]
hq : denom x * p ≠ 0
⊢ ∃ p_1, x = ↑(algebraMap K[X] (RatFunc K)) p_1 / ↑(algebraMap K[X] (RatFunc K)) (denom x * p)
[PROOFSTEP]
obtain ⟨_hx, hp⟩ := mul_ne_zero_iff.mp hq
[GOAL]
case mp.intro.intro
K : Type u
inst✝ : Field K
x : RatFunc K
p : K[X]
hq : denom x * p ≠ 0
_hx : denom x ≠ 0
hp : p ≠ 0
⊢ ∃ p_1, x = ↑(algebraMap K[X] (RatFunc K)) p_1 / ↑(algebraMap K[X] (RatFunc K)) (denom x * p)
[PROOFSTEP]
use num x * p
[GOAL]
case h
K : Type u
inst✝ : Field K
x : RatFunc K
p : K[X]
hq : denom x * p ≠ 0
_hx : denom x ≠ 0
hp : p ≠ 0
⊢ x = ↑(algebraMap K[X] (RatFunc K)) (num x * p) / ↑(algebraMap K[X] (RatFunc K)) (denom x * p)
[PROOFSTEP]
rw [RingHom.map_mul, RingHom.map_mul, ← div_mul_div_comm, div_self, mul_one, num_div_denom]
[GOAL]
case h
K : Type u
inst✝ : Field K
x : RatFunc K
p : K[X]
hq : denom x * p ≠ 0
_hx : denom x ≠ 0
hp : p ≠ 0
⊢ ↑(algebraMap K[X] (RatFunc K)) p ≠ 0
[PROOFSTEP]
exact algebraMap_ne_zero hp
[GOAL]
case mpr
K : Type u
inst✝ : Field K
x : RatFunc K
q : K[X]
hq : q ≠ 0
⊢ (∃ p, x = ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) → denom x ∣ q
[PROOFSTEP]
rintro ⟨p, rfl⟩
[GOAL]
case mpr.intro
K : Type u
inst✝ : Field K
q : K[X]
hq : q ≠ 0
p : K[X]
⊢ denom (↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) q) ∣ q
[PROOFSTEP]
exact denom_div_dvd p q
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ num (x * y) ∣ num x * num y
[PROOFSTEP]
by_cases hx : x = 0
[GOAL]
case pos
K : Type u
inst✝ : Field K
x y : RatFunc K
hx : x = 0
⊢ num (x * y) ∣ num x * num y
[PROOFSTEP]
simp [hx]
[GOAL]
case neg
K : Type u
inst✝ : Field K
x y : RatFunc K
hx : ¬x = 0
⊢ num (x * y) ∣ num x * num y
[PROOFSTEP]
by_cases hy : y = 0
[GOAL]
case pos
K : Type u
inst✝ : Field K
x y : RatFunc K
hx : ¬x = 0
hy : y = 0
⊢ num (x * y) ∣ num x * num y
[PROOFSTEP]
simp [hy]
[GOAL]
case neg
K : Type u
inst✝ : Field K
x y : RatFunc K
hx : ¬x = 0
hy : ¬y = 0
⊢ num (x * y) ∣ num x * num y
[PROOFSTEP]
rw [num_dvd (mul_ne_zero (num_ne_zero hx) (num_ne_zero hy))]
[GOAL]
case neg
K : Type u
inst✝ : Field K
x y : RatFunc K
hx : ¬x = 0
hy : ¬y = 0
⊢ ∃ q hq, x * y = ↑(algebraMap K[X] (RatFunc K)) (num x * num y) / ↑(algebraMap K[X] (RatFunc K)) q
[PROOFSTEP]
refine' ⟨x.denom * y.denom, mul_ne_zero (denom_ne_zero x) (denom_ne_zero y), _⟩
[GOAL]
case neg
K : Type u
inst✝ : Field K
x y : RatFunc K
hx : ¬x = 0
hy : ¬y = 0
⊢ x * y = ↑(algebraMap K[X] (RatFunc K)) (num x * num y) / ↑(algebraMap K[X] (RatFunc K)) (denom x * denom y)
[PROOFSTEP]
rw [RingHom.map_mul, RingHom.map_mul, ← div_mul_div_comm, num_div_denom, num_div_denom]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ denom (x * y) ∣ denom x * denom y
[PROOFSTEP]
rw [denom_dvd (mul_ne_zero (denom_ne_zero x) (denom_ne_zero y))]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ ∃ p, x * y = ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) (denom x * denom y)
[PROOFSTEP]
refine' ⟨x.num * y.num, _⟩
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ x * y = ↑(algebraMap K[X] (RatFunc K)) (num x * num y) / ↑(algebraMap K[X] (RatFunc K)) (denom x * denom y)
[PROOFSTEP]
rw [RingHom.map_mul, RingHom.map_mul, ← div_mul_div_comm, num_div_denom, num_div_denom]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ denom (x + y) ∣ denom x * denom y
[PROOFSTEP]
rw [denom_dvd (mul_ne_zero (denom_ne_zero x) (denom_ne_zero y))]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ ∃ p, x + y = ↑(algebraMap K[X] (RatFunc K)) p / ↑(algebraMap K[X] (RatFunc K)) (denom x * denom y)
[PROOFSTEP]
refine' ⟨x.num * y.denom + x.denom * y.num, _⟩
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ x + y =
    ↑(algebraMap K[X] (RatFunc K)) (num x * denom y + denom x * num y) /
      ↑(algebraMap K[X] (RatFunc K)) (denom x * denom y)
[PROOFSTEP]
rw [RingHom.map_mul, RingHom.map_add, RingHom.map_mul, RingHom.map_mul, ← div_add_div, num_div_denom, num_div_denom]
[GOAL]
case hb
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ ↑(algebraMap K[X] (RatFunc K)) (denom x) ≠ 0
[PROOFSTEP]
exact algebraMap_ne_zero (denom_ne_zero x)
[GOAL]
case hd
K : Type u
inst✝ : Field K
x y : RatFunc K
⊢ ↑(algebraMap K[X] (RatFunc K)) (denom y) ≠ 0
[PROOFSTEP]
exact algebraMap_ne_zero (denom_ne_zero y)
[GOAL]
K : Type u
inst✝³ : Field K
R : Type u_1
F : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : MonoidHomClass F K[X] R[X]
φ : F
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
f : RatFunc K
⊢ ↑(map φ hφ) f =
    ↑(algebraMap ((fun x => R[X]) (num f)) (RatFunc R)) (↑φ (num f)) /
      ↑(algebraMap ((fun x => R[X]) (denom f)) (RatFunc R)) (↑φ (denom f))
[PROOFSTEP]
rw [← num_div_denom f, map_apply_div_ne_zero, num_div_denom f]
[GOAL]
case hq
K : Type u
inst✝³ : Field K
R : Type u_1
F : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : MonoidHomClass F K[X] R[X]
φ : F
hφ : K[X]⁰ ≤ Submonoid.comap φ R[X]⁰
f : RatFunc K
⊢ denom f ≠ 0
[PROOFSTEP]
exact denom_ne_zero _
[GOAL]
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : CommGroupWithZero L
φ : K[X] →*₀ L
hφ : K[X]⁰ ≤ Submonoid.comap φ L⁰
f : RatFunc K
⊢ ↑(liftMonoidWithZeroHom φ hφ) f = ↑φ (num f) / ↑φ (denom f)
[PROOFSTEP]
rw [← num_div_denom f, liftMonoidWithZeroHom_apply_div, num_div_denom]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
hxy : x + y ≠ 0
⊢ num x * denom y + denom x * num y ≠ 0
[PROOFSTEP]
intro h_zero
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
hxy : x + y ≠ 0
h_zero : num x * denom y + denom x * num y = 0
⊢ False
[PROOFSTEP]
have h := num_denom_add x y
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
hxy : x + y ≠ 0
h_zero : num x * denom y + denom x * num y = 0
h : num (x + y) * (denom x * denom y) = (num x * denom y + denom x * num y) * denom (x + y)
⊢ False
[PROOFSTEP]
rw [h_zero, zero_mul] at h 
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
hxy : x + y ≠ 0
h_zero : num x * denom y + denom x * num y = 0
h : num (x + y) * (denom x * denom y) = 0
⊢ False
[PROOFSTEP]
exact (mul_ne_zero (num_ne_zero hxy) (mul_ne_zero x.denom_ne_zero y.denom_ne_zero)) h
[GOAL]
K : Type u
inst✝¹ : CommRing K
inst✝ : IsDomain K
r : K
x : RatFunc K
⊢ r • x = ↑C r * x
[PROOFSTEP]
rw [Algebra.smul_def, algebraMap_eq_C]
[GOAL]
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
x : RatFunc K
h : Polynomial.eval₂ f a (denom x) = 0
⊢ eval f a x = 0
[PROOFSTEP]
rw [eval, h, div_zero]
[GOAL]
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
c : K
⊢ eval f a (↑C c) = ↑f c
[PROOFSTEP]
simp [eval]
[GOAL]
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
⊢ eval f a X = a
[PROOFSTEP]
simp [eval]
[GOAL]
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
⊢ eval f a 0 = 0
[PROOFSTEP]
simp [eval]
[GOAL]
K : Type u
inst✝¹ : Field K
L : Type u_1
inst✝ : Field L
f : K →+* L
a : L
⊢ eval f a 1 = 1
[PROOFSTEP]
simp [eval]
[GOAL]
K : Type u
inst✝³ : Field K
L : Type u_1
inst✝² : Field L
f : K →+* L
a : L
S : Type u_2
inst✝¹ : CommSemiring S
inst✝ : Algebra S K[X]
p : S
⊢ eval f a (↑(algebraMap S (RatFunc K)) p) = Polynomial.eval₂ f a (↑(algebraMap S K[X]) p)
[PROOFSTEP]
simp [eval, IsScalarTower.algebraMap_apply S K[X] (RatFunc K)]
[GOAL]
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
[PROOFSTEP]
unfold eval
[GOAL]
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)
[PROOFSTEP]
by_cases hxy : Polynomial.eval₂ f a (denom (x + y)) = 0
[GOAL]
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)
[PROOFSTEP]
have := Polynomial.eval₂_eq_zero_of_dvd_of_eval₂_eq_zero f a (denom_add_dvd x y) hxy
[GOAL]
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)
[PROOFSTEP]
rw [Polynomial.eval₂_mul] at this 
[GOAL]
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)
[PROOFSTEP]
cases mul_eq_zero.mp this
[GOAL]
case pos.inl
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
h✝ : Polynomial.eval₂ f a (denom x) = 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)
[PROOFSTEP]
contradiction
[GOAL]
case pos.inr
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
h✝ : 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)
[PROOFSTEP]
contradiction
[GOAL]
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)
[PROOFSTEP]
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]
[GOAL]
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))
[PROOFSTEP]
simp only [← Polynomial.eval₂_mul, ← Polynomial.eval₂_add]
[GOAL]
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))
[PROOFSTEP]
congr 1
[GOAL]
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)
[PROOFSTEP]
apply num_denom_add
[GOAL]
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
[PROOFSTEP]
unfold eval
[GOAL]
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))
[PROOFSTEP]
by_cases hxy : Polynomial.eval₂ f a (denom (x * y)) = 0
[GOAL]
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))
[PROOFSTEP]
have := Polynomial.eval₂_eq_zero_of_dvd_of_eval₂_eq_zero f a (denom_mul_dvd x y) hxy
[GOAL]
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))
[PROOFSTEP]
rw [Polynomial.eval₂_mul] at this 
[GOAL]
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))
[PROOFSTEP]
cases mul_eq_zero.mp this
[GOAL]
case pos.inl
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
h✝ : Polynomial.eval₂ f a (denom x) = 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))
[PROOFSTEP]
contradiction
[GOAL]
case pos.inr
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
h✝ : 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))
[PROOFSTEP]
contradiction
[GOAL]
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))
[PROOFSTEP]
rw [div_mul_div_comm, eq_div_iff (mul_ne_zero hx hy), div_eq_mul_inv, mul_right_comm, ← div_eq_mul_inv, div_eq_iff hxy]
[GOAL]
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 (num y) * Polynomial.eval₂ f a (denom (x * y))
[PROOFSTEP]
simp only [← Polynomial.eval₂_mul]
  -- porting note: was `repeat' rw [← Polynomial.eval₂_mul]`
[GOAL]
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 * num y * denom (x * y))
[PROOFSTEP]
congr 1
[GOAL]
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 * num y * denom (x * y)
[PROOFSTEP]
apply num_denom_mul
[GOAL]
K : Type u
inst✝ : Field K
⊢ intDegree 0 = 0
[PROOFSTEP]
rw [intDegree, num_zero, natDegree_zero, denom_zero, natDegree_one, sub_self]
[GOAL]
K : Type u
inst✝ : Field K
⊢ intDegree 1 = 0
[PROOFSTEP]
rw [intDegree, num_one, denom_one, sub_self]
[GOAL]
K : Type u
inst✝ : Field K
k : K
⊢ intDegree (↑C k) = 0
[PROOFSTEP]
rw [intDegree, num_C, natDegree_C, denom_C, natDegree_one, sub_self]
[GOAL]
K : Type u
inst✝ : Field K
⊢ intDegree X = 1
[PROOFSTEP]
rw [intDegree, RatFunc.num_X, Polynomial.natDegree_X, RatFunc.denom_X, Polynomial.natDegree_one, Int.ofNat_one,
  Int.ofNat_zero, sub_zero]
[GOAL]
K : Type u
inst✝ : Field K
p : K[X]
⊢ intDegree (↑(algebraMap K[X] (RatFunc K)) p) = ↑(natDegree p)
[PROOFSTEP]
rw [intDegree, RatFunc.num_algebraMap, RatFunc.denom_algebraMap, Polynomial.natDegree_one, Int.ofNat_zero, sub_zero]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
hx : x ≠ 0
hy : y ≠ 0
⊢ intDegree (x * y) = intDegree x + intDegree y
[PROOFSTEP]
simp only [intDegree, add_sub, sub_add, sub_sub_eq_add_sub, sub_sub, sub_eq_sub_iff_add_eq_add]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
hx : x ≠ 0
hy : y ≠ 0
⊢ ↑(natDegree (num (x * y))) + (↑(natDegree (denom x)) + ↑(natDegree (denom y))) =
    ↑(natDegree (num x)) + ↑(natDegree (num y)) + ↑(natDegree (denom (x * y)))
[PROOFSTEP]
norm_cast
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
hx : x ≠ 0
hy : y ≠ 0
⊢ natDegree (num (x * y)) + (natDegree (denom x) + natDegree (denom y)) =
    natDegree (num x) + natDegree (num y) + natDegree (denom (x * y))
[PROOFSTEP]
rw [← Polynomial.natDegree_mul x.denom_ne_zero y.denom_ne_zero, ←
  Polynomial.natDegree_mul (RatFunc.num_ne_zero (mul_ne_zero hx hy)) (mul_ne_zero x.denom_ne_zero y.denom_ne_zero), ←
  Polynomial.natDegree_mul (RatFunc.num_ne_zero hx) (RatFunc.num_ne_zero hy), ←
  Polynomial.natDegree_mul (mul_ne_zero (RatFunc.num_ne_zero hx) (RatFunc.num_ne_zero hy)) (x * y).denom_ne_zero,
  RatFunc.num_denom_mul]
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
⊢ intDegree (-x) = intDegree x
[PROOFSTEP]
by_cases hx : x = 0
[GOAL]
case pos
K : Type u
inst✝ : Field K
x : RatFunc K
hx : x = 0
⊢ intDegree (-x) = intDegree x
[PROOFSTEP]
rw [hx, neg_zero]
[GOAL]
case neg
K : Type u
inst✝ : Field K
x : RatFunc K
hx : ¬x = 0
⊢ intDegree (-x) = intDegree x
[PROOFSTEP]
rw [intDegree, intDegree, ← natDegree_neg x.num]
[GOAL]
case neg
K : Type u
inst✝ : Field K
x : RatFunc K
hx : ¬x = 0
⊢ ↑(natDegree (num (-x))) - ↑(natDegree (denom (-x))) = ↑(natDegree (-num x)) - ↑(natDegree (denom x))
[PROOFSTEP]
exact
  natDegree_sub_eq_of_prod_eq (num_ne_zero (neg_ne_zero.mpr hx)) (denom_ne_zero (-x)) (neg_ne_zero.mpr (num_ne_zero hx))
    (denom_ne_zero x) (num_denom_neg x)
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
hx : x ≠ 0
s : K[X]
hs : s ≠ 0
⊢ ↑(natDegree (num x * s)) - ↑(natDegree (s * denom x)) = intDegree x
[PROOFSTEP]
apply
  natDegree_sub_eq_of_prod_eq (mul_ne_zero (num_ne_zero hx) hs) (mul_ne_zero hs x.denom_ne_zero) (num_ne_zero hx)
    x.denom_ne_zero
[GOAL]
K : Type u
inst✝ : Field K
x : RatFunc K
hx : x ≠ 0
s : K[X]
hs : s ≠ 0
⊢ num x * s * denom x = num x * (s * denom x)
[PROOFSTEP]
rw [mul_assoc]
[GOAL]
K : Type u
inst✝ : Field K
x y : RatFunc K
hy : y ≠ 0
hxy : x + y ≠ 0
⊢ intDegree (x + y) ≤ max (intDegree x) (intDegree y)
[PROOFSTEP]
by_cases hx : x = 0
[GOAL]
case pos
K : Type u
inst✝ : Field K
x y : RatFunc K
hy : y ≠ 0
hxy : x + y ≠ 0
hx : x = 0
⊢ intDegree (x + y) ≤ max (intDegree x) (intDegree y)
[PROOFSTEP]
simp [hx] at hxy 
[GOAL]
case pos
K : Type u
inst✝ : Field K
x y : RatFunc K
hy : y ≠ 0
hx : x = 0
hxy : ¬y = 0
⊢ intDegree (x + y) ≤ max (intDegree x) (intDegree y)
[PROOFSTEP]
simp [hx, hxy]
[GOAL]
case neg
K : Type u
inst✝ : Field K
x y : RatFunc K
hy : y ≠ 0
hxy : x + y ≠ 0
hx : ¬x = 0
⊢ intDegree (x + y) ≤ max (intDegree x) (intDegree y)
[PROOFSTEP]
rw [intDegree_add hxy, ← natDegree_num_mul_right_sub_natDegree_denom_mul_left_eq_intDegree hx y.denom_ne_zero,
  mul_comm y.denom, ← natDegree_num_mul_right_sub_natDegree_denom_mul_left_eq_intDegree hy x.denom_ne_zero, le_max_iff,
  sub_le_sub_iff_right, Int.ofNat_le, sub_le_sub_iff_right, Int.ofNat_le, ← le_max_iff, mul_comm y.num]
[GOAL]
case neg
K : Type u
inst✝ : Field K
x y : RatFunc K
hy : y ≠ 0
hxy : x + y ≠ 0
hx : ¬x = 0
⊢ natDegree (num x * denom y + denom x * num y) ≤ max (natDegree (num x * denom y)) (natDegree (denom x * num y))
[PROOFSTEP]
exact natDegree_add_le _ _
[GOAL]
K F : Type u
inst✝ : Field F
p q : F[X]
f g : RatFunc F
r : F
⊢ ↑(↑C r) = ↑HahnSeries.C r
[PROOFSTEP]
rw [coe_num_denom, num_C, denom_C, Polynomial.coe_C,
  -- porting note: removed `coe_C`Polynomial.coe_one, PowerSeries.coe_one, div_one]
[GOAL]
K F : Type u
inst✝ : Field F
p q : F[X]
f g : RatFunc F
r : F
⊢ ↑(ofPowerSeries ℤ F) (↑(PowerSeries.C F) r) = ↑HahnSeries.C r
[PROOFSTEP]
simp only [algebraMap_eq_C, ofPowerSeries_C, C_apply]
  -- porting note: added
[GOAL]
K F : Type u
inst✝ : Field F
p q : F[X]
f g : RatFunc F
r : F
⊢ ↑(r • f) = r • ↑f
[PROOFSTEP]
rw [smul_eq_C_mul, ← C_mul_eq_smul, coe_mul, coe_C]
[GOAL]
K F : Type u
inst✝ : Field F
p q : F[X]
f g : RatFunc F
⊢ ↑X = ↑(single 1) 1
[PROOFSTEP]
rw [coe_num_denom, num_X, denom_X, Polynomial.coe_X,
  -- porting note: removed `coe_C`Polynomial.coe_one, PowerSeries.coe_one, div_one]
[GOAL]
K F : Type u
inst✝ : Field F
p q : F[X]
f g : RatFunc F
⊢ ↑(ofPowerSeries ℤ F) PowerSeries.X = ↑(single 1) 1
[PROOFSTEP]
simp only [ofPowerSeries_X]
  -- porting note: added
[GOAL]
K F : Type u
inst✝ : Field F
p q : F[X]
f g : RatFunc F
⊢ ↑(algebraMap (RatFunc F) (LaurentSeries F)) (↑(algebraMap F[X] (RatFunc F)) p / ↑(algebraMap F[X] (RatFunc F)) q) =
    ↑(algebraMap F[X] (LaurentSeries F)) p / ↑(algebraMap F[X] (LaurentSeries F)) q
[PROOFSTEP]
convert coe_div (algebraMap F[X] (RatFunc F) p) (algebraMap F[X] (RatFunc F) q)
[GOAL]
case h.e'_3.h.e'_5
K F : Type u
inst✝ : Field F
p q : F[X]
f g : RatFunc F
⊢ ↑(algebraMap F[X] (LaurentSeries F)) p = ↑(↑(algebraMap F[X] (RatFunc F)) p)
[PROOFSTEP]
rw [← mk_one, coe_def, coeAlgHom, mk_eq_div, liftAlgHom_apply_div, map_one, div_one, Algebra.ofId_apply]
[GOAL]
case h.e'_3.h.e'_6
K F : Type u
inst✝ : Field F
p q : F[X]
f g : RatFunc F
⊢ ↑(algebraMap F[X] (LaurentSeries F)) q = ↑(↑(algebraMap F[X] (RatFunc F)) q)
[PROOFSTEP]
rw [← mk_one, coe_def, coeAlgHom, mk_eq_div, liftAlgHom_apply_div, map_one, div_one, Algebra.ofId_apply]
[GOAL]
K F : Type u
inst✝ : Field F
p q : F[X]
f g : RatFunc F
x : F[X]
y : RatFunc F
z : LaurentSeries F
⊢ (x • y) • z = x • y • z
[PROOFSTEP]
ext
[GOAL]
case coeff.h
K F : Type u
inst✝ : Field F
p q : F[X]
f g : RatFunc F
x : F[X]
y : RatFunc F
z : LaurentSeries F
x✝ : ℤ
⊢ HahnSeries.coeff ((x • y) • z) x✝ = HahnSeries.coeff (x • y • z) x✝
[PROOFSTEP]
simp
