Theorem: associated_of_dvd_dvd
File: Mathlib/Algebra/Associated.lean

tactic: rcases hab with ⟨c, rfl⟩
state_before: α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a b : α
hab : a ∣ b
hba : b ∣ a
⊢ a ~ᵤ b

tactic: rcases hba with ⟨d, a_eq⟩
state_before: case intro
α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c : α
hba : a * c ∣ a
⊢ a ~ᵤ a * c

tactic: by_cases ha0 : a = 0
state_before: case intro.intro
α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = a * c * d
⊢ a ~ᵤ a * c

tactic: have hac0 : a * c ≠ 0 := by
  intro con
  rw [con, zero_mul] at a_eq
  apply ha0 a_eq
state_before: case neg
α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = a * c * d
ha0 : ¬a = 0
⊢ a ~ᵤ a * c

tactic: have : a * (c * d) = a * 1 := by rw [← mul_assoc, ← a_eq, mul_one]
state_before: case neg
α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = a * c * d
ha0 : ¬a = 0
hac0 : a * c ≠ 0
⊢ a ~ᵤ a * c

tactic: have hcd : c * d = 1 := mul_left_cancel₀ ha0 this
state_before: case neg
α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = a * c * d
ha0 : ¬a = 0
hac0 : a * c ≠ 0
this : a * (c * d) = a * 1
⊢ a ~ᵤ a * c

tactic: have : a * c * (d * c) = a * c * 1 := by rw [← mul_assoc, ← a_eq, mul_one]
state_before: case neg
α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = a * c * d
ha0 : ¬a = 0
hac0 : a * c ≠ 0
this : a * (c * d) = a * 1
hcd : c * d = 1
⊢ a ~ᵤ a * c

tactic: have hdc : d * c = 1 := mul_left_cancel₀ hac0 this
state_before: case neg
α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = a * c * d
ha0 : ¬a = 0
hac0 : a * c ≠ 0
this✝ : a * (c * d) = a * 1
hcd : c * d = 1
this : a * c * (d * c) = a * c * 1
⊢ a ~ᵤ a * c

tactic: exact ⟨⟨c, d, hcd, hdc⟩, rfl⟩
state_before: case neg
α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = a * c * d
ha0 : ¬a = 0
hac0 : a * c ≠ 0
this✝ : a * (c * d) = a * 1
hcd : c * d = 1
this : a * c * (d * c) = a * c * 1
hdc : d * c = 1
⊢ a ~ᵤ a * c

tactic: simp_all
state_before: case pos
α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = a * c * d
ha0 : a = 0
⊢ a ~ᵤ a * c

tactic: rfl
state_before: case pos
α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
ha0 : a = 0
⊢ 0 ~ᵤ 0

tactic: intro con
state_before: α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = a * c * d
ha0 : ¬a = 0
⊢ a * c ≠ 0

tactic: rw [con, zero_mul] at a_eq
state_before: α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = a * c * d
ha0 : ¬a = 0
con : a * c = 0
⊢ False

tactic: apply ha0 a_eq
state_before: α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = 0
ha0 : ¬a = 0
con : a * c = 0
⊢ False

tactic: rw [← mul_assoc, ← a_eq, mul_one]
state_before: α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = a * c * d
ha0 : ¬a = 0
hac0 : a * c ≠ 0
⊢ a * (c * d) = a * 1

tactic: rw [← mul_assoc, ← a_eq, mul_one]
state_before: α : Type u_1
β : Type ?u.199123
γ : Type ?u.199126
δ : Type ?u.199129
inst✝ : CancelMonoidWithZero α
a c d : α
a_eq : a = a * c * d
ha0 : ¬a = 0
hac0 : a * c ≠ 0
this : a * (c * d) = a * 1
hcd : c * d = 1
⊢ a * c * (d * c) = a * c * 1