File: Mathlib/RingTheory/UniqueFactorizationDomain.lean

full_name: _aux_Mathlib_RingTheory_UniqueFactorizationDomain___unexpand_Associated_1
code: local infixl:50 " ~ᵤ " => Associated
goal: Lean.PrettyPrinter.Unexpander

full_name: «_aux_Mathlib_RingTheory_UniqueFactorizationDomain___macroRules_term_~ᵤ__1»
code: local infixl:50 " ~ᵤ " => Associated
goal: Lean.Macro

full_name: WfDvdMonoid.wellFounded_dvdNotUnit
code: /-- Well-foundedness of the strict version of |, which is equivalent to the descending chain
condition on divisibility and to the ascending chain condition on
principal ideals in an integral domain.
  -/
class WfDvdMonoid (α : Type*) [CommMonoidWithZero α] : Prop where
  wellFounded_dvdNotUnit : WellFounded (@DvdNotUnit α _)
goal: WellFounded DvdNotUnit

full_name: WfDvdMonoid
code: /-- Well-foundedness of the strict version of |, which is equivalent to the descending chain
condition on divisibility and to the ascending chain condition on
principal ideals in an integral domain.
  -/
class WfDvdMonoid (α : Type*) [CommMonoidWithZero α] : Prop where
  wellFounded_dvdNotUnit : WellFounded (@DvdNotUnit α _)
goal: Prop

full_name: IsNoetherianRing.wfDvdMonoid
code: instance (priority := 100) IsNoetherianRing.wfDvdMonoid [CommRing α] [IsDomain α]
    [IsNoetherianRing α] : WfDvdMonoid α 
goal: WfDvdMonoid α

full_name: WfDvdMonoid.of_wfDvdMonoid_associates
code: theorem of_wfDvdMonoid_associates (_ : WfDvdMonoid (Associates α)) : WfDvdMonoid α 
goal: WfDvdMonoid (Associates α) → WfDvdMonoid α

full_name: WfDvdMonoid.wfDvdMonoid_associates
code: instance wfDvdMonoid_associates : WfDvdMonoid (Associates α) 
goal: WfDvdMonoid (Associates α)

full_name: WfDvdMonoid.wellFounded_associates
code: theorem wellFounded_associates : WellFounded ((· < ·) : Associates α → Associates α → Prop) 
goal: WellFounded fun x x_1 => x < x_1

full_name: WfDvdMonoid.exists_irreducible_factor
code: theorem exists_irreducible_factor {a : α} (ha : ¬IsUnit a) (ha0 : a ≠ 0) :
    ∃ i, Irreducible i ∧ i ∣ a 
goal: ∃ i, Irreducible i ∧ i ∣ a

full_name: WfDvdMonoid.induction_on_irreducible
code: @[elab_as_elim]
theorem induction_on_irreducible {P : α → Prop} (a : α) (h0 : P 0) (hu : ∀ u : α, IsUnit u → P u)
    (hi : ∀ a i : α, a ≠ 0 → Irreducible i → P a → P (i * a)) : P a 
goal: P a

full_name: WfDvdMonoid.exists_factors
code: theorem exists_factors (a : α) :
    a ≠ 0 → ∃ f : Multiset α, (∀ b ∈ f, Irreducible b) ∧ Associated f.prod a 
goal: a ≠ 0 → ∃ f, (∀ b ∈ f, Irreducible b) ∧ f.prod ~ᵤ a

full_name: WfDvdMonoid.not_unit_iff_exists_factors_eq
code: theorem not_unit_iff_exists_factors_eq (a : α) (hn0 : a ≠ 0) :
    ¬IsUnit a ↔ ∃ f : Multiset α, (∀ b ∈ f, Irreducible b) ∧ f.prod = a ∧ f ≠ ∅ 
goal: ¬IsUnit a ↔ ∃ f, (∀ b ∈ f, Irreducible b) ∧ f.prod = a ∧ f ≠ ∅

full_name: WfDvdMonoid.isRelPrime_of_no_irreducible_factors
code: theorem isRelPrime_of_no_irreducible_factors {x y : α} (nonzero : ¬(x = 0 ∧ y = 0))
    (H : ∀ z : α, Irreducible z → z ∣ x → ¬z ∣ y) : IsRelPrime x y 
goal: IsRelPrime x y

full_name: WfDvdMonoid.of_wellFounded_associates
code: theorem WfDvdMonoid.of_wellFounded_associates [CancelCommMonoidWithZero α]
    (h : WellFounded ((· < ·) : Associates α → Associates α → Prop)) : WfDvdMonoid α 
goal: WfDvdMonoid α

full_name: WfDvdMonoid.iff_wellFounded_associates
code: theorem WfDvdMonoid.iff_wellFounded_associates [CancelCommMonoidWithZero α] :
    WfDvdMonoid α ↔ WellFounded ((· < ·) : Associates α → Associates α → Prop) 
goal: WfDvdMonoid α ↔ WellFounded fun x x_1 => x < x_1

full_name: WfDvdMonoid.max_power_factor'
code: theorem WfDvdMonoid.max_power_factor' [CommMonoidWithZero α] [WfDvdMonoid α] {a₀ x : α}
    (h : a₀ ≠ 0) (hx : ¬IsUnit x) : ∃ (n : ℕ) (a : α), ¬x ∣ a ∧ a₀ = x ^ n * a 
goal: ∃ n a, ¬x ∣ a ∧ a₀ = x ^ n * a

full_name: WfDvdMonoid.max_power_factor
code: theorem WfDvdMonoid.max_power_factor [CommMonoidWithZero α] [WfDvdMonoid α] {a₀ x : α}
    (h : a₀ ≠ 0) (hx : Irreducible x) : ∃ (n : ℕ) (a : α), ¬x ∣ a ∧ a₀ = x ^ n * a 
goal: ∃ n a, ¬x ∣ a ∧ a₀ = x ^ n * a

full_name: multiplicity.finite_of_not_isUnit
code: theorem multiplicity.finite_of_not_isUnit [CancelCommMonoidWithZero α] [WfDvdMonoid α]
    {a b : α} (ha : ¬IsUnit a) (hb : b ≠ 0) : multiplicity.Finite a b 
goal: multiplicity.Finite a b

full_name: UniqueFactorizationMonoid
code: /-- unique factorization monoids.

These are defined as `CancelCommMonoidWithZero`s with well-founded strict divisibility
relations, but this is equivalent to more familiar definitions:

Each element (except zero) is uniquely represented as a multiset of irreducible factors.
Uniqueness is only up to associated elements.

Each element (except zero) is non-uniquely represented as a multiset
of prime factors.

To define a UFD using the definition in terms of multisets
of irreducible factors, use the definition `of_exists_unique_irreducible_factors`

To define a UFD using the definition in terms of multisets
of prime factors, use the definition `of_exists_prime_factors`

-/
class UniqueFactorizationMonoid (α : Type*) [CancelCommMonoidWithZero α] extends WfDvdMonoid α :
  Prop where
  protected irreducible_iff_prime : ∀ {a : α}, Irreducible a ↔ Prime a
goal: Prop

full_name: UniqueFactorizationMonoid.irreducible_iff_prime
code: /-- unique factorization monoids.

These are defined as `CancelCommMonoidWithZero`s with well-founded strict divisibility
relations, but this is equivalent to more familiar definitions:

Each element (except zero) is uniquely represented as a multiset of irreducible factors.
Uniqueness is only up to associated elements.

Each element (except zero) is non-uniquely represented as a multiset
of prime factors.

To define a UFD using the definition in terms of multisets
of irreducible factors, use the definition `of_exists_unique_irreducible_factors`

To define a UFD using the definition in terms of multisets
of prime factors, use the definition `of_exists_prime_factors`

-/
class UniqueFactorizationMonoid (α : Type*) [CancelCommMonoidWithZero α] extends WfDvdMonoid α :
  Prop where
  protected irreducible_iff_prime : ∀ {a : α}, Irreducible a ↔ Prime a
goal: Irreducible a ↔ Prime a

full_name: ufm_of_decomposition_of_wfDvdMonoid
code: /-- Can't be an instance because it would cause a loop `ufm → WfDvdMonoid → ufm → ...`. -/
instance (priority := 100) ufm_of_decomposition_of_wfDvdMonoid
    [CancelCommMonoidWithZero α] [WfDvdMonoid α] [DecompositionMonoid α] :
    UniqueFactorizationMonoid α 
goal: UniqueFactorizationMonoid α

