File: Mathlib/Data/Nat/Factors.lean

full_name: Nat.primeFactorsList
code: /-- `primeFactorsList n` is the prime factorization of `n`, listed in increasing order. -/
def primeFactorsList : ℕ → List ℕ
  
goal: ℕ → List ℕ

full_name: Nat.primeFactorsList_zero
code: @[simp]
theorem primeFactorsList_zero : primeFactorsList 0 = [] 
goal: Nat.primeFactorsList 0 = []

full_name: Nat.primeFactorsList_one
code: @[simp]
theorem primeFactorsList_one : primeFactorsList 1 = [] 
goal: Nat.primeFactorsList 1 = []

full_name: Nat.primeFactorsList_two
code: @[simp]
theorem primeFactorsList_two : primeFactorsList 2 = [2] 
goal: Nat.primeFactorsList 2 = [2]

full_name: Nat.prime_of_mem_primeFactorsList
code: theorem prime_of_mem_primeFactorsList {n : ℕ} : ∀ {p : ℕ}, p ∈ primeFactorsList n → Prime p 
goal: p ∈ n.primeFactorsList → Nat.Prime p

full_name: Nat.pos_of_mem_primeFactorsList
code: theorem pos_of_mem_primeFactorsList {n p : ℕ} (h : p ∈ primeFactorsList n) : 0 < p 
goal: 0 < p

full_name: Nat.prod_primeFactorsList
code: theorem prod_primeFactorsList : ∀ {n}, n ≠ 0 → List.prod (primeFactorsList n) = n
  
goal: n ≠ 0 → n.primeFactorsList.prod = n

full_name: Nat.primeFactorsList_prime
code: theorem primeFactorsList_prime {p : ℕ} (hp : Nat.Prime p) : p.primeFactorsList = [p] 
goal: p.primeFactorsList = [p]

full_name: Nat.primeFactorsList_chain
code: theorem primeFactorsList_chain {n : ℕ} :
    ∀ {a}, (∀ p, Prime p → p ∣ n → a ≤ p) → List.Chain (· ≤ ·) a (primeFactorsList n) 
goal: (∀ (p : ℕ), Nat.Prime p → p ∣ n → a ≤ p) → List.Chain (fun x x_1 => x ≤ x_1) a n.primeFactorsList

full_name: Nat.primeFactorsList_chain_2
code: theorem primeFactorsList_chain_2 (n) : List.Chain (· ≤ ·) 2 (primeFactorsList n) 
goal: List.Chain (fun x x_1 => x ≤ x_1) 2 n.primeFactorsList

full_name: Nat.primeFactorsList_chain'
code: theorem primeFactorsList_chain' (n) : List.Chain' (· ≤ ·) (primeFactorsList n) 
goal: List.Chain' (fun x x_1 => x ≤ x_1) n.primeFactorsList

full_name: Nat.primeFactorsList_sorted
code: theorem primeFactorsList_sorted (n : ℕ) : List.Sorted (· ≤ ·) (primeFactorsList n) 
goal: List.Sorted (fun x x_1 => x ≤ x_1) n.primeFactorsList

full_name: Nat.primeFactorsList_add_two
code: /-- `primeFactorsList` can be constructed inductively by extracting `minFac`, for sufficiently
large `n`. -/
theorem primeFactorsList_add_two (n : ℕ) :
    primeFactorsList (n + 2) = minFac (n + 2) :: primeFactorsList ((n + 2) / minFac (n + 2)) 
goal: (n + 2).primeFactorsList = (n + 2).minFac :: ((n + 2) / (n + 2).minFac).primeFactorsList

full_name: Nat.primeFactorsList_eq_nil
code: @[simp]
theorem primeFactorsList_eq_nil (n : ℕ) : n.primeFactorsList = [] ↔ n = 0 ∨ n = 1 
goal: n.primeFactorsList = [] ↔ n = 0 ∨ n = 1

full_name: Nat.eq_of_perm_primeFactorsList
code: theorem eq_of_perm_primeFactorsList {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0)
    (h : a.primeFactorsList ~ b.primeFactorsList) : a = b 
goal: a = b

