Theorem: div_eq_quo_add_sum_rem_div
File: Mathlib/Data/Polynomial/PartialFractions.lean

tactic: induction' s using Finset.induction_on with a b hab Hind f generalizing f
state_before: R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg : ∀ (i : ι), i ∈ s → Monic (g i)
hcop : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
⊢ ∃ q r, (∀ (i : ι), i ∈ s → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in s, ↑(g i) = ↑q + ∑ i in s, ↑(r i) / ↑(g i)

tactic: obtain ⟨q₀, r₁, r₂, hdeg₁, _, hf : (↑f : K) / _ = _⟩ :=
  div_eq_quo_add_rem_div_add_rem_div R K f
    (hg a (b.mem_insert_self a) : Monic (g a))
    (monic_prod_of_monic _ _ fun i hi => hg i (Finset.mem_insert_of_mem hi) :
      Monic (∏ i : ι in b, g i))
    (IsCoprime.prod_right fun i hi =>
      hcop (Finset.mem_coe.2 (b.mem_insert_self a))
        (Finset.mem_coe.2 (Finset.mem_insert_of_mem hi)) (by rintro rfl; exact hab hi))
state_before: case insert
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
⊢ ∃ q r,
    (∀ (i : ι), i ∈ insert a b → degree (r i) < degree (g i)) ∧
      ↑f / ∏ i in insert a b, ↑(g i) = ↑q + ∑ i in insert a b, ↑(r i) / ↑(g i)

tactic: refine' ⟨f, fun _ : ι => (0 : R[X]), fun i => _, by simp⟩
state_before: case empty
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
f : R[X]
hg : ∀ (i : ι), i ∈ ∅ → Monic (g i)
hcop : Set.Pairwise ↑∅ fun i j => IsCoprime (g i) (g j)
⊢ ∃ q r, (∀ (i : ι), i ∈ ∅ → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in ∅, ↑(g i) = ↑q + ∑ i in ∅, ↑(r i) / ↑(g i)

tactic: rintro ⟨⟩
state_before: case empty
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
f : R[X]
hg : ∀ (i : ι), i ∈ ∅ → Monic (g i)
hcop : Set.Pairwise ↑∅ fun i j => IsCoprime (g i) (g j)
i : ι
⊢ i ∈ ∅ → degree ((fun x => 0) i) < degree (g i)

tactic: simp
state_before: R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
f : R[X]
hg : ∀ (i : ι), i ∈ ∅ → Monic (g i)
hcop : Set.Pairwise ↑∅ fun i j => IsCoprime (g i) (g j)
⊢ ↑f / ∏ i in ∅, ↑(g i) = ↑f + ∑ i in ∅, ↑((fun x => 0) i) / ↑(g i)

tactic: rintro rfl
state_before: R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
i : ι
hi : i ∈ b
⊢ a ≠ i

tactic: exact hab hi
state_before: R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
hi : a ∈ b
⊢ False

tactic: obtain ⟨q, r, hrdeg, IH⟩ :=
  Hind _ (fun i hi => hg i (Finset.mem_insert_of_mem hi))
    (Set.Pairwise.mono (Finset.coe_subset.2 fun i hi => Finset.mem_insert_of_mem hi) hcop)
state_before: case insert.intro.intro.intro.intro.intro
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
⊢ ∃ q r,
    (∀ (i : ι), i ∈ insert a b → degree (r i) < degree (g i)) ∧
      ↑f / ∏ i in insert a b, ↑(g i) = ↑q + ∑ i in insert a b, ↑(r i) / ↑(g i)

tactic: refine ⟨q₀ + q, fun i => if i = a then r₁ else r i, ?_, ?_⟩
state_before: case insert.intro.intro.intro.intro.intro.intro.intro.intro
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
IH : ↑?m.66060 / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
⊢ ∃ q r,
    (∀ (i : ι), i ∈ insert a b → degree (r i) < degree (g i)) ∧
      ↑f / ∏ i in insert a b, ↑(g i) = ↑q + ∑ i in insert a b, ↑(r i) / ↑(g i)

tactic: norm_cast  at hf IH⊢
state_before: case insert.intro.intro.intro.intro.intro.intro.intro.intro.refine_2
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
IH : ↑?m.66060 / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
⊢ ↑f / ∏ i in insert a b, ↑(g i) = ↑(q₀ + q) + ∑ i in insert a b, ↑((fun i => if i = a then r₁ else r i) i) / ↑(g i)

tactic: rw [Finset.prod_insert hab, hf, IH, Finset.sum_insert hab, if_pos rfl]
state_before: case insert.intro.intro.intro.intro.intro.intro.intro.intro.refine_2
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf✝ : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
hf : ↑f / ↑(g a * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
IH : ↑?m.66060 / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
⊢ ↑f / ↑(∏ i in insert a b, g i) = ↑(q₀ + q) + ∑ x in insert a b, ↑(if x = a then r₁ else r x) / ↑(g x)

tactic: trans (↑(q₀ + q : R[X]) : K) + (↑r₁ / ↑(g a) + ∑ i : ι in b, (r i : K) / (g i : K))
state_before: case insert.intro.intro.intro.intro.intro.intro.intro.intro.refine_2
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf✝ : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
hf : ↑f / ↑(g a * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
⊢ ↑q₀ + ↑r₁ / ↑(g a) + (↑q + ∑ i in b, ↑(r i) / ↑(g i)) =
    ↑(q₀ + q) + (↑r₁ / ↑(g a) + ∑ x in b, ↑(if x = a then r₁ else r x) / ↑(g x))

tactic: congr 2
state_before: R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf✝ : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
hf : ↑f / ↑(g a * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
⊢ ↑(q₀ + q) + (↑r₁ / ↑(g a) + ∑ i in b, ↑(r i) / ↑(g i)) =
    ↑(q₀ + q) + (↑r₁ / ↑(g a) + ∑ x in b, ↑(if x = a then r₁ else r x) / ↑(g x))

tactic: refine' Finset.sum_congr rfl fun x hxb => _
state_before: case e_a.e_a
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf✝ : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
hf : ↑f / ↑(g a * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
⊢ ∑ i in b, ↑(r i) / ↑(g i) = ∑ x in b, ↑(if x = a then r₁ else r x) / ↑(g x)

tactic: rw [if_neg]
state_before: case e_a.e_a
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf✝ : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
hf : ↑f / ↑(g a * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
x : ι
hxb : x ∈ b
⊢ ↑(r x) / ↑(g x) = ↑(if x = a then r₁ else r x) / ↑(g x)

tactic: rintro rfl
state_before: case e_a.e_a.hnc
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf✝ : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
hf : ↑f / ↑(g a * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
x : ι
hxb : x ∈ b
⊢ ¬x = a

tactic: exact hab hxb
state_before: case e_a.e_a.hnc
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
b : Finset ι
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f q₀ r₁ r₂ : R[X]
left✝ : degree r₂ < degree (∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
x : ι
hxb : x ∈ b
hab : ¬x ∈ b
hg : ∀ (i : ι), i ∈ insert x b → Monic (g i)
hcop : Set.Pairwise ↑(insert x b) fun i j => IsCoprime (g i) (g j)
hdeg₁ : degree r₁ < degree (g x)
hf✝ : ↑f / (↑(g x) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g x) + ↑r₂ / ↑(∏ i in b, g i)
hf : ↑f / ↑(g x * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g x) + ↑r₂ / ↑(∏ i in b, g i)
⊢ False

tactic: intro i
state_before: case insert.intro.intro.intro.intro.intro.intro.intro.intro.refine_1
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
IH : ↑?m.66060 / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
⊢ ∀ (i : ι), i ∈ insert a b → degree ((fun i => if i = a then r₁ else r i) i) < degree (g i)

tactic: dsimp only
state_before: case insert.intro.intro.intro.intro.intro.intro.intro.intro.refine_1
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
IH : ↑?m.66060 / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
i : ι
⊢ i ∈ insert a b → degree ((fun i => if i = a then r₁ else r i) i) < degree (g i)

tactic: split_ifs with h1
state_before: case insert.intro.intro.intro.intro.intro.intro.intro.intro.refine_1
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
IH : ↑?m.66060 / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
i : ι
⊢ i ∈ insert a b → degree (if i = a then r₁ else r i) < degree (g i)

tactic: cases h1
state_before: case insert.intro.intro.intro.intro.intro.intro.intro.intro.refine_1.inl
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
IH : ↑?m.66060 / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
i : ι
h1 : i = a
⊢ i ∈ insert a b → degree r₁ < degree (g i)

tactic: intro
state_before: case insert.intro.intro.intro.intro.intro.intro.intro.intro.refine_1.inl.refl
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
IH : ↑?m.66060 / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
⊢ a ∈ insert a b → degree r₁ < degree (g a)

tactic: exact hdeg₁
state_before: case insert.intro.intro.intro.intro.intro.intro.intro.intro.refine_1.inl.refl
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
IH : ↑?m.66060 / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
a✝ : a ∈ insert a b
⊢ degree r₁ < degree (g a)

tactic: intro hi
state_before: case insert.intro.intro.intro.intro.intro.intro.intro.intro.refine_1.inr
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
IH : ↑?m.66060 / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
i : ι
h1 : ¬i = a
⊢ i ∈ insert a b → degree (r i) < degree (g i)

tactic: exact hrdeg i (Finset.mem_of_mem_insert_of_ne hi h1)
state_before: case insert.intro.intro.intro.intro.intro.intro.intro.intro.refine_1.inr
R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
IH : ↑?m.66060 / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
i : ι
h1 : ¬i = a
hi : i ∈ insert a b
⊢ degree (r i) < degree (g i)

tactic: push_cast
state_before: R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf✝ : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
hf : ↑f / ↑(g a * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
⊢ ↑q₀ + ↑r₁ / ↑(g a) + (↑q + ∑ i in b, ↑(r i) / ↑(g i)) = ↑(q₀ + q) + (↑r₁ / ↑(g a) + ∑ i in b, ↑(r i) / ↑(g i))

tactic: ring
state_before: R : Type
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type
inst✝² : Field K
inst✝¹ : Algebra R[X] K
inst✝ : IsFractionRing R[X] K
f✝ : R[X]
ι : Type u_1
g : ι → R[X]
s : Finset ι
hg✝ : ∀ (i : ι), i ∈ s → Monic (g i)
hcop✝ : Set.Pairwise ↑s fun i j => IsCoprime (g i) (g j)
a : ι
b : Finset ι
hab : ¬a ∈ b
Hind :
  ∀ (f : R[X]),
    (∀ (i : ι), i ∈ b → Monic (g i)) →
      (Set.Pairwise ↑b fun i j => IsCoprime (g i) (g j)) →
        ∃ q r, (∀ (i : ι), i ∈ b → degree (r i) < degree (g i)) ∧ ↑f / ∏ i in b, ↑(g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
f : R[X]
hg : ∀ (i : ι), i ∈ insert a b → Monic (g i)
hcop : Set.Pairwise ↑(insert a b) fun i j => IsCoprime (g i) (g j)
q₀ r₁ r₂ : R[X]
hdeg₁ : degree r₁ < degree (g a)
left✝ : degree r₂ < degree (∏ i in b, g i)
hf✝ : ↑f / (↑(g a) * ↑(∏ i in b, g i)) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
q : R[X]
r : ι → R[X]
hrdeg : ∀ (i : ι), i ∈ b → degree (r i) < degree (g i)
hf : ↑f / ↑(g a * ∏ i in b, g i) = ↑q₀ + ↑r₁ / ↑(g a) + ↑r₂ / ↑(∏ i in b, g i)
IH : ↑r₂ / ↑(∏ i in b, g i) = ↑q + ∑ i in b, ↑(r i) / ↑(g i)
⊢ ↑q₀ + ↑r₁ / ↑(g a) + (↑q + ∑ i in b, ↑(r i) / ↑(g i)) = ↑q₀ + ↑q + (↑r₁ / ↑(g a) + ∑ i in b, ↑(r i) / ↑(g i))