l3lab/ntp-mathlib huggingface dataset:
theorem gramSchmidtOrthonormalBasis_inv_triangular {i j : ι} (hij : i < j) :
    ⟪gramSchmidtOrthonormalBasis h f j, f i⟫ = 0 := by
  by_cases hi : gramSchmidtNormed 𝕜 f j = 0
  · 

Proof state:
case pos
𝕜 : Type u_1
E : Type u_2
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : InnerProductSpace 𝕜 E
ι : Type u_3
inst✝⁴ : LinearOrder ι
inst✝³ : LocallyFiniteOrderBot ι
inst✝² : IsWellOrder ι fun x x_1 => x < x_1
inst✝¹ : Fintype ι
inst✝ : FiniteDimensional 𝕜 E
h : finrank 𝕜 E = Fintype.card ι
f : ι → E
i j : ι
hij : i < j
hi : gramSchmidtNormed 𝕜 f j = 0
⊢ inner ((gramSchmidtOrthonormalBasis h f) j) (f i) = 0

Next tactic:
rw [inner_gramSchmidtOrthonormalBasis_eq_zero h hi]
theorem gramSchmidtOrthonormalBasis_inv_triangular {i j : ι} (hij : i < j) :
    ⟪gramSchmidtOrthonormalBasis h f j, f i⟫ = 0 := by
  by_cases hi : gramSchmidtNormed 𝕜 f j = 0
  · rw [inner_gramSchmidtOrthonormalBasis_eq_zero h hi]
  · 

Proof state:
case neg
𝕜 : Type u_1
E : Type u_2
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : InnerProductSpace 𝕜 E
ι : Type u_3
inst✝⁴ : LinearOrder ι
inst✝³ : LocallyFiniteOrderBot ι
inst✝² : IsWellOrder ι fun x x_1 => x < x_1
inst✝¹ : Fintype ι
inst✝ : FiniteDimensional 𝕜 E
h : finrank 𝕜 E = Fintype.card ι
f : ι → E
i j : ι
hij : i < j
hi : ¬gramSchmidtNormed 𝕜 f j = 0
⊢ inner ((gramSchmidtOrthonormalBasis h f) j) (f i) = 0

Next tactic:
simp [gramSchmidtOrthonormalBasis_apply h hi, gramSchmidtNormed, inner_smul_left,
      gramSchmidt_inv_triangular 𝕜 f hij]
theorem gramSchmidtOrthonormalBasis_inv_triangular' {i j : ι} (hij : i < j) :
    (gramSchmidtOrthonormalBasis h f).repr (f i) j = 0 := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup E
inst✝⁵ : InnerProductSpace 𝕜 E
ι : Type u_3
inst✝⁴ : LinearOrder ι
inst✝³ : LocallyFiniteOrderBot ι
inst✝² : IsWellOrder ι fun x x_1 => x < x_1
inst✝¹ : Fintype ι
inst✝ : FiniteDimensional 𝕜 E
h : finrank 𝕜 E = Fintype.card ι
f : ι → E
i j : ι
hij : i < j
⊢ (gramSchmidtOrthonormalBasis h f).repr (f i) j = 0

Next tactic:
simpa [OrthonormalBasis.repr_apply_apply] using gramSchmidtOrthonormalBasis_inv_triangular h f hij
theorem gramSchmidtOrthonormalBasis_det [DecidableEq ι] :
    (gramSchmidtOrthonormalBasis h f).toBasis.det f =
      ∏ i, ⟪gramSchmidtOrthonormalBasis h f i, f i⟫ := by
  

Proof state:
𝕜 : Type u_1
E : Type u_2
inst✝⁸ : IsROrC 𝕜
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : InnerProductSpace 𝕜 E
ι : Type u_3
inst✝⁵ : LinearOrder ι
inst✝⁴ : LocallyFiniteOrderBot ι
inst✝³ : IsWellOrder ι fun x x_1 => x < x_1
inst✝² : Fintype ι
inst✝¹ : FiniteDimensional 𝕜 E
h : finrank 𝕜 E = Fintype.card ι
f : ι → E
inst✝ : DecidableEq ι
⊢ (Basis.det (OrthonormalBasis.toBasis (gramSchmidtOrthonormalBasis h f))) f =
    ∏ i : ι, inner ((gramSchmidtOrthonormalBasis h f) i) (f i)