full_name: Nat.mem_primeFactorsList_iff_dvd
code: theorem mem_primeFactorsList_iff_dvd {n p : ℕ} (hn : n ≠ 0) (hp : Prime p) :
    p ∈ primeFactorsList n ↔ p ∣ n 
goal: p ∈ n.primeFactorsList ↔ p ∣ n

full_name: Nat.dvd_of_mem_primeFactorsList
code: theorem dvd_of_mem_primeFactorsList {n p : ℕ} (h : p ∈ n.primeFactorsList) : p ∣ n 
goal: p ∣ n

full_name: Nat.mem_primeFactorsList
code: theorem mem_primeFactorsList {n p} (hn : n ≠ 0) : p ∈ primeFactorsList n ↔ Prime p ∧ p ∣ n 
goal: p ∈ n.primeFactorsList ↔ Nat.Prime p ∧ p ∣ n

full_name: Nat.mem_primeFactorsList'
code: @[simp] lemma mem_primeFactorsList' {n p} : p ∈ n.primeFactorsList ↔ p.Prime ∧ p ∣ n ∧ n ≠ 0 
goal: p ∈ n.primeFactorsList ↔ Nat.Prime p ∧ p ∣ n ∧ n ≠ 0

full_name: Nat.le_of_mem_primeFactorsList
code: theorem le_of_mem_primeFactorsList {n p : ℕ} (h : p ∈ n.primeFactorsList) : p ≤ n 
goal: p ≤ n

full_name: Nat.primeFactorsList_unique
code: /-- **Fundamental theorem of arithmetic**-/
theorem primeFactorsList_unique {n : ℕ} {l : List ℕ} (h₁ : prod l = n) (h₂ : ∀ p ∈ l, Prime p) :
    l ~ primeFactorsList n 
goal: l.Perm n.primeFactorsList

full_name: Nat.Prime.primeFactorsList_pow
code: theorem Prime.primeFactorsList_pow {p : ℕ} (hp : p.Prime) (n : ℕ) :
    (p ^ n).primeFactorsList = List.replicate n p 
goal: (p ^ n).primeFactorsList = List.replicate n p

full_name: Nat.eq_prime_pow_of_unique_prime_dvd
code: theorem eq_prime_pow_of_unique_prime_dvd {n p : ℕ} (hpos : n ≠ 0)
    (h : ∀ {d}, Nat.Prime d → d ∣ n → d = p) : n = p ^ n.primeFactorsList.length 
goal: n = p ^ n.primeFactorsList.length

full_name: Nat.perm_primeFactorsList_mul
code: /-- For positive `a` and `b`, the prime factors of `a * b` are the union of those of `a` and `b` -/
theorem perm_primeFactorsList_mul {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) :
    (a * b).primeFactorsList ~ a.primeFactorsList ++ b.primeFactorsList 
goal: (a * b).primeFactorsList.Perm (a.primeFactorsList ++ b.primeFactorsList)

full_name: Nat.perm_primeFactorsList_mul_of_coprime
code: /-- For coprime `a` and `b`, the prime factors of `a * b` are the union of those of `a` and `b` -/
theorem perm_primeFactorsList_mul_of_coprime {a b : ℕ} (hab : Coprime a b) :
    (a * b).primeFactorsList ~ a.primeFactorsList ++ b.primeFactorsList 
goal: (a * b).primeFactorsList.Perm (a.primeFactorsList ++ b.primeFactorsList)

full_name: Nat.primeFactorsList_sublist_right
code: theorem primeFactorsList_sublist_right {n k : ℕ} (h : k ≠ 0) :
    n.primeFactorsList <+ (n * k).primeFactorsList 
goal: n.primeFactorsList.Sublist (n * k).primeFactorsList

