Theorem: IsLeftCancelMulZero.to_noZeroDivisors
File: Mathlib/Algebra/Ring/Basic.lean

tactic: by_cases hx : x = 0
state_before: R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
⊢ x = 0 ∨ y = 0
state_after: case pos
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
hx : x = 0
⊢ x = 0 ∨ y = 0

case neg
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
hx : ¬x = 0
⊢ x = 0 ∨ y = 0

tactic: { left
  exact hx }
state_before: case pos
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
hx : x = 0
⊢ x = 0 ∨ y = 0

case neg
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
hx : ¬x = 0
⊢ x = 0 ∨ y = 0
state_after: case neg
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
hx : ¬x = 0
⊢ x = 0 ∨ y = 0

tactic: { right
  rw [← sub_zero (x * y), ← mul_zero x, ← mul_sub] at h
  have := (IsLeftCancelMulZero.mul_left_cancel_of_ne_zero) hx h
  rwa [sub_zero] at this }
state_before: case neg
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
hx : ¬x = 0
⊢ x = 0 ∨ y = 0
state_after: no goals

tactic: left
state_before: case pos
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
hx : x = 0
⊢ x = 0 ∨ y = 0
state_after: case pos.h
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
hx : x = 0
⊢ x = 0

tactic: exact hx
state_before: case pos.h
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
hx : x = 0
⊢ x = 0
state_after: no goals

tactic: right
state_before: case neg
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
hx : ¬x = 0
⊢ x = 0 ∨ y = 0
state_after: case neg.h
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
hx : ¬x = 0
⊢ y = 0

tactic: rw [← sub_zero (x * y), ← mul_zero x, ← mul_sub] at h
state_before: case neg.h
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * y = 0
hx : ¬x = 0
⊢ y = 0
state_after: case neg.h
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * (y - 0) = x * 0
hx : ¬x = 0
⊢ y = 0

tactic: have := (IsLeftCancelMulZero.mul_left_cancel_of_ne_zero) hx h
state_before: case neg.h
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * (y - 0) = x * 0
hx : ¬x = 0
⊢ y = 0
state_after: case neg.h
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * (y - 0) = x * 0
hx : ¬x = 0
this : y - 0 = 0
⊢ y = 0

tactic: rwa [sub_zero] at this
state_before: case neg.h
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsLeftCancelMulZero α
x y : α
h : x * (y - 0) = x * 0
hx : ¬x = 0
this : y - 0 = 0
⊢ y = 0
state_after: no goals