Theorem: normalize_eq_normalize
File: Mathlib/Algebra/GCDMonoid/Basic.lean

tactic: nontriviality α
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a b : α
hab : a ∣ b
hba : b ∣ a
⊢ normalize a = normalize b
state_after: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a b : α
hab : a ∣ b
hba : b ∣ a
a✝ : Nontrivial α
⊢ normalize a = normalize b

tactic: rcases associated_of_dvd_dvd hab hba with ⟨u, rfl⟩
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a b : α
hab : a ∣ b
hba : b ∣ a
a✝ : Nontrivial α
⊢ normalize a = normalize b
state_after: case intro
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a : α
a✝ : Nontrivial α
u : αˣ
hab : a ∣ a * ↑u
hba : a * ↑u ∣ a
⊢ normalize a = normalize (a * ↑u)

tactic: refine by_cases (by rintro rfl; simp only [zero_mul]) fun ha : a ≠ 0 => ?_
state_before: case intro
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a : α
a✝ : Nontrivial α
u : αˣ
hab : a ∣ a * ↑u
hba : a * ↑u ∣ a
⊢ normalize a = normalize (a * ↑u)
state_after: case intro
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a : α
a✝ : Nontrivial α
u : αˣ
hab : a ∣ a * ↑u
hba : a * ↑u ∣ a
ha : a ≠ 0
⊢ normalize a = normalize (a * ↑u)

tactic: suffices a * ↑(normUnit a) = a * ↑u * ↑(normUnit a) * ↑u⁻¹ by
  simpa only [normalize_apply, mul_assoc, normUnit_mul ha u.ne_zero, normUnit_coe_units]
state_before: case intro
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a : α
a✝ : Nontrivial α
u : αˣ
hab : a ∣ a * ↑u
hba : a * ↑u ∣ a
ha : a ≠ 0
⊢ normalize a = normalize (a * ↑u)
state_after: case intro
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a : α
a✝ : Nontrivial α
u : αˣ
hab : a ∣ a * ↑u
hba : a * ↑u ∣ a
ha : a ≠ 0
⊢ a * ↑(normUnit a) = a * ↑u * ↑(normUnit a) * ↑u⁻¹

tactic: calc
  a * ↑(normUnit a) = a * ↑(normUnit a) * ↑u * ↑u⁻¹ := (Units.mul_inv_cancel_right _ _).symm
  _ = a * ↑u * ↑(normUnit a) * ↑u⁻¹ := by rw [mul_right_comm a]
state_before: case intro
α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a : α
a✝ : Nontrivial α
u : αˣ
hab : a ∣ a * ↑u
hba : a * ↑u ∣ a
ha : a ≠ 0
⊢ a * ↑(normUnit a) = a * ↑u * ↑(normUnit a) * ↑u⁻¹
state_after: no goals

tactic: rintro rfl
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a : α
a✝ : Nontrivial α
u : αˣ
hab : a ∣ a * ↑u
hba : a * ↑u ∣ a
⊢ a = 0 → normalize a = normalize (a * ↑u)
state_after: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a✝ : Nontrivial α
u : αˣ
hab : 0 ∣ 0 * ↑u
hba : 0 * ↑u ∣ 0
⊢ normalize 0 = normalize (0 * ↑u)

tactic: simp only [zero_mul]
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a✝ : Nontrivial α
u : αˣ
hab : 0 ∣ 0 * ↑u
hba : 0 * ↑u ∣ 0
⊢ normalize 0 = normalize (0 * ↑u)
state_after: no goals

tactic: simpa only [normalize_apply, mul_assoc, normUnit_mul ha u.ne_zero, normUnit_coe_units]
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a : α
a✝ : Nontrivial α
u : αˣ
hab : a ∣ a * ↑u
hba : a * ↑u ∣ a
ha : a ≠ 0
this : a * ↑(normUnit a) = a * ↑u * ↑(normUnit a) * ↑u⁻¹
⊢ normalize a = normalize (a * ↑u)
state_after: no goals

tactic: rw [mul_right_comm a]
state_before: α : Type u_1
inst✝¹ : CancelCommMonoidWithZero α
inst✝ : NormalizationMonoid α
a : α
a✝ : Nontrivial α
u : αˣ
hab : a ∣ a * ↑u
hba : a * ↑u ∣ a
ha : a ≠ 0
⊢ a * ↑(normUnit a) * ↑u * ↑u⁻¹ = a * ↑u * ↑(normUnit a) * ↑u⁻¹
state_after: no goals