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

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

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

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

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

tactic: { left
  rw [← sub_zero (x * y), ← zero_mul y, ← sub_mul] at h
  have := (IsRightCancelMulZero.mul_right_cancel_of_ne_zero) hy h
  rwa [sub_zero] at this }
state_before: case neg
R : Type u_1
α : Type u_2
inst✝¹ : NonUnitalNonAssocRing α
inst✝ : IsRightCancelMulZero α
x y : α
h : x * y = 0
hy : ¬y = 0
⊢ x = 0 ∨ y = 0
state_after: no goals

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

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

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

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

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

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