l3lab/ntp-mathlib huggingface dataset:
instance nonUnitalRing [Semigroup α] : NonUnitalRing (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalNonAssocRing with
    mul_assoc := fun x y z ↦ by
      refine' FreeAbelianGroup.induction_on z (by simp only [mul_zero])
          (fun L3 ↦ _) (fun L3 ih ↦ _) fun z₁ z₂ ih₁ ih₂ ↦ _
      · refine' FreeAbelianGroup.induction_on y (by simp only [mul_zero, zero_mul])
            (fun L2 ↦ _) (fun L2 ih ↦ _) fun y₁ y₂ ih₁ ih₂ ↦ _
        · refine' FreeAbelianGroup.induction_on x (by 

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝ : Semigroup α
src✝ : NonUnitalNonAssocRing (FreeAbelianGroup α) := nonUnitalNonAssocRing
x y z : FreeAbelianGroup α
L3 L2 : α
⊢ 0 * of L2 * of L3 = 0 * (of L2 * of L3)

Next tactic:
simp only [zero_mul]
instance nonUnitalRing [Semigroup α] : NonUnitalRing (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalNonAssocRing with
    mul_assoc := fun x y z ↦ by
      refine' FreeAbelianGroup.induction_on z (by simp only [mul_zero])
          (fun L3 ↦ _) (fun L3 ih ↦ _) fun z₁ z₂ ih₁ ih₂ ↦ _
      · refine' FreeAbelianGroup.induction_on y (by simp only [mul_zero, zero_mul])
            (fun L2 ↦ _) (fun L2 ih ↦ _) fun y₁ y₂ ih₁ ih₂ ↦ _
        · refine' FreeAbelianGroup.induction_on x (by simp only [zero_mul])
              (fun L1 ↦ _) (fun L1 ih ↦ _) fun x₁ x₂ ih₁ ih₂ ↦ _
          · 

Proof state:
case refine'_1.refine'_1.refine'_1
α : Type u
β : Type v
γ : Type w
inst✝ : Semigroup α
src✝ : NonUnitalNonAssocRing (FreeAbelianGroup α) := nonUnitalNonAssocRing
x y z : FreeAbelianGroup α
L3 L2 L1 : α
⊢ of L1 * of L2 * of L3 = of L1 * (of L2 * of L3)

Next tactic:
rw [of_mul_of, of_mul_of, of_mul_of, of_mul_of, mul_assoc]
instance nonUnitalRing [Semigroup α] : NonUnitalRing (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalNonAssocRing with
    mul_assoc := fun x y z ↦ by
      refine' FreeAbelianGroup.induction_on z (by simp only [mul_zero])
          (fun L3 ↦ _) (fun L3 ih ↦ _) fun z₁ z₂ ih₁ ih₂ ↦ _
      · refine' FreeAbelianGroup.induction_on y (by simp only [mul_zero, zero_mul])
            (fun L2 ↦ _) (fun L2 ih ↦ _) fun y₁ y₂ ih₁ ih₂ ↦ _
        · refine' FreeAbelianGroup.induction_on x (by simp only [zero_mul])
              (fun L1 ↦ _) (fun L1 ih ↦ _) fun x₁ x₂ ih₁ ih₂ ↦ _
          · rw [of_mul_of, of_mul_of, of_mul_of, of_mul_of, mul_assoc]
          · 

Proof state:
case refine'_1.refine'_1.refine'_2
α : Type u
β : Type v
γ : Type w
inst✝ : Semigroup α
src✝ : NonUnitalNonAssocRing (FreeAbelianGroup α) := nonUnitalNonAssocRing
x y z : FreeAbelianGroup α
L3 L2 L1 : α
ih : of L1 * of L2 * of L3 = of L1 * (of L2 * of L3)
⊢ -of L1 * of L2 * of L3 = -of L1 * (of L2 * of L3)

Next tactic:
rw [neg_mul, neg_mul, neg_mul, ih]
instance nonUnitalRing [Semigroup α] : NonUnitalRing (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalNonAssocRing with
    mul_assoc := fun x y z ↦ by
      refine' FreeAbelianGroup.induction_on z (by simp only [mul_zero])
          (fun L3 ↦ _) (fun L3 ih ↦ _) fun z₁ z₂ ih₁ ih₂ ↦ _
      · refine' FreeAbelianGroup.induction_on y (by simp only [mul_zero, zero_mul])
            (fun L2 ↦ _) (fun L2 ih ↦ _) fun y₁ y₂ ih₁ ih₂ ↦ _
        · refine' FreeAbelianGroup.induction_on x (by simp only [zero_mul])
              (fun L1 ↦ _) (fun L1 ih ↦ _) fun x₁ x₂ ih₁ ih₂ ↦ _
          · rw [of_mul_of, of_mul_of, of_mul_of, of_mul_of, mul_assoc]
          · rw [neg_mul, neg_mul, neg_mul, ih]
          · 

Proof state:
case refine'_1.refine'_1.refine'_3
α : Type u
β : Type v
γ : Type w
inst✝ : Semigroup α
src✝ : NonUnitalNonAssocRing (FreeAbelianGroup α) := nonUnitalNonAssocRing
x y z : FreeAbelianGroup α
L3 L2 : α
x₁ x₂ : FreeAbelianGroup α
ih₁ : x₁ * of L2 * of L3 = x₁ * (of L2 * of L3)
ih₂ : x₂ * of L2 * of L3 = x₂ * (of L2 * of L3)
⊢ (x₁ + x₂) * of L2 * of L3 = (x₁ + x₂) * (of L2 * of L3)

Next tactic:
rw [add_mul, add_mul, add_mul, ih₁, ih₂]
instance nonUnitalRing [Semigroup α] : NonUnitalRing (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalNonAssocRing with
    mul_assoc := fun x y z ↦ by
      refine' FreeAbelianGroup.induction_on z (by simp only [mul_zero])
          (fun L3 ↦ _) (fun L3 ih ↦ _) fun z₁ z₂ ih₁ ih₂ ↦ _
      · refine' FreeAbelianGroup.induction_on y (by simp only [mul_zero, zero_mul])
            (fun L2 ↦ _) (fun L2 ih ↦ _) fun y₁ y₂ ih₁ ih₂ ↦ _
        · refine' FreeAbelianGroup.induction_on x (by simp only [zero_mul])
              (fun L1 ↦ _) (fun L1 ih ↦ _) fun x₁ x₂ ih₁ ih₂ ↦ _
          · rw [of_mul_of, of_mul_of, of_mul_of, of_mul_of, mul_assoc]
          · rw [neg_mul, neg_mul, neg_mul, ih]
          · rw [add_mul, add_mul, add_mul, ih₁, ih₂]
        · 

Proof state:
case refine'_1.refine'_2
α : Type u
β : Type v
γ : Type w
inst✝ : Semigroup α
src✝ : NonUnitalNonAssocRing (FreeAbelianGroup α) := nonUnitalNonAssocRing
x y z : FreeAbelianGroup α
L3 L2 : α
ih : x * of L2 * of L3 = x * (of L2 * of L3)
⊢ x * -of L2 * of L3 = x * (-of L2 * of L3)

Next tactic:
rw [neg_mul, mul_neg, mul_neg, neg_mul, ih]
instance nonUnitalRing [Semigroup α] : NonUnitalRing (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalNonAssocRing with
    mul_assoc := fun x y z ↦ by
      refine' FreeAbelianGroup.induction_on z (by simp only [mul_zero])
          (fun L3 ↦ _) (fun L3 ih ↦ _) fun z₁ z₂ ih₁ ih₂ ↦ _
      · refine' FreeAbelianGroup.induction_on y (by simp only [mul_zero, zero_mul])
            (fun L2 ↦ _) (fun L2 ih ↦ _) fun y₁ y₂ ih₁ ih₂ ↦ _
        · refine' FreeAbelianGroup.induction_on x (by simp only [zero_mul])
              (fun L1 ↦ _) (fun L1 ih ↦ _) fun x₁ x₂ ih₁ ih₂ ↦ _
          · rw [of_mul_of, of_mul_of, of_mul_of, of_mul_of, mul_assoc]
          · rw [neg_mul, neg_mul, neg_mul, ih]
          · rw [add_mul, add_mul, add_mul, ih₁, ih₂]
        · rw [neg_mul, mul_neg, mul_neg, neg_mul, ih]
        · 

Proof state:
case refine'_1.refine'_3
α : Type u
β : Type v
γ : Type w
inst✝ : Semigroup α
src✝ : NonUnitalNonAssocRing (FreeAbelianGroup α) := nonUnitalNonAssocRing
x y z : FreeAbelianGroup α
L3 : α
y₁ y₂ : FreeAbelianGroup α
ih₁ : x * y₁ * of L3 = x * (y₁ * of L3)
ih₂ : x * y₂ * of L3 = x * (y₂ * of L3)
⊢ x * (y₁ + y₂) * of L3 = x * ((y₁ + y₂) * of L3)

Next tactic:
rw [add_mul, mul_add, mul_add, add_mul, ih₁, ih₂]
instance nonUnitalRing [Semigroup α] : NonUnitalRing (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalNonAssocRing with
    mul_assoc := fun x y z ↦ by
      refine' FreeAbelianGroup.induction_on z (by simp only [mul_zero])
          (fun L3 ↦ _) (fun L3 ih ↦ _) fun z₁ z₂ ih₁ ih₂ ↦ _
      · refine' FreeAbelianGroup.induction_on y (by simp only [mul_zero, zero_mul])
            (fun L2 ↦ _) (fun L2 ih ↦ _) fun y₁ y₂ ih₁ ih₂ ↦ _
        · refine' FreeAbelianGroup.induction_on x (by simp only [zero_mul])
              (fun L1 ↦ _) (fun L1 ih ↦ _) fun x₁ x₂ ih₁ ih₂ ↦ _
          · rw [of_mul_of, of_mul_of, of_mul_of, of_mul_of, mul_assoc]
          · rw [neg_mul, neg_mul, neg_mul, ih]
          · rw [add_mul, add_mul, add_mul, ih₁, ih₂]
        · rw [neg_mul, mul_neg, mul_neg, neg_mul, ih]
        · rw [add_mul, mul_add, mul_add, add_mul, ih₁, ih₂]
      · 

Proof state:
case refine'_2
α : Type u
β : Type v
γ : Type w
inst✝ : Semigroup α
src✝ : NonUnitalNonAssocRing (FreeAbelianGroup α) := nonUnitalNonAssocRing
x y z : FreeAbelianGroup α
L3 : α
ih : x * y * of L3 = x * (y * of L3)
⊢ x * y * -of L3 = x * (y * -of L3)

Next tactic:
rw [mul_neg, mul_neg, mul_neg, ih]
instance nonUnitalRing [Semigroup α] : NonUnitalRing (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalNonAssocRing with
    mul_assoc := fun x y z ↦ by
      refine' FreeAbelianGroup.induction_on z (by simp only [mul_zero])
          (fun L3 ↦ _) (fun L3 ih ↦ _) fun z₁ z₂ ih₁ ih₂ ↦ _
      · refine' FreeAbelianGroup.induction_on y (by simp only [mul_zero, zero_mul])
            (fun L2 ↦ _) (fun L2 ih ↦ _) fun y₁ y₂ ih₁ ih₂ ↦ _
        · refine' FreeAbelianGroup.induction_on x (by simp only [zero_mul])
              (fun L1 ↦ _) (fun L1 ih ↦ _) fun x₁ x₂ ih₁ ih₂ ↦ _
          · rw [of_mul_of, of_mul_of, of_mul_of, of_mul_of, mul_assoc]
          · rw [neg_mul, neg_mul, neg_mul, ih]
          · rw [add_mul, add_mul, add_mul, ih₁, ih₂]
        · rw [neg_mul, mul_neg, mul_neg, neg_mul, ih]
        · rw [add_mul, mul_add, mul_add, add_mul, ih₁, ih₂]
      · rw [mul_neg, mul_neg, mul_neg, ih]
      · 

Proof state:
case refine'_3
α : Type u
β : Type v
γ : Type w
inst✝ : Semigroup α
src✝ : NonUnitalNonAssocRing (FreeAbelianGroup α) := nonUnitalNonAssocRing
x y z z₁ z₂ : FreeAbelianGroup α
ih₁ : x * y * z₁ = x * (y * z₁)
ih₂ : x * y * z₂ = x * (y * z₂)
⊢ x * y * (z₁ + z₂) = x * (y * (z₁ + z₂))

Next tactic:
rw [mul_add, mul_add, mul_add, ih₁, ih₂]
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        exact mul_one L
      · rw [map_neg, ih]
      · rw [map_add, ih1, ih2]
    one_mul := fun x ↦ by
      

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
⊢ 1 * x = x

Next tactic:
dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        exact mul_one L
      · rw [map_neg, ih]
      · rw [map_add, ih1, ih2]
    one_mul := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
⊢ (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) x = x

Next tactic:
refine' FreeAbelianGroup.induction_on x rfl _ _ _
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        exact mul_one L
      · rw [map_neg, ih]
      · rw [map_add, ih1, ih2]
    one_mul := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      refine' FreeAbelianGroup.induction_on x rfl _ _ _
      · 

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
⊢ ∀ (x : α), (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) (of x) = of x

Next tactic:
intro L
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        exact mul_one L
      · rw [map_neg, ih]
      · rw [map_add, ih1, ih2]
    one_mul := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      refine' FreeAbelianGroup.induction_on x rfl _ _ _
      · intro L
        

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
L : α
⊢ (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) (of L) = of L

Next tactic:
rw [lift.of, lift.of]
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        exact mul_one L
      · rw [map_neg, ih]
      · rw [map_add, ih1, ih2]
    one_mul := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      refine' FreeAbelianGroup.induction_on x rfl _ _ _
      · intro L
        rw [lift.of, lift.of]
        

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
L : α
⊢ of (Mul.mul One.one L) = of L

Next tactic:
congr 1
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        exact mul_one L
      · rw [map_neg, ih]
      · rw [map_add, ih1, ih2]
    one_mul := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      refine' FreeAbelianGroup.induction_on x rfl _ _ _
      · intro L
        rw [lift.of, lift.of]
        congr 1
        

Proof state:
case refine'_1.e_x
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
L : α
⊢ Mul.mul One.one L = L

Next tactic:
exact one_mul L
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        exact mul_one L
      · rw [map_neg, ih]
      · rw [map_add, ih1, ih2]
    one_mul := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      refine' FreeAbelianGroup.induction_on x rfl _ _ _
      · intro L
        rw [lift.of, lift.of]
        congr 1
        exact one_mul L
      · 

Proof state:
case refine'_2
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
⊢ ∀ (x : α),
    (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) (of x) = of x →
      (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) (-of x) = -of x

Next tactic:
intro L ih
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        exact mul_one L
      · rw [map_neg, ih]
      · rw [map_add, ih1, ih2]
    one_mul := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      refine' FreeAbelianGroup.induction_on x rfl _ _ _
      · intro L
        rw [lift.of, lift.of]
        congr 1
        exact one_mul L
      · intro L ih
        

Proof state:
case refine'_2
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
L : α
ih : (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) (of L) = of L
⊢ (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) (-of L) = -of L

Next tactic:
rw [map_neg, ih]
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        exact mul_one L
      · rw [map_neg, ih]
      · rw [map_add, ih1, ih2]
    one_mul := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      refine' FreeAbelianGroup.induction_on x rfl _ _ _
      · intro L
        rw [lift.of, lift.of]
        congr 1
        exact one_mul L
      · intro L ih
        rw [map_neg, ih]
      · 

Proof state:
case refine'_3
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
⊢ ∀ (x y : FreeAbelianGroup α),
    (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) x = x →
      (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) y = y →
        (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) (x + y) = x + y

Next tactic:
intro x1 x2 ih1 ih2
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        exact mul_one L
      · rw [map_neg, ih]
      · rw [map_add, ih1, ih2]
    one_mul := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      refine' FreeAbelianGroup.induction_on x rfl _ _ _
      · intro L
        rw [lift.of, lift.of]
        congr 1
        exact one_mul L
      · intro L ih
        rw [map_neg, ih]
      · intro x1 x2 ih1 ih2
        

Proof state:
case refine'_3
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x x1 x2 : FreeAbelianGroup α
ih1 : (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) x1 = x1
ih2 : (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) x2 = x2
⊢ (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) (of One.one)) (x1 + x2) = x1 + x2

Next tactic:
rw [map_add, ih1, ih2]
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
⊢ x * 1 = x

Next tactic:
dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
⊢ (lift fun x₂ => (lift fun x₁ => of (Mul.mul x₁ x₂)) x) (of One.one) = x

Next tactic:
rw [lift.of]
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      

Proof state:
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
⊢ (lift fun x₁ => of (Mul.mul x₁ One.one)) x = x

Next tactic:
refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · 

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
L : α
⊢ (lift fun x₁ => of (Mul.mul x₁ One.one)) (of L) = of L

Next tactic:
erw [lift.of]
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
L : α
⊢ of (Mul.mul L One.one) = of L

Next tactic:
congr 1
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        

Proof state:
case refine'_1.e_x
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
L : α
⊢ Mul.mul L One.one = L

Next tactic:
exact mul_one L
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        exact mul_one L
      · 

Proof state:
case refine'_2
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x : FreeAbelianGroup α
L : α
ih : (lift fun x₁ => of (Mul.mul x₁ One.one)) (of L) = of L
⊢ (lift fun x₁ => of (Mul.mul x₁ One.one)) (-of L) = -of L

Next tactic:
rw [map_neg, ih]
instance ring : Ring (FreeAbelianGroup α) :=
  { FreeAbelianGroup.nonUnitalRing _,
    FreeAbelianGroup.one _ with
    mul_one := fun x ↦ by
      dsimp only [(· * ·), Mul.mul, OfNat.ofNat, One.one]
      rw [lift.of]
      refine' FreeAbelianGroup.induction_on x rfl (fun L ↦ _) (fun L ih ↦ _) fun x1 x2 ih1 ih2 ↦ _
      · erw [lift.of]
        congr 1
        exact mul_one L
      · rw [map_neg, ih]
      · 

Proof state:
case refine'_3
α : Type u
β : Type v
γ : Type w
R : Type u_1
inst✝¹ : Monoid α
inst✝ : Ring R
src✝¹ : NonUnitalRing (FreeAbelianGroup α) := nonUnitalRing α
src✝ : One (FreeAbelianGroup α) := one α
x x1 x2 : FreeAbelianGroup α
ih1 : (lift fun x₁ => of (Mul.mul x₁ One.one)) x1 = x1
ih2 : (lift fun x₁ => of (Mul.mul x₁ One.one)) x2 = x2
⊢ (lift fun x₁ => of (Mul.mul x₁ One.one)) (x1 + x2) = x1 + x2

Next tactic:
rw [map_add, ih1, ih2]