Theorem: Polynomial.reflect_mul_induction
File: Mathlib/Algebra/Polynomial/Reverse.lean

tactic: induction' cf with cf hcf
state_before: R : Type u_1
inst✝ : Semiring R
f : R[X]
cf cg : ℕ
⊢ ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
state_after: case zero
R : Type u_1
inst✝ : Semiring R
f : R[X]
cg : ℕ
⊢ ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g

case succ
R : Type u_1
inst✝ : Semiring R
f : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
⊢ ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ (cf + 1).succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g

tactic: induction' cg with cg hcg
state_before: case zero
R : Type u_1
inst✝ : Semiring R
f : R[X]
cg : ℕ
⊢ ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
state_after: case zero.zero
R : Type u_1
inst✝ : Semiring R
f : R[X]
⊢ ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ Nat.succ 0 →
        f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g

case zero.succ
R : Type u_1
inst✝ : Semiring R
f : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
⊢ ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ (cg + 1).succ →
        f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g

tactic: intro N O f g Cf Cg Nf Og
state_before: case zero.zero
R : Type u_1
inst✝ : Semiring R
f : R[X]
⊢ ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ Nat.succ 0 →
        f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
state_after: case zero.zero
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ Nat.succ 0
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g

tactic: rw [← C_mul_X_pow_eq_self Cf, ← C_mul_X_pow_eq_self Cg]
state_before: case zero.zero
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ Nat.succ 0
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g
state_after: case zero.zero
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ Nat.succ 0
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
⊢ reflect (N + O) (C f.leadingCoeff * X ^ f.natDegree * (C g.leadingCoeff * X ^ g.natDegree)) =
    reflect N (C f.leadingCoeff * X ^ f.natDegree) * reflect O (C g.leadingCoeff * X ^ g.natDegree)

tactic: simp_rw [mul_assoc, X_pow_mul, mul_assoc, ← pow_add (X : R[X]), reflect_C_mul,
  reflect_monomial, add_comm, revAt_add Nf Og, mul_assoc, X_pow_mul, mul_assoc, ←
  pow_add (X : R[X]), add_comm]
state_before: case zero.zero
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ Nat.succ 0
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
⊢ reflect (N + O) (C f.leadingCoeff * X ^ f.natDegree * (C g.leadingCoeff * X ^ g.natDegree)) =
    reflect N (C f.leadingCoeff * X ^ f.natDegree) * reflect O (C g.leadingCoeff * X ^ g.natDegree)
state_after: no goals

tactic: intro N O f g Cf Cg Nf Og
state_before: case zero.succ
R : Type u_1
inst✝ : Semiring R
f : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
⊢ ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ (cg + 1).succ →
        f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
state_after: case zero.succ
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g

tactic: by_cases g0 : g = 0
state_before: case zero.succ
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g
state_after: case pos
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : g = 0
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g

case neg
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : ¬g = 0
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g

tactic: rw [← eraseLead_add_C_mul_X_pow g, mul_add, reflect_add, reflect_add, mul_add, hcg, hcg] <;>
  try assumption
state_before: case neg
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : ¬g = 0
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g
state_after: case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : ¬g = 0
⊢ (C g.leadingCoeff * X ^ g.natDegree).support.card ≤ cg.succ

case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : ¬g = 0
⊢ (C g.leadingCoeff * X ^ g.natDegree).natDegree ≤ O

case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : ¬g = 0
⊢ g.eraseLead.support.card ≤ cg.succ

case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : ¬g = 0
⊢ g.eraseLead.natDegree ≤ O

tactic: rw [g0, reflect_zero, mul_zero, mul_zero, reflect_zero]
state_before: case pos
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : g = 0
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g
state_after: no goals

tactic: assumption
state_before: case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : ¬g = 0
⊢ f.natDegree ≤ N
state_after: no goals

