Theorem: UniqueFactorizationMonoid.induction_on_coprime
File: Mathlib/RingTheory/UniqueFactorizationDomain.lean

tactic: letI := Classical.decEq α
state_before: α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
⊢ P a

tactic: have P_of_associated : ∀ {x y}, Associated x y → P x → P y := by
  rintro x y ⟨u, rfl⟩ hx
  exact hcp (fun p _ hpx => isUnit_of_dvd_unit hpx u.isUnit) hx (h1 u.isUnit)
state_before: α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
this : DecidableEq α := Classical.decEq α
⊢ P a

tactic: by_cases ha0 : a = 0
state_before: α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
this : DecidableEq α := Classical.decEq α
P_of_associated : ∀ {x y : α}, x ~ᵤ y → P x → P y
⊢ P a

tactic: haveI : Nontrivial α := ⟨⟨_, _, ha0⟩⟩
state_before: case neg
α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
this : DecidableEq α := Classical.decEq α
P_of_associated : ∀ {x y : α}, x ~ᵤ y → P x → P y
ha0 : ¬a = 0
⊢ P a

tactic: letI : NormalizationMonoid α := UniqueFactorizationMonoid.normalizationMonoid
state_before: case neg
α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
this✝ : DecidableEq α := Classical.decEq α
P_of_associated : ∀ {x y : α}, x ~ᵤ y → P x → P y
ha0 : ¬a = 0
this : Nontrivial α
⊢ P a

tactic: refine' P_of_associated (normalizedFactors_prod ha0) _
state_before: case neg
α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
this✝¹ : DecidableEq α := Classical.decEq α
P_of_associated : ∀ {x y : α}, x ~ᵤ y → P x → P y
ha0 : ¬a = 0
this✝ : Nontrivial α
this : NormalizationMonoid α := UniqueFactorizationMonoid.normalizationMonoid
⊢ P a

tactic: rw [← (normalizedFactors a).map_id, Finset.prod_multiset_map_count]
state_before: case neg
α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
this✝¹ : DecidableEq α := Classical.decEq α
P_of_associated : ∀ {x y : α}, x ~ᵤ y → P x → P y
ha0 : ¬a = 0
this✝ : Nontrivial α
this : NormalizationMonoid α := UniqueFactorizationMonoid.normalizationMonoid
⊢ P (Multiset.prod (normalizedFactors a))

tactic: refine' induction_on_prime_power _ _ _ _ @h1 @hpr @hcp <;> simp only [Multiset.mem_toFinset]
state_before: case neg
α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
this✝¹ : DecidableEq α := Classical.decEq α
P_of_associated : ∀ {x y : α}, x ~ᵤ y → P x → P y
ha0 : ¬a = 0
this✝ : Nontrivial α
this : NormalizationMonoid α := UniqueFactorizationMonoid.normalizationMonoid
⊢ P (∏ m in Multiset.toFinset (normalizedFactors a), id m ^ Multiset.count m (normalizedFactors a))

tactic: rintro x y ⟨u, rfl⟩ hx
state_before: α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
this : DecidableEq α := Classical.decEq α
⊢ ∀ {x y : α}, x ~ᵤ y → P x → P y

tactic: exact hcp (fun p _ hpx => isUnit_of_dvd_unit hpx u.isUnit) hx (h1 u.isUnit)
state_before: case intro
α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
this : DecidableEq α := Classical.decEq α
x : α
u : αˣ
hx : P x
⊢ P (x * ↑u)

tactic: rwa [ha0]
state_before: case pos
α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
this : DecidableEq α := Classical.decEq α
P_of_associated : ∀ {x y : α}, x ~ᵤ y → P x → P y
ha0 : a = 0
⊢ P a

tactic: apply prime_of_normalized_factor
state_before: case neg.refine'_1
α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
this✝¹ : DecidableEq α := Classical.decEq α
P_of_associated : ∀ {x y : α}, x ~ᵤ y → P x → P y
ha0 : ¬a = 0
this✝ : Nontrivial α
this : NormalizationMonoid α := UniqueFactorizationMonoid.normalizationMonoid
⊢ ∀ (p : α), p ∈ normalizedFactors a → Prime p

tactic: apply normalizedFactors_eq_of_dvd
state_before: case neg.refine'_2
α : Type u_1
R : Type ?u.1571585
inst✝⁴ : CancelCommMonoidWithZero R
inst✝³ : UniqueFactorizationMonoid R
inst✝² : CancelCommMonoidWithZero α
inst✝¹ : UniqueFactorizationMonoid α
β : Type ?u.1571612
inst✝ : CancelCommMonoidWithZero β
P : α → Prop
a : α
h0 : P 0
h1 : ∀ {x : α}, IsUnit x → P x
hpr : ∀ {p : α} (i : ℕ), Prime p → P (p ^ i)
hcp : ∀ {x y : α}, (∀ (p : α), p ∣ x → p ∣ y → IsUnit p) → P x → P y → P (x * y)
this✝¹ : DecidableEq α := Classical.decEq α
P_of_associated : ∀ {x y : α}, x ~ᵤ y → P x → P y
ha0 : ¬a = 0
this✝ : Nontrivial α
this : NormalizationMonoid α := UniqueFactorizationMonoid.normalizationMonoid
⊢ ∀ (p : α), p ∈ normalizedFactors a → ∀ (q : α), q ∈ normalizedFactors a → p ∣ q → p = q