Next tactic:
convert Matrix.det_of_upperTriangular (gramSchmidtOrthonormalBasis_inv_blockTriangular h f)
theorem gramSchmidtOrthonormalBasis_det [DecidableEq ι] :
    (gramSchmidtOrthonormalBasis h f).toBasis.det f =
      ∏ i, ⟪gramSchmidtOrthonormalBasis h f i, f i⟫ := by
  convert Matrix.det_of_upperTriangular (gramSchmidtOrthonormalBasis_inv_blockTriangular h f)
  

Proof state:
case h.e'_3.a
𝕜 : Type u_1
E : Type u_2
inst✝⁸ : IsROrC 𝕜
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : InnerProductSpace 𝕜 E
ι : Type u_3
inst✝⁵ : LinearOrder ι
inst✝⁴ : LocallyFiniteOrderBot ι
inst✝³ : IsWellOrder ι fun x x_1 => x < x_1
inst✝² : Fintype ι
inst✝¹ : FiniteDimensional 𝕜 E
h : finrank 𝕜 E = Fintype.card ι
f : ι → E
inst✝ : DecidableEq ι
x✝ : ι
a✝ : x✝ ∈ Finset.univ
⊢ inner ((gramSchmidtOrthonormalBasis h f) x✝) (f x✝) =
    Basis.toMatrix (OrthonormalBasis.toBasis (gramSchmidtOrthonormalBasis h f)) f x✝ x✝

Next tactic:
exact ((gramSchmidtOrthonormalBasis h f).repr_apply_apply (f _) _).symm
/-- `padicValNat p 0` is `0` for any `p`. -/
@[simp]
protected theorem zero : padicValNat p 0 = 0 := by 

Proof state:
p : ℕ
⊢ padicValNat p 0 = 0

Next tactic:
simp [padicValNat]
/-- `padicValNat p 1` is `0` for any `p`. -/
@[simp]
protected theorem one : padicValNat p 1 = 0 := by
  

Proof state:
p : ℕ
⊢ padicValNat p 1 = 0

Next tactic:
unfold padicValNat
/-- `padicValNat p 1` is `0` for any `p`. -/
@[simp]
protected theorem one : padicValNat p 1 = 0 := by
  unfold padicValNat
  

Proof state:
p : ℕ
⊢ (if h : p ≠ 1 ∧ 0 < 1 then Part.get (multiplicity p 1) (_ : multiplicity.Finite p 1) else 0) = 0

Next tactic:
split_ifs
/-- `padicValNat p 1` is `0` for any `p`. -/
@[simp]
protected theorem one : padicValNat p 1 = 0 := by
  unfold padicValNat
  split_ifs
  · 

Proof state:
case pos
p : ℕ
h✝ : p ≠ 1 ∧ 0 < 1
⊢ Part.get (multiplicity p 1) (_ : multiplicity.Finite p 1) = 0

Next tactic:
simp
/-- `padicValNat p 1` is `0` for any `p`. -/
@[simp]
protected theorem one : padicValNat p 1 = 0 := by
  unfold padicValNat
  split_ifs
  · simp
  · 

Proof state:
case neg
p : ℕ
h✝ : ¬(p ≠ 1 ∧ 0 < 1)
⊢ 0 = 0

Next tactic:
rfl
/-- If `p ≠ 0` and `p ≠ 1`, then `padicValNat p p` is `1`. -/
@[simp]
theorem self (hp : 1 < p) : padicValNat p p = 1 := by
  

Proof state:
p : ℕ
hp : 1 < p
⊢ padicValNat p p = 1

Next tactic:
have neq_one : ¬p = 1 ↔ True := iff_of_true hp.ne' trivial
/-- If `p ≠ 0` and `p ≠ 1`, then `padicValNat p p` is `1`. -/
@[simp]
theorem self (hp : 1 < p) : padicValNat p p = 1 := by
  have neq_one : ¬p = 1 ↔ True := iff_of_true hp.ne' trivial
  

