no goals
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hn : n = 0
⊢ False
simp_all
no goals
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d = 0
⊢ False
simp_all
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
⊢ padicValRat p q =
    ↑(Part.get (multiplicity (↑p) n) (_ : multiplicity.Finite (↑p) n)) -
      ↑(Part.get (multiplicity (↑p) d) (_ : multiplicity.Finite (↑p) d))
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
⊢ padicValRat p q =
    ↑(Part.get (multiplicity (↑p) n) (_ : multiplicity.Finite (↑p) n)) -
      ↑(Part.get (multiplicity (↑p) d) (_ : multiplicity.Finite (↑p) d))
have hd : d ≠ 0 := Rat.mk_denom_ne_zero_of_ne_zero hqz qdf
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
c : ℤ
hc1 : n = c * q.num
hc2 : d = c * ↑q.den
⊢ padicValRat p q =
    ↑(Part.get (multiplicity (↑p) n) (_ : multiplicity.Finite (↑p) n)) -
      ↑(Part.get (multiplicity (↑p) d) (_ : multiplicity.Finite (↑p) d))
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
⊢ padicValRat p q =
    ↑(Part.get (multiplicity (↑p) n) (_ : multiplicity.Finite (↑p) n)) -
      ↑(Part.get (multiplicity (↑p) d) (_ : multiplicity.Finite (↑p) d))
let ⟨c, hc1, hc2⟩ := Rat.num_den_mk hd qdf
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
c : ℤ
hc1 : n = c * q.num
hc2 : d = c * ↑q.den
⊢ ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom)) =
    ↑(Part.get (multiplicity (↑p) n) (_ : multiplicity.Finite (↑p) n)) -
      ↑(Part.get (multiplicity (↑p) d) (_ : multiplicity.Finite (↑p) d))
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
c : ℤ
hc1 : n = c * q.num
hc2 : d = c * ↑q.den
⊢ padicValRat p q =
    ↑(Part.get (multiplicity (↑p) n) (_ : multiplicity.Finite (↑p) n)) -
      ↑(Part.get (multiplicity (↑p) d) (_ : multiplicity.Finite (↑p) d))
rw [padicValRat.multiplicity_sub_multiplicity hp.1.ne_one hqz]
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
c : ℤ
hc1 : n = c * q.num
hc2 : d = c * ↑q.den
⊢ ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom)) =
    ↑(Part.get (multiplicity (↑p) (c * q.num)) (_ : (multiplicity (↑p) (c * q.num)).Dom)) -
      ↑(Part.get (multiplicity (↑p) (c * ↑q.den)) (_ : (multiplicity (↑p) (c * ↑q.den)).Dom))
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
c : ℤ
hc1 : n = c * q.num
hc2 : d = c * ↑q.den
⊢ ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom)) =
    ↑(Part.get (multiplicity (↑p) n) (_ : multiplicity.Finite (↑p) n)) -
      ↑(Part.get (multiplicity (↑p) d) (_ : multiplicity.Finite (↑p) d))
simp only [Nat.isUnit_iff, hc1, hc2]
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
c : ℤ
hc1 : n = c * q.num
hc2 : d = c * ↑q.den
⊢ ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom)) =
    ↑(Part.get (multiplicity (↑p) c) (_ : multiplicity.Finite (↑p) c) +
          Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity (↑p) c) (_ : multiplicity.Finite (↑p) c) +
          Part.get (multiplicity ↑p ↑q.den) (_ : multiplicity.Finite ↑p ↑q.den))
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
c : ℤ
hc1 : n = c * q.num
hc2 : d = c * ↑q.den
⊢ ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom)) =
    ↑(Part.get (multiplicity (↑p) (c * q.num)) (_ : (multiplicity (↑p) (c * q.num)).Dom)) -
      ↑(Part.get (multiplicity (↑p) (c * ↑q.den)) (_ : (multiplicity (↑p) (c * ↑q.den)).Dom))
rw [multiplicity.mul' (Nat.prime_iff_prime_int.1 hp.1),
  multiplicity.mul' (Nat.prime_iff_prime_int.1 hp.1)]
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
c : ℤ
hc1 : n = c * q.num
hc2 : d = c * ↑q.den
⊢ ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom)) =
    ↑(Part.get (multiplicity (↑p) c) (_ : multiplicity.Finite (↑p) c)) +
        ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      (↑(Part.get (multiplicity (↑p) c) (_ : multiplicity.Finite (↑p) c)) +
        ↑(Part.get (multiplicity ↑p ↑q.den) (_ : multiplicity.Finite ↑p ↑q.den)))
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
c : ℤ
hc1 : n = c * q.num
hc2 : d = c * ↑q.den
⊢ ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom)) =
    ↑(Part.get (multiplicity (↑p) c) (_ : multiplicity.Finite (↑p) c) +
          Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity (↑p) c) (_ : multiplicity.Finite (↑p) c) +
          Part.get (multiplicity ↑p ↑q.den) (_ : multiplicity.Finite ↑p ↑q.den))
rw [Nat.cast_add, Nat.cast_add]
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
c : ℤ
hc1 : n = c * q.num
hc2 : d = c * ↑q.den
⊢ ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom)) =
    ↑(Part.get (multiplicity (↑p) c) (_ : multiplicity.Finite (↑p) c)) +
        ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      (↑(Part.get (multiplicity (↑p) c) (_ : multiplicity.Finite (↑p) c)) +
        ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom)))
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
c : ℤ
hc1 : n = c * q.num
hc2 : d = c * ↑q.den
⊢ ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom)) =
    ↑(Part.get (multiplicity (↑p) c) (_ : multiplicity.Finite (↑p) c)) +
        ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      (↑(Part.get (multiplicity (↑p) c) (_ : multiplicity.Finite (↑p) c)) +
        ↑(Part.get (multiplicity ↑p ↑q.den) (_ : multiplicity.Finite ↑p ↑q.den)))
simp_rw [Int.coe_nat_multiplicity p q.den]
no goals
p✝ : ℕ
hp✝ : Fact (Nat.Prime p✝)
p : ℕ
hp : Fact (Nat.Prime p)
q : ℚ
n d : ℤ
hqz : q ≠ 0
qdf : q = n /. d
hd : d ≠ 0
c : ℤ
hc1 : n = c * q.num
hc2 : d = c * ↑q.den
⊢ ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom)) =
    ↑(Part.get (multiplicity (↑p) c) (_ : multiplicity.Finite (↑p) c)) +
        ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      (↑(Part.get (multiplicity (↑p) c) (_ : multiplicity.Finite (↑p) c)) +
        ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom)))
ring