Skip to content

Commit

Permalink
feat(NumberTheory/Padics/PadicVal): Add `padicValNat_mul_pow_left/rig…
Browse files Browse the repository at this point in the history
…ht` (#11354)

Add two theorems solving goals of this form: for any primes `p` and `q` such that `p != q`, `padicValNat p (p^n * q^m) = n`




Co-authored-by: Gaëtan Serré <56162277+gaetanserre@users.noreply.github.com>
  • Loading branch information
gaetanserre and gaetanserre committed Apr 5, 2024
1 parent 2baa320 commit 62cf98c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Mathlib/NumberTheory/Padics/PadicVal.lean
Expand Up @@ -584,6 +584,20 @@ theorem padicValNat_primes {q : ℕ} [hp : Fact p.Prime] [hq : Fact q.Prime] (ne
(not_congr (Iff.symm (prime_dvd_prime_iff_eq hp.1 hq.1))).mp neq
#align padic_val_nat_primes padicValNat_primes

theorem padicValNat_prime_prime_pow {q : ℕ} [hp : Fact p.Prime] [hq : Fact q.Prime]
(n : ℕ) (neq : p ≠ q) : padicValNat p (q ^ n) = 0 := by
rw [padicValNat.pow _ <| Nat.Prime.ne_zero hq.elim, padicValNat_primes neq, mul_zero]

theorem padicValNat_mul_pow_left {q : ℕ} [hp : Fact p.Prime] [hq : Fact q.Prime]
(n m : ℕ) (neq : p ≠ q) : padicValNat p (p^n * q^m) = n := by
rw [padicValNat.mul (NeZero.ne' (p^n)).symm (NeZero.ne' (q^m)).symm,
padicValNat.prime_pow, padicValNat_prime_prime_pow m neq, add_zero]

theorem padicValNat_mul_pow_right {q : ℕ} [hp : Fact p.Prime] [hq : Fact q.Prime]
(n m : ℕ) (neq : q ≠ p) : padicValNat q (p^n * q^m) = m := by
rw [mul_comm (p^n) (q^m)]
exact padicValNat_mul_pow_left m n neq

/-- The p-adic valuation of `n` is less than or equal to its logarithm w.r.t `p`.-/
lemma padicValNat_le_nat_log (n : ℕ) : padicValNat p n ≤ Nat.log p n := by
rcases n with _ | n
Expand Down

0 comments on commit 62cf98c

Please sign in to comment.