Theorem: DiscreteValuationRing.addVal_le_iff_dvd
File: Mathlib/RingTheory/DiscreteValuationRing/Basic.lean

tactic: have hp := Classical.choose_spec (exists_prime R)
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
⊢ (addVal R) a ≤ (addVal R) b ↔ a ∣ b
state_after: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
⊢ (addVal R) a ≤ (addVal R) b ↔ a ∣ b

tactic: constructor <;> intro h
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
⊢ (addVal R) a ≤ (addVal R) b ↔ a ∣ b
state_after: case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : (addVal R) a ≤ (addVal R) b
⊢ a ∣ b

case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : a ∣ b
⊢ (addVal R) a ≤ (addVal R) b

tactic: by_cases ha0 : a = 0
state_before: case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : (addVal R) a ≤ (addVal R) b
⊢ a ∣ b
state_after: case pos
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : (addVal R) a ≤ (addVal R) b
ha0 : a = 0
⊢ a ∣ b

case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : (addVal R) a ≤ (addVal R) b
ha0 : ¬a = 0
⊢ a ∣ b

tactic: obtain ⟨n, ha⟩ := associated_pow_irreducible ha0 hp.irreducible
state_before: case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : (addVal R) a ≤ (addVal R) b
ha0 : ¬a = 0
⊢ a ∣ b
state_after: case neg.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : (addVal R) a ≤ (addVal R) b
ha0 : ¬a = 0
n : ℕ
ha : Associated a (Classical.choose ⋯ ^ n)
⊢ a ∣ b

tactic: rw [addVal, addValuation_apply, addValuation_apply, multiplicity_le_multiplicity_iff] at h
state_before: case neg.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : (addVal R) a ≤ (addVal R) b
ha0 : ¬a = 0
n : ℕ
ha : Associated a (Classical.choose ⋯ ^ n)
⊢ a ∣ b
state_after: case neg.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : ∀ (n : ℕ), Classical.choose ⋯ ^ n ∣ a → Classical.choose ⋯ ^ n ∣ b
ha0 : ¬a = 0
n : ℕ
ha : Associated a (Classical.choose ⋯ ^ n)
⊢ a ∣ b

tactic: exact ha.dvd.trans (h n ha.symm.dvd)
state_before: case neg.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : ∀ (n : ℕ), Classical.choose ⋯ ^ n ∣ a → Classical.choose ⋯ ^ n ∣ b
ha0 : ¬a = 0
n : ℕ
ha : Associated a (Classical.choose ⋯ ^ n)
⊢ a ∣ b
state_after: no goals

tactic: rw [ha0, addVal_zero, top_le_iff, addVal_eq_top_iff] at h
state_before: case pos
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : (addVal R) a ≤ (addVal R) b
ha0 : a = 0
⊢ a ∣ b
state_after: case pos
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : b = 0
ha0 : a = 0
⊢ a ∣ b

tactic: rw [h]
state_before: case pos
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : b = 0
ha0 : a = 0
⊢ a ∣ b
state_after: case pos
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : b = 0
ha0 : a = 0
⊢ a ∣ 0

tactic: apply dvd_zero
state_before: case pos
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : b = 0
ha0 : a = 0
⊢ a ∣ 0
state_after: no goals

tactic: rw [addVal, addValuation_apply, addValuation_apply]
state_before: case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : a ∣ b
⊢ (addVal R) a ≤ (addVal R) b
state_after: case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : a ∣ b
⊢ multiplicity (Classical.choose ⋯) a ≤ multiplicity (Classical.choose ⋯) b

tactic: exact multiplicity_le_multiplicity_of_dvd_right h
state_before: case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (Classical.choose ⋯)
h : a ∣ b
⊢ multiplicity (Classical.choose ⋯) a ≤ multiplicity (Classical.choose ⋯) b
state_after: no goals