tactic: exact le_add_left card_support_C_mul_X_pow_le_one
state_before: case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : ¬g = 0
⊢ (C g.leadingCoeff * X ^ g.natDegree).support.card ≤ cg.succ
state_after: no goals

tactic: exact le_trans (natDegree_C_mul_X_pow_le g.leadingCoeff g.natDegree) Og
state_before: case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : ¬g = 0
⊢ (C g.leadingCoeff * X ^ g.natDegree).natDegree ≤ O
state_after: no goals

tactic: exact Nat.lt_succ_iff.mp (gt_of_ge_of_gt Cg (eraseLead_support_card_lt g0))
state_before: case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : ¬g = 0
⊢ g.eraseLead.support.card ≤ cg.succ
state_after: no goals

tactic: exact le_trans eraseLead_natDegree_le_aux Og
state_before: case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg : ℕ
hcg :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ Nat.succ 0 →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ Nat.succ 0
Cg : g.support.card ≤ (cg + 1).succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
g0 : ¬g = 0
⊢ g.eraseLead.natDegree ≤ O
state_after: no goals

tactic: intro N O f g Cf Cg Nf Og
state_before: case succ
R : Type u_1
inst✝ : Semiring R
f : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
⊢ ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ (cf + 1).succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
state_after: case succ
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g

tactic: by_cases f0 : f = 0
state_before: case succ
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g
state_after: case pos
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : f = 0
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g

case neg
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : ¬f = 0
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g

tactic: rw [← eraseLead_add_C_mul_X_pow f, add_mul, reflect_add, reflect_add, add_mul, hcf, hcf] <;>
  try assumption
state_before: case neg
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : ¬f = 0
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g
state_after: case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : ¬f = 0
⊢ (C f.leadingCoeff * X ^ f.natDegree).support.card ≤ cf.succ

case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : ¬f = 0
⊢ (C f.leadingCoeff * X ^ f.natDegree).natDegree ≤ N

case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : ¬f = 0
⊢ f.eraseLead.support.card ≤ cf.succ

case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : ¬f = 0
⊢ f.eraseLead.natDegree ≤ N

tactic: rw [f0, reflect_zero, zero_mul, zero_mul, reflect_zero]
state_before: case pos
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : f = 0
⊢ reflect (N + O) (f * g) = reflect N f * reflect O g
state_after: no goals

tactic: assumption
state_before: case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : ¬f = 0
⊢ g.natDegree ≤ O
state_after: no goals

tactic: exact le_add_left card_support_C_mul_X_pow_le_one
state_before: case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : ¬f = 0
⊢ (C f.leadingCoeff * X ^ f.natDegree).support.card ≤ cf.succ
state_after: no goals

tactic: exact le_trans (natDegree_C_mul_X_pow_le f.leadingCoeff f.natDegree) Nf
state_before: case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : ¬f = 0
⊢ (C f.leadingCoeff * X ^ f.natDegree).natDegree ≤ N
state_after: no goals

tactic: exact Nat.lt_succ_iff.mp (gt_of_ge_of_gt Cf (eraseLead_support_card_lt f0))
state_before: case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : ¬f = 0
⊢ f.eraseLead.support.card ≤ cf.succ
state_after: no goals

tactic: exact le_trans eraseLead_natDegree_le_aux Nf
state_before: case neg.a
R : Type u_1
inst✝ : Semiring R
f✝ : R[X]
cg cf : ℕ
hcf :
  ∀ (N O : ℕ) (f g : R[X]),
    f.support.card ≤ cf.succ →
      g.support.card ≤ cg.succ → f.natDegree ≤ N → g.natDegree ≤ O → reflect (N + O) (f * g) = reflect N f * reflect O g
N O : ℕ
f g : R[X]
Cf : f.support.card ≤ (cf + 1).succ
Cg : g.support.card ≤ cg.succ
Nf : f.natDegree ≤ N
Og : g.natDegree ≤ O
f0 : ¬f = 0
⊢ f.eraseLead.natDegree ≤ N
state_after: no goals