p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
⊢ padicValRat p (q * r) = padicValRat p q + padicValRat p r
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
⊢ padicValRat p (q * r) = padicValRat p q + padicValRat p r
have : q * r = q.num * r.num /. (q.den * r.den) := by rw_mod_cast [Rat.mul_num_den]
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
⊢ padicValRat p (q * r) = padicValRat p q + padicValRat p r
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
⊢ padicValRat p (q * r) = padicValRat p q + padicValRat p r
have hq' : q.num /. q.den ≠ 0 := by rwa [Rat.num_den]
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
hr' : r.num /. ↑r.den ≠ 0
⊢ padicValRat p (q * r) = padicValRat p q + padicValRat p r
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
⊢ padicValRat p (q * r) = padicValRat p q + padicValRat p r
have hr' : r.num /. r.den ≠ 0 := by rwa [Rat.num_den]
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
hr' : r.num /. ↑r.den ≠ 0
hp' : _root_.Prime ↑p
⊢ padicValRat p (q * r) = padicValRat p q + padicValRat p r
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
hr' : r.num /. ↑r.den ≠ 0
⊢ padicValRat p (q * r) = padicValRat p q + padicValRat p r
have hp' : Prime (p : ℤ) := Nat.prime_iff_prime_int.1 hp.1
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
hr' : r.num /. ↑r.den ≠ 0
hp' : _root_.Prime ↑p
⊢ ↑(Part.get (multiplicity (↑p) (q.num * r.num)) (_ : multiplicity.Finite (↑p) (q.num * r.num))) -
      ↑(Part.get (multiplicity (↑p) (↑q.den * ↑r.den)) (_ : multiplicity.Finite (↑p) (↑q.den * ↑r.den))) =
    padicValRat p q + padicValRat p r
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
hr' : r.num /. ↑r.den ≠ 0
hp' : _root_.Prime ↑p
⊢ padicValRat p (q * r) = padicValRat p q + padicValRat p r
rw [padicValRat.defn p (mul_ne_zero hq hr) this]
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
hr' : r.num /. ↑r.den ≠ 0
hp' : _root_.Prime ↑p
⊢ ↑(Part.get (multiplicity (↑p) (q.num * r.num)) (_ : multiplicity.Finite (↑p) (q.num * r.num))) -
      ↑(Part.get (multiplicity (↑p) (↑q.den * ↑r.den)) (_ : multiplicity.Finite (↑p) (↑q.den * ↑r.den))) =
    ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
        ↑(Part.get (multiplicity ↑p ↑q.den) (_ : multiplicity.Finite ↑p ↑q.den)) +
      (↑(Part.get (multiplicity (↑p) r.num) (_ : multiplicity.Finite (↑p) r.num)) -
        ↑(Part.get (multiplicity ↑p ↑r.den) (_ : multiplicity.Finite ↑p ↑r.den)))
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
hr' : r.num /. ↑r.den ≠ 0
hp' : _root_.Prime ↑p
⊢ ↑(Part.get (multiplicity (↑p) (q.num * r.num)) (_ : multiplicity.Finite (↑p) (q.num * r.num))) -
      ↑(Part.get (multiplicity (↑p) (↑q.den * ↑r.den)) (_ : multiplicity.Finite (↑p) (↑q.den * ↑r.den))) =
    padicValRat p q + padicValRat p r
conv_rhs =>
  rw [← @Rat.num_den q, padicValRat.defn p hq', ← @Rat.num_den r, padicValRat.defn p hr']
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
hr' : r.num /. ↑r.den ≠ 0
hp' : _root_.Prime ↑p
⊢ ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) +
        ↑(Part.get (multiplicity (↑p) r.num) (_ : multiplicity.Finite (↑p) r.num)) -
      (↑(Part.get (multiplicity ↑p ↑q.den) (_ : multiplicity.Finite ↑p ↑q.den)) +
        ↑(Part.get (multiplicity ↑p ↑r.den) (_ : multiplicity.Finite ↑p ↑r.den))) =
    ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
        ↑(Part.get (multiplicity ↑p ↑q.den) (_ : multiplicity.Finite ↑p ↑q.den)) +
      (↑(Part.get (multiplicity (↑p) r.num) (_ : multiplicity.Finite (↑p) r.num)) -
        ↑(Part.get (multiplicity ↑p ↑r.den) (_ : multiplicity.Finite ↑p ↑r.den)))
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
hr' : r.num /. ↑r.den ≠ 0
hp' : _root_.Prime ↑p
⊢ ↑(Part.get (multiplicity (↑p) (q.num * r.num)) (_ : multiplicity.Finite (↑p) (q.num * r.num))) -
      ↑(Part.get (multiplicity (↑p) (↑q.den * ↑r.den)) (_ : multiplicity.Finite (↑p) (↑q.den * ↑r.den))) =
    ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
        ↑(Part.get (multiplicity ↑p ↑q.den) (_ : multiplicity.Finite ↑p ↑q.den)) +
      (↑(Part.get (multiplicity (↑p) r.num) (_ : multiplicity.Finite (↑p) r.num)) -
        ↑(Part.get (multiplicity ↑p ↑r.den) (_ : multiplicity.Finite ↑p ↑r.den)))
rw [multiplicity.mul' hp', multiplicity.mul' hp', Nat.cast_add, Nat.cast_add]
no goals
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
hr' : r.num /. ↑r.den ≠ 0
hp' : _root_.Prime ↑p
⊢ ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) +
        ↑(Part.get (multiplicity (↑p) r.num) (_ : multiplicity.Finite (↑p) r.num)) -
      (↑(Part.get (multiplicity ↑p ↑q.den) (_ : multiplicity.Finite ↑p ↑q.den)) +
        ↑(Part.get (multiplicity ↑p ↑r.den) (_ : multiplicity.Finite ↑p ↑r.den))) =
    ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
        ↑(Part.get (multiplicity ↑p ↑q.den) (_ : multiplicity.Finite ↑p ↑q.den)) +
      (↑(Part.get (multiplicity (↑p) r.num) (_ : multiplicity.Finite (↑p) r.num)) -
        ↑(Part.get (multiplicity ↑p ↑r.den) (_ : multiplicity.Finite ↑p ↑r.den)))
ring
no goals
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
⊢ q * r = q.num * r.num /. (↑q.den * ↑r.den)
rw_mod_cast [Rat.mul_num_den]
no goals
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
⊢ q.num /. ↑q.den ≠ 0
rwa [Rat.num_den]
no goals
p : ℕ
hp : Fact (Nat.Prime p)
q r : ℚ
hq : q ≠ 0
hr : r ≠ 0
this : q * r = q.num * r.num /. (↑q.den * ↑r.den)
hq' : q.num /. ↑q.den ≠ 0
⊢ r.num /. ↑r.den ≠ 0
rwa [Rat.num_den]