Proof state:
p : ℕ
hp : 1 < p
neq_one : ¬p = 1 ↔ True
⊢ padicValNat p p = 1

Next tactic:
have eq_zero_false : p = 0 ↔ False := iff_false_intro (zero_lt_one.trans hp).ne'
/-- If `p ≠ 0` and `p ≠ 1`, then `padicValNat p p` is `1`. -/
@[simp]
theorem self (hp : 1 < p) : padicValNat p p = 1 := by
  have neq_one : ¬p = 1 ↔ True := iff_of_true hp.ne' trivial
  have eq_zero_false : p = 0 ↔ False := iff_false_intro (zero_lt_one.trans hp).ne'
  

Proof state:
p : ℕ
hp : 1 < p
neq_one : ¬p = 1 ↔ True
eq_zero_false : p = 0 ↔ False
⊢ padicValNat p p = 1

Next tactic:
simp [padicValNat, neq_one, eq_zero_false]
@[simp]
theorem eq_zero_iff {n : ℕ} : padicValNat p n = 0 ↔ p = 1 ∨ n = 0 ∨ ¬p ∣ n := by
  

Proof state:
p n : ℕ
⊢ padicValNat p n = 0 ↔ p = 1 ∨ n = 0 ∨ ¬p ∣ n

Next tactic:
simp only [padicValNat, dite_eq_right_iff, PartENat.get_eq_iff_eq_coe, Nat.cast_zero,
    multiplicity_eq_zero, and_imp, pos_iff_ne_zero, Ne.def, ← or_iff_not_imp_left]
