l3lab/ntp-mathlib huggingface dataset:
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    

Proof state:
case refine'_6
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ b✝ : Poly α
⊢ a✝ - b✝ = a✝ + -b✝

Next tactic:
first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | rw [zero_apply, add_zero]
          | rw [neg_apply, add_left_neg, zero_apply]
          | rw [add_comm]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | 

Proof state:
case refine'_6
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ b✝ : Poly α
⊢ a✝ - b✝ = a✝ + -b✝

Next tactic:
rfl
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    

Proof state:
case refine'_7
α : Type u_1
β : Type u_2
γ : Type u_3
⊢ ∀ (a : Poly α), zsmulRec 0 a = 0

Next tactic:
intros
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    

Proof state:
case refine'_7
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ : Poly α
⊢ zsmulRec 0 a✝ = 0

Next tactic:
first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | rw [zero_apply, add_zero]
          | rw [neg_apply, add_left_neg, zero_apply]
          | rw [add_comm]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | 

Proof state:
case refine'_7
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ : Poly α
⊢ zsmulRec 0 a✝ = 0

Next tactic:
rfl
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    

Proof state:
case refine'_8
α : Type u_1
β : Type u_2
γ : Type u_3
⊢ ∀ (n : ℕ) (a : Poly α), zsmulRec (Int.ofNat (succ n)) a = a + zsmulRec (Int.ofNat n) a

Next tactic:
intros
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    

Proof state:
case refine'_8
α : Type u_1
β : Type u_2
γ : Type u_3
n✝ : ℕ
a✝ : Poly α
⊢ zsmulRec (Int.ofNat (succ n✝)) a✝ = a✝ + zsmulRec (Int.ofNat n✝) a✝

Next tactic:
first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | rw [zero_apply, add_zero]
          | rw [neg_apply, add_left_neg, zero_apply]
          | rw [add_comm]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | 

Proof state:
case refine'_8
α : Type u_1
β : Type u_2
γ : Type u_3
n✝ : ℕ
a✝ : Poly α
⊢ zsmulRec (Int.ofNat (succ n✝)) a✝ = a✝ + zsmulRec (Int.ofNat n✝) a✝

Next tactic:
rfl
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    

Proof state:
case refine'_9
α : Type u_1
β : Type u_2
γ : Type u_3
⊢ ∀ (n : ℕ) (a : Poly α), zsmulRec (Int.negSucc n) a = -zsmulRec (↑(succ n)) a

Next tactic:
intros
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    

Proof state:
case refine'_9
α : Type u_1
β : Type u_2
γ : Type u_3
n✝ : ℕ
a✝ : Poly α
⊢ zsmulRec (Int.negSucc n✝) a✝ = -zsmulRec (↑(succ n✝)) a✝

Next tactic:
first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | rw [zero_apply, add_zero]
          | rw [neg_apply, add_left_neg, zero_apply]
          | rw [add_comm]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | 

Proof state:
case refine'_9
α : Type u_1
β : Type u_2
γ : Type u_3
n✝ : ℕ
a✝ : Poly α
⊢ zsmulRec (Int.negSucc n✝) a✝ = -zsmulRec (↑(succ n✝)) a✝

Next tactic:
rfl
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    

Proof state:
case refine'_10
α : Type u_1
β : Type u_2
γ : Type u_3
⊢ ∀ (a : Poly α), -a + a = 0

Next tactic:
intros
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    

Proof state:
case refine'_10
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ : Poly α
⊢ -a✝ + a✝ = 0

Next tactic:
first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | rw [zero_apply, add_zero]
          | rw [neg_apply, add_left_neg, zero_apply]
          | rw [add_comm]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | 

Proof state:
case refine'_10
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ : Poly α
⊢ -a✝ + a✝ = 0

Next tactic:
rfl
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | 

Proof state:
case refine'_10
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ : Poly α
⊢ -a✝ + a✝ = 0

Next tactic:
ext
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; 

Proof state:
case refine'_10.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ : Poly α
x✝ : α → ℕ
⊢ (-a✝ + a✝) x✝ = 0 x✝

Next tactic:
simp_rw [add_apply]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; simp_rw [add_apply]
        

Proof state:
case refine'_10.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ : Poly α
x✝ : α → ℕ
⊢ (-a✝) x✝ + a✝ x✝ = 0 x✝

