Zulip Chat Archive

Stream: Is there code for X?

Topic: Moebius Inversion on a subset of ℕ


Arend Mellendijk (Jun 23 2023 at 09:23):

I have two functions f g : ℕ → ℝ and a natural number S and I know that (f*ζ) n = g n for all n ∣ S, where * denotes Dirichlet convolution. I want to be able to conclude that f n = (g*μ) n for all n ∣ S, but the standard Moebius inversion results (e.g. docs#Nat.ArithmeticFunction.sum_eq_iff_sum_smul_moebius_eq) require the equalities hold for all positive n. Ideally there would be something like

theorem sum_eq_iff_sum_smul_moebius_eq' [AddCommGroup R] {f g :   R}
  (P :   Prop) (hP :  m n, m  n  P n  P m) :
    ( n : , 0 < n  P n  ( i in n.divisors, f i) = g n) 
      n : , 0 < n  P n  ( x :  ×  in n.divisorsAntidiagonal, μ x.fst  g x.snd) = f n

so the condition n ∣ S could be replaced by say Squarefree n.

I do have a workaround for my application but it's a bit of a painful change of variables. Is there a better way to do this?

Kevin Buzzard (Jun 23 2023 at 10:47):

I can believe it's not there :-( One way to prove this would be to define new functions F and G which equal f and g on the naturals satisfying P and are 0 outside, and then applying standard Moebius inversion to F and G and then working back to f and g.

Arend Mellendijk (Jun 23 2023 at 12:40):

Right - what I ran into when I tried that in an ad-hoc way was that you could have (F*ζ)(2*S) ≠ 0 = G (2*S), so the result I linked doesn't directly apply. You'd need to work directly with the fact that ζ*μ=1, at which point you also have to make F and G an ArithmeticFunctionand you're just repeating the proof of docs#Nat.ArithmeticFunction.sum_eq_iff_sum_smul_moebius_eq in a slightly more general context.

Arend Mellendijk (Jun 23 2023 at 13:09):

Thinking about it some more, what you'd actually have to do is define F as equal to f on P and 0 outside, and define G=F*ζ. Then the standard result applies and on P we get f=F and g=G.

Arend Mellendijk (Jun 23 2023 at 14:57):

It works! Sadly you do have to swap the definitions of F and G going the other way, so I've had to prove both directions separately.

The code

Kevin Buzzard (Jun 23 2023 at 15:00):

Oh nice! Could I ask you to PR it to mathlib4? It's the most efficient way to get someone to review your code :-)

Arend Mellendijk (Jun 23 2023 at 15:14):

If someone could give me write access, sure :) My username is FLDutchmann

Kevin Buzzard (Jun 23 2023 at 15:17):

@maintainers

Anne Baanen (Jun 23 2023 at 15:18):

Invite sent!

Arend Mellendijk (Jun 23 2023 at 15:20):

Got it! Thank you.

Arend Mellendijk (Jun 24 2023 at 10:18):

Opened #5445


Last updated: Dec 20 2023 at 11:08 UTC