Skip to content

Commit 3b50a83

Browse files
CBirkbeckPaul-Lez
authored andcommitted
feat(NumberTheory/Divisors): add divisorAntidiagonal equivalence. (leanprover-community#27837)
1 parent 776b3db commit 3b50a83

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4825,6 +4825,7 @@ import Mathlib.NumberTheory.Transcendental.Liouville.LiouvilleNumber
48254825
import Mathlib.NumberTheory.Transcendental.Liouville.LiouvilleWith
48264826
import Mathlib.NumberTheory.Transcendental.Liouville.Measure
48274827
import Mathlib.NumberTheory.Transcendental.Liouville.Residual
4828+
import Mathlib.NumberTheory.TsumDivsorsAntidiagonal
48284829
import Mathlib.NumberTheory.VonMangoldt
48294830
import Mathlib.NumberTheory.WellApproximable
48304831
import Mathlib.NumberTheory.Wilson
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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

Comments
 (0)