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

tactic: have hi := (Classical.choose_spec (exists_prime R)).irreducible
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
⊢ (addVal R) a = ⊤ ↔ a = 0
state_after: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (Classical.choose ⋯)
⊢ (addVal R) a = ⊤ ↔ a = 0

tactic: constructor
state_before: R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (Classical.choose ⋯)
⊢ (addVal R) a = ⊤ ↔ a = 0
state_after: case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (Classical.choose ⋯)
⊢ (addVal R) a = ⊤ → a = 0

case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (Classical.choose ⋯)
⊢ a = 0 → (addVal R) a = ⊤

tactic: contrapose
state_before: case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (Classical.choose ⋯)
⊢ (addVal R) a = ⊤ → a = 0
state_after: case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (Classical.choose ⋯)
⊢ ¬a = 0 → ¬(addVal R) a = ⊤

tactic: intro h
state_before: case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (Classical.choose ⋯)
⊢ ¬a = 0 → ¬(addVal R) a = ⊤
state_after: case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (Classical.choose ⋯)
h : ¬a = 0
⊢ ¬(addVal R) a = ⊤

tactic: obtain ⟨n, ha⟩ := associated_pow_irreducible h hi
state_before: case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (Classical.choose ⋯)
h : ¬a = 0
⊢ ¬(addVal R) a = ⊤
state_after: case mp.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (Classical.choose ⋯)
h : ¬a = 0
n : ℕ
ha : Associated a (Classical.choose ⋯ ^ n)
⊢ ¬(addVal R) a = ⊤

tactic: obtain ⟨u, rfl⟩ := ha.symm
state_before: case mp.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (Classical.choose ⋯)
h : ¬a = 0
n : ℕ
ha : Associated a (Classical.choose ⋯ ^ n)
⊢ ¬(addVal R) a = ⊤
state_after: case mp.intro.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
hi : Irreducible (Classical.choose ⋯)
n : ℕ
u : Rˣ
h : ¬Classical.choose ⋯ ^ n * ↑u = 0
ha : Associated (Classical.choose ⋯ ^ n * ↑u) (Classical.choose ⋯ ^ n)
⊢ ¬(addVal R) (Classical.choose ⋯ ^ n * ↑u) = ⊤

tactic: rw [mul_comm, addVal_def' u hi n]
state_before: case mp.intro.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
hi : Irreducible (Classical.choose ⋯)
n : ℕ
u : Rˣ
h : ¬Classical.choose ⋯ ^ n * ↑u = 0
ha : Associated (Classical.choose ⋯ ^ n * ↑u) (Classical.choose ⋯ ^ n)
⊢ ¬(addVal R) (Classical.choose ⋯ ^ n * ↑u) = ⊤
state_after: case mp.intro.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
hi : Irreducible (Classical.choose ⋯)
n : ℕ
u : Rˣ
h : ¬Classical.choose ⋯ ^ n * ↑u = 0
ha : Associated (Classical.choose ⋯ ^ n * ↑u) (Classical.choose ⋯ ^ n)
⊢ ¬↑n = ⊤

tactic: exact PartENat.natCast_ne_top _
state_before: case mp.intro.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
hi : Irreducible (Classical.choose ⋯)
n : ℕ
u : Rˣ
h : ¬Classical.choose ⋯ ^ n * ↑u = 0
ha : Associated (Classical.choose ⋯ ^ n * ↑u) (Classical.choose ⋯ ^ n)
⊢ ¬↑n = ⊤
state_after: no goals

tactic: rintro rfl
state_before: case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (Classical.choose ⋯)
⊢ a = 0 → (addVal R) a = ⊤
state_after: case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
hi : Irreducible (Classical.choose ⋯)
⊢ (addVal R) 0 = ⊤

tactic: exact addVal_zero
state_before: case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
hi : Irreducible (Classical.choose ⋯)
⊢ (addVal R) 0 = ⊤
state_after: no goals