Theorem: FreeModule.addn_comm (UnitConjecture/FreeModule.lean)

State before:
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
⊢ x₁ + x₂ = x₂ + x₁
Tactic:
apply @Quotient.ind₂ (motive := fun x₁ x₂ : R[X] => x₁ + x₂ = x₂ + x₁)
State after:
case h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
⊢ ∀ (a b : FormalSum R X),
    Quotient.mk (formalSumSetoid R X) a + Quotient.mk (formalSumSetoid R X) b =
      Quotient.mk (formalSumSetoid R X) b + Quotient.mk (formalSumSetoid R X) a

State before:
case h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
⊢ ∀ (a b : FormalSum R X),
    Quotient.mk (formalSumSetoid R X) a + Quotient.mk (formalSumSetoid R X) b =
      Quotient.mk (formalSumSetoid R X) b + Quotient.mk (formalSumSetoid R X) a
Tactic:
intro s₁ s₂
State after:
case h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
⊢ Quotient.mk (formalSumSetoid R X) s₁ + Quotient.mk (formalSumSetoid R X) s₂ =
    Quotient.mk (formalSumSetoid R X) s₂ + Quotient.mk (formalSumSetoid R X) s₁

State before:
case h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
⊢ Quotient.mk (formalSumSetoid R X) s₁ + Quotient.mk (formalSumSetoid R X) s₂ =
    Quotient.mk (formalSumSetoid R X) s₂ + Quotient.mk (formalSumSetoid R X) s₁
Tactic:
apply Quotient.sound
State after:
case h.a
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
⊢ s₁ ++ s₂ ≈ s₂ ++ s₁

State before:
case h.a
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
⊢ s₁ ++ s₂ ≈ s₂ ++ s₁
Tactic:
apply funext
State after:
case h.a.h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
⊢ ∀ (x : X), coords (s₁ ++ s₂) x = coords (s₂ ++ s₁) x

State before:
case h.a.h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
⊢ ∀ (x : X), coords (s₁ ++ s₂) x = coords (s₂ ++ s₁) x
Tactic:
intro x₀
State after:
case h.a.h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
x₀ : X
⊢ coords (s₁ ++ s₂) x₀ = coords (s₂ ++ s₁) x₀

State before:
case h.a.h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
x₀ : X
⊢ coords (s₁ ++ s₂) x₀ = coords (s₂ ++ s₁) x₀
Tactic:
let lm₁ := append_coords s₁ s₂ x₀
State after:
case h.a.h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
x₀ : X
lm₁ : coords s₁ x₀ + coords s₂ x₀ = coords (s₁ ++ s₂) x₀ := append_coords s₁ s₂ x₀
⊢ coords (s₁ ++ s₂) x₀ = coords (s₂ ++ s₁) x₀

State before:
case h.a.h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
x₀ : X
lm₁ : coords s₁ x₀ + coords s₂ x₀ = coords (s₁ ++ s₂) x₀ := append_coords s₁ s₂ x₀
⊢ coords (s₁ ++ s₂) x₀ = coords (s₂ ++ s₁) x₀
Tactic:
let lm₂ := append_coords s₂ s₁ x₀
State after:
case h.a.h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
x₀ : X
lm₁ : coords s₁ x₀ + coords s₂ x₀ = coords (s₁ ++ s₂) x₀ := append_coords s₁ s₂ x₀
lm₂ : coords s₂ x₀ + coords s₁ x₀ = coords (s₂ ++ s₁) x₀ := append_coords s₂ s₁ x₀
⊢ coords (s₁ ++ s₂) x₀ = coords (s₂ ++ s₁) x₀

State before:
case h.a.h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
x₀ : X
lm₁ : coords s₁ x₀ + coords s₂ x₀ = coords (s₁ ++ s₂) x₀ := append_coords s₁ s₂ x₀
lm₂ : coords s₂ x₀ + coords s₁ x₀ = coords (s₂ ++ s₁) x₀ := append_coords s₂ s₁ x₀
⊢ coords (s₁ ++ s₂) x₀ = coords (s₂ ++ s₁) x₀
Tactic:
rw [← lm₁, ← lm₂]
State after:
case h.a.h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
x₀ : X
lm₁ : coords s₁ x₀ + coords s₂ x₀ = coords (s₁ ++ s₂) x₀ := append_coords s₁ s₂ x₀
lm₂ : coords s₂ x₀ + coords s₁ x₀ = coords (s₂ ++ s₁) x₀ := append_coords s₂ s₁ x₀
⊢ coords s₁ x₀ + coords s₂ x₀ = coords s₂ x₀ + coords s₁ x₀

State before:
case h.a.h
R : Type
inst✝² : Ring R
inst✝¹ : DecidableEq R
X : Type
inst✝ : DecidableEq X
x₁ x₂ : R[X]
s₁ s₂ : FormalSum R X
x₀ : X
lm₁ : coords s₁ x₀ + coords s₂ x₀ = coords (s₁ ++ s₂) x₀ := append_coords s₁ s₂ x₀
lm₂ : coords s₂ x₀ + coords s₁ x₀ = coords (s₂ ++ s₁) x₀ := append_coords s₂ s₁ x₀
⊢ coords s₁ x₀ + coords s₂ x₀ = coords s₂ x₀ + coords s₁ x₀
Tactic:
simp [add_comm]
State after:
no goals