full_name: ufm_of_gcd_of_wfDvdMonoid
code: @[deprecated ufm_of_decomposition_of_wfDvdMonoid (since := "2024-02-12")]
theorem ufm_of_gcd_of_wfDvdMonoid [CancelCommMonoidWithZero α] [WfDvdMonoid α]
    [DecompositionMonoid α] : UniqueFactorizationMonoid α 
goal: UniqueFactorizationMonoid α

full_name: Associates.ufm
code: instance Associates.ufm [CancelCommMonoidWithZero α] [UniqueFactorizationMonoid α] :
    UniqueFactorizationMonoid (Associates α) 
goal: UniqueFactorizationMonoid (Associates α)

full_name: UniqueFactorizationMonoid.exists_prime_factors
code: theorem exists_prime_factors (a : α) :
    a ≠ 0 → ∃ f : Multiset α, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a 
goal: a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a

full_name: UniqueFactorizationMonoid.instDecompositionMonoid
code: instance : DecompositionMonoid α 
goal: DecompositionMonoid α

full_name: UniqueFactorizationMonoid.exists_prime_iff
code: lemma exists_prime_iff :
    (∃ (p : α), Prime p) ↔ ∃ (x : α), x ≠ 0 ∧ ¬ IsUnit x 
goal: (∃ p, Prime p) ↔ ∃ x, x ≠ 0 ∧ ¬IsUnit x

full_name: UniqueFactorizationMonoid.induction_on_prime
code: @[elab_as_elim]
theorem induction_on_prime {P : α → Prop} (a : α) (h₁ : P 0) (h₂ : ∀ x : α, IsUnit x → P x)
    (h₃ : ∀ a p : α, a ≠ 0 → Prime p → P a → P (p * a)) : P a 
goal: P a

full_name: prime_factors_unique
code: theorem prime_factors_unique [CancelCommMonoidWithZero α] :
    ∀ {f g : Multiset α},
      (∀ x ∈ f, Prime x) → (∀ x ∈ g, Prime x) → f.prod ~ᵤ g.prod → Multiset.Rel Associated f g 
goal: (∀ x ∈ f, Prime x) → (∀ x ∈ g, Prime x) → f.prod ~ᵤ g.prod → Multiset.Rel Associated f g

full_name: UniqueFactorizationMonoid.factors_unique
code: theorem factors_unique {f g : Multiset α} (hf : ∀ x ∈ f, Irreducible x)
    (hg : ∀ x ∈ g, Irreducible x) (h : f.prod ~ᵤ g.prod) : Multiset.Rel Associated f g 
goal: Multiset.Rel Associated f g

full_name: prime_factors_irreducible
code: /-- If an irreducible has a prime factorization,
  then it is an associate of one of its prime factors. -/