Next tactic:
first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | rw [zero_apply, add_zero]
          | rw [neg_apply, add_left_neg, zero_apply]
          | rw [add_comm]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | 

Proof state:
case refine'_10.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ : Poly α
x✝ : α → ℕ
⊢ (-a✝) x✝ + a✝ x✝ = 0 x✝

Next tactic:
rw [← add_assoc]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | 

Proof state:
case refine'_10.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ : Poly α
x✝ : α → ℕ
⊢ (-a✝) x✝ + a✝ x✝ = 0 x✝

Next tactic:
rw [zero_apply, zero_add]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | 

Proof state:
case refine'_10.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ : Poly α
x✝ : α → ℕ
⊢ (-a✝) x✝ + a✝ x✝ = 0 x✝

Next tactic:
rw [zero_apply, add_zero]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | rw [zero_apply, add_zero]
          | 

Proof state:
case refine'_10.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ : Poly α
x✝ : α → ℕ
⊢ (-a✝) x✝ + a✝ x✝ = 0 x✝

Next tactic:
rw [neg_apply, add_left_neg, zero_apply]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    

Proof state:
case refine'_11
α : Type u_1
β : Type u_2
γ : Type u_3
⊢ ∀ (a b : Poly α), a + b = b + a

Next tactic:
intros
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    

Proof state:
case refine'_11
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ b✝ : Poly α
⊢ a✝ + b✝ = b✝ + a✝

Next tactic:
first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | rw [zero_apply, add_zero]
          | rw [neg_apply, add_left_neg, zero_apply]
          | rw [add_comm]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | 

Proof state:
case refine'_11
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ b✝ : Poly α
⊢ a✝ + b✝ = b✝ + a✝

Next tactic:
rfl
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | 

Proof state:
case refine'_11
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ b✝ : Poly α
⊢ a✝ + b✝ = b✝ + a✝

Next tactic:
ext
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; 

Proof state:
case refine'_11.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ b✝ : Poly α
x✝ : α → ℕ
⊢ (a✝ + b✝) x✝ = (b✝ + a✝) x✝

Next tactic:
simp_rw [add_apply]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; simp_rw [add_apply]
        

Proof state:
case refine'_11.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ b✝ : Poly α
x✝ : α → ℕ
⊢ a✝ x✝ + b✝ x✝ = b✝ x✝ + a✝ x✝

Next tactic:
first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | rw [zero_apply, add_zero]
          | rw [neg_apply, add_left_neg, zero_apply]
          | rw [add_comm]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | 

Proof state:
case refine'_11.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ b✝ : Poly α
x✝ : α → ℕ
⊢ a✝ x✝ + b✝ x✝ = b✝ x✝ + a✝ x✝

Next tactic:
rw [← add_assoc]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | 

Proof state:
case refine'_11.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ b✝ : Poly α
x✝ : α → ℕ
⊢ a✝ x✝ + b✝ x✝ = b✝ x✝ + a✝ x✝

Next tactic:
rw [zero_apply, zero_add]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | 

Proof state:
case refine'_11.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ b✝ : Poly α
x✝ : α → ℕ
⊢ a✝ x✝ + b✝ x✝ = b✝ x✝ + a✝ x✝

Next tactic:
rw [zero_apply, add_zero]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | rw [zero_apply, add_zero]
          | 

Proof state:
case refine'_11.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ b✝ : Poly α
x✝ : α → ℕ
⊢ a✝ x✝ + b✝ x✝ = b✝ x✝ + a✝ x✝

Next tactic:
rw [neg_apply, add_left_neg, zero_apply]
instance : AddCommGroup (Poly α) := by
  refine' { add := ((· + ·) : Poly α → Poly α → Poly α)
            neg := (Neg.neg : Poly α → Poly α)
            sub := Sub.sub
            zero := 0
            zsmul := @zsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩ ⟨Neg.neg⟩
            nsmul := @nsmulRec _ ⟨(0 : Poly α)⟩ ⟨(· + ·)⟩
            .. }
  all_goals
    intros
    first
      | rfl
      | ext; simp_rw [add_apply]
        first
          | rw [← add_assoc]
          | rw [zero_apply, zero_add]
          | rw [zero_apply, add_zero]
          | rw [neg_apply, add_left_neg, zero_apply]
          | 

