Theorem: Nat.multiplicative_factorization
File: Mathlib/Data/Nat/Factorization/Basic.lean

tactic: apply Nat.recOnPosPrimePosCoprime
state_before: β : Type u_1
inst✝ : CommMonoid β
f : ℕ → β
h_mult : ∀ (x y : ℕ), coprime x y → f (x * y) = f x * f y
hf : f 1 = 1
⊢ ∀ {n : ℕ}, n ≠ 0 → f n = Finsupp.prod (factorization n) fun p k => f (p ^ k)

tactic: rintro p k hp - -
state_before: case hp
β : Type u_1
inst✝ : CommMonoid β
f : ℕ → β
h_mult : ∀ (x y : ℕ), coprime x y → f (x * y) = f x * f y
hf : f 1 = 1
⊢ ∀ (p n : ℕ), Prime p → 0 < n → p ^ n ≠ 0 → f (p ^ n) = Finsupp.prod (factorization (p ^ n)) fun p k => f (p ^ k)

tactic: rw [Prime.factorization_pow hp, Finsupp.prod_single_index _]
state_before: case hp
β : Type u_1
inst✝ : CommMonoid β
f : ℕ → β
h_mult : ∀ (x y : ℕ), coprime x y → f (x * y) = f x * f y
hf : f 1 = 1
p k : ℕ
hp : Prime p
⊢ f (p ^ k) = Finsupp.prod (factorization (p ^ k)) fun p k => f (p ^ k)

tactic: rwa [pow_zero]
state_before: β : Type u_1
inst✝ : CommMonoid β
f : ℕ → β
h_mult : ∀ (x y : ℕ), coprime x y → f (x * y) = f x * f y
hf : f 1 = 1
p k : ℕ
hp : Prime p
⊢ f (p ^ 0) = 1

tactic: simp
state_before: case h0
β : Type u_1
inst✝ : CommMonoid β
f : ℕ → β
h_mult : ∀ (x y : ℕ), coprime x y → f (x * y) = f x * f y
hf : f 1 = 1
⊢ 0 ≠ 0 → f 0 = Finsupp.prod (factorization 0) fun p k => f (p ^ k)

tactic: rintro -
state_before: case h1
β : Type u_1
inst✝ : CommMonoid β
f : ℕ → β
h_mult : ∀ (x y : ℕ), coprime x y → f (x * y) = f x * f y
hf : f 1 = 1
⊢ 1 ≠ 0 → f 1 = Finsupp.prod (factorization 1) fun p k => f (p ^ k)

tactic: rw [factorization_one, hf]
state_before: case h1
β : Type u_1
inst✝ : CommMonoid β
f : ℕ → β
h_mult : ∀ (x y : ℕ), coprime x y → f (x * y) = f x * f y
hf : f 1 = 1
⊢ f 1 = Finsupp.prod (factorization 1) fun p k => f (p ^ k)

tactic: simp
state_before: case h1
β : Type u_1
inst✝ : CommMonoid β
f : ℕ → β
h_mult : ∀ (x y : ℕ), coprime x y → f (x * y) = f x * f y
hf : f 1 = 1
⊢ 1 = Finsupp.prod 0 fun p k => f (p ^ k)

tactic: intro a b _ _ hab ha hb hab_pos
state_before: case h
β : Type u_1
inst✝ : CommMonoid β
f : ℕ → β
h_mult : ∀ (x y : ℕ), coprime x y → f (x * y) = f x * f y
hf : f 1 = 1
⊢ ∀ (a b : ℕ),
    1 < a →
      1 < b →
        coprime a b →
          (a ≠ 0 → f a = Finsupp.prod (factorization a) fun p k => f (p ^ k)) →
            (b ≠ 0 → f b = Finsupp.prod (factorization b) fun p k => f (p ^ k)) →
              a * b ≠ 0 → f (a * b) = Finsupp.prod (factorization (a * b)) fun p k => f (p ^ k)

tactic: rw [h_mult a b hab, ha (left_ne_zero_of_mul hab_pos), hb (right_ne_zero_of_mul hab_pos),
  factorization_mul_of_coprime hab, ← prod_add_index_of_disjoint]
state_before: case h
β : Type u_1
inst✝ : CommMonoid β
f : ℕ → β
h_mult : ∀ (x y : ℕ), coprime x y → f (x * y) = f x * f y
hf : f 1 = 1
a b : ℕ
a✝¹ : 1 < a
a✝ : 1 < b
hab : coprime a b
ha : a ≠ 0 → f a = Finsupp.prod (factorization a) fun p k => f (p ^ k)
hb : b ≠ 0 → f b = Finsupp.prod (factorization b) fun p k => f (p ^ k)
hab_pos : a * b ≠ 0
⊢ f (a * b) = Finsupp.prod (factorization (a * b)) fun p k => f (p ^ k)

tactic: convert factorization_disjoint_of_coprime hab
state_before: case h.hd
β : Type u_1
inst✝ : CommMonoid β
f : ℕ → β
h_mult : ∀ (x y : ℕ), coprime x y → f (x * y) = f x * f y
hf : f 1 = 1
a b : ℕ
a✝¹ : 1 < a
a✝ : 1 < b
hab : coprime a b
ha : a ≠ 0 → f a = Finsupp.prod (factorization a) fun p k => f (p ^ k)
hb : b ≠ 0 → f b = Finsupp.prod (factorization b) fun p k => f (p ^ k)
hab_pos : a * b ≠ 0
⊢ _root_.Disjoint (factorization a).support (factorization b).support