theorem prime_factors_irreducible [CancelCommMonoidWithZero α] {a : α} {f : Multiset α}
    (ha : Irreducible a) (pfa : (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a) : ∃ p, a ~ᵤ p ∧ f = {p} 
goal: ∃ p, a ~ᵤ p ∧ f = {p}

full_name: WfDvdMonoid.of_exists_prime_factors
code: theorem WfDvdMonoid.of_exists_prime_factors : WfDvdMonoid α 
goal: WfDvdMonoid α

full_name: irreducible_iff_prime_of_exists_prime_factors
code: theorem irreducible_iff_prime_of_exists_prime_factors {p : α} : Irreducible p ↔ Prime p 
goal: Irreducible p ↔ Prime p

full_name: UniqueFactorizationMonoid.of_exists_prime_factors
code: theorem UniqueFactorizationMonoid.of_exists_prime_factors : UniqueFactorizationMonoid α 
goal: UniqueFactorizationMonoid α

full_name: UniqueFactorizationMonoid.iff_exists_prime_factors
code: theorem UniqueFactorizationMonoid.iff_exists_prime_factors [CancelCommMonoidWithZero α] :
    UniqueFactorizationMonoid α ↔
      ∀ a : α, a ≠ 0 → ∃ f : Multiset α, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a 
goal: UniqueFactorizationMonoid α ↔ ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a

full_name: MulEquiv.uniqueFactorizationMonoid
code: theorem MulEquiv.uniqueFactorizationMonoid (e : α ≃* β) (hα : UniqueFactorizationMonoid α) :
    UniqueFactorizationMonoid β 
goal: UniqueFactorizationMonoid β

full_name: MulEquiv.uniqueFactorizationMonoid_iff
code: theorem MulEquiv.uniqueFactorizationMonoid_iff (e : α ≃* β) :
    UniqueFactorizationMonoid α ↔ UniqueFactorizationMonoid β 
goal: UniqueFactorizationMonoid α ↔ UniqueFactorizationMonoid β

full_name: irreducible_iff_prime_of_exists_unique_irreducible_factors
code: theorem irreducible_iff_prime_of_exists_unique_irreducible_factors [CancelCommMonoidWithZero α]
    (eif : ∀ a : α, a ≠ 0 → ∃ f : Multiset α, (∀ b ∈ f, Irreducible b) ∧ f.prod ~ᵤ a)
    (uif :
      ∀ f g : Multiset α,
        (∀ x ∈ f, Irreducible x) →
          (∀ x ∈ g, Irreducible x) → f.prod ~ᵤ g.prod → Multiset.Rel Associated f g)
    (p : α) : Irreducible p ↔ Prime p 
goal: Irreducible p ↔ Prime p

full_name: UniqueFactorizationMonoid.of_exists_unique_irreducible_factors
code: theorem UniqueFactorizationMonoid.of_exists_unique_irreducible_factors [CancelCommMonoidWithZero α]
    (eif : ∀ a : α, a ≠ 0 → ∃ f : Multiset α, (∀ b ∈ f, Irreducible b) ∧ f.prod ~ᵤ a)
    (uif :
      ∀ f g : Multiset α,
        (∀ x ∈ f, Irreducible x) →
          (∀ x ∈ g, Irreducible x) → f.prod ~ᵤ g.prod → Multiset.Rel Associated f g) :
    UniqueFactorizationMonoid α 
goal: UniqueFactorizationMonoid α

full_name: UniqueFactorizationMonoid.factors
code: /-- Noncomputably determines the multiset of prime factors. -/
noncomputable def factors (a : α) : Multiset α 
goal: Multiset α

full_name: UniqueFactorizationMonoid.factors_prod
code: theorem factors_prod {a : α} (ane0 : a ≠ 0) : Associated (factors a).prod a 
goal: (UniqueFactorizationMonoid.factors a).prod ~ᵤ a

full_name: UniqueFactorizationMonoid.factors_zero
code: @[simp]
theorem factors_zero : factors (0 : α) = 0 
goal: UniqueFactorizationMonoid.factors 0 = 0

full_name: UniqueFactorizationMonoid.ne_zero_of_mem_factors
code: theorem ne_zero_of_mem_factors {p a : α} (h : p ∈ factors a) : a ≠ 0 
goal: a ≠ 0

full_name: UniqueFactorizationMonoid.dvd_of_mem_factors
code: theorem dvd_of_mem_factors {p a : α} (h : p ∈ factors a) : p ∣ a 
goal: p ∣ a

full_name: UniqueFactorizationMonoid.prime_of_factor
code: theorem prime_of_factor {a : α} (x : α) (hx : x ∈ factors a) : Prime x 
goal: Prime x

full_name: UniqueFactorizationMonoid.irreducible_of_factor
code: theorem irreducible_of_factor {a : α} : ∀ x : α, x ∈ factors a → Irreducible x 
goal: x ∈ UniqueFactorizationMonoid.factors a → Irreducible x

full_name: UniqueFactorizationMonoid.factors_one
code: @[simp]
theorem factors_one : factors (1 : α) = 0 
goal: UniqueFactorizationMonoid.factors 1 = 0

full_name: UniqueFactorizationMonoid.exists_mem_factors_of_dvd
code: theorem exists_mem_factors_of_dvd {a p : α} (ha0 : a ≠ 0) (hp : Irreducible p) :
    p ∣ a → ∃ q ∈ factors a, p ~ᵤ q 
goal: p ∣ a → ∃ q ∈ UniqueFactorizationMonoid.factors a, p ~ᵤ q

full_name: UniqueFactorizationMonoid.exists_mem_factors
code: theorem exists_mem_factors {x : α} (hx : x ≠ 0) (h : ¬IsUnit x) : ∃ p, p ∈ factors x 
goal: ∃ p, p ∈ UniqueFactorizationMonoid.factors x

full_name: UniqueFactorizationMonoid.factors_mul
code: theorem factors_mul {x y : α} (hx : x ≠ 0) (hy : y ≠ 0) :
    Multiset.Rel Associated (factors (x * y)) (factors x + factors y) 
goal: Multiset.Rel Associated (UniqueFactorizationMonoid.factors (x * y))
  (UniqueFactorizationMonoid.factors x + UniqueFactorizationMonoid.factors y)

full_name: UniqueFactorizationMonoid.factors_pow
code: theorem factors_pow {x : α} (n : ℕ) :
    Multiset.Rel Associated (factors (x ^ n)) (n • factors x) 
goal: Multiset.Rel Associated (UniqueFactorizationMonoid.factors (x ^ n)) (n • UniqueFactorizationMonoid.factors x)

full_name: UniqueFactorizationMonoid.factors_pos
code: @[simp]
theorem factors_pos (x : α) (hx : x ≠ 0) : 0 < factors x ↔ ¬IsUnit x 
goal: 0 < UniqueFactorizationMonoid.factors x ↔ ¬IsUnit x

full_name: UniqueFactorizationMonoid.factors_pow_count_prod
code: theorem factors_pow_count_prod [DecidableEq α] {x : α} (hx : x ≠ 0) :
    (∏ p ∈ (factors x).toFinset, p ^ (factors x).count p) ~ᵤ x 
goal: ∏ p ∈ (UniqueFactorizationMonoid.factors x).toFinset, p ^ Multiset.count p (UniqueFactorizationMonoid.factors x) ~ᵤ x

full_name: UniqueFactorizationMonoid.normalizedFactors
code: /-- Noncomputably determines the multiset of prime factors. -/
noncomputable def normalizedFactors (a : α) : Multiset α 
goal: Multiset α

full_name: UniqueFactorizationMonoid.factors_eq_normalizedFactors
code: /-- An arbitrary choice of factors of `x : M` is exactly the (unique) normalized set of factors,
if `M` has a trivial group of units. -/
@[simp]
theorem factors_eq_normalizedFactors {M : Type*} [CancelCommMonoidWithZero M]
    [UniqueFactorizationMonoid M] [Unique Mˣ] (x : M) : factors x = normalizedFactors x 
goal: UniqueFactorizationMonoid.factors x = UniqueFactorizationMonoid.normalizedFactors x

full_name: UniqueFactorizationMonoid.normalizedFactors_prod
code: theorem normalizedFactors_prod {a : α} (ane0 : a ≠ 0) :
    Associated (normalizedFactors a).prod a 
goal: (UniqueFactorizationMonoid.normalizedFactors a).prod ~ᵤ a

full_name: UniqueFactorizationMonoid.prime_of_normalized_factor
code: theorem prime_of_normalized_factor {a : α} : ∀ x : α, x ∈ normalizedFactors a → Prime x 
goal: x ∈ UniqueFactorizationMonoid.normalizedFactors a → Prime x

full_name: UniqueFactorizationMonoid.irreducible_of_normalized_factor
code: theorem irreducible_of_normalized_factor {a : α} :
    ∀ x : α, x ∈ normalizedFactors a → Irreducible x 
goal: x ∈ UniqueFactorizationMonoid.normalizedFactors a → Irreducible x

full_name: UniqueFactorizationMonoid.normalize_normalized_factor
code: theorem normalize_normalized_factor {a : α} :
    ∀ x : α, x ∈ normalizedFactors a → normalize x = x 
goal: x ∈ UniqueFactorizationMonoid.normalizedFactors a → normalize x = x

full_name: UniqueFactorizationMonoid.normalizedFactors_irreducible
code: theorem normalizedFactors_irreducible {a : α} (ha : Irreducible a) :
    normalizedFactors a = {normalize a} 
goal: UniqueFactorizationMonoid.normalizedFactors a = {normalize a}

full_name: UniqueFactorizationMonoid.normalizedFactors_eq_of_dvd
code: theorem normalizedFactors_eq_of_dvd (a : α) :
    ∀ᵉ (p ∈ normalizedFactors a) (q ∈ normalizedFactors a), p ∣ q → p = q 
goal: p ∈ UniqueFactorizationMonoid.normalizedFactors a → ∀ q ∈ UniqueFactorizationMonoid.normalizedFactors a, p ∣ q → p = q

full_name: UniqueFactorizationMonoid.exists_mem_normalizedFactors_of_dvd
code: theorem exists_mem_normalizedFactors_of_dvd {a p : α} (ha0 : a ≠ 0) (hp : Irreducible p) :
    p ∣ a → ∃ q ∈ normalizedFactors a, p ~ᵤ q 
goal: p ∣ a → ∃ q ∈ UniqueFactorizationMonoid.normalizedFactors a, p ~ᵤ q

full_name: UniqueFactorizationMonoid.exists_mem_normalizedFactors
code: theorem exists_mem_normalizedFactors {x : α} (hx : x ≠ 0) (h : ¬IsUnit x) :
    ∃ p, p ∈ normalizedFactors x 
goal: ∃ p, p ∈ UniqueFactorizationMonoid.normalizedFactors x

full_name: UniqueFactorizationMonoid.normalizedFactors_zero
code: @[simp]
theorem normalizedFactors_zero : normalizedFactors (0 : α) = 0 
goal: UniqueFactorizationMonoid.normalizedFactors 0 = 0

full_name: UniqueFactorizationMonoid.normalizedFactors_one
code: @[simp]
theorem normalizedFactors_one : normalizedFactors (1 : α) = 0 
goal: UniqueFactorizationMonoid.normalizedFactors 1 = 0

full_name: UniqueFactorizationMonoid.normalizedFactors_mul
code: @[simp]
theorem normalizedFactors_mul {x y : α} (hx : x ≠ 0) (hy : y ≠ 0) :
    normalizedFactors (x * y) = normalizedFactors x + normalizedFactors y 
goal: UniqueFactorizationMonoid.normalizedFactors (x * y) =
  UniqueFactorizationMonoid.normalizedFactors x + UniqueFactorizationMonoid.normalizedFactors y

full_name: UniqueFactorizationMonoid.normalizedFactors_pow
code: @[simp]
theorem normalizedFactors_pow {x : α} (n : ℕ) :
    normalizedFactors (x ^ n) = n • normalizedFactors x 
goal: UniqueFactorizationMonoid.normalizedFactors (x ^ n) = n • UniqueFactorizationMonoid.normalizedFactors x

full_name: Irreducible.normalizedFactors_pow
code: theorem _root_.Irreducible.normalizedFactors_pow {p : α} (hp : Irreducible p) (k : ℕ) :
    normalizedFactors (p ^ k) = Multiset.replicate k (normalize p) 
goal: UniqueFactorizationMonoid.normalizedFactors (p ^ k) = Multiset.replicate k (normalize p)

full_name: UniqueFactorizationMonoid.normalizedFactors_prod_eq
code: theorem normalizedFactors_prod_eq (s : Multiset α) (hs : ∀ a ∈ s, Irreducible a) :
    normalizedFactors s.prod = s.map normalize 
goal: UniqueFactorizationMonoid.normalizedFactors s.prod = Multiset.map (⇑normalize) s

full_name: UniqueFactorizationMonoid.dvd_iff_normalizedFactors_le_normalizedFactors
code: theorem dvd_iff_normalizedFactors_le_normalizedFactors {x y : α} (hx : x ≠ 0) (hy : y ≠ 0) :
    x ∣ y ↔ normalizedFactors x ≤ normalizedFactors y 
goal: x ∣ y ↔ UniqueFactorizationMonoid.normalizedFactors x ≤ UniqueFactorizationMonoid.normalizedFactors y

full_name: UniqueFactorizationMonoid.associated_iff_normalizedFactors_eq_normalizedFactors
code: theorem associated_iff_normalizedFactors_eq_normalizedFactors {x y : α} (hx : x ≠ 0) (hy : y ≠ 0) :
    x ~ᵤ y ↔ normalizedFactors x = normalizedFactors y 
goal: x ~ᵤ y ↔ UniqueFactorizationMonoid.normalizedFactors x = UniqueFactorizationMonoid.normalizedFactors y

full_name: UniqueFactorizationMonoid.normalizedFactors_of_irreducible_pow
code: theorem normalizedFactors_of_irreducible_pow {p : α} (hp : Irreducible p) (k : ℕ) :
    normalizedFactors (p ^ k) = Multiset.replicate k (normalize p) 
goal: UniqueFactorizationMonoid.normalizedFactors (p ^ k) = Multiset.replicate k (normalize p)

full_name: UniqueFactorizationMonoid.zero_not_mem_normalizedFactors
code: theorem zero_not_mem_normalizedFactors (x : α) : (0 : α) ∉ normalizedFactors x 
goal: 0 ∉ UniqueFactorizationMonoid.normalizedFactors x

full_name: UniqueFactorizationMonoid.dvd_of_mem_normalizedFactors
code: theorem dvd_of_mem_normalizedFactors {a p : α} (H : p ∈ normalizedFactors a) : p ∣ a 
goal: p ∣ a

full_name: UniqueFactorizationMonoid.mem_normalizedFactors_iff
code: theorem mem_normalizedFactors_iff [Unique αˣ] {p x : α} (hx : x ≠ 0) :
    p ∈ normalizedFactors x ↔ Prime p ∧ p ∣ x 
goal: p ∈ UniqueFactorizationMonoid.normalizedFactors x ↔ Prime p ∧ p ∣ x

full_name: UniqueFactorizationMonoid.exists_associated_prime_pow_of_unique_normalized_factor
code: theorem exists_associated_prime_pow_of_unique_normalized_factor {p r : α}
    (h : ∀ {m}, m ∈ normalizedFactors r → m = p) (hr : r ≠ 0) : ∃ i : ℕ, Associated (p ^ i) r 
goal: ∃ i, p ^ i ~ᵤ r

full_name: UniqueFactorizationMonoid.normalizedFactors_prod_of_prime
code: theorem normalizedFactors_prod_of_prime [Nontrivial α] [Unique αˣ] {m : Multiset α}
    (h : ∀ p ∈ m, Prime p) : normalizedFactors m.prod = m 
goal: UniqueFactorizationMonoid.normalizedFactors m.prod = m

full_name: UniqueFactorizationMonoid.mem_normalizedFactors_eq_of_associated
code: theorem mem_normalizedFactors_eq_of_associated {a b c : α} (ha : a ∈ normalizedFactors c)
    (hb : b ∈ normalizedFactors c) (h : Associated a b) : a = b 
goal: a = b

full_name: UniqueFactorizationMonoid.normalizedFactors_pos
code: @[simp]
theorem normalizedFactors_pos (x : α) (hx : x ≠ 0) : 0 < normalizedFactors x ↔ ¬IsUnit x 
goal: 0 < UniqueFactorizationMonoid.normalizedFactors x ↔ ¬IsUnit x

full_name: UniqueFactorizationMonoid.dvdNotUnit_iff_normalizedFactors_lt_normalizedFactors
code: theorem dvdNotUnit_iff_normalizedFactors_lt_normalizedFactors {x y : α} (hx : x ≠ 0) (hy : y ≠ 0) :
    DvdNotUnit x y ↔ normalizedFactors x < normalizedFactors y 
goal: DvdNotUnit x y ↔ UniqueFactorizationMonoid.normalizedFactors x < UniqueFactorizationMonoid.normalizedFactors y

full_name: UniqueFactorizationMonoid.normalizedFactors_multiset_prod
code: theorem normalizedFactors_multiset_prod (s : Multiset α) (hs : 0 ∉ s) :
    normalizedFactors (s.prod) = (s.map normalizedFactors).sum 
goal: UniqueFactorizationMonoid.normalizedFactors s.prod = (Multiset.map UniqueFactorizationMonoid.normalizedFactors s).sum

full_name: UniqueFactorizationMonoid.normalizationMonoid
code: /-- Noncomputably defines a `normalizationMonoid` structure on a `UniqueFactorizationMonoid`. -/
protected noncomputable def normalizationMonoid : NormalizationMonoid α 
goal: NormalizationMonoid α

full_name: UniqueFactorizationMonoid.isRelPrime_iff_no_prime_factors
code: theorem isRelPrime_iff_no_prime_factors {a b : R} (ha : a ≠ 0) :
    IsRelPrime a b ↔ ∀ ⦃d⦄, d ∣ a → d ∣ b → ¬Prime d 
goal: IsRelPrime a b ↔ ∀ ⦃d : R⦄, d ∣ a → d ∣ b → ¬Prime d

full_name: UniqueFactorizationMonoid.dvd_of_dvd_mul_left_of_no_prime_factors
code: /-- Euclid's lemma: if `a ∣ b * c` and `a` and `c` have no common prime factors, `a ∣ b`.
Compare `IsCoprime.dvd_of_dvd_mul_left`. -/
theorem dvd_of_dvd_mul_left_of_no_prime_factors {a b c : R} (ha : a ≠ 0)
    (h : ∀ ⦃d⦄, d ∣ a → d ∣ c → ¬Prime d) : a ∣ b * c → a ∣ b 
goal: a ∣ b * c → a ∣ b

full_name: UniqueFactorizationMonoid.dvd_of_dvd_mul_right_of_no_prime_factors
code: /-- Euclid's lemma: if `a ∣ b * c` and `a` and `b` have no common prime factors, `a ∣ c`.
Compare `IsCoprime.dvd_of_dvd_mul_right`. -/
theorem dvd_of_dvd_mul_right_of_no_prime_factors {a b c : R} (ha : a ≠ 0)
    (no_factors : ∀ {d}, d ∣ a → d ∣ b → ¬Prime d) : a ∣ b * c → a ∣ c 
goal: a ∣ b * c → a ∣ c

full_name: UniqueFactorizationMonoid.exists_reduced_factors
code: /-- If `a ≠ 0, b` are elements of a unique factorization domain, then dividing
out their common factor `c'` gives `a'` and `b'` with no factors in common. -/
theorem exists_reduced_factors :
    ∀ a ≠ (0 : R), ∀ b,
      ∃ a' b' c', IsRelPrime a' b' ∧ c' * a' = a ∧ c' * b' = b 
goal: a ≠ 0 → ∀ (b : R), ∃ a' b' c', IsRelPrime a' b' ∧ c' * a' = a ∧ c' * b' = b

full_name: UniqueFactorizationMonoid.exists_reduced_factors'
code: theorem exists_reduced_factors' (a b : R) (hb : b ≠ 0) :
    ∃ a' b' c', IsRelPrime a' b' ∧ c' * a' = a ∧ c' * b' = b 
goal: ∃ a' b' c', IsRelPrime a' b' ∧ c' * a' = a ∧ c' * b' = b

full_name: UniqueFactorizationMonoid.pow_right_injective
code: theorem pow_right_injective {a : R} (ha0 : a ≠ 0) (ha1 : ¬IsUnit a) :
    Function.Injective (a ^ · : ℕ → R) 
goal: Function.Injective fun x => a ^ x

full_name: UniqueFactorizationMonoid.pow_eq_pow_iff
code: theorem pow_eq_pow_iff {a : R} (ha0 : a ≠ 0) (ha1 : ¬IsUnit a) {i j : ℕ} : a ^ i = a ^ j ↔ i = j 
goal: a ^ i = a ^ j ↔ i = j

full_name: UniqueFactorizationMonoid.le_multiplicity_iff_replicate_le_normalizedFactors
code: theorem le_multiplicity_iff_replicate_le_normalizedFactors {a b : R} {n : ℕ} (ha : Irreducible a)
    (hb : b ≠ 0) :
    ↑n ≤ multiplicity a b ↔ replicate n (normalize a) ≤ normalizedFactors b 
goal: ↑n ≤ multiplicity a b ↔ Multiset.replicate n (normalize a) ≤ UniqueFactorizationMonoid.normalizedFactors b

full_name: UniqueFactorizationMonoid.multiplicity_eq_count_normalizedFactors
code: /-- The multiplicity of an irreducible factor of a nonzero element is exactly the number of times
the normalized factor occurs in the `normalizedFactors`.

See also `count_normalizedFactors_eq` which expands the definition of `multiplicity`
to produce a specification for `count (normalizedFactors _) _`..
-/
theorem multiplicity_eq_count_normalizedFactors [DecidableEq R] {a b : R} (ha : Irreducible a)
    (hb : b ≠ 0) : multiplicity a b = (normalizedFactors b).count (normalize a) 
goal: multiplicity a b = ↑(Multiset.count (normalize a) (UniqueFactorizationMonoid.normalizedFactors b))

full_name: UniqueFactorizationMonoid.count_normalizedFactors_eq
code: /-- The number of times an irreducible factor `p` appears in `normalizedFactors x` is defined by
the number of times it divides `x`.

See also `multiplicity_eq_count_normalizedFactors` if `n` is given by `multiplicity p x`.
-/
theorem count_normalizedFactors_eq [DecidableEq R] {p x : R} (hp : Irreducible p)
    (hnorm : normalize p = p) {n : ℕ} (hle : p ^ n ∣ x) (hlt : ¬p ^ (n + 1) ∣ x) :
    (normalizedFactors x).count p = n 
goal: Multiset.count p (UniqueFactorizationMonoid.normalizedFactors x) = n

full_name: UniqueFactorizationMonoid.count_normalizedFactors_eq'
code: /-- The number of times an irreducible factor `p` appears in `normalizedFactors x` is defined by
the number of times it divides `x`. This is a slightly more general version of
`UniqueFactorizationMonoid.count_normalizedFactors_eq` that allows `p = 0`.

See also `multiplicity_eq_count_normalizedFactors` if `n` is given by `multiplicity p x`.
-/
theorem count_normalizedFactors_eq' [DecidableEq R] {p x : R} (hp : p = 0 ∨ Irreducible p)
    (hnorm : normalize p = p) {n : ℕ} (hle : p ^ n ∣ x) (hlt : ¬p ^ (n + 1) ∣ x) :
    (normalizedFactors x).count p = n 
goal: Multiset.count p (UniqueFactorizationMonoid.normalizedFactors x) = n

full_name: UniqueFactorizationMonoid.max_power_factor
code: /-- Deprecated. Use `WfDvdMonoid.max_power_factor` instead. -/
@[deprecated WfDvdMonoid.max_power_factor (since := "2024-03-01")]
theorem max_power_factor {a₀ x : R} (h : a₀ ≠ 0) (hx : Irreducible x) :
    ∃ n : ℕ, ∃ a : R, ¬x ∣ a ∧ a₀ = x ^ n * a 
goal: ∃ n a, ¬x ∣ a ∧ a₀ = x ^ n * a

full_name: UniqueFactorizationMonoid.prime_pow_coprime_prod_of_coprime_insert
code: theorem prime_pow_coprime_prod_of_coprime_insert [DecidableEq α] {s : Finset α} (i : α → ℕ) (p : α)
    (hps : p ∉ s) (is_prime : ∀ q ∈ insert p s, Prime q)
    (is_coprime : ∀ᵉ (q ∈ insert p s) (q' ∈ insert p s), q ∣ q' → q = q') :
    IsRelPrime (p ^ i p) (∏ p' ∈ s, p' ^ i p') 
goal: IsRelPrime (p ^ i p) (∏ p' ∈ s, p' ^ i p')

full_name: UniqueFactorizationMonoid.induction_on_prime_power
code: /-- If `P` holds for units and powers of primes,
and `P x ∧ P y` for coprime `x, y` implies `P (x * y)`,
then `P` holds on a product of powers of distinct primes. -/
-- @[elab_as_elim] Porting note: commented out
theorem induction_on_prime_power {P : α → Prop} (s : Finset α) (i : α → ℕ)
    (is_prime : ∀ p ∈ s, Prime p) (is_coprime : ∀ᵉ (p ∈ s) (q ∈ s), p ∣ q → p = q)
    (h1 : ∀ {x}, IsUnit x → P x) (hpr : ∀ {p} (i : ℕ), Prime p → P (p ^ i))
    (hcp : ∀ {x y}, IsRelPrime x y → P x → P y → P (x * y)) :
    P (∏ p ∈ s, p ^ i p) 
goal: P (∏ p ∈ s, p ^ i p)

full_name: UniqueFactorizationMonoid.induction_on_coprime
code: /-- If `P` holds for `0`, units and powers of primes,
and `P x ∧ P y` for coprime `x, y` implies `P (x * y)`,
then `P` holds on all `a : α`. -/
@[elab_as_elim]
theorem induction_on_coprime {P : α → Prop} (a : α) (h0 : P 0) (h1 : ∀ {x}, IsUnit x → P x)
    (hpr : ∀ {p} (i : ℕ), Prime p → P (p ^ i))
    (hcp : ∀ {x y}, IsRelPrime x y → P x → P y → P (x * y)) : P a 
goal: P a

full_name: UniqueFactorizationMonoid.multiplicative_prime_power
code: /-- If `f` maps `p ^ i` to `(f p) ^ i` for primes `p`, and `f`
is multiplicative on coprime elements, then `f` is multiplicative on all products of primes. -/
-- @[elab_as_elim] Porting note: commented out
theorem multiplicative_prime_power {f : α → β} (s : Finset α) (i j : α → ℕ)
    (is_prime : ∀ p ∈ s, Prime p) (is_coprime : ∀ᵉ (p ∈ s) (q ∈ s), p ∣ q → p = q)
    (h1 : ∀ {x y}, IsUnit y → f (x * y) = f x * f y)
    (hpr : ∀ {p} (i : ℕ), Prime p → f (p ^ i) = f p ^ i)
    (hcp : ∀ {x y}, IsRelPrime x y → f (x * y) = f x * f y) :
    f (∏ p ∈ s, p ^ (i p + j p)) = f (∏ p ∈ s, p ^ i p) * f (∏ p ∈ s, p ^ j p) 
goal: f (∏ p ∈ s, p ^ (i p + j p)) = f (∏ p ∈ s, p ^ i p) * f (∏ p ∈ s, p ^ j p)

full_name: UniqueFactorizationMonoid.multiplicative_of_coprime
code: /-- If `f` maps `p ^ i` to `(f p) ^ i` for primes `p`, and `f`
is multiplicative on coprime elements, then `f` is multiplicative everywhere. -/
theorem multiplicative_of_coprime (f : α → β) (a b : α) (h0 : f 0 = 0)
    (h1 : ∀ {x y}, IsUnit y → f (x * y) = f x * f y)
    (hpr : ∀ {p} (i : ℕ), Prime p → f (p ^ i) = f p ^ i)
    (hcp : ∀ {x y}, IsRelPrime x y → f (x * y) = f x * f y) :
    f (a * b) = f a * f b 
goal: f (a * b) = f a * f b

full_name: Associates.FactorSet
code: /-- `FactorSet α` representation elements of unique factorization domain as multisets.
`Multiset α` produced by `normalizedFactors` are only unique up to associated elements, while the
multisets in `FactorSet α` are unique by equality and restricted to irreducible elements. This
gives us a representation of each element as a unique multisets (or the added ⊤ for 0), which has a
complete lattice structure. Infimum is the greatest common divisor and supremum is the least common
multiple.
-/
abbrev FactorSet.{u} (α : Type u) [CancelCommMonoidWithZero α] : Type u 
goal: Type u

full_name: Associates.FactorSet.coe_add
code: theorem FactorSet.coe_add {a b : Multiset { a : Associates α // Irreducible a }} :
    (↑(a + b) : FactorSet α) = a + b 
goal: ↑(a + b) = ↑a + ↑b

full_name: Associates.FactorSet.sup_add_inf_eq_add
code: theorem FactorSet.sup_add_inf_eq_add [DecidableEq (Associates α)] :
    ∀ a b : FactorSet α, a ⊔ b + a ⊓ b = a + b
  
goal: a ⊔ b + a ⊓ b = a + b

full_name: Associates.FactorSet.prod
code: /-- Evaluates the product of a `FactorSet` to be the product of the corresponding multiset,
  or `0` if there is none. -/
def FactorSet.prod : FactorSet α → Associates α
  
goal: Associates.FactorSet α → Associates α

full_name: Associates.prod_top
code: @[simp]
theorem prod_top : (⊤ : FactorSet α).prod = 0 
goal: ⊤.prod = 0

full_name: Associates.prod_coe
code: @[simp]
theorem prod_coe {s : Multiset { a : Associates α // Irreducible a }} :
    FactorSet.prod (s : FactorSet α) = (s.map (↑)).prod 
goal: Associates.FactorSet.prod ↑s = (Multiset.map Subtype.val s).prod

full_name: Associates.prod_add
code: @[simp]
theorem prod_add : ∀ a b : FactorSet α, (a + b).prod = a.prod * b.prod
  
goal: (a + b).prod = a.prod * b.prod

full_name: Associates.prod_mono
code: @[gcongr]
theorem prod_mono : ∀ {a b : FactorSet α}, a ≤ b → a.prod ≤ b.prod
  
goal: a ≤ b → a.prod ≤ b.prod

full_name: Associates.FactorSet.prod_eq_zero_iff
code: theorem FactorSet.prod_eq_zero_iff [Nontrivial α] (p : FactorSet α) : p.prod = 0 ↔ p = ⊤ 
goal: p.prod = 0 ↔ p = ⊤

full_name: Associates.bcount
code: /-- `bcount p s` is the multiplicity of `p` in the FactorSet `s` (with bundled `p`)-/
def bcount (p : { a : Associates α // Irreducible a }) :
    FactorSet α → ℕ
  
goal: Associates.FactorSet α → ℕ

full_name: Associates.count
code: /-- `count p s` is the multiplicity of the irreducible `p` in the FactorSet `s`.

If `p` is not irreducible, `count p s` is defined to be `0`. -/
def count (p : Associates α) : FactorSet α → ℕ 
goal: Associates.FactorSet α → ℕ

full_name: Associates.count_some
code: @[simp]
theorem count_some (hp : Irreducible p) (s : Multiset _) :
    count p (WithTop.some s) = s.count ⟨p, hp⟩ 
goal: p.count ↑s = Multiset.count ⟨p, hp⟩ s

full_name: Associates.count_zero
code: @[simp]
theorem count_zero (hp : Irreducible p) : count p (0 : FactorSet α) = 0 
goal: p.count 0 = 0

full_name: Associates.count_reducible
code: theorem count_reducible (hp : ¬Irreducible p) : count p = 0 
goal: p.count = 0

full_name: Associates.BfactorSetMem
code: /-- membership in a FactorSet (bundled version) -/
def BfactorSetMem : { a : Associates α // Irreducible a } → FactorSet α → Prop
  
goal: { a // Irreducible a } → Associates.FactorSet α → Prop

full_name: Associates.FactorSetMem
code: /-- `FactorSetMem p s` is the predicate that the irreducible `p` is a member of
`s : FactorSet α`.

If `p` is not irreducible, `p` is not a member of any `FactorSet`. -/
def FactorSetMem (p : Associates α) (s : FactorSet α) : Prop 
goal: Prop

full_name: Associates.instMembershipFactorSet
code: instance : Membership (Associates α) (FactorSet α) 
goal: Membership (Associates α) (Associates.FactorSet α)

full_name: Associates.factorSetMem_eq_mem
code: @[simp]
theorem factorSetMem_eq_mem (p : Associates α) (s : FactorSet α) : FactorSetMem p s = (p ∈ s) 
goal: p.FactorSetMem s = (p ∈ s)

full_name: Associates.mem_factorSet_top
code: theorem mem_factorSet_top {p : Associates α} {hp : Irreducible p} : p ∈ (⊤ : FactorSet α) 
goal: p ∈ ⊤

full_name: Associates.mem_factorSet_some
code: theorem mem_factorSet_some {p : Associates α} {hp : Irreducible p}
    {l : Multiset { a : Associates α // Irreducible a }} :
    p ∈ (l : FactorSet α) ↔ Subtype.mk p hp ∈ l 
goal: p ∈ ↑l ↔ ⟨p, hp⟩ ∈ l

full_name: Associates.reducible_not_mem_factorSet
code: theorem reducible_not_mem_factorSet {p : Associates α} (hp : ¬Irreducible p) (s : FactorSet α) :
    ¬p ∈ s 
goal: p ∉ s

full_name: Associates.irreducible_of_mem_factorSet
code: theorem irreducible_of_mem_factorSet {p : Associates α} {s : FactorSet α} (h : p ∈ s) :
    Irreducible p 
goal: Irreducible p

full_name: Associates.unique'
code: theorem unique' {p q : Multiset (Associates α)} :
    (∀ a ∈ p, Irreducible a) → (∀ a ∈ q, Irreducible a) → p.prod = q.prod → p = q 
goal: (∀ a ∈ p, Irreducible a) → (∀ a ∈ q, Irreducible a) → p.prod = q.prod → p = q

full_name: Associates.FactorSet.unique
code: theorem FactorSet.unique [Nontrivial α] {p q : FactorSet α} (h : p.prod = q.prod) : p = q 
goal: p = q

full_name: Associates.prod_le_prod_iff_le
code: theorem prod_le_prod_iff_le [Nontrivial α] {p q : Multiset (Associates α)}
    (hp : ∀ a ∈ p, Irreducible a) (hq : ∀ a ∈ q, Irreducible a) : p.prod ≤ q.prod ↔ p ≤ q 
goal: p.prod ≤ q.prod ↔ p ≤ q

full_name: Associates.factors'
code: /-- This returns the multiset of irreducible factors as a `FactorSet`,
  a multiset of irreducible associates `WithTop`. -/
noncomputable def factors' (a : α) : Multiset { a : Associates α // Irreducible a } 
goal: Multiset { a // Irreducible a }

full_name: Associates.map_subtype_coe_factors'
code: @[simp]
theorem map_subtype_coe_factors' {a : α} :
    (factors' a).map (↑) = (factors a).map Associates.mk 
goal: Multiset.map Subtype.val (Associates.factors' a) = Multiset.map Associates.mk (UniqueFactorizationMonoid.factors a)

full_name: Associates.factors'_cong
code: theorem factors'_cong {a b : α} (h : a ~ᵤ b) : factors' a = factors' b 
goal: Associates.factors' a = Associates.factors' b

full_name: Associates.factors
code: /-- This returns the multiset of irreducible factors of an associate as a `FactorSet`,
  a multiset of irreducible associates `WithTop`. -/
noncomputable def factors (a : Associates α) : FactorSet α 
goal: Associates.FactorSet α

full_name: Associates.factors_zero
code: @[simp]
theorem factors_zero : (0 : Associates α).factors = ⊤ 
goal: Associates.factors 0 = ⊤

full_name: Associates.factors_mk
code: @[simp]
theorem factors_mk (a : α) (h : a ≠ 0) : (Associates.mk a).factors = factors' a 
goal: (Associates.mk a).factors = ↑(Associates.factors' a)

full_name: Associates.factors_prod
code: @[simp]
theorem factors_prod (a : Associates α) : a.factors.prod = a 
goal: a.factors.prod = a

full_name: Associates.prod_factors
code: @[simp]
theorem prod_factors [Nontrivial α] (s : FactorSet α) : s.prod.factors = s 
goal: s.prod.factors = s

full_name: Associates.factors_subsingleton
code: @[nontriviality]
theorem factors_subsingleton [Subsingleton α] {a : Associates α} : a.factors = ⊤ 
goal: a.factors = ⊤

full_name: Associates.factors_eq_top_iff_zero
code: theorem factors_eq_top_iff_zero {a : Associates α} : a.factors = ⊤ ↔ a = 0 
goal: a.factors = ⊤ ↔ a = 0

full_name: Associates.factors_eq_some_iff_ne_zero
code: theorem factors_eq_some_iff_ne_zero {a : Associates α} :
    (∃ s : Multiset { p : Associates α // Irreducible p }, a.factors = s) ↔ a ≠ 0 
goal: (∃ s, a.factors = ↑s) ↔ a ≠ 0

full_name: Associates.eq_of_factors_eq_factors
code: theorem eq_of_factors_eq_factors {a b : Associates α} (h : a.factors = b.factors) : a = b 
goal: a = b

full_name: Associates.eq_of_prod_eq_prod
code: theorem eq_of_prod_eq_prod [Nontrivial α] {a b : FactorSet α} (h : a.prod = b.prod) : a = b 
goal: a = b

full_name: Associates.factors_mul
code: @[simp]
theorem factors_mul (a b : Associates α) : (a * b).factors = a.factors + b.factors 
goal: (a * b).factors = a.factors + b.factors

full_name: Associates.factors_mono
code: @[gcongr]
theorem factors_mono : ∀ {a b : Associates α}, a ≤ b → a.factors ≤ b.factors
  
goal: a ≤ b → a.factors ≤ b.factors

full_name: Associates.factors_le
code: @[simp]
theorem factors_le {a b : Associates α} : a.factors ≤ b.factors ↔ a ≤ b 
goal: a.factors ≤ b.factors ↔ a ≤ b

full_name: Associates.eq_factors_of_eq_counts
code: theorem eq_factors_of_eq_counts {a b : Associates α} (ha : a ≠ 0) (hb : b ≠ 0)
    (h : ∀ p : Associates α, Irreducible p → p.count a.factors = p.count b.factors) :
    a.factors = b.factors 
goal: a.factors = b.factors

full_name: Associates.eq_of_eq_counts
code: theorem eq_of_eq_counts {a b : Associates α} (ha : a ≠ 0) (hb : b ≠ 0)
    (h : ∀ p : Associates α, Irreducible p → p.count a.factors = p.count b.factors) : a = b 
goal: a = b

full_name: Associates.count_le_count_of_factors_le
code: theorem count_le_count_of_factors_le {a b p : Associates α} (hb : b ≠ 0) (hp : Irreducible p)
    (h : a.factors ≤ b.factors) : p.count a.factors ≤ p.count b.factors 
goal: p.count a.factors ≤ p.count b.factors

full_name: Associates.count_le_count_of_le
code: theorem count_le_count_of_le {a b p : Associates α} (hb : b ≠ 0) (hp : Irreducible p) (h : a ≤ b) :
    p.count a.factors ≤ p.count b.factors 
goal: p.count a.factors ≤ p.count b.factors

full_name: Associates.prod_le
code: theorem prod_le [Nontrivial α] {a b : FactorSet α} : a.prod ≤ b.prod ↔ a ≤ b 
goal: a.prod ≤ b.prod ↔ a ≤ b

full_name: Associates.instSup
code: noncomputable instance : Sup (Associates α) 
goal: Sup (Associates α)

full_name: Associates.instInf
code: noncomputable instance : Inf (Associates α) 
goal: Inf (Associates α)

full_name: Associates.instLattice
code: noncomputable instance : Lattice (Associates α) 
goal: Lattice (Associates α)

full_name: Associates.sup_mul_inf
code: theorem sup_mul_inf (a b : Associates α) : (a ⊔ b) * (a ⊓ b) = a * b 
goal: (a ⊔ b) * (a ⊓ b) = a * b

full_name: Associates.dvd_of_mem_factors
code: theorem dvd_of_mem_factors {a p : Associates α} (hm : p ∈ factors a) :
    p ∣ a 
goal: p ∣ a

full_name: Associates.dvd_of_mem_factors'
code: theorem dvd_of_mem_factors' {a : α} {p : Associates α} {hp : Irreducible p} {hz : a ≠ 0}
    (h_mem : Subtype.mk p hp ∈ factors' a) : p ∣ Associates.mk a 
goal: p ∣ Associates.mk a

full_name: Associates.mem_factors'_of_dvd
code: theorem mem_factors'_of_dvd {a p : α} (ha0 : a ≠ 0) (hp : Irreducible p) (hd : p ∣ a) :
    Subtype.mk (Associates.mk p) (irreducible_mk.2 hp) ∈ factors' a 
goal: ⟨Associates.mk p, ⋯⟩ ∈ Associates.factors' a

full_name: Associates.mem_factors'_iff_dvd
code: theorem mem_factors'_iff_dvd {a p : α} (ha0 : a ≠ 0) (hp : Irreducible p) :
    Subtype.mk (Associates.mk p) (irreducible_mk.2 hp) ∈ factors' a ↔ p ∣ a 
goal: ⟨Associates.mk p, ⋯⟩ ∈ Associates.factors' a ↔ p ∣ a

full_name: Associates.mem_factors_of_dvd
code: theorem mem_factors_of_dvd {a p : α} (ha0 : a ≠ 0) (hp : Irreducible p) (hd : p ∣ a) :
    Associates.mk p ∈ factors (Associates.mk a) 
goal: Associates.mk p ∈ (Associates.mk a).factors

full_name: Associates.mem_factors_iff_dvd
code: theorem mem_factors_iff_dvd {a p : α} (ha0 : a ≠ 0) (hp : Irreducible p) :
    Associates.mk p ∈ factors (Associates.mk a) ↔ p ∣ a 
goal: Associates.mk p ∈ (Associates.mk a).factors ↔ p ∣ a

full_name: Associates.exists_prime_dvd_of_not_inf_one
code: theorem exists_prime_dvd_of_not_inf_one {a b : α} (ha : a ≠ 0) (hb : b ≠ 0)
    (h : Associates.mk a ⊓ Associates.mk b ≠ 1) : ∃ p : α, Prime p ∧ p ∣ a ∧ p ∣ b 
goal: ∃ p, Prime p ∧ p ∣ a ∧ p ∣ b

full_name: Associates.coprime_iff_inf_one
code: theorem coprime_iff_inf_one {a b : α} (ha0 : a ≠ 0) (hb0 : b ≠ 0) :
    Associates.mk a ⊓ Associates.mk b = 1 ↔ ∀ {d : α}, d ∣ a → d ∣ b → ¬Prime d 
goal: Associates.mk a ⊓ Associates.mk b = 1 ↔ ∀ {d : α}, d ∣ a → d ∣ b → ¬Prime d

full_name: Associates.factors_self
code: theorem factors_self [Nontrivial α] {p : Associates α} (hp : Irreducible p) :
    p.factors = WithTop.some {⟨p, hp⟩} 
goal: p.factors = ↑{⟨p, hp⟩}

full_name: Associates.factors_prime_pow
code: theorem factors_prime_pow [Nontrivial α] {p : Associates α} (hp : Irreducible p) (k : ℕ) :
    factors (p ^ k) = WithTop.some (Multiset.replicate k ⟨p, hp⟩) 
goal: (p ^ k).factors = ↑(Multiset.replicate k ⟨p, hp⟩)

full_name: Associates.prime_pow_le_iff_le_bcount
code: theorem prime_pow_le_iff_le_bcount [DecidableEq (Associates α)] {m p : Associates α}
    (h₁ : m ≠ 0) (h₂ : Irreducible p) {k : ℕ} : p ^ k ≤ m ↔ k ≤ bcount ⟨p, h₂⟩ m.factors 
goal: p ^ k ≤ m ↔ k ≤ Associates.bcount ⟨p, h₂⟩ m.factors

full_name: Associates.prime_pow_dvd_iff_le
code: theorem prime_pow_dvd_iff_le {m p : Associates α} (h₁ : m ≠ 0) (h₂ : Irreducible p) {k : ℕ} :
    p ^ k ≤ m ↔ k ≤ count p m.factors 
goal: p ^ k ≤ m ↔ k ≤ p.count m.factors

full_name: Associates.le_of_count_ne_zero
code: theorem le_of_count_ne_zero {m p : Associates α} (h0 : m ≠ 0) (hp : Irreducible p) :
    count p m.factors ≠ 0 → p ≤ m 
goal: p.count m.factors ≠ 0 → p ≤ m

full_name: Associates.count_ne_zero_iff_dvd
code: theorem count_ne_zero_iff_dvd {a p : α} (ha0 : a ≠ 0) (hp : Irreducible p) :
    (Associates.mk p).count (Associates.mk a).factors ≠ 0 ↔ p ∣ a 
goal: (Associates.mk p).count (Associates.mk a).factors ≠ 0 ↔ p ∣ a

full_name: Associates.count_self
code: theorem count_self [Nontrivial α] [DecidableEq (Associates α)] {p : Associates α}
    (hp : Irreducible p) : p.count p.factors = 1 
goal: p.count p.factors = 1

full_name: Associates.count_eq_zero_of_ne
code: theorem count_eq_zero_of_ne [DecidableEq (Associates α)] {p q : Associates α} (hp : Irreducible p)
    (hq : Irreducible q) (h : p ≠ q) : p.count q.factors = 0 
goal: p.count q.factors = 0

full_name: Associates.count_mul
code: theorem count_mul [DecidableEq (Associates α)] {a : Associates α} (ha : a ≠ 0) {b : Associates α}
    (hb : b ≠ 0) {p : Associates α} (hp : Irreducible p) :
    count p (factors (a * b)) = count p a.factors + count p b.factors 
goal: p.count (a * b).factors = p.count a.factors + p.count b.factors

full_name: Associates.count_of_coprime
code: theorem count_of_coprime [DecidableEq (Associates α)] {a : Associates α} (ha : a ≠ 0)
    {b : Associates α} (hb : b ≠ 0) (hab : ∀ d, d ∣ a → d ∣ b → ¬Prime d) {p : Associates α}
    (hp : Irreducible p) : count p a.factors = 0 ∨ count p b.factors = 0 
goal: p.count a.factors = 0 ∨ p.count b.factors = 0

full_name: Associates.count_mul_of_coprime
code: theorem count_mul_of_coprime [DecidableEq (Associates α)] {a : Associates α} {b : Associates α}
    (hb : b ≠ 0) {p : Associates α} (hp : Irreducible p) (hab : ∀ d, d ∣ a → d ∣ b → ¬Prime d) :
    count p a.factors = 0 ∨ count p a.factors = count p (a * b).factors 
goal: p.count a.factors = 0 ∨ p.count a.factors = p.count (a * b).factors

full_name: Associates.count_mul_of_coprime'
code: theorem count_mul_of_coprime' [DecidableEq (Associates α)] {a b : Associates α} {p : Associates α}
    (hp : Irreducible p) (hab : ∀ d, d ∣ a → d ∣ b → ¬Prime d) :
    count p (a * b).factors = count p a.factors ∨ count p (a * b).factors = count p b.factors 
goal: p.count (a * b).factors = p.count a.factors ∨ p.count (a * b).factors = p.count b.factors

full_name: Associates.dvd_count_of_dvd_count_mul
code: theorem dvd_count_of_dvd_count_mul [DecidableEq (Associates α)] {a b : Associates α} (hb : b ≠ 0)
    {p : Associates α} (hp : Irreducible p) (hab : ∀ d, d ∣ a → d ∣ b → ¬Prime d) {k : ℕ}
    (habk : k ∣ count p (a * b).factors) : k ∣ count p a.factors 
goal: k ∣ p.count a.factors

full_name: Associates.factors_one
code: @[simp]
theorem factors_one [Nontrivial α] : factors (1 : Associates α) = 0 
goal: Associates.factors 1 = 0

full_name: Associates.pow_factors
code: @[simp]
theorem pow_factors [Nontrivial α] {a : Associates α} {k : ℕ} :
    (a ^ k).factors = k • a.factors 
goal: (a ^ k).factors = k • a.factors

full_name: Associates.count_pow
code: theorem count_pow [Nontrivial α] [DecidableEq (Associates α)] {a : Associates α} (ha : a ≠ 0)
    {p : Associates α} (hp : Irreducible p) (k : ℕ) :
    count p (a ^ k).factors = k * count p a.factors 
goal: p.count (a ^ k).factors = k * p.count a.factors

full_name: Associates.dvd_count_pow
code: theorem dvd_count_pow [Nontrivial α] [DecidableEq (Associates α)] {a : Associates α} (ha : a ≠ 0)
    {p : Associates α} (hp : Irreducible p) (k : ℕ) : k ∣ count p (a ^ k).factors 
goal: k ∣ p.count (a ^ k).factors

full_name: Associates.is_pow_of_dvd_count
code: theorem is_pow_of_dvd_count [DecidableEq (Associates α)] {a : Associates α}
    (ha : a ≠ 0) {k : ℕ} (hk : ∀ p : Associates α, Irreducible p → k ∣ count p a.factors) :
    ∃ b : Associates α, a = b ^ k 
goal: ∃ b, a = b ^ k

full_name: Associates.eq_pow_count_factors_of_dvd_pow
code: /-- The only divisors of prime powers are prime powers. See `eq_pow_find_of_dvd_irreducible_pow`
for an explicit expression as a p-power (without using `count`). -/
theorem eq_pow_count_factors_of_dvd_pow [DecidableEq (Associates α)] {p a : Associates α}
    (hp : Irreducible p) {n : ℕ} (h : a ∣ p ^ n) : a = p ^ p.count a.factors 
goal: a = p ^ p.count a.factors

full_name: Associates.count_factors_eq_find_of_dvd_pow
code: theorem count_factors_eq_find_of_dvd_pow [DecidableEq (Associates α)] {a p : Associates α}
    (hp : Irreducible p) [∀ n : ℕ, Decidable (a ∣ p ^ n)] {n : ℕ} (h : a ∣ p ^ n) :
    @Nat.find (fun n => a ∣ p ^ n) _ ⟨n, h⟩ = p.count a.factors 
goal: Nat.find ⋯ = p.count a.factors

full_name: Associates.eq_pow_of_mul_eq_pow
code: theorem eq_pow_of_mul_eq_pow {a b c : Associates α} (ha : a ≠ 0) (hb : b ≠ 0)
    (hab : ∀ d, d ∣ a → d ∣ b → ¬Prime d) {k : ℕ} (h : a * b = c ^ k) :
    ∃ d : Associates α, a = d ^ k 
goal: ∃ d, a = d ^ k

full_name: Associates.eq_pow_find_of_dvd_irreducible_pow
code: /-- The only divisors of prime powers are prime powers. -/
theorem eq_pow_find_of_dvd_irreducible_pow {a p : Associates α} (hp : Irreducible p)
    [∀ n : ℕ, Decidable (a ∣ p ^ n)] {n : ℕ} (h : a ∣ p ^ n) :
    a = p ^ @Nat.find (fun n => a ∣ p ^ n) _ ⟨n, h⟩ 
goal: a = p ^ Nat.find ⋯

full_name: UniqueFactorizationMonoid.toGCDMonoid
code: /-- `toGCDMonoid` constructs a GCD monoid out of a unique factorization domain. -/
noncomputable def UniqueFactorizationMonoid.toGCDMonoid (α : Type*) [CancelCommMonoidWithZero α]
    [UniqueFactorizationMonoid α] : GCDMonoid α 
goal: GCDMonoid α

full_name: UniqueFactorizationMonoid.toNormalizedGCDMonoid
code: /-- `toNormalizedGCDMonoid` constructs a GCD monoid out of a normalization on a
  unique factorization domain. -/
noncomputable def UniqueFactorizationMonoid.toNormalizedGCDMonoid (α : Type*)
    [CancelCommMonoidWithZero α] [UniqueFactorizationMonoid α] [NormalizationMonoid α] :
    NormalizedGCDMonoid α 
goal: NormalizedGCDMonoid α

full_name: instNonemptyNormalizedGCDMonoidOfUniqueFactorizationMonoid
code: instance (α) [CancelCommMonoidWithZero α] [UniqueFactorizationMonoid α] :
    Nonempty (NormalizedGCDMonoid α) 
goal: Nonempty (NormalizedGCDMonoid α)

full_name: UniqueFactorizationMonoid.fintypeSubtypeDvd
code: /-- If `y` is a nonzero element of a unique factorization monoid with finitely
many units (e.g. `ℤ`, `Ideal (ring_of_integers K)`), it has finitely many divisors. -/
noncomputable def fintypeSubtypeDvd {M : Type*} [CancelCommMonoidWithZero M]
    [UniqueFactorizationMonoid M] [Fintype Mˣ] (y : M) (hy : y ≠ 0) : Fintype { x // x ∣ y } 
goal: Fintype { x // x ∣ y }

full_name: factorization
code: /-- This returns the multiset of irreducible factors as a `Finsupp`. -/
noncomputable def factorization (n : α) : α →₀ ℕ 
goal: α →₀ ℕ

full_name: factorization_eq_count
code: theorem factorization_eq_count {n p : α} :
    factorization n p = Multiset.count p (normalizedFactors n) 
goal: (factorization n) p = Multiset.count p (UniqueFactorizationMonoid.normalizedFactors n)

full_name: factorization_zero
code: @[simp]
theorem factorization_zero : factorization (0 : α) = 0 
goal: factorization 0 = 0

full_name: factorization_one
code: @[simp]
theorem factorization_one : factorization (1 : α) = 0 
goal: factorization 1 = 0

full_name: support_factorization
code: /-- The support of `factorization n` is exactly the Finset of normalized factors -/
@[simp]
theorem support_factorization {n : α} :
    (factorization n).support = (normalizedFactors n).toFinset 
goal: (factorization n).support = (UniqueFactorizationMonoid.normalizedFactors n).toFinset

full_name: factorization_mul
code: /-- For nonzero `a` and `b`, the power of `p` in `a * b` is the sum of the powers in `a` and `b` -/
@[simp]
theorem factorization_mul {a b : α} (ha : a ≠ 0) (hb : b ≠ 0) :
    factorization (a * b) = factorization a + factorization b 
goal: factorization (a * b) = factorization a + factorization b

full_name: factorization_pow
code: /-- For any `p`, the power of `p` in `x^n` is `n` times the power in `x` -/
theorem factorization_pow {x : α} {n : ℕ} : factorization (x ^ n) = n • factorization x 
goal: factorization (x ^ n) = n • factorization x

full_name: associated_of_factorization_eq
code: theorem associated_of_factorization_eq (a b : α) (ha : a ≠ 0) (hb : b ≠ 0)
    (h : factorization a = factorization b) : Associated a b 
goal: a ~ᵤ b

full_name: Ideal.IsPrime.exists_mem_prime_of_ne_bot
code: /-- Every non-zero prime ideal in a unique factorization domain contains a prime element. -/
theorem Ideal.IsPrime.exists_mem_prime_of_ne_bot {R : Type*} [CommSemiring R] [IsDomain R]
    [UniqueFactorizationMonoid R] {I : Ideal R} (hI₂ : I.IsPrime) (hI : I ≠ ⊥) :
    ∃ x ∈ I, Prime x 
goal: ∃ x ∈ I, Prime x

full_name: Nat.instWfDvdMonoid
code: instance instWfDvdMonoid : WfDvdMonoid ℕ 
goal: WfDvdMonoid ℕ

full_name: Nat.instUniqueFactorizationMonoid
code: instance instUniqueFactorizationMonoid : UniqueFactorizationMonoid ℕ 
goal: UniqueFactorizationMonoid ℕ

full_name: Nat.factors_eq
code: lemma factors_eq : ∀ n : ℕ, normalizedFactors n = n.primeFactorsList
  
goal: UniqueFactorizationMonoid.normalizedFactors n = ↑n.primeFactorsList

full_name: Nat.factors_multiset_prod_of_irreducible
code: lemma factors_multiset_prod_of_irreducible {s : Multiset ℕ} (h : ∀ x : ℕ, x ∈ s → Irreducible x) :
    normalizedFactors s.prod = s 
goal: UniqueFactorizationMonoid.normalizedFactors s.prod = s