Zulip Chat Archive
Stream: Is there code for X?
Topic: div by p_adic_val_nat is coprime
Chris Birkbeck (Jun 06 2022 at 13:18):
Do we have :
lemma p_val_nat_div_coprime (a p : ℕ) (ha : 0 < a ) (hp: 0 < p):
coprime p (a/ p^(padic_val_nat p a)) :=
(Maybe this needs prime p
, but I think the padic_val_nat
should work fine in this case).
Yaël Dillies (Jun 06 2022 at 14:37):
It doesn't need prime
. Instead it needs squarefree
.
Yaël Dillies (Jun 06 2022 at 14:38):
Trouble happens when padic_val_nat
is the "true valuation", but rounded down. For example 2 / 4 ^ padic_val_nat 4 2
is 2
, not 1
.
Stuart Presnell (Jun 06 2022 at 14:40):
I've just PRed (#14576) a version of this for factorization
, which uses an assumption of prime p
.
Chris Birkbeck (Jun 06 2022 at 14:44):
Yaël Dillies said:
Trouble happens when
padic_val_nat
is the "true valuation", but rounded down. For example2 / 4 ^ padic_val_nat 4 2
is2
, not1
.
ah good point! tbh all I need is the prime case
Chris Birkbeck (Jun 06 2022 at 14:45):
Stuart Presnell said:
I've just PRed (#14576) a version of this for
factorization
, which uses an assumption ofprime p
.
Great!
Stuart Presnell (Jun 09 2022 at 09:26):
Yaël Dillies said:
It doesn't need
prime
. Instead it needssquarefree
.
Coming back to this: squarefree
isn't the relevant criterion, what's needed is coprime p n
. For example, when n = 21
and p = 15
we have padic_val_nat p n = 0
and so coprime p (n / p ^ (padic_val_nat p n))
is false.
So, using the generalised pow_padic_val_nat_dvd
I've PRed in #14637, we have
example {n p : ℕ} (hpn : p.coprime n) :
coprime p (n / p ^ (padic_val_nat p n)) :=
coprime.coprime_div_right hpn (pow_padic_val_nat_dvd p n)
Yaël Dillies (Jun 09 2022 at 09:27):
But... coprime p n
means that padic_val_nat p n = 0
, so you're just restating coprime p n
in a complicated way.
Stuart Presnell (Jun 09 2022 at 09:28):
Oh, of course
Stuart Presnell (Jun 09 2022 at 09:30):
So how does squarefree
help here?
Yaël Dillies (Jun 09 2022 at 09:32):
It helps if you assume p ∣ n
on top.
Yaël Dillies (Jun 09 2022 at 09:32):
Well, actually no it doesn't really seem to help.
Mario Carneiro (Jun 09 2022 at 09:40):
A quick unit test suggests that \forall a > 0, coprime p (a/ p^(padic_val_nat p a))
is true exactly when prime p
or p = 1
Mario Carneiro (Jun 09 2022 at 09:40):
the p = 1 case is boring since everything is coprime to 1
Mario Carneiro (Jun 09 2022 at 09:45):
The counterexample is: if p = a * b
where a, b > 1, then padic_val_nat p a = 0
so a / p^(padic_val_nat p a) = a
but gcd p a = a != 1
Stuart Presnell (Jun 09 2022 at 10:04):
So that suggests that there's no further interesting generalisation beyond coprime_of_div_pow_factorization
in #14576.
Chris Birkbeck (Jun 09 2022 at 16:57):
The prime case is the only one I need so I'm happy with that
Stuart Presnell (Jun 15 2022 at 15:01):
Chris Birkbeck said:
The prime case is the only one I need so I'm happy with that
#14576 is merged now, so docs#nat.coprime_of_div_pow_factorization should be available
Chris Birkbeck (Jun 15 2022 at 15:12):
Great, thank you!
Last updated: Dec 20 2023 at 11:08 UTC