Theorem: Associates.isPrimal_mk
File: Mathlib/Algebra/Associated.lean

tactic: simp_rw [IsPrimal, forall_associated, mk_surjective.exists, mk_mul_mk, mk_dvd_mk]
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CommMonoid α
a : α
⊢ IsPrimal (Associates.mk a) ↔ IsPrimal a
state_after: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CommMonoid α
a : α
⊢ (∀ (a_1 a_2 : α), a ∣ a_1 * a_2 → ∃ x x_1, x ∣ a_1 ∧ x_1 ∣ a_2 ∧ Associates.mk a = Associates.mk (x * x_1)) ↔
    ∀ ⦃b c : α⦄, a ∣ b * c → ∃ a₁ a₂, a₁ ∣ b ∧ a₂ ∣ c ∧ a = a₁ * a₂

tactic: constructor <;> intro h b c dvd <;> obtain ⟨a₁, a₂, h₁, h₂, eq⟩ := @h b c dvd
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CommMonoid α
a : α
⊢ (∀ (a_1 a_2 : α), a ∣ a_1 * a_2 → ∃ x x_1, x ∣ a_1 ∧ x_1 ∣ a_2 ∧ Associates.mk a = Associates.mk (x * x_1)) ↔
    ∀ ⦃b c : α⦄, a ∣ b * c → ∃ a₁ a₂, a₁ ∣ b ∧ a₂ ∣ c ∧ a = a₁ * a₂
state_after: case mp.intro.intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CommMonoid α
a : α
h : ∀ (a_1 a_2 : α), a ∣ a_1 * a_2 → ∃ x x_1, x ∣ a_1 ∧ x_1 ∣ a_2 ∧ Associates.mk a = Associates.mk (x * x_1)
b c : α
dvd : a ∣ b * c
a₁ a₂ : α
h₁ : a₁ ∣ b
h₂ : a₂ ∣ c
eq : Associates.mk a = Associates.mk (a₁ * a₂)
⊢ ∃ a₁ a₂, a₁ ∣ b ∧ a₂ ∣ c ∧ a = a₁ * a₂

case mpr.intro.intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CommMonoid α
a : α
h : ∀ ⦃b c : α⦄, a ∣ b * c → ∃ a₁ a₂, a₁ ∣ b ∧ a₂ ∣ c ∧ a = a₁ * a₂
b c : α
dvd : a ∣ b * c
a₁ a₂ : α
h₁ : a₁ ∣ b
h₂ : a₂ ∣ c
eq : a = a₁ * a₂
⊢ ∃ x x_1, x ∣ b ∧ x_1 ∣ c ∧ Associates.mk a = Associates.mk (x * x_1)

tactic: obtain ⟨u, rfl⟩ := mk_eq_mk_iff_associated.mp eq.symm
state_before: case mp.intro.intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CommMonoid α
a : α
h : ∀ (a_1 a_2 : α), a ∣ a_1 * a_2 → ∃ x x_1, x ∣ a_1 ∧ x_1 ∣ a_2 ∧ Associates.mk a = Associates.mk (x * x_1)
b c : α
dvd : a ∣ b * c
a₁ a₂ : α
h₁ : a₁ ∣ b
h₂ : a₂ ∣ c
eq : Associates.mk a = Associates.mk (a₁ * a₂)
⊢ ∃ a₁ a₂, a₁ ∣ b ∧ a₂ ∣ c ∧ a = a₁ * a₂
state_after: case mp.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CommMonoid α
b c a₁ a₂ : α
h₁ : a₁ ∣ b
h₂ : a₂ ∣ c
u : αˣ
h :
  ∀ (a a_1 : α),
    a₁ * a₂ * ↑u ∣ a * a_1 → ∃ x x_1, x ∣ a ∧ x_1 ∣ a_1 ∧ Associates.mk (a₁ * a₂ * ↑u) = Associates.mk (x * x_1)
dvd : a₁ * a₂ * ↑u ∣ b * c
eq : Associates.mk (a₁ * a₂ * ↑u) = Associates.mk (a₁ * a₂)
⊢ ∃ a₁_1 a₂_1, a₁_1 ∣ b ∧ a₂_1 ∣ c ∧ a₁ * a₂ * ↑u = a₁_1 * a₂_1

tactic: exact ⟨a₁, a₂ * u, h₁, Units.mul_right_dvd.mpr h₂, mul_assoc _ _ _⟩
state_before: case mp.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CommMonoid α
b c a₁ a₂ : α
h₁ : a₁ ∣ b
h₂ : a₂ ∣ c
u : αˣ
h :
  ∀ (a a_1 : α),
    a₁ * a₂ * ↑u ∣ a * a_1 → ∃ x x_1, x ∣ a ∧ x_1 ∣ a_1 ∧ Associates.mk (a₁ * a₂ * ↑u) = Associates.mk (x * x_1)
dvd : a₁ * a₂ * ↑u ∣ b * c
eq : Associates.mk (a₁ * a₂ * ↑u) = Associates.mk (a₁ * a₂)
⊢ ∃ a₁_1 a₂_1, a₁_1 ∣ b ∧ a₂_1 ∣ c ∧ a₁ * a₂ * ↑u = a₁_1 * a₂_1
state_after: no goals

tactic: exact ⟨a₁, a₂, h₁, h₂, congr_arg _ eq⟩
state_before: case mpr.intro.intro.intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
inst✝ : CommMonoid α
a : α
h : ∀ ⦃b c : α⦄, a ∣ b * c → ∃ a₁ a₂, a₁ ∣ b ∧ a₂ ∣ c ∧ a = a₁ * a₂
b c : α
dvd : a ∣ b * c
a₁ a₂ : α
h₁ : a₁ ∣ b
h₂ : a₂ ∣ c
eq : a = a₁ * a₂
⊢ ∃ x x_1, x ∣ b ∧ x_1 ∣ c ∧ Associates.mk a = Associates.mk (x * x_1)
state_after: no goals