|
| 1 | +/- |
| 2 | +Copyright (c) 2025 Chris Birkbeck. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Chris Birkbeck |
| 5 | +-/ |
| 6 | +import Mathlib.NumberTheory.Divisors |
| 7 | +import Mathlib.Data.PNat.Defs |
| 8 | + |
| 9 | +/-! |
| 10 | +# Lemmas on infinite sums over the antidiagonal of the divisors function |
| 11 | +
|
| 12 | +This file contains lemmas about the antidiagonal of the divisors function. It defines the map from |
| 13 | +`Nat.divisorsAntidiagonal n` to `ℕ+ × ℕ+` given by sending `n = a * b` to `(a, b)`. |
| 14 | +
|
| 15 | +-/ |
| 16 | + |
| 17 | +/-- The map from `Nat.divisorsAntidiagonal n` to `ℕ+ × ℕ+` given by sending `n = a * b` |
| 18 | +to `(a , b)`. -/ |
| 19 | +def divisorsAntidiagonalFactors (n : ℕ+) : Nat.divisorsAntidiagonal n → ℕ+ × ℕ+ := |
| 20 | + fun x ↦ |
| 21 | + ⟨⟨x.1.1, Nat.pos_of_mem_divisors (Nat.fst_mem_divisors_of_mem_antidiagonal x.2)⟩, |
| 22 | + (⟨x.1.2, Nat.pos_of_mem_divisors (Nat.snd_mem_divisors_of_mem_antidiagonal x.2)⟩ : ℕ+), |
| 23 | + Nat.pos_of_mem_divisors (Nat.snd_mem_divisors_of_mem_antidiagonal x.2)⟩ |
| 24 | + |
| 25 | +lemma divisorsAntidiagonalFactors_eq {n : ℕ+} (x : Nat.divisorsAntidiagonal n) : |
| 26 | + (divisorsAntidiagonalFactors n x).1.1 * (divisorsAntidiagonalFactors n x).2.1 = n := by |
| 27 | + simp [divisorsAntidiagonalFactors, (Nat.mem_divisorsAntidiagonal.mp x.2).1] |
| 28 | + |
| 29 | +lemma divisorsAntidiagonalFactors_one (x : Nat.divisorsAntidiagonal 1) : |
| 30 | + (divisorsAntidiagonalFactors 1 x) = (1, 1) := by |
| 31 | + have h := Nat.mem_divisorsAntidiagonal.mp x.2 |
| 32 | + simp only [mul_eq_one, ne_eq, one_ne_zero, not_false_eq_true, and_true] at h |
| 33 | + simp [divisorsAntidiagonalFactors, h.1, h.2] |
| 34 | + |
| 35 | +/-- The equivalence from the union over `n` of `Nat.divisorsAntidiagonal n` to `ℕ+ × ℕ+` |
| 36 | +given by sending `n = a * b` to `(a , b)`. -/ |
| 37 | +def sigmaAntidiagonalEquivProd : (Σ n : ℕ+, Nat.divisorsAntidiagonal n) ≃ ℕ+ × ℕ+ where |
| 38 | + toFun x := divisorsAntidiagonalFactors x.1 x.2 |
| 39 | + invFun x := |
| 40 | + ⟨⟨x.1.val * x.2.val, mul_pos x.1.2 x.2.2⟩, ⟨x.1, x.2⟩, by simp [Nat.mem_divisorsAntidiagonal]⟩ |
| 41 | + left_inv := by |
| 42 | + rintro ⟨n, ⟨k, l⟩, h⟩ |
| 43 | + rw [Nat.mem_divisorsAntidiagonal] at h |
| 44 | + ext <;> simp [divisorsAntidiagonalFactors, ← PNat.coe_injective.eq_iff, h.1] |
| 45 | + right_inv _ := rfl |
| 46 | + |
| 47 | +lemma sigmaAntidiagonalEquivProd_symm_apply_fst (x : ℕ+ × ℕ+) : |
| 48 | + (sigmaAntidiagonalEquivProd.symm x).1 = x.1.1 * x.2.1 := rfl |
| 49 | + |
| 50 | +lemma sigmaAntidiagonalEquivProd_symm_apply_snd (x : ℕ+ × ℕ+) : |
| 51 | + (sigmaAntidiagonalEquivProd.symm x).2 = (x.1.1, x.2.1) := rfl |
0 commit comments