Proof state:
case refine'_11.a
α : Type u_1
β : Type u_2
γ : Type u_3
a✝ b✝ : Poly α
x✝ : α → ℕ
⊢ a✝ x✝ + b✝ x✝ = b✝ x✝ + a✝ x✝

Next tactic:
rw [add_comm]
instance : CommRing (Poly α) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
⊢ CommRing (Poly α)

Next tactic:
refine' { (inferInstance : AddCommGroup (Poly α)),
            (inferInstance : AddGroupWithOne (Poly α)) with
              mul := (· * ·)
              npow := @npowRec _ ⟨(1 : Poly α)⟩ ⟨(· * ·)⟩
              .. }
instance : CommRing (Poly α) := by
  refine' { (inferInstance : AddCommGroup (Poly α)),
            (inferInstance : AddGroupWithOne (Poly α)) with
              mul := (· * ·)
              npow := @npowRec _ ⟨(1 : Poly α)⟩ ⟨(· * ·)⟩
              .. }
  

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
⊢ ∀ (a b c : Poly α), a * (b + c) = a * b + a * c
case refine'_2
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
⊢ ∀ (a b c : Poly α), (a + b) * c = a * c + b * c
case refine'_3
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
⊢ ∀ (a : Poly α), 0 * a = 0
case refine'_4
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
⊢ ∀ (a : Poly α), a * 0 = 0
case refine'_5
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
⊢ ∀ (a b c : Poly α), a * b * c = a * (b * c)
case refine'_6
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
⊢ ∀ (a : Poly α), 1 * a = a
case refine'_7
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
⊢ ∀ (a : Poly α), a * 1 = a
case refine'_8
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
⊢ ∀ (x : Poly α), npowRec 0 x = 1
case refine'_9
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
⊢ ∀ (n : ℕ) (x : Poly α), npowRec (n + 1) x = x * npowRec n x
case refine'_10
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
⊢ ∀ (a b : Poly α), a * b = b * a

Next tactic:
all_goals
    intros
    first
      | rfl
      | ext; simp only [add_apply, mul_apply]
        first
          | rw [mul_add]
          | rw [add_mul]
          | rw [zero_apply, zero_mul]
          | rw [zero_apply, mul_zero]
          | rw [← mul_assoc]
          | rw [one_apply, one_mul]
          | rw [one_apply, mul_one]
          | rw [mul_comm]
instance : CommRing (Poly α) := by
  refine' { (inferInstance : AddCommGroup (Poly α)),
            (inferInstance : AddGroupWithOne (Poly α)) with
              mul := (· * ·)
              npow := @npowRec _ ⟨(1 : Poly α)⟩ ⟨(· * ·)⟩
              .. }
  all_goals
    

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
⊢ ∀ (a b c : Poly α), a * (b + c) = a * b + a * c

Next tactic:
intros
instance : CommRing (Poly α) := by
  refine' { (inferInstance : AddCommGroup (Poly α)),
            (inferInstance : AddGroupWithOne (Poly α)) with
              mul := (· * ·)
              npow := @npowRec _ ⟨(1 : Poly α)⟩ ⟨(· * ·)⟩
              .. }
  all_goals
    intros
    

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
a✝ b✝ c✝ : Poly α
⊢ a✝ * (b✝ + c✝) = a✝ * b✝ + a✝ * c✝

Next tactic:
first
      | rfl
      | ext; simp only [add_apply, mul_apply]
        first
          | rw [mul_add]
          | rw [add_mul]
          | rw [zero_apply, zero_mul]
          | rw [zero_apply, mul_zero]
          | rw [← mul_assoc]
          | rw [one_apply, one_mul]
          | rw [one_apply, mul_one]
          | rw [mul_comm]
instance : CommRing (Poly α) := by
  refine' { (inferInstance : AddCommGroup (Poly α)),
            (inferInstance : AddGroupWithOne (Poly α)) with
              mul := (· * ·)
              npow := @npowRec _ ⟨(1 : Poly α)⟩ ⟨(· * ·)⟩
              .. }
  all_goals
    intros
    first
      | 

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
src✝¹ : AddCommGroup (Poly α) := inferInstance
src✝ : AddGroupWithOne (Poly α) := inferInstance
a✝ b✝ c✝ : Poly α
⊢ a✝ * (b✝ + c✝) = a✝ * b✝ + a✝ * c✝

Next tactic:
rfl