full_name: Nat.primeFactorsList_sublist_of_dvd
code: theorem primeFactorsList_sublist_of_dvd {n k : ℕ} (h : n ∣ k) (h' : k ≠ 0) :
    n.primeFactorsList <+ k.primeFactorsList 
goal: n.primeFactorsList.Sublist k.primeFactorsList

full_name: Nat.primeFactorsList_subset_right
code: theorem primeFactorsList_subset_right {n k : ℕ} (h : k ≠ 0) :
    n.primeFactorsList ⊆ (n * k).primeFactorsList 
goal: n.primeFactorsList ⊆ (n * k).primeFactorsList

full_name: Nat.primeFactorsList_subset_of_dvd
code: theorem primeFactorsList_subset_of_dvd {n k : ℕ} (h : n ∣ k) (h' : k ≠ 0) :
    n.primeFactorsList ⊆ k.primeFactorsList 
goal: n.primeFactorsList ⊆ k.primeFactorsList

full_name: Nat.dvd_of_primeFactorsList_subperm
code: theorem dvd_of_primeFactorsList_subperm {a b : ℕ} (ha : a ≠ 0)
    (h : a.primeFactorsList <+~ b.primeFactorsList) : a ∣ b 
goal: a ∣ b

full_name: Nat.replicate_subperm_primeFactorsList_iff
code: theorem replicate_subperm_primeFactorsList_iff {a b n : ℕ} (ha : Prime a) (hb : b ≠ 0) :
    replicate n a <+~ primeFactorsList b ↔ a ^ n ∣ b 
goal: (List.replicate n a).Subperm b.primeFactorsList ↔ a ^ n ∣ b

full_name: Nat.mem_primeFactorsList_mul
code: theorem mem_primeFactorsList_mul {a b : ℕ} (ha : a ≠ 0) (hb : b ≠ 0) {p : ℕ} :
    p ∈ (a * b).primeFactorsList ↔ p ∈ a.primeFactorsList ∨ p ∈ b.primeFactorsList 
goal: p ∈ (a * b).primeFactorsList ↔ p ∈ a.primeFactorsList ∨ p ∈ b.primeFactorsList

full_name: Nat.coprime_primeFactorsList_disjoint
code: /-- The sets of factors of coprime `a` and `b` are disjoint -/
theorem coprime_primeFactorsList_disjoint {a b : ℕ} (hab : a.Coprime b) :
    List.Disjoint a.primeFactorsList b.primeFactorsList 
goal: a.primeFactorsList.Disjoint b.primeFactorsList

full_name: Nat.mem_primeFactorsList_mul_of_coprime
code: theorem mem_primeFactorsList_mul_of_coprime {a b : ℕ} (hab : Coprime a b) (p : ℕ) :
    p ∈ (a * b).primeFactorsList ↔ p ∈ a.primeFactorsList ∪ b.primeFactorsList 
goal: p ∈ (a * b).primeFactorsList ↔ p ∈ a.primeFactorsList ∪ b.primeFactorsList

full_name: Nat.mem_primeFactorsList_mul_left
code: /-- If `p` is a prime factor of `a` then `p` is also a prime factor of `a * b` for any `b > 0` -/
theorem mem_primeFactorsList_mul_left {p a b : ℕ} (hpa : p ∈ a.primeFactorsList) (hb : b ≠ 0) :
    p ∈ (a * b).primeFactorsList 
goal: p ∈ (a * b).primeFactorsList

full_name: Nat.mem_primeFactorsList_mul_right
code: /-- If `p` is a prime factor of `b` then `p` is also a prime factor of `a * b` for any `a > 0` -/
theorem mem_primeFactorsList_mul_right {p a b : ℕ} (hpb : p ∈ b.primeFactorsList) (ha : a ≠ 0) :
    p ∈ (a * b).primeFactorsList 
goal: p ∈ (a * b).primeFactorsList

full_name: Nat.eq_two_pow_or_exists_odd_prime_and_dvd
code: theorem eq_two_pow_or_exists_odd_prime_and_dvd (n : ℕ) :
    (∃ k : ℕ, n = 2 ^ k) ∨ ∃ p, Nat.Prime p ∧ p ∣ n ∧ Odd p 
goal: (∃ k, n = 2 ^ k) ∨ ∃ p, Nat.Prime p ∧ p ∣ n ∧ Odd p

full_name: Nat.four_dvd_or_exists_odd_prime_and_dvd_of_two_lt
code: theorem four_dvd_or_exists_odd_prime_and_dvd_of_two_lt {n : ℕ} (n2 : 2 < n) :
    4 ∣ n ∨ ∃ p, Prime p ∧ p ∣ n ∧ Odd p 
goal: 4 ∣ n ∨ ∃ p, Nat.Prime p ∧ p ∣ n ∧ Odd p