theorem maxPowDiv_eq_multiplicity {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv n = multiplicity p n := by
  

Proof state:
p✝ p n : ℕ
hp : 1 < p
hn : 0 < n
⊢ ↑(maxPowDiv p n) = multiplicity p n

Next tactic:
apply multiplicity.unique <| pow_dvd p n
theorem maxPowDiv_eq_multiplicity {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv n = multiplicity p n := by
  apply multiplicity.unique <| pow_dvd p n
  

Proof state:
p✝ p n : ℕ
hp : 1 < p
hn : 0 < n
⊢ ¬p ^ (maxPowDiv p n + 1) ∣ n

Next tactic:
intro h
theorem maxPowDiv_eq_multiplicity {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv n = multiplicity p n := by
  apply multiplicity.unique <| pow_dvd p n
  intro h
  

Proof state:
p✝ p n : ℕ
hp : 1 < p
hn : 0 < n
h : p ^ (maxPowDiv p n + 1) ∣ n
⊢ False

Next tactic:
apply Nat.not_lt.mpr <| le_of_dvd hp hn h
theorem maxPowDiv_eq_multiplicity {p n : ℕ} (hp : 1 < p) (hn : 0 < n) :
    p.maxPowDiv n = multiplicity p n := by
  apply multiplicity.unique <| pow_dvd p n
  intro h
  apply Nat.not_lt.mpr <| le_of_dvd hp hn h
  

Proof state:
p✝ p n : ℕ
hp : 1 < p
hn : 0 < n
h : p ^ (maxPowDiv p n + 1) ∣ n
⊢ maxPowDiv p n < maxPowDiv p n + 1

Next tactic:
simp
theorem maxPowDiv_eq_multiplicity_get {p n : ℕ} (hp : 1 < p) (hn : 0 < n) (h : Finite p n) :
    p.maxPowDiv n = (multiplicity p n).get h := by
  

Proof state:
p✝ p n : ℕ
hp : 1 < p
hn : 0 < n
h : multiplicity.Finite p n
⊢ maxPowDiv p n = Part.get (multiplicity p n) h

Next tactic:
rw [PartENat.get_eq_iff_eq_coe.mpr]
theorem maxPowDiv_eq_multiplicity_get {p n : ℕ} (hp : 1 < p) (hn : 0 < n) (h : Finite p n) :
    p.maxPowDiv n = (multiplicity p n).get h := by
  rw [PartENat.get_eq_iff_eq_coe.mpr]
  

Proof state:
p✝ p n : ℕ
hp : 1 < p
hn : 0 < n
h : multiplicity.Finite p n
⊢ multiplicity p n = ↑(maxPowDiv p n)

Next tactic:
apply maxPowDiv_eq_multiplicity hp hn|>.symm
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  

Proof state:
p : ℕ
⊢ padicValNat = maxPowDiv

Next tactic:
ext p n
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  

Proof state:
case h.h
p✝ p n : ℕ
⊢ padicValNat p n = maxPowDiv p n

Next tactic:
by_cases h : 1 < p ∧ 0 < n
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · 

Proof state:
case pos
p✝ p n : ℕ
h : 1 < p ∧ 0 < n
⊢ padicValNat p n = maxPowDiv p n

Next tactic:
dsimp [padicValNat]
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    

Proof state:
case pos
p✝ p n : ℕ
h : 1 < p ∧ 0 < n
⊢ (if h : ¬p = 1 ∧ 0 < n then Part.get (multiplicity p n) (_ : multiplicity.Finite p n) else 0) = maxPowDiv p n

Next tactic:
rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
  · 

Proof state:
case neg
p✝ p n : ℕ
h : ¬(1 < p ∧ 0 < n)
⊢ padicValNat p n = maxPowDiv p n

Next tactic:
simp only [not_and_or,not_gt_eq,le_zero_iff] at h
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
  · simp only [not_and_or,not_gt_eq,le_zero_iff] at h
    

Proof state:
case neg
p✝ p n : ℕ
h : p ≤ 1 ∨ n = 0
⊢ padicValNat p n = maxPowDiv p n

Next tactic:
apply h.elim
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
  · simp only [not_and_or,not_gt_eq,le_zero_iff] at h
    apply h.elim
    · 

Proof state:
case neg.left
p✝ p n : ℕ
h : p ≤ 1 ∨ n = 0
⊢ p ≤ 1 → padicValNat p n = maxPowDiv p n

Next tactic:
intro h
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
  · simp only [not_and_or,not_gt_eq,le_zero_iff] at h
    apply h.elim
    · intro h
      

Proof state:
case neg.left
p✝ p n : ℕ
h✝ : p ≤ 1 ∨ n = 0
h : p ≤ 1
⊢ padicValNat p n = maxPowDiv p n

Next tactic:
interval_cases p
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
  · simp only [not_and_or,not_gt_eq,le_zero_iff] at h
    apply h.elim
    · intro h
      interval_cases p
      · 

Proof state:
case neg.left.«0»
p✝ p n : ℕ
h✝ : 0 ≤ 1 ∨ n = 0
h : 0 ≤ 1
⊢ padicValNat 0 n = maxPowDiv 0 n

Next tactic:
simp [Classical.em]
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
  · simp only [not_and_or,not_gt_eq,le_zero_iff] at h
    apply h.elim
    · intro h
      interval_cases p
      · simp [Classical.em]
      · 

Proof state:
case neg.left.«1»
p✝ p n : ℕ
h✝ : 1 ≤ 1 ∨ n = 0
h : 1 ≤ 1
⊢ padicValNat 1 n = maxPowDiv 1 n

Next tactic:
dsimp [padicValNat, maxPowDiv]
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
  · simp only [not_and_or,not_gt_eq,le_zero_iff] at h
    apply h.elim
    · intro h
      interval_cases p
      · simp [Classical.em]
      · dsimp [padicValNat, maxPowDiv]
        

Proof state:
case neg.left.«1»
p✝ p n : ℕ
h✝ : 1 ≤ 1 ∨ n = 0
h : 1 ≤ 1
⊢ (if h : ¬1 = 1 ∧ 0 < n then Part.get (multiplicity 1 n) (_ : multiplicity.Finite 1 n) else 0) = go 0 1 n

Next tactic:
rw [go_eq, if_neg, dif_neg]
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
  · simp only [not_and_or,not_gt_eq,le_zero_iff] at h
    apply h.elim
    · intro h
      interval_cases p
      · simp [Classical.em]
      · dsimp [padicValNat, maxPowDiv]
        rw [go_eq, if_neg, dif_neg] <;> 

Proof state:
case neg.left.«1».hnc
p✝ p n : ℕ
h✝ : 1 ≤ 1 ∨ n = 0
h : 1 ≤ 1
⊢ ¬(¬1 = 1 ∧ 0 < n)

Next tactic:
simp
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
  · simp only [not_and_or,not_gt_eq,le_zero_iff] at h
    apply h.elim
    · intro h
      interval_cases p
      · simp [Classical.em]
      · dsimp [padicValNat, maxPowDiv]
        rw [go_eq, if_neg, dif_neg] <;> 

Proof state:
case neg.left.«1».hnc
p✝ p n : ℕ
h✝ : 1 ≤ 1 ∨ n = 0
h : 1 ≤ 1
⊢ ¬(1 < 1 ∧ 0 < n ∧ n % 1 = 0)

Next tactic:
simp
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
  · simp only [not_and_or,not_gt_eq,le_zero_iff] at h
    apply h.elim
    · intro h
      interval_cases p
      · simp [Classical.em]
      · dsimp [padicValNat, maxPowDiv]
        rw [go_eq, if_neg, dif_neg] <;> simp
    · 

Proof state:
case neg.right
p✝ p n : ℕ
h : p ≤ 1 ∨ n = 0
⊢ n = 0 → padicValNat p n = maxPowDiv p n

Next tactic:
intro h
/-- Allows for more efficient code for `padicValNat` -/
@[csimp]
theorem padicValNat_eq_maxPowDiv : @padicValNat = @maxPowDiv := by
  ext p n
  by_cases h : 1 < p ∧ 0 < n
  · dsimp [padicValNat]
    rw [dif_pos ⟨Nat.ne_of_gt h.1,h.2⟩, maxPowDiv_eq_multiplicity_get h.1 h.2]
  · simp only [not_and_or,not_gt_eq,le_zero_iff] at h
    apply h.elim
    · intro h
      interval_cases p
      · simp [Classical.em]
      · dsimp [padicValNat, maxPowDiv]
        rw [go_eq, if_neg, dif_neg] <;> simp
    · intro h
      

Proof state:
case neg.right
p✝ p n : ℕ
h✝ : p ≤ 1 ∨ n = 0
h : n = 0
⊢ padicValNat p n = maxPowDiv p n

Next tactic:
simp [h]
theorem of_ne_one_ne_zero {z : ℤ} (hp : p ≠ 1) (hz : z ≠ 0) :
    padicValInt p z =
      (multiplicity (p : ℤ) z).get
        (by
          

Proof state:
p : ℕ
z : ℤ
hp : p ≠ 1
hz : z ≠ 0
⊢ (multiplicity (↑p) z).Dom

Next tactic:
apply multiplicity.finite_int_iff.2
theorem of_ne_one_ne_zero {z : ℤ} (hp : p ≠ 1) (hz : z ≠ 0) :
    padicValInt p z =
      (multiplicity (p : ℤ) z).get
        (by
          apply multiplicity.finite_int_iff.2
          

Proof state:
p : ℕ
z : ℤ
hp : p ≠ 1
hz : z ≠ 0
⊢ Int.natAbs ↑p ≠ 1 ∧ z ≠ 0

Next tactic:
simp [hp, hz]
theorem of_ne_one_ne_zero {z : ℤ} (hp : p ≠ 1) (hz : z ≠ 0) :
    padicValInt p z =
      (multiplicity (p : ℤ) z).get
        (by
          apply multiplicity.finite_int_iff.2
          simp [hp, hz]) := by
  

Proof state:
p : ℕ
z : ℤ
hp : p ≠ 1
hz : z ≠ 0
⊢ padicValInt p z = Part.get (multiplicity (↑p) z) (_ : multiplicity.Finite (↑p) z)

Next tactic:
rw [padicValInt, padicValNat, dif_pos (And.intro hp (Int.natAbs_pos.mpr hz))]
theorem of_ne_one_ne_zero {z : ℤ} (hp : p ≠ 1) (hz : z ≠ 0) :
    padicValInt p z =
      (multiplicity (p : ℤ) z).get
        (by
          apply multiplicity.finite_int_iff.2
          simp [hp, hz]) := by
  rw [padicValInt, padicValNat, dif_pos (And.intro hp (Int.natAbs_pos.mpr hz))]
  

Proof state:
p : ℕ
z : ℤ
hp : p ≠ 1
hz : z ≠ 0
⊢ Part.get (multiplicity p (Int.natAbs z)) (_ : multiplicity.Finite p (Int.natAbs z)) =
    Part.get (multiplicity (↑p) z) (_ : multiplicity.Finite (↑p) z)

Next tactic:
simp only [multiplicity.Int.natAbs p z]
/-- `padicValInt p 0` is `0` for any `p`. -/
@[simp]
protected theorem zero : padicValInt p 0 = 0 := by 

Proof state:
p : ℕ
⊢ padicValInt p 0 = 0

Next tactic:
simp [padicValInt]
/-- `padicValInt p 1` is `0` for any `p`. -/
@[simp]
protected theorem one : padicValInt p 1 = 0 := by 

Proof state:
p : ℕ
⊢ padicValInt p 1 = 0

Next tactic:
simp [padicValInt]
/-- The `p`-adic value of a natural is its `p`-adic value as an integer. -/
@[simp]
theorem of_nat {n : ℕ} : padicValInt p n = padicValNat p n := by 

Proof state:
p n : ℕ
⊢ padicValInt p ↑n = padicValNat p n

Next tactic:
simp [padicValInt]
/-- If `p ≠ 0` and `p ≠ 1`, then `padicValInt p p` is `1`. -/
theorem self (hp : 1 < p) : padicValInt p p = 1 := by 

Proof state:
p : ℕ
hp : 1 < p
⊢ padicValInt p ↑p = 1

Next tactic:
simp [padicValNat.self hp]
theorem eq_zero_of_not_dvd {z : ℤ} (h : ¬(p : ℤ) ∣ z) : padicValInt p z = 0 := by
  

Proof state:
p : ℕ
z : ℤ
h : ¬↑p ∣ z
⊢ padicValInt p z = 0

Next tactic:
rw [padicValInt, padicValNat]
theorem eq_zero_of_not_dvd {z : ℤ} (h : ¬(p : ℤ) ∣ z) : padicValInt p z = 0 := by
  rw [padicValInt, padicValNat]
  

Proof state:
p : ℕ
z : ℤ
h : ¬↑p ∣ z
⊢ (if h : p ≠ 1 ∧ 0 < Int.natAbs z then
      Part.get (multiplicity p (Int.natAbs z)) (_ : multiplicity.Finite p (Int.natAbs z))
    else 0) =
    0

Next tactic:
split_ifs
theorem eq_zero_of_not_dvd {z : ℤ} (h : ¬(p : ℤ) ∣ z) : padicValInt p z = 0 := by
  rw [padicValInt, padicValNat]
  split_ifs <;> 

Proof state:
case pos
p : ℕ
z : ℤ
h : ¬↑p ∣ z
h✝ : p ≠ 1 ∧ 0 < Int.natAbs z
⊢ Part.get (multiplicity p (Int.natAbs z)) (_ : multiplicity.Finite p (Int.natAbs z)) = 0

Next tactic:
simp [multiplicity.Int.natAbs, multiplicity_eq_zero.2 h]
theorem eq_zero_of_not_dvd {z : ℤ} (h : ¬(p : ℤ) ∣ z) : padicValInt p z = 0 := by
  rw [padicValInt, padicValNat]
  split_ifs <;> 

Proof state:
case neg
p : ℕ
z : ℤ
h : ¬↑p ∣ z
h✝ : ¬(p ≠ 1 ∧ 0 < Int.natAbs z)
⊢ 0 = 0

Next tactic:
simp [multiplicity.Int.natAbs, multiplicity_eq_zero.2 h]
/-- `padicValRat p q` is symmetric in `q`. -/
@[simp]
protected theorem neg (q : ℚ) : padicValRat p (-q) = padicValRat p q := by
  

Proof state:
p : ℕ
q : ℚ
⊢ padicValRat p (-q) = padicValRat p q

Next tactic:
simp [padicValRat, padicValInt]
/-- `padicValRat p 0` is `0` for any `p`. -/
@[simp]
protected theorem zero : padicValRat p 0 = 0 := by 

Proof state:
p : ℕ
⊢ padicValRat p 0 = 0

Next tactic:
simp [padicValRat]
/-- `padicValRat p 1` is `0` for any `p`. -/
@[simp]
protected theorem one : padicValRat p 1 = 0 := by 

Proof state:
p : ℕ
⊢ padicValRat p 1 = 0

Next tactic:
simp [padicValRat]
/-- The `p`-adic value of an integer `z ≠ 0` is its `p`-adic_value as a rational. -/
@[simp]
theorem of_int {z : ℤ} : padicValRat p z = padicValInt p z := by 

Proof state:
p : ℕ
z : ℤ
⊢ padicValRat p ↑z = ↑(padicValInt p z)

Next tactic:
simp [padicValRat]
/-- The `p`-adic value of an integer `z ≠ 0` is the multiplicity of `p` in `z`. -/
theorem of_int_multiplicity {z : ℤ} (hp : p ≠ 1) (hz : z ≠ 0) :
    padicValRat p (z : ℚ) = (multiplicity (p : ℤ) z).get (finite_int_iff.2 ⟨hp, hz⟩) := by
  

Proof state:
p : ℕ
z : ℤ
hp : p ≠ 1
hz : z ≠ 0
⊢ padicValRat p ↑z = ↑(Part.get (multiplicity (↑p) z) (_ : multiplicity.Finite (↑p) z))

Next tactic:
rw [of_int, padicValInt.of_ne_one_ne_zero hp hz]
theorem multiplicity_sub_multiplicity {q : ℚ} (hp : p ≠ 1) (hq : q ≠ 0) :
    padicValRat p q =
      (multiplicity (p : ℤ) q.num).get (finite_int_iff.2 ⟨hp, Rat.num_ne_zero_of_ne_zero hq⟩) -
        (multiplicity p q.den).get
          (by
            

Proof state:
p : ℕ
q : ℚ
hp : p ≠ 1
hq : q ≠ 0
⊢ (multiplicity p q.den).Dom

Next tactic:
rw [← finite_iff_dom, finite_nat_iff]
theorem multiplicity_sub_multiplicity {q : ℚ} (hp : p ≠ 1) (hq : q ≠ 0) :
    padicValRat p q =
      (multiplicity (p : ℤ) q.num).get (finite_int_iff.2 ⟨hp, Rat.num_ne_zero_of_ne_zero hq⟩) -
        (multiplicity p q.den).get
          (by
            rw [← finite_iff_dom, finite_nat_iff]
            

Proof state:
p : ℕ
q : ℚ
hp : p ≠ 1
hq : q ≠ 0
⊢ p ≠ 1 ∧ 0 < q.den

Next tactic:
exact ⟨hp, q.pos⟩
theorem multiplicity_sub_multiplicity {q : ℚ} (hp : p ≠ 1) (hq : q ≠ 0) :
    padicValRat p q =
      (multiplicity (p : ℤ) q.num).get (finite_int_iff.2 ⟨hp, Rat.num_ne_zero_of_ne_zero hq⟩) -
        (multiplicity p q.den).get
          (by
            rw [← finite_iff_dom, finite_nat_iff]
            exact ⟨hp, q.pos⟩) := by
  

Proof state:
p : ℕ
q : ℚ
hp : p ≠ 1
hq : q ≠ 0
⊢ padicValRat p q =
    ↑(Part.get (multiplicity (↑p) q.num) (_ : multiplicity.Finite (↑p) q.num)) -
      ↑(Part.get (multiplicity p q.den) (_ : (multiplicity p q.den).Dom))

Next tactic:
rw [padicValRat, padicValInt.of_ne_one_ne_zero hp, padicValNat, dif_pos]
theorem multiplicity_sub_multiplicity {q : ℚ} (hp : p ≠ 1) (hq : q ≠ 0) :
    padicValRat p q =
      (multiplicity (p : ℤ) q.num).get (finite_int_iff.2 ⟨hp, Rat.num_ne_zero_of_ne_zero hq⟩) -
        (multiplicity p q.den).get
          (by
            rw [← finite_iff_dom, finite_nat_iff]
            exact ⟨hp, q.pos⟩) := by
  rw [padicValRat, padicValInt.of_ne_one_ne_zero hp, padicValNat, dif_pos]
  · 

Proof state:
case hc
p : ℕ
q : ℚ
hp : p ≠ 1
hq : q ≠ 0
⊢ p ≠ 1 ∧ 0 < q.den

Next tactic:
exact ⟨hp, q.pos⟩
theorem multiplicity_sub_multiplicity {q : ℚ} (hp : p ≠ 1) (hq : q ≠ 0) :
    padicValRat p q =
      (multiplicity (p : ℤ) q.num).get (finite_int_iff.2 ⟨hp, Rat.num_ne_zero_of_ne_zero hq⟩) -
        (multiplicity p q.den).get
          (by
            rw [← finite_iff_dom, finite_nat_iff]
            exact ⟨hp, q.pos⟩) := by
  rw [padicValRat, padicValInt.of_ne_one_ne_zero hp, padicValNat, dif_pos]
  · exact ⟨hp, q.pos⟩
  · 

Proof state:
p : ℕ
q : ℚ
hp : p ≠ 1
hq : q ≠ 0
⊢ q.num ≠ 0

Next tactic:
exact Rat.num_ne_zero_of_ne_zero hq
/-- The `p`-adic value of an integer `z ≠ 0` is its `p`-adic value as a rational. -/
@[simp]
theorem of_nat {n : ℕ} : padicValRat p n = padicValNat p n := by 

Proof state:
p n : ℕ
⊢ padicValRat p ↑n = ↑(padicValNat p n)

Next tactic:
simp [padicValRat]
/-- If `p ≠ 0` and `p ≠ 1`, then `padicValRat p p` is `1`. -/
theorem self (hp : 1 < p) : padicValRat p p = 1 := by 

Proof state:
p : ℕ
hp : 1 < p
⊢ padicValRat p ↑p = 1

Next tactic:
simp [hp]
theorem zero_le_padicValRat_of_nat (n : ℕ) : 0 ≤ padicValRat p n := by 

Proof state:
p n : ℕ
⊢ 0 ≤ padicValRat p ↑n

Next tactic:
simp
/-- `padicValRat` coincides with `padicValNat`. -/
@[norm_cast]
theorem padicValRat_of_nat (n : ℕ) : ↑(padicValNat p n) = padicValRat p n := by 

Proof state:
p n : ℕ
⊢ ↑(padicValNat p n) = padicValRat p ↑n

Next tactic:
simp
theorem padicValNat_def' {n : ℕ} (hp : p ≠ 1) (hn : 0 < n) :
    ↑(padicValNat p n) = multiplicity p n := by 

Proof state:
p n : ℕ
hp : p ≠ 1
hn : 0 < n
⊢ ↑(padicValNat p n) = multiplicity p n

Next tactic:
simp [padicValNat, hp, hn]
@[simp]
theorem padicValNat_self [Fact p.Prime] : padicValNat p p = 1 := by
  

Proof state:
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ padicValNat p p = 1

Next tactic:
rw [padicValNat_def (@Fact.out p.Prime).pos]
@[simp]
theorem padicValNat_self [Fact p.Prime] : padicValNat p p = 1 := by
  rw [padicValNat_def (@Fact.out p.Prime).pos]
  

Proof state:
p : ℕ
inst✝ : Fact (Nat.Prime p)
⊢ Part.get (multiplicity p p) (_ : multiplicity.Finite p p) = 1

Next tactic:
simp