Theorem: Nat.ArithmeticFunction.mul_smul'
File: Mathlib/NumberTheory/ArithmeticFunction.lean

tactic: ext n
state_before: R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
⊢ (f * g) • h = f • g • h

tactic: simp only [mul_apply, smul_apply, sum_smul, mul_smul, smul_sum, Finset.sum_sigma']
state_before: case h
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n : ℕ
⊢ ↑((f * g) • h) n = ↑(f • g • h) n

tactic: apply Finset.sum_bij
state_before: case h
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n : ℕ
⊢ ∑ x in Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst,
      ↑f x.snd.fst • ↑g x.snd.snd • ↑h x.fst.snd =
    ∑ x in Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.snd,
      ↑f x.fst.fst • ↑g x.snd.fst • ↑h x.snd.snd

tactic: pick_goal 5
state_before: case h.hi
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n : ℕ
⊢ ∀ (a : (_ : ℕ × ℕ) × ℕ × ℕ) (ha : a ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst),
    ?h.i a ha ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.snd

case h.h
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n : ℕ
⊢ ∀ (a : (_ : ℕ × ℕ) × ℕ × ℕ) (ha : a ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst),
    ↑f a.snd.fst • ↑g a.snd.snd • ↑h a.fst.snd =
      ↑f (?h.i a ha).fst.fst • ↑g (?h.i a ha).snd.fst • ↑h (?h.i a ha).snd.snd

case h.i_inj
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n : ℕ
⊢ ∀ (a₁ a₂ : (_ : ℕ × ℕ) × ℕ × ℕ) (ha₁ : a₁ ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst)
    (ha₂ : a₂ ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst),
    ?h.i a₁ ha₁ = ?h.i a₂ ha₂ → a₁ = a₂

case h.i_surj
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n : ℕ
⊢ ∀ (b : (_ : ℕ × ℕ) × ℕ × ℕ),
    (b ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.snd) → ∃ a ha, b = ?h.i a ha

case h.i
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n : ℕ
⊢ (a : (_ : ℕ × ℕ) × ℕ × ℕ) →
    (a ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ

tactic: rintro ⟨⟨i, j⟩, ⟨k, l⟩⟩ _H
state_before: case h.i
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n : ℕ
⊢ (a : (_ : ℕ × ℕ) × ℕ × ℕ) →
    (a ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ

tactic: exact ⟨(k, l * j), (l, j)⟩
state_before: case h.i.mk.mk.mk
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n i j k l : ℕ
_H : { fst := (i, j), snd := (k, l) } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst
⊢ (_ : ℕ × ℕ) × ℕ × ℕ

tactic: rintro ⟨⟨i, j⟩, ⟨k, l⟩⟩ H
state_before: case h.hi
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n : ℕ
⊢ ∀ (a : (_ : ℕ × ℕ) × ℕ × ℕ) (ha : a ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst),
    Sigma.casesOn (motive := fun x =>
        (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ) a
        (fun fst snd =>
          Prod.casesOn (motive := fun x =>
            ({ fst := x, snd := snd } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
              (_ : ℕ × ℕ) × ℕ × ℕ)
            fst fun i j =>
            Prod.casesOn (motive := fun x =>
              ({ fst := (i, j), snd := x } ∈
                  Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                (_ : ℕ × ℕ) × ℕ × ℕ)
              snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
        ha ∈
      Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.snd

tactic: simp only [Finset.mem_sigma, mem_divisorsAntidiagonal] at H⊢
state_before: case h.hi.mk.mk.mk
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n i j k l : ℕ
H : { fst := (i, j), snd := (k, l) } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst
⊢ Sigma.casesOn (motive := fun x =>
      (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ)
      { fst := (i, j), snd := (k, l) }
      (fun fst snd =>
        Prod.casesOn (motive := fun x =>
          ({ fst := x, snd := snd } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
            (_ : ℕ × ℕ) × ℕ × ℕ)
          fst fun i j =>
          Prod.casesOn (motive := fun x =>
            ({ fst := (i, j), snd := x } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
              (_ : ℕ × ℕ) × ℕ × ℕ)
            snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
      H ∈
    Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.snd

tactic: rcases H with ⟨⟨rfl, n0⟩, rfl, i0⟩
state_before: case h.hi.mk.mk.mk
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n i j k l : ℕ
H : (i * j = n ∧ n ≠ 0) ∧ k * l = i ∧ i ≠ 0
⊢ (k * (l * j) = n ∧ n ≠ 0) ∧ True ∧ l * j ≠ 0

tactic: refine' ⟨⟨(mul_assoc _ _ _).symm, n0⟩, trivial, _⟩
state_before: case h.hi.mk.mk.mk.intro.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
j k l : ℕ
n0 : k * l * j ≠ 0
i0 : k * l ≠ 0
⊢ (k * (l * j) = k * l * j ∧ k * l * j ≠ 0) ∧ True ∧ l * j ≠ 0

tactic: rw [mul_ne_zero_iff] at *
state_before: case h.hi.mk.mk.mk.intro.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
j k l : ℕ
n0 : k * l * j ≠ 0
i0 : k * l ≠ 0
⊢ l * j ≠ 0

tactic: exact ⟨i0.2, n0.2⟩
state_before: case h.hi.mk.mk.mk.intro.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
j k l : ℕ
n0 : k * l ≠ 0 ∧ j ≠ 0
i0 : k ≠ 0 ∧ l ≠ 0
⊢ l ≠ 0 ∧ j ≠ 0

tactic: rintro ⟨⟨i, j⟩, ⟨k, l⟩⟩ _H
state_before: case h.h
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n : ℕ
⊢ ∀ (a : (_ : ℕ × ℕ) × ℕ × ℕ) (ha : a ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst),
    ↑f a.snd.fst • ↑g a.snd.snd • ↑h a.fst.snd =
      ↑f
          (Sigma.casesOn (motive := fun x =>
                (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ) a
                (fun fst snd =>
                  Prod.casesOn (motive := fun x =>
                    ({ fst := x, snd := snd } ∈
                        Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                      (_ : ℕ × ℕ) × ℕ × ℕ)
                    fst fun i j =>
                    Prod.casesOn (motive := fun x =>
                      ({ fst := (i, j), snd := x } ∈
                          Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                        (_ : ℕ × ℕ) × ℕ × ℕ)
                      snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
                ha).fst.fst •
        ↑g
            (Sigma.casesOn (motive := fun x =>
                  (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ)
                  a
                  (fun fst snd =>
                    Prod.casesOn (motive := fun x =>
                      ({ fst := x, snd := snd } ∈
                          Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                        (_ : ℕ × ℕ) × ℕ × ℕ)
                      fst fun i j =>
                      Prod.casesOn (motive := fun x =>
                        ({ fst := (i, j), snd := x } ∈
                            Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                          (_ : ℕ × ℕ) × ℕ × ℕ)
                        snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
                  ha).snd.fst •
          ↑h
            (Sigma.casesOn (motive := fun x =>
                  (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ)
                  a
                  (fun fst snd =>
                    Prod.casesOn (motive := fun x =>
                      ({ fst := x, snd := snd } ∈
                          Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                        (_ : ℕ × ℕ) × ℕ × ℕ)
                      fst fun i j =>
                      Prod.casesOn (motive := fun x =>
                        ({ fst := (i, j), snd := x } ∈
                            Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                          (_ : ℕ × ℕ) × ℕ × ℕ)
                        snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
                  ha).snd.snd

tactic: simp only [mul_assoc]
state_before: case h.h.mk.mk.mk
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n i j k l : ℕ
_H : { fst := (i, j), snd := (k, l) } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst
⊢ ↑f { fst := (i, j), snd := (k, l) }.snd.fst •
      ↑g { fst := (i, j), snd := (k, l) }.snd.snd • ↑h { fst := (i, j), snd := (k, l) }.fst.snd =
    ↑f
        (Sigma.casesOn (motive := fun x =>
              (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ)
              { fst := (i, j), snd := (k, l) }
              (fun fst snd =>
                Prod.casesOn (motive := fun x =>
                  ({ fst := x, snd := snd } ∈
                      Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                    (_ : ℕ × ℕ) × ℕ × ℕ)
                  fst fun i j =>
                  Prod.casesOn (motive := fun x =>
                    ({ fst := (i, j), snd := x } ∈
                        Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                      (_ : ℕ × ℕ) × ℕ × ℕ)
                    snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
              _H).fst.fst •
      ↑g
          (Sigma.casesOn (motive := fun x =>
                (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ)
                { fst := (i, j), snd := (k, l) }
                (fun fst snd =>
                  Prod.casesOn (motive := fun x =>
                    ({ fst := x, snd := snd } ∈
                        Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                      (_ : ℕ × ℕ) × ℕ × ℕ)
                    fst fun i j =>
                    Prod.casesOn (motive := fun x =>
                      ({ fst := (i, j), snd := x } ∈
                          Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                        (_ : ℕ × ℕ) × ℕ × ℕ)
                      snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
                _H).snd.fst •
        ↑h
          (Sigma.casesOn (motive := fun x =>
                (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ)
                { fst := (i, j), snd := (k, l) }
                (fun fst snd =>
                  Prod.casesOn (motive := fun x =>
                    ({ fst := x, snd := snd } ∈
                        Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                      (_ : ℕ × ℕ) × ℕ × ℕ)
                    fst fun i j =>
                    Prod.casesOn (motive := fun x =>
                      ({ fst := (i, j), snd := x } ∈
                          Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                        (_ : ℕ × ℕ) × ℕ × ℕ)
                      snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
                _H).snd.snd

tactic: rintro ⟨⟨a, b⟩, ⟨c, d⟩⟩ ⟨⟨i, j⟩, ⟨k, l⟩⟩ H₁ H₂
state_before: case h.i_inj
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n : ℕ
⊢ ∀ (a₁ a₂ : (_ : ℕ × ℕ) × ℕ × ℕ) (ha₁ : a₁ ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst)
    (ha₂ : a₂ ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst),
    Sigma.casesOn (motive := fun x =>
          (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ) a₁
          (fun fst snd =>
            Prod.casesOn (motive := fun x =>
              ({ fst := x, snd := snd } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                (_ : ℕ × ℕ) × ℕ × ℕ)
              fst fun i j =>
              Prod.casesOn (motive := fun x =>
                ({ fst := (i, j), snd := x } ∈
                    Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                  (_ : ℕ × ℕ) × ℕ × ℕ)
                snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
          ha₁ =
        Sigma.casesOn (motive := fun x =>
          (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ) a₂
          (fun fst snd =>
            Prod.casesOn (motive := fun x =>
              ({ fst := x, snd := snd } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                (_ : ℕ × ℕ) × ℕ × ℕ)
              fst fun i j =>
              Prod.casesOn (motive := fun x =>
                ({ fst := (i, j), snd := x } ∈
                    Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                  (_ : ℕ × ℕ) × ℕ × ℕ)
                snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
          ha₂ →
      a₁ = a₂

tactic: simp only [Finset.mem_sigma, mem_divisorsAntidiagonal, and_imp, Prod.mk.inj_iff, add_comm,
  heq_iff_eq] at H₁ H₂⊢
state_before: case h.i_inj.mk.mk.mk.mk.mk.mk
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n a b c d i j k l : ℕ
H₁ : { fst := (a, b), snd := (c, d) } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst
H₂ : { fst := (i, j), snd := (k, l) } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst
⊢ Sigma.casesOn (motive := fun x =>
        (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ)
        { fst := (a, b), snd := (c, d) }
        (fun fst snd =>
          Prod.casesOn (motive := fun x =>
            ({ fst := x, snd := snd } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
              (_ : ℕ × ℕ) × ℕ × ℕ)
            fst fun i j =>
            Prod.casesOn (motive := fun x =>
              ({ fst := (i, j), snd := x } ∈
                  Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                (_ : ℕ × ℕ) × ℕ × ℕ)
              snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
        H₁ =
      Sigma.casesOn (motive := fun x =>
        (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ)
        { fst := (i, j), snd := (k, l) }
        (fun fst snd =>
          Prod.casesOn (motive := fun x =>
            ({ fst := x, snd := snd } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
              (_ : ℕ × ℕ) × ℕ × ℕ)
            fst fun i j =>
            Prod.casesOn (motive := fun x =>
              ({ fst := (i, j), snd := x } ∈
                  Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                (_ : ℕ × ℕ) × ℕ × ℕ)
              snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
        H₂ →
    { fst := (a, b), snd := (c, d) } = { fst := (i, j), snd := (k, l) }

tactic: simp only [Sigma.mk.inj_iff, Prod.mk.injEq, heq_eq_eq, and_imp]
state_before: case h.i_inj.mk.mk.mk.mk.mk.mk
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n a b c d i j k l : ℕ
H₁ : (a * b = n ∧ n ≠ 0) ∧ c * d = a ∧ a ≠ 0
H₂ : (i * j = n ∧ n ≠ 0) ∧ k * l = i ∧ i ≠ 0
⊢ { fst := (c, d * b), snd := (d, b) } = { fst := (k, l * j), snd := (l, j) } →
    { fst := (a, b), snd := (c, d) } = { fst := (i, j), snd := (k, l) }

tactic: rintro h h2 rfl rfl
state_before: case h.i_inj.mk.mk.mk.mk.mk.mk
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n a b c d i j k l : ℕ
H₁ : (a * b = n ∧ n ≠ 0) ∧ c * d = a ∧ a ≠ 0
H₂ : (i * j = n ∧ n ≠ 0) ∧ k * l = i ∧ i ≠ 0
⊢ c = k → d * b = l * j → d = l → b = j → (a = i ∧ b = j) ∧ c = k ∧ d = l

tactic: subst h
state_before: case h.i_inj.mk.mk.mk.mk.mk.mk
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h✝ : ArithmeticFunction M
n a b c d i k : ℕ
H₁ : (a * b = n ∧ n ≠ 0) ∧ c * d = a ∧ a ≠ 0
h : c = k
H₂ : (i * b = n ∧ n ≠ 0) ∧ k * d = i ∧ i ≠ 0
h2 : d * b = d * b
⊢ (a = i ∧ b = b) ∧ c = k ∧ d = d

tactic: exact ⟨⟨Eq.trans H₁.2.1.symm H₂.2.1, rfl⟩, rfl, rfl⟩
state_before: case h.i_inj.mk.mk.mk.mk.mk.mk
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n a b c d i : ℕ
H₁ : (a * b = n ∧ n ≠ 0) ∧ c * d = a ∧ a ≠ 0
h2 : d * b = d * b
H₂ : (i * b = n ∧ n ≠ 0) ∧ c * d = i ∧ i ≠ 0
⊢ (a = i ∧ b = b) ∧ c = c ∧ d = d

tactic: rintro ⟨⟨i, j⟩, ⟨k, l⟩⟩ H
state_before: case h.i_surj
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n : ℕ
⊢ ∀ (b : (_ : ℕ × ℕ) × ℕ × ℕ),
    (b ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.snd) →
      ∃ a ha,
        b =
          Sigma.casesOn (motive := fun x =>
            (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ) a
            (fun fst snd =>
              Prod.casesOn (motive := fun x =>
                ({ fst := x, snd := snd } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                  (_ : ℕ × ℕ) × ℕ × ℕ)
                fst fun i j =>
                Prod.casesOn (motive := fun x =>
                  ({ fst := (i, j), snd := x } ∈
                      Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                    (_ : ℕ × ℕ) × ℕ × ℕ)
                  snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
            ha

tactic: refine' ⟨⟨(i * k, l), (i, k)⟩, _, _⟩
state_before: case h.i_surj.mk.mk.mk
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n i j k l : ℕ
H : { fst := (i, j), snd := (k, l) } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.snd
⊢ ∃ a ha,
    { fst := (i, j), snd := (k, l) } =
      Sigma.casesOn (motive := fun x =>
        (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ) a
        (fun fst snd =>
          Prod.casesOn (motive := fun x =>
            ({ fst := x, snd := snd } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
              (_ : ℕ × ℕ) × ℕ × ℕ)
            fst fun i j =>
            Prod.casesOn (motive := fun x =>
              ({ fst := (i, j), snd := x } ∈
                  Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
                (_ : ℕ × ℕ) × ℕ × ℕ)
              snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
        ha

tactic: simp only [Finset.mem_sigma, mem_divisorsAntidiagonal] at H⊢
state_before: case h.i_surj.mk.mk.mk.refine'_1
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n i j k l : ℕ
H : { fst := (i, j), snd := (k, l) } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.snd
⊢ { fst := (i * k, l), snd := (i, k) } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst

tactic: rcases H with ⟨⟨rfl, n0⟩, rfl, j0⟩
state_before: case h.i_surj.mk.mk.mk.refine'_1
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n i j k l : ℕ
H : (i * j = n ∧ n ≠ 0) ∧ k * l = j ∧ j ≠ 0
⊢ (i * k * l = n ∧ n ≠ 0) ∧ True ∧ i * k ≠ 0

tactic: refine' ⟨⟨mul_assoc _ _ _, n0⟩, trivial, _⟩
state_before: case h.i_surj.mk.mk.mk.refine'_1.intro.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
i k l : ℕ
n0 : i * (k * l) ≠ 0
j0 : k * l ≠ 0
⊢ (i * k * l = i * (k * l) ∧ i * (k * l) ≠ 0) ∧ True ∧ i * k ≠ 0

tactic: rw [mul_ne_zero_iff] at *
state_before: case h.i_surj.mk.mk.mk.refine'_1.intro.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
i k l : ℕ
n0 : i * (k * l) ≠ 0
j0 : k * l ≠ 0
⊢ i * k ≠ 0

tactic: exact ⟨n0.1, j0.1⟩
state_before: case h.i_surj.mk.mk.mk.refine'_1.intro.intro.intro
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
i k l : ℕ
n0 : i ≠ 0 ∧ k * l ≠ 0
j0 : k ≠ 0 ∧ l ≠ 0
⊢ i ≠ 0 ∧ k ≠ 0

tactic: simp only [true_and_iff, mem_divisorsAntidiagonal, and_true_iff, Prod.mk.inj_iff,
  eq_self_iff_true, Ne.def, mem_sigma, heq_iff_eq] at H⊢
state_before: case h.i_surj.mk.mk.mk.refine'_2
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n i j k l : ℕ
H : { fst := (i, j), snd := (k, l) } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.snd
⊢ { fst := (i, j), snd := (k, l) } =
    Sigma.casesOn (motive := fun x =>
      (x ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) → (_ : ℕ × ℕ) × ℕ × ℕ)
      { fst := (i * k, l), snd := (i, k) }
      (fun fst snd =>
        Prod.casesOn (motive := fun x =>
          ({ fst := x, snd := snd } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
            (_ : ℕ × ℕ) × ℕ × ℕ)
          fst fun i j =>
          Prod.casesOn (motive := fun x =>
            ({ fst := (i, j), snd := x } ∈ Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst) →
              (_ : ℕ × ℕ) × ℕ × ℕ)
            snd fun k l _H => { fst := (k, l * j), snd := (l, j) })
      (_ :
        { fst := (i * k, l), snd := (i, k) } ∈
          Finset.sigma (divisorsAntidiagonal n) fun a => divisorsAntidiagonal a.fst)

tactic: rw [H.2.1]
state_before: case h.i_surj.mk.mk.mk.refine'_2
R : Type u_1
M : Type u_2
inst✝² : Semiring R
inst✝¹ : AddCommMonoid M
inst✝ : Module R M
f g : ArithmeticFunction R
h : ArithmeticFunction M
n i j k l : ℕ
H : (i * j = n ∧ ¬n = 0) ∧ k * l = j ∧ ¬j = 0
⊢ { fst := (i, j), snd := (k, l) } = { fst := (i, k * l), snd := (k, l) }