case refine'_1
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
⊢ ∏ i in divisors n, f i = g n ↔
    (∏ i in divisors n, if h : 0 < i then Units.mk0 (f i) (_ : f i ≠ 0) else 1) =
      if h : 0 < n then Units.mk0 (g n) (_ : g n ≠ 0) else 1

case refine'_2
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
⊢ (∏ x in divisorsAntidiagonal n, (if h : 0 < x.snd then Units.mk0 (g x.snd) (_ : g x.snd ≠ 0) else 1) ^ ↑μ x.fst =
      if h : 0 < n then Units.mk0 (f n) (_ : f n ≠ 0) else 1) ↔
    ∏ x in divisorsAntidiagonal n, g x.snd ^ ↑μ x.fst = f n
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
⊢ (∀ (n : ℕ), 0 < n → ∏ i in divisors n, f i = g n) ↔
    ∀ (n : ℕ), 0 < n → ∏ x in divisorsAntidiagonal n, g x.snd ^ ↑μ x.fst = f n
refine'
    Iff.trans
      (Iff.trans (forall_congr' fun n => _)
        (@prod_eq_iff_prod_pow_moebius_eq Rˣ _
          (fun n => if h : 0 < n then Units.mk0 (f n) (hf n h) else 1) fun n =>
          if h : 0 < n then Units.mk0 (g n) (hg n h) else 1))
      (forall_congr' fun n => _) <;>
  refine' imp_congr_right fun hn => _
case refine'_1
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
⊢ ∏ i in divisors n, f i = g n ↔
    (∏ i in divisors n, if h : 0 < i then Units.mk0 (f i) (_ : f i ≠ 0) else 1) =
      if h : 0 < n then Units.mk0 (g n) (_ : g n ≠ 0) else 1
case refine'_1
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
⊢ ∏ i in divisors n, f i = g n ↔
    (∏ i in divisors n, if h : 0 < i then Units.mk0 (f i) (_ : f i ≠ 0) else 1) =
      if h : 0 < n then Units.mk0 (g n) (_ : g n ≠ 0) else 1
dsimp
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
⊢ ∀ (x : ℕ), x ∈ divisors n → f x = ↑(Units.coeHom R) (if h : 0 < x then Units.mk0 (f x) (_ : f x ≠ 0) else 1)
case refine'_1
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
⊢ ∏ i in divisors n, f i = g n ↔
    (∏ i in divisors n, if h : 0 < i then Units.mk0 (f i) (_ : f i ≠ 0) else 1) =
      if h : 0 < n then Units.mk0 (g n) (_ : g n ≠ 0) else 1
rw [dif_pos hn, ← Units.eq_iff, ← Units.coeHom_apply, map_prod, Units.val_mk0,
  prod_congr rfl _]
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
x : ℕ
hx : x ∈ divisors n
⊢ f x = ↑(Units.coeHom R) (if h : 0 < x then Units.mk0 (f x) (_ : f x ≠ 0) else 1)
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
⊢ ∀ (x : ℕ), x ∈ divisors n → f x = ↑(Units.coeHom R) (if h : 0 < x then Units.mk0 (f x) (_ : f x ≠ 0) else 1)
intro x hx
no goals
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
x : ℕ
hx : x ∈ divisors n
⊢ f x = ↑(Units.coeHom R) (if h : 0 < x then Units.mk0 (f x) (_ : f x ≠ 0) else 1)
rw [dif_pos (Nat.pos_of_mem_divisors hx), Units.coeHom_apply, Units.val_mk0]
case refine'_2
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
⊢ (∏ x in divisorsAntidiagonal n, (if h : 0 < x.snd then Units.mk0 (g x.snd) (_ : g x.snd ≠ 0) else 1) ^ ↑μ x.fst =
      if h : 0 < n then Units.mk0 (f n) (_ : f n ≠ 0) else 1) ↔
    ∏ x in divisorsAntidiagonal n, g x.snd ^ ↑μ x.fst = f n
case refine'_2
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
⊢ (∏ x in divisorsAntidiagonal n, (if h : 0 < x.snd then Units.mk0 (g x.snd) (_ : g x.snd ≠ 0) else 1) ^ ↑μ x.fst =
      if h : 0 < n then Units.mk0 (f n) (_ : f n ≠ 0) else 1) ↔
    ∏ x in divisorsAntidiagonal n, g x.snd ^ ↑μ x.fst = f n
dsimp
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
⊢ ∀ (x : ℕ × ℕ),
    x ∈ divisorsAntidiagonal n →
      ↑(Units.coeHom R) ((if h : 0 < x.snd then Units.mk0 (g x.snd) (_ : g x.snd ≠ 0) else 1) ^ ↑μ x.fst) =
        g x.snd ^ ↑μ x.fst
case refine'_2
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
⊢ (∏ x in divisorsAntidiagonal n, (if h : 0 < x.snd then Units.mk0 (g x.snd) (_ : g x.snd ≠ 0) else 1) ^ ↑μ x.fst =
      if h : 0 < n then Units.mk0 (f n) (_ : f n ≠ 0) else 1) ↔
    ∏ x in divisorsAntidiagonal n, g x.snd ^ ↑μ x.fst = f n
rw [dif_pos hn, ← Units.eq_iff, ← Units.coeHom_apply, map_prod, Units.val_mk0,
  prod_congr rfl _]
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
x : ℕ × ℕ
hx : x ∈ divisorsAntidiagonal n
⊢ ↑(Units.coeHom R) ((if h : 0 < x.snd then Units.mk0 (g x.snd) (_ : g x.snd ≠ 0) else 1) ^ ↑μ x.fst) =
    g x.snd ^ ↑μ x.fst
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
⊢ ∀ (x : ℕ × ℕ),
    x ∈ divisorsAntidiagonal n →
      ↑(Units.coeHom R) ((if h : 0 < x.snd then Units.mk0 (g x.snd) (_ : g x.snd ≠ 0) else 1) ^ ↑μ x.fst) =
        g x.snd ^ ↑μ x.fst
intro x hx
no goals
R : Type u_1
inst✝ : CommGroupWithZero R
f g : ℕ → R
hf : ∀ (n : ℕ), 0 < n → f n ≠ 0
hg : ∀ (n : ℕ), 0 < n → g n ≠ 0
n : ℕ
hn : 0 < n
x : ℕ × ℕ
hx : x ∈ divisorsAntidiagonal n
⊢ ↑(Units.coeHom R) ((if h : 0 < x.snd then Units.mk0 (g x.snd) (_ : g x.snd ≠ 0) else 1) ^ ↑μ x.fst) =
    g x.snd ^ ↑μ x.fst
rw [dif_pos (Nat.pos_of_mem_divisors (Nat.snd_mem_divisors_of_mem_antidiagonal hx)),
  Units.coeHom_apply, Units.val_zpow_eq_zpow_val, Units.val_mk0]