[GOAL]
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h : maximalIdeal R = span {ϖ}
⊢ Irreducible ϖ
[PROOFSTEP]
have h2 : ¬IsUnit ϖ := show ϖ ∈ maximalIdeal R from h.symm ▸ Submodule.mem_span_singleton_self ϖ
[GOAL]
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h : maximalIdeal R = span {ϖ}
h2 : ¬IsUnit ϖ
⊢ Irreducible ϖ
[PROOFSTEP]
refine' ⟨h2, _⟩
[GOAL]
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h : maximalIdeal R = span {ϖ}
h2 : ¬IsUnit ϖ
⊢ ∀ (a b : R), ϖ = a * b → IsUnit a ∨ IsUnit b
[PROOFSTEP]
intro a b hab
[GOAL]
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h : maximalIdeal R = span {ϖ}
h2 : ¬IsUnit ϖ
a b : R
hab : ϖ = a * b
⊢ IsUnit a ∨ IsUnit b
[PROOFSTEP]
by_contra' h
[GOAL]
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h✝ : maximalIdeal R = span {ϖ}
h2 : ¬IsUnit ϖ
a b : R
hab : ϖ = a * b
h : ¬IsUnit a ∧ ¬IsUnit b
⊢ False
[PROOFSTEP]
obtain ⟨ha : a ∈ maximalIdeal R, hb : b ∈ maximalIdeal R⟩ := h
[GOAL]
case intro
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h : maximalIdeal R = span {ϖ}
h2 : ¬IsUnit ϖ
a b : R
hab : ϖ = a * b
ha : a ∈ maximalIdeal R
hb : b ∈ maximalIdeal R
⊢ False
[PROOFSTEP]
rw [h, mem_span_singleton'] at ha hb 
[GOAL]
case intro
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h : maximalIdeal R = span {ϖ}
h2 : ¬IsUnit ϖ
a b : R
hab : ϖ = a * b
ha : ∃ a_1, a_1 * ϖ = a
hb : ∃ a, a * ϖ = b
⊢ False
[PROOFSTEP]
rcases ha with ⟨a, rfl⟩
[GOAL]
case intro.intro
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h : maximalIdeal R = span {ϖ}
h2 : ¬IsUnit ϖ
b : R
hb : ∃ a, a * ϖ = b
a : R
hab : ϖ = a * ϖ * b
⊢ False
[PROOFSTEP]
rcases hb with ⟨b, rfl⟩
[GOAL]
case intro.intro.intro
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h : maximalIdeal R = span {ϖ}
h2 : ¬IsUnit ϖ
a b : R
hab : ϖ = a * ϖ * (b * ϖ)
⊢ False
[PROOFSTEP]
rw [show a * ϖ * (b * ϖ) = ϖ * (ϖ * (a * b)) by ring] at hab 
[GOAL]
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h : maximalIdeal R = span {ϖ}
h2 : ¬IsUnit ϖ
a b : R
hab : ϖ = a * ϖ * (b * ϖ)
⊢ a * ϖ * (b * ϖ) = ϖ * (ϖ * (a * b))
[PROOFSTEP]
ring
[GOAL]
case intro.intro.intro
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h : maximalIdeal R = span {ϖ}
h2 : ¬IsUnit ϖ
a b : R
hab : ϖ = ϖ * (ϖ * (a * b))
⊢ False
[PROOFSTEP]
apply hϖ
[GOAL]
case intro.intro.intro
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h : maximalIdeal R = span {ϖ}
h2 : ¬IsUnit ϖ
a b : R
hab : ϖ = ϖ * (ϖ * (a * b))
⊢ ϖ = 0
[PROOFSTEP]
apply eq_zero_of_mul_eq_self_right _ hab.symm
[GOAL]
R✝ : Type u
inst✝⁵ : CommRing R✝
inst✝⁴ : IsDomain R✝
inst✝³ : DiscreteValuationRing R✝
R : Type u_1
inst✝² : CommRing R
inst✝¹ : LocalRing R
inst✝ : IsDomain R
ϖ : R
hϖ : ϖ ≠ 0
h : maximalIdeal R = span {ϖ}
h2 : ¬IsUnit ϖ
a b : R
hab : ϖ = ϖ * (ϖ * (a * b))
⊢ ϖ * (a * b) ≠ 1
[PROOFSTEP]
exact fun hh => h2 (isUnit_of_dvd_one ⟨_, hh.symm⟩)
[GOAL]
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
ϖ : R
h : maximalIdeal R = span {ϖ}
e : ϖ = 0
⊢ maximalIdeal R = ⊥
[PROOFSTEP]
rwa [h, span_singleton_eq_bot]
[GOAL]
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
⊢ ∃ ϖ, Irreducible ϖ
[PROOFSTEP]
simp_rw [irreducible_iff_uniformizer]
[GOAL]
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
⊢ ∃ ϖ, maximalIdeal R = span {ϖ}
[PROOFSTEP]
exact (IsPrincipalIdealRing.principal <| maximalIdeal R).principal
[GOAL]
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
⊢ DiscreteValuationRing R ↔ IsPrincipalIdealRing R ∧ ∃! P, P ≠ ⊥ ∧ IsPrime P
[PROOFSTEP]
constructor
[GOAL]
case mp
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
⊢ DiscreteValuationRing R → IsPrincipalIdealRing R ∧ ∃! P, P ≠ ⊥ ∧ IsPrime P
[PROOFSTEP]
intro RDVR
[GOAL]
case mp
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
⊢ IsPrincipalIdealRing R ∧ ∃! P, P ≠ ⊥ ∧ IsPrime P
[PROOFSTEP]
rcases id RDVR with ⟨Rlocal⟩
[GOAL]
case mp.mk
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
⊢ IsPrincipalIdealRing R ∧ ∃! P, P ≠ ⊥ ∧ IsPrime P
[PROOFSTEP]
constructor
[GOAL]
case mp.mk.left
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
⊢ IsPrincipalIdealRing R
case mp.mk.right
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
⊢ ∃! P, P ≠ ⊥ ∧ IsPrime P
[PROOFSTEP]
assumption
[GOAL]
case mp.mk.right
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
⊢ ∃! P, P ≠ ⊥ ∧ IsPrime P
[PROOFSTEP]
use LocalRing.maximalIdeal R
[GOAL]
case h
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
⊢ (fun P => P ≠ ⊥ ∧ IsPrime P) (maximalIdeal R) ∧ ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ IsPrime P) y → y = maximalIdeal R
[PROOFSTEP]
constructor
[GOAL]
case h.left
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
⊢ (fun P => P ≠ ⊥ ∧ IsPrime P) (maximalIdeal R)
case h.right
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
⊢ ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ IsPrime P) y → y = maximalIdeal R
[PROOFSTEP]
exact ⟨Rlocal, inferInstance⟩
[GOAL]
case h.right
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
⊢ ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ IsPrime P) y → y = maximalIdeal R
[PROOFSTEP]
rintro Q ⟨hQ1, hQ2⟩
[GOAL]
case h.right.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
Q : Ideal R
hQ1 : Q ≠ ⊥
hQ2 : IsPrime Q
⊢ Q = maximalIdeal R
[PROOFSTEP]
obtain ⟨q, rfl⟩ := (IsPrincipalIdealRing.principal Q).1
[GOAL]
case h.right.intro.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
q : R
hQ1 : Submodule.span R {q} ≠ ⊥
hQ2 : IsPrime (Submodule.span R {q})
⊢ Submodule.span R {q} = maximalIdeal R
[PROOFSTEP]
have hq : q ≠ 0 := by
  rintro rfl
  apply hQ1
  simp
[GOAL]
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
q : R
hQ1 : Submodule.span R {q} ≠ ⊥
hQ2 : IsPrime (Submodule.span R {q})
⊢ q ≠ 0
[PROOFSTEP]
rintro rfl
[GOAL]
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
hQ1 : Submodule.span R {0} ≠ ⊥
hQ2 : IsPrime (Submodule.span R {0})
⊢ False
[PROOFSTEP]
apply hQ1
[GOAL]
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
hQ1 : Submodule.span R {0} ≠ ⊥
hQ2 : IsPrime (Submodule.span R {0})
⊢ Submodule.span R {0} = ⊥
[PROOFSTEP]
simp
[GOAL]
case h.right.intro.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
q : R
hQ1 : Submodule.span R {q} ≠ ⊥
hQ2 : IsPrime (Submodule.span R {q})
hq : q ≠ 0
⊢ Submodule.span R {q} = maximalIdeal R
[PROOFSTEP]
erw [span_singleton_prime hq] at hQ2 
[GOAL]
case h.right.intro.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
q : R
hQ1 : Submodule.span R {q} ≠ ⊥
hQ2 : Prime q
hq : q ≠ 0
⊢ Submodule.span R {q} = maximalIdeal R
[PROOFSTEP]
replace hQ2 := hQ2.irreducible
[GOAL]
case h.right.intro.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
q : R
hQ1 : Submodule.span R {q} ≠ ⊥
hq : q ≠ 0
hQ2 : Irreducible q
⊢ Submodule.span R {q} = maximalIdeal R
[PROOFSTEP]
rw [irreducible_iff_uniformizer] at hQ2 
[GOAL]
case h.right.intro.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RDVR : DiscreteValuationRing R
toIsPrincipalIdealRing✝ : IsPrincipalIdealRing R
toLocalRing✝ : LocalRing R
Rlocal : maximalIdeal R ≠ ⊥
q : R
hQ1 : Submodule.span R {q} ≠ ⊥
hq : q ≠ 0
hQ2✝ : Irreducible q
hQ2 : maximalIdeal R = span {q}
⊢ Submodule.span R {q} = maximalIdeal R
[PROOFSTEP]
exact hQ2.symm
[GOAL]
case mpr
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
⊢ (IsPrincipalIdealRing R ∧ ∃! P, P ≠ ⊥ ∧ IsPrime P) → DiscreteValuationRing R
[PROOFSTEP]
rintro ⟨RPID, Punique⟩
[GOAL]
case mpr.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RPID : IsPrincipalIdealRing R
Punique : ∃! P, P ≠ ⊥ ∧ IsPrime P
⊢ DiscreteValuationRing R
[PROOFSTEP]
haveI : LocalRing R := LocalRing.of_unique_nonzero_prime Punique
[GOAL]
case mpr.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RPID : IsPrincipalIdealRing R
Punique : ∃! P, P ≠ ⊥ ∧ IsPrime P
this : LocalRing R
⊢ DiscreteValuationRing R
[PROOFSTEP]
refine' { not_a_field' := _ }
[GOAL]
case mpr.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RPID : IsPrincipalIdealRing R
Punique : ∃! P, P ≠ ⊥ ∧ IsPrime P
this : LocalRing R
⊢ maximalIdeal R ≠ ⊥
[PROOFSTEP]
rcases Punique with ⟨P, ⟨hP1, hP2⟩, _⟩
[GOAL]
case mpr.intro.intro.intro.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RPID : IsPrincipalIdealRing R
this : LocalRing R
P : Ideal R
right✝ : ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ IsPrime P) y → y = P
hP1 : P ≠ ⊥
hP2 : IsPrime P
⊢ maximalIdeal R ≠ ⊥
[PROOFSTEP]
have hPM : P ≤ maximalIdeal R := le_maximalIdeal hP2.1
[GOAL]
case mpr.intro.intro.intro.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RPID : IsPrincipalIdealRing R
this : LocalRing R
P : Ideal R
right✝ : ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ IsPrime P) y → y = P
hP1 : P ≠ ⊥
hP2 : IsPrime P
hPM : P ≤ maximalIdeal R
⊢ maximalIdeal R ≠ ⊥
[PROOFSTEP]
intro h
[GOAL]
case mpr.intro.intro.intro.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RPID : IsPrincipalIdealRing R
this : LocalRing R
P : Ideal R
right✝ : ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ IsPrime P) y → y = P
hP1 : P ≠ ⊥
hP2 : IsPrime P
hPM : P ≤ maximalIdeal R
h : maximalIdeal R = ⊥
⊢ False
[PROOFSTEP]
rw [h, le_bot_iff] at hPM 
[GOAL]
case mpr.intro.intro.intro.intro
R✝ : Type u
inst✝⁴ : CommRing R✝
inst✝³ : IsDomain R✝
inst✝² : DiscreteValuationRing R✝
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
RPID : IsPrincipalIdealRing R
this : LocalRing R
P : Ideal R
right✝ : ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ IsPrime P) y → y = P
hP1 : P ≠ ⊥
hP2 : IsPrime P
hPM : P = ⊥
h : maximalIdeal R = ⊥
⊢ False
[PROOFSTEP]
exact hP1 hPM
[GOAL]
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
ha : Irreducible a
hb : Irreducible b
⊢ Associated a b
[PROOFSTEP]
rw [irreducible_iff_uniformizer] at ha hb 
[GOAL]
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
ha✝ : Irreducible a
ha : maximalIdeal R = span {a}
hb✝ : Irreducible b
hb : maximalIdeal R = span {b}
⊢ Associated a b
[PROOFSTEP]
rw [← span_singleton_eq_span_singleton, ← ha, hb]
[GOAL]
R : Type u_1
inst✝ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
p q : R
hp : Irreducible p
hq : Irreducible q
⊢ Associated p q
[PROOFSTEP]
rcases hR with ⟨ϖ, hϖ, hR⟩
[GOAL]
case intro.intro
R : Type u_1
inst✝ : CommRing R
p q : R
hp : Irreducible p
hq : Irreducible q
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
⊢ Associated p q
[PROOFSTEP]
suffices ∀ {p : R} (_ : Irreducible p), Associated p ϖ by apply Associated.trans (this hp) (this hq).symm
[GOAL]
R : Type u_1
inst✝ : CommRing R
p q : R
hp : Irreducible p
hq : Irreducible q
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
this : ∀ {p : R}, Irreducible p → Associated p ϖ
⊢ Associated p q
[PROOFSTEP]
apply Associated.trans (this hp) (this hq).symm
[GOAL]
case intro.intro
R : Type u_1
inst✝ : CommRing R
p q : R
hp : Irreducible p
hq : Irreducible q
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
⊢ ∀ {p : R}, Irreducible p → Associated p ϖ
[PROOFSTEP]
clear hp hq p q
[GOAL]
case intro.intro
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
⊢ ∀ {p : R}, Irreducible p → Associated p ϖ
[PROOFSTEP]
intro p hp
[GOAL]
case intro.intro
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
⊢ Associated p ϖ
[PROOFSTEP]
obtain ⟨n, hn⟩ := hR hp.ne_zero
[GOAL]
case intro.intro.intro
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
n : ℕ
hn : Associated (ϖ ^ n) p
⊢ Associated p ϖ
[PROOFSTEP]
have : Irreducible (ϖ ^ n) := hn.symm.irreducible hp
[GOAL]
case intro.intro.intro
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
n : ℕ
hn : Associated (ϖ ^ n) p
this : Irreducible (ϖ ^ n)
⊢ Associated p ϖ
[PROOFSTEP]
rcases lt_trichotomy n 1 with (H | rfl | H)
[GOAL]
case intro.intro.intro.inl
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
n : ℕ
hn : Associated (ϖ ^ n) p
this : Irreducible (ϖ ^ n)
H : n < 1
⊢ Associated p ϖ
[PROOFSTEP]
obtain rfl : n = 0 := by
  clear hn this
  revert H n
  exact by decide
[GOAL]
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
n : ℕ
hn : Associated (ϖ ^ n) p
this : Irreducible (ϖ ^ n)
H : n < 1
⊢ n = 0
[PROOFSTEP]
clear hn this
[GOAL]
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
n : ℕ
H : n < 1
⊢ n = 0
[PROOFSTEP]
revert H n
[GOAL]
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
⊢ ∀ (n : ℕ), n < 1 → n = 0
[PROOFSTEP]
exact by decide
[GOAL]
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
⊢ ∀ (n : ℕ), n < 1 → n = 0
[PROOFSTEP]
decide
[GOAL]
case intro.intro.intro.inl
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
hn : Associated (ϖ ^ 0) p
this : Irreducible (ϖ ^ 0)
H : 0 < 1
⊢ Associated p ϖ
[PROOFSTEP]
simp [not_irreducible_one, pow_zero] at this 
[GOAL]
case intro.intro.intro.inr.inl
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
hn : Associated (ϖ ^ 1) p
this : Irreducible (ϖ ^ 1)
⊢ Associated p ϖ
[PROOFSTEP]
simpa only [pow_one] using hn.symm
[GOAL]
case intro.intro.intro.inr.inr
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
n : ℕ
hn : Associated (ϖ ^ n) p
this : Irreducible (ϖ ^ n)
H : 1 < n
⊢ Associated p ϖ
[PROOFSTEP]
obtain ⟨n, rfl⟩ : ∃ k, n = 1 + k + 1 := Nat.exists_eq_add_of_lt H
[GOAL]
case intro.intro.intro.inr.inr.intro
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
n : ℕ
hn : Associated (ϖ ^ (1 + n + 1)) p
this : Irreducible (ϖ ^ (1 + n + 1))
H : 1 < 1 + n + 1
⊢ Associated p ϖ
[PROOFSTEP]
rw [pow_succ] at this 
[GOAL]
case intro.intro.intro.inr.inr.intro
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
n : ℕ
hn : Associated (ϖ ^ (1 + n + 1)) p
this : Irreducible (ϖ * ϖ ^ (1 + n))
H : 1 < 1 + n + 1
⊢ Associated p ϖ
[PROOFSTEP]
rcases this.isUnit_or_isUnit rfl with (H0 | H0)
[GOAL]
case intro.intro.intro.inr.inr.intro.inl
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
n : ℕ
hn : Associated (ϖ ^ (1 + n + 1)) p
this : Irreducible (ϖ * ϖ ^ (1 + n))
H : 1 < 1 + n + 1
H0 : IsUnit ϖ
⊢ Associated p ϖ
[PROOFSTEP]
exact (hϖ.not_unit H0).elim
[GOAL]
case intro.intro.intro.inr.inr.intro.inr
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
n : ℕ
hn : Associated (ϖ ^ (1 + n + 1)) p
this : Irreducible (ϖ * ϖ ^ (1 + n))
H : 1 < 1 + n + 1
H0 : IsUnit (ϖ ^ (1 + n))
⊢ Associated p ϖ
[PROOFSTEP]
rw [add_comm, pow_succ] at H0 
[GOAL]
case intro.intro.intro.inr.inr.intro.inr
R : Type u_1
inst✝ : CommRing R
ϖ : R
hϖ : Irreducible ϖ
hR : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (ϖ ^ n) x
p : R
hp : Irreducible p
n : ℕ
hn : Associated (ϖ ^ (1 + n + 1)) p
this : Irreducible (ϖ * ϖ ^ (1 + n))
H : 1 < 1 + n + 1
H0 : IsUnit (ϖ * ϖ ^ n)
⊢ Associated p ϖ
[PROOFSTEP]
exact (hϖ.not_unit (isUnit_of_mul_isUnit_left H0)).elim
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
⊢ ∃ f, (∀ (b : R), b ∈ f → Prime b) ∧ Associated (Multiset.prod f) x
[PROOFSTEP]
use Multiset.replicate (Classical.choose (spec.2 hx)) p
[GOAL]
case h
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
⊢ (∀ (b : R), b ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p → Prime b) ∧
    Associated (Multiset.prod (Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p)) x
[PROOFSTEP]
constructor
[GOAL]
case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
⊢ ∀ (b : R), b ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p → Prime b
[PROOFSTEP]
intro q hq
[GOAL]
case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
⊢ Prime q
[PROOFSTEP]
have hpq := Multiset.eq_of_mem_replicate hq
[GOAL]
case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
⊢ Prime q
[PROOFSTEP]
rw [hpq]
[GOAL]
case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
⊢ Prime p
[PROOFSTEP]
refine' ⟨spec.1.ne_zero, spec.1.not_unit, _⟩
[GOAL]
case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
⊢ ∀ (a b : R), p ∣ a * b → p ∣ a ∨ p ∣ b
[PROOFSTEP]
intro a b h
[GOAL]
case h.left
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
a b : R
h : p ∣ a * b
⊢ p ∣ a ∨ p ∣ b
[PROOFSTEP]
by_cases ha : a = 0
[GOAL]
case pos
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
a b : R
h : p ∣ a * b
ha : a = 0
⊢ p ∣ a ∨ p ∣ b
[PROOFSTEP]
rw [ha]
[GOAL]
case pos
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
a b : R
h : p ∣ a * b
ha : a = 0
⊢ p ∣ 0 ∨ p ∣ b
[PROOFSTEP]
simp only [true_or_iff, dvd_zero]
[GOAL]
case neg
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
a b : R
h : p ∣ a * b
ha : ¬a = 0
⊢ p ∣ a ∨ p ∣ b
[PROOFSTEP]
obtain ⟨m, u, rfl⟩ := spec.2 ha
[GOAL]
case neg.intro.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ choose hR ^ m * ↑u * b
ha : ¬choose hR ^ m * ↑u = 0
⊢ p ∣ choose hR ^ m * ↑u ∨ p ∣ b
[PROOFSTEP]
rw [mul_assoc, mul_left_comm, IsUnit.dvd_mul_left _ _ _ (Units.isUnit _)] at h 
[GOAL]
case neg.intro.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ choose hR ^ m * b
ha : ¬choose hR ^ m * ↑u = 0
⊢ p ∣ choose hR ^ m * ↑u ∨ p ∣ b
[PROOFSTEP]
rw [IsUnit.dvd_mul_right (Units.isUnit _)]
[GOAL]
case neg.intro.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ choose hR ^ m * b
ha : ¬choose hR ^ m * ↑u = 0
⊢ p ∣ choose hR ^ m ∨ p ∣ b
[PROOFSTEP]
by_cases hm : m = 0
[GOAL]
case pos
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ choose hR ^ m * b
ha : ¬choose hR ^ m * ↑u = 0
hm : m = 0
⊢ p ∣ choose hR ^ m ∨ p ∣ b
[PROOFSTEP]
simp only [hm, one_mul, pow_zero] at h ⊢
[GOAL]
case pos
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
ha : ¬choose hR ^ m * ↑u = 0
hm : m = 0
h : choose hR ∣ b
⊢ choose hR ∣ 1 ∨ choose hR ∣ b
[PROOFSTEP]
right
[GOAL]
case pos.h
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
ha : ¬choose hR ^ m * ↑u = 0
hm : m = 0
h : choose hR ∣ b
⊢ choose hR ∣ b
[PROOFSTEP]
exact h
[GOAL]
case neg
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ choose hR ^ m * b
ha : ¬choose hR ^ m * ↑u = 0
hm : ¬m = 0
⊢ p ∣ choose hR ^ m ∨ p ∣ b
[PROOFSTEP]
left
[GOAL]
case neg.h
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
b : R
m : ℕ
u : Rˣ
h : p ∣ choose hR ^ m * b
ha : ¬choose hR ^ m * ↑u = 0
hm : ¬m = 0
⊢ p ∣ choose hR ^ m
[PROOFSTEP]
obtain ⟨m, rfl⟩ := Nat.exists_eq_succ_of_ne_zero hm
[GOAL]
case neg.h.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
b : R
u : Rˣ
m : ℕ
h : p ∣ choose hR ^ Nat.succ m * b
ha : ¬choose hR ^ Nat.succ m * ↑u = 0
hm : ¬Nat.succ m = 0
⊢ p ∣ choose hR ^ Nat.succ m
[PROOFSTEP]
rw [pow_succ]
[GOAL]
case neg.h.intro
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
q : R
hq : q ∈ Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p
hpq : q = p
b : R
u : Rˣ
m : ℕ
h : p ∣ choose hR ^ Nat.succ m * b
ha : ¬choose hR ^ Nat.succ m * ↑u = 0
hm : ¬Nat.succ m = 0
⊢ p ∣ choose hR * choose hR ^ m
[PROOFSTEP]
apply dvd_mul_of_dvd_left dvd_rfl _
[GOAL]
case h.right
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
⊢ Associated (Multiset.prod (Multiset.replicate (choose (_ : ∃ n, Associated (choose hR ^ n) x)) p)) x
[PROOFSTEP]
rw [Multiset.prod_replicate]
[GOAL]
case h.right
R : Type u_1
inst✝¹ : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝ : IsDomain R
p : R := choose hR
spec : Irreducible (choose hR) ∧ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (choose hR ^ n) x := choose_spec hR
x : R
hx : x ≠ 0
⊢ Associated (p ^ choose (_ : ∃ n, Associated (choose hR ^ n) x)) x
[PROOFSTEP]
exact Classical.choose_spec (spec.2 hx)
[GOAL]
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
⊢ HasUnitMulPowIrreducibleFactorization R
[PROOFSTEP]
obtain ⟨p, hp⟩ := h₁
[GOAL]
case intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
⊢ HasUnitMulPowIrreducibleFactorization R
[PROOFSTEP]
refine' ⟨p, hp, _⟩
[GOAL]
case intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
⊢ ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
[PROOFSTEP]
intro x hx
[GOAL]
case intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
⊢ ∃ n, Associated (p ^ n) x
[PROOFSTEP]
cases' WfDvdMonoid.exists_factors x hx with fx hfx
[GOAL]
case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
⊢ ∃ n, Associated (p ^ n) x
[PROOFSTEP]
refine' ⟨Multiset.card fx, _⟩
[GOAL]
case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
⊢ Associated (p ^ ↑Multiset.card fx) x
[PROOFSTEP]
have H := hfx.2
[GOAL]
case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associated (Multiset.prod fx) x
⊢ Associated (p ^ ↑Multiset.card fx) x
[PROOFSTEP]
rw [← Associates.mk_eq_mk_iff_associated] at H ⊢
[GOAL]
case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ Associates.mk (p ^ ↑Multiset.card fx) = Associates.mk x
[PROOFSTEP]
rw [← H, ← Associates.prod_mk, Associates.mk_pow, ← Multiset.prod_replicate]
[GOAL]
case intro.intro
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ Multiset.prod (Multiset.replicate (↑Multiset.card fx) (Associates.mk p)) =
    Multiset.prod (Multiset.map Associates.mk fx)
[PROOFSTEP]
congr 1
[GOAL]
case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ Multiset.replicate (↑Multiset.card fx) (Associates.mk p) = Multiset.map Associates.mk fx
[PROOFSTEP]
symm
[GOAL]
case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ Multiset.map Associates.mk fx = Multiset.replicate (↑Multiset.card fx) (Associates.mk p)
[PROOFSTEP]
rw [Multiset.eq_replicate]
[GOAL]
case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ ↑Multiset.card (Multiset.map Associates.mk fx) = ↑Multiset.card fx ∧
    ∀ (b : Associates R), b ∈ Multiset.map Associates.mk fx → b = Associates.mk p
[PROOFSTEP]
simp only [true_and_iff, and_imp, Multiset.card_map, eq_self_iff_true, Multiset.mem_map, exists_imp]
[GOAL]
case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ ∀ (b : Associates R) (x : R), x ∈ fx → Associates.mk x = b → b = Associates.mk p
[PROOFSTEP]
rintro _ q hq rfl
[GOAL]
case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
q : R
hq : q ∈ fx
⊢ Associates.mk q = Associates.mk p
[PROOFSTEP]
rw [Associates.mk_eq_mk_iff_associated]
[GOAL]
case intro.intro.e_a
R : Type u_1
inst✝² : CommRing R
hR : HasUnitMulPowIrreducibleFactorization R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
p : R
hp : Irreducible p
x : R
hx : x ≠ 0
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
q : R
hq : q ∈ fx
⊢ Associated q p
[PROOFSTEP]
apply h₂ (hfx.1 _ hq) hp
[GOAL]
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
⊢ IsPrincipalIdealRing R
[PROOFSTEP]
constructor
[GOAL]
case principal
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
⊢ ∀ (S : Ideal R), Submodule.IsPrincipal S
[PROOFSTEP]
intro I
[GOAL]
case principal
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
⊢ Submodule.IsPrincipal I
[PROOFSTEP]
by_cases I0 : I = ⊥
[GOAL]
case pos
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : I = ⊥
⊢ Submodule.IsPrincipal I
[PROOFSTEP]
rw [I0]
[GOAL]
case pos
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : I = ⊥
⊢ Submodule.IsPrincipal ⊥
[PROOFSTEP]
use 0
[GOAL]
case h
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : I = ⊥
⊢ ⊥ = Submodule.span R {0}
[PROOFSTEP]
simp only [Set.singleton_zero, Submodule.span_zero]
[GOAL]
case neg
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
⊢ Submodule.IsPrincipal I
[PROOFSTEP]
obtain ⟨x, hxI, hx0⟩ : ∃ x ∈ I, x ≠ (0 : R) := I.ne_bot_iff.mp I0
[GOAL]
case neg.intro.intro
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
⊢ Submodule.IsPrincipal I
[PROOFSTEP]
obtain ⟨p, _, H⟩ := HasUnitMulPowIrreducibleFactorization.of_ufd_of_unique_irreducible h₁ h₂
[GOAL]
case neg.intro.intro.intro.intro
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
⊢ Submodule.IsPrincipal I
[PROOFSTEP]
have ex : ∃ n : ℕ, p ^ n ∈ I := by
  obtain ⟨n, u, rfl⟩ := H hx0
  refine' ⟨n, _⟩
  simpa only [Units.mul_inv_cancel_right] using I.mul_mem_right (↑u⁻¹) hxI
[GOAL]
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
⊢ ∃ n, p ^ n ∈ I
[PROOFSTEP]
obtain ⟨n, u, rfl⟩ := H hx0
[GOAL]
case intro.intro
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
n : ℕ
u : Rˣ
hxI : p ^ n * ↑u ∈ I
hx0 : p ^ n * ↑u ≠ 0
⊢ ∃ n, p ^ n ∈ I
[PROOFSTEP]
refine' ⟨n, _⟩
[GOAL]
case intro.intro
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
n : ℕ
u : Rˣ
hxI : p ^ n * ↑u ∈ I
hx0 : p ^ n * ↑u ≠ 0
⊢ p ^ n ∈ I
[PROOFSTEP]
simpa only [Units.mul_inv_cancel_right] using I.mul_mem_right (↑u⁻¹) hxI
[GOAL]
case neg.intro.intro.intro.intro
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
⊢ Submodule.IsPrincipal I
[PROOFSTEP]
constructor
[GOAL]
case neg.intro.intro.intro.intro.principal'
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
⊢ ∃ a, I = Submodule.span R {a}
[PROOFSTEP]
use p ^ Nat.find ex
[GOAL]
case h
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
⊢ I = Submodule.span R {p ^ Nat.find ex}
[PROOFSTEP]
show I = Ideal.span _
[GOAL]
case h
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
⊢ I = span {p ^ Nat.find ex}
[PROOFSTEP]
apply le_antisymm
[GOAL]
case h.a
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
⊢ I ≤ span {p ^ Nat.find ex}
[PROOFSTEP]
intro r hr
[GOAL]
case h.a
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
r : R
hr : r ∈ I
⊢ r ∈ span {p ^ Nat.find ex}
[PROOFSTEP]
by_cases hr0 : r = 0
[GOAL]
case pos
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
r : R
hr : r ∈ I
hr0 : r = 0
⊢ r ∈ span {p ^ Nat.find ex}
[PROOFSTEP]
simp only [hr0, Submodule.zero_mem]
[GOAL]
case neg
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
r : R
hr : r ∈ I
hr0 : ¬r = 0
⊢ r ∈ span {p ^ Nat.find ex}
[PROOFSTEP]
obtain ⟨n, u, rfl⟩ := H hr0
[GOAL]
case neg.intro.intro
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
n : ℕ
u : Rˣ
hr : p ^ n * ↑u ∈ I
hr0 : ¬p ^ n * ↑u = 0
⊢ p ^ n * ↑u ∈ span {p ^ Nat.find ex}
[PROOFSTEP]
simp only [mem_span_singleton, Units.isUnit, IsUnit.dvd_mul_right]
[GOAL]
case neg.intro.intro
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
n : ℕ
u : Rˣ
hr : p ^ n * ↑u ∈ I
hr0 : ¬p ^ n * ↑u = 0
⊢ p ^ Nat.find ex ∣ p ^ n
[PROOFSTEP]
apply pow_dvd_pow
[GOAL]
case neg.intro.intro.h
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
n : ℕ
u : Rˣ
hr : p ^ n * ↑u ∈ I
hr0 : ¬p ^ n * ↑u = 0
⊢ Nat.find ex ≤ n
[PROOFSTEP]
apply Nat.find_min'
[GOAL]
case neg.intro.intro.h.h
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
n : ℕ
u : Rˣ
hr : p ^ n * ↑u ∈ I
hr0 : ¬p ^ n * ↑u = 0
⊢ p ^ n ∈ I
[PROOFSTEP]
simpa only [Units.mul_inv_cancel_right] using I.mul_mem_right (↑u⁻¹) hr
[GOAL]
case h.a
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
⊢ span {p ^ Nat.find ex} ≤ I
[PROOFSTEP]
erw [Submodule.span_singleton_le_iff_mem]
[GOAL]
case h.a
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
I : Ideal R
I0 : ¬I = ⊥
x : R
hxI : x ∈ I
hx0 : x ≠ 0
p : R
left✝ : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
ex : ∃ n, p ^ n ∈ I
⊢ p ^ Nat.find ex ∈ I
[PROOFSTEP]
exact Nat.find_spec ex
[GOAL]
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
⊢ DiscreteValuationRing R
[PROOFSTEP]
rw [iff_pid_with_one_nonzero_prime]
[GOAL]
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
⊢ IsPrincipalIdealRing R ∧ ∃! P, P ≠ ⊥ ∧ IsPrime P
[PROOFSTEP]
haveI PID : IsPrincipalIdealRing R := aux_pid_of_ufd_of_unique_irreducible R h₁ h₂
[GOAL]
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₁ : ∃ p, Irreducible p
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
PID : IsPrincipalIdealRing R
⊢ IsPrincipalIdealRing R ∧ ∃! P, P ≠ ⊥ ∧ IsPrime P
[PROOFSTEP]
obtain ⟨p, hp⟩ := h₁
[GOAL]
case intro
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
PID : IsPrincipalIdealRing R
p : R
hp : Irreducible p
⊢ IsPrincipalIdealRing R ∧ ∃! P, P ≠ ⊥ ∧ IsPrime P
[PROOFSTEP]
refine' ⟨PID, ⟨Ideal.span { p }, ⟨_, _⟩, _⟩⟩
[GOAL]
case intro.refine'_1
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
PID : IsPrincipalIdealRing R
p : R
hp : Irreducible p
⊢ span {p} ≠ ⊥
[PROOFSTEP]
rw [Submodule.ne_bot_iff]
[GOAL]
case intro.refine'_1
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
PID : IsPrincipalIdealRing R
p : R
hp : Irreducible p
⊢ ∃ x, x ∈ span {p} ∧ x ≠ 0
[PROOFSTEP]
refine' ⟨p, Ideal.mem_span_singleton.mpr (dvd_refl p), hp.ne_zero⟩
[GOAL]
case intro.refine'_2
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
PID : IsPrincipalIdealRing R
p : R
hp : Irreducible p
⊢ IsPrime (span {p})
[PROOFSTEP]
rwa [Ideal.span_singleton_prime hp.ne_zero, ← UniqueFactorizationMonoid.irreducible_iff_prime]
[GOAL]
case intro.refine'_3
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
PID : IsPrincipalIdealRing R
p : R
hp : Irreducible p
⊢ ∀ (y : Ideal R), (fun P => P ≠ ⊥ ∧ IsPrime P) y → y = span {p}
[PROOFSTEP]
intro I
[GOAL]
case intro.refine'_3
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
PID : IsPrincipalIdealRing R
p : R
hp : Irreducible p
I : Ideal R
⊢ (fun P => P ≠ ⊥ ∧ IsPrime P) I → I = span {p}
[PROOFSTEP]
rw [← Submodule.IsPrincipal.span_singleton_generator I]
[GOAL]
case intro.refine'_3
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
PID : IsPrincipalIdealRing R
p : R
hp : Irreducible p
I : Ideal R
⊢ (fun P => P ≠ ⊥ ∧ IsPrime P) (Submodule.span R {Submodule.IsPrincipal.generator I}) →
    Submodule.span R {Submodule.IsPrincipal.generator I} = span {p}
[PROOFSTEP]
rintro ⟨I0, hI⟩
[GOAL]
case intro.refine'_3.intro
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
PID : IsPrincipalIdealRing R
p : R
hp : Irreducible p
I : Ideal R
I0 : Submodule.span R {Submodule.IsPrincipal.generator I} ≠ ⊥
hI : IsPrime (Submodule.span R {Submodule.IsPrincipal.generator I})
⊢ Submodule.span R {Submodule.IsPrincipal.generator I} = span {p}
[PROOFSTEP]
apply span_singleton_eq_span_singleton.mpr
[GOAL]
case intro.refine'_3.intro
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
PID : IsPrincipalIdealRing R
p : R
hp : Irreducible p
I : Ideal R
I0 : Submodule.span R {Submodule.IsPrincipal.generator I} ≠ ⊥
hI : IsPrime (Submodule.span R {Submodule.IsPrincipal.generator I})
⊢ Associated (Submodule.IsPrincipal.generator I) p
[PROOFSTEP]
apply h₂ _ hp
[GOAL]
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
PID : IsPrincipalIdealRing R
p : R
hp : Irreducible p
I : Ideal R
I0 : Submodule.span R {Submodule.IsPrincipal.generator I} ≠ ⊥
hI : IsPrime (Submodule.span R {Submodule.IsPrincipal.generator I})
⊢ Irreducible (Submodule.IsPrincipal.generator I)
[PROOFSTEP]
erw [Ne.def, span_singleton_eq_bot] at I0 
[GOAL]
R✝ : Type u_1
R : Type u
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : UniqueFactorizationMonoid R
h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q
PID : IsPrincipalIdealRing R
p : R
hp : Irreducible p
I : Ideal R
I0 : ¬Submodule.IsPrincipal.generator I = 0
hI : IsPrime (Submodule.span R {Submodule.IsPrincipal.generator I})
⊢ Irreducible (Submodule.IsPrincipal.generator I)
[PROOFSTEP]
rwa [UniqueFactorizationMonoid.irreducible_iff_prime, ← Ideal.span_singleton_prime I0]
[GOAL]
R✝ : Type u_1
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
hR : HasUnitMulPowIrreducibleFactorization R
⊢ DiscreteValuationRing R
[PROOFSTEP]
letI : UniqueFactorizationMonoid R := hR.toUniqueFactorizationMonoid
[GOAL]
R✝ : Type u_1
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
hR : HasUnitMulPowIrreducibleFactorization R
this : UniqueFactorizationMonoid R := HasUnitMulPowIrreducibleFactorization.toUniqueFactorizationMonoid hR
⊢ DiscreteValuationRing R
[PROOFSTEP]
apply of_ufd_of_unique_irreducible _ hR.unique_irreducible
[GOAL]
R✝ : Type u_1
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
hR : HasUnitMulPowIrreducibleFactorization R
this : UniqueFactorizationMonoid R := HasUnitMulPowIrreducibleFactorization.toUniqueFactorizationMonoid hR
⊢ ∃ p, Irreducible p
[PROOFSTEP]
obtain ⟨p, hp, H⟩ := hR
[GOAL]
case intro.intro
R✝ : Type u_1
R : Type u
inst✝¹ : CommRing R
inst✝ : IsDomain R
p : R
hp : Irreducible p
H : ∀ {x : R}, x ≠ 0 → ∃ n, Associated (p ^ n) x
this : UniqueFactorizationMonoid R :=
  HasUnitMulPowIrreducibleFactorization.toUniqueFactorizationMonoid (Exists.intro p { left := hp, right := H })
⊢ ∃ p, Irreducible p
[PROOFSTEP]
exact ⟨p, hp⟩
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
⊢ ∃ n, Associated x (ϖ ^ n)
[PROOFSTEP]
have : WfDvdMonoid R := IsNoetherianRing.wfDvdMonoid
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
⊢ ∃ n, Associated x (ϖ ^ n)
[PROOFSTEP]
cases' WfDvdMonoid.exists_factors x hx with fx hfx
[GOAL]
case intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
⊢ ∃ n, Associated x (ϖ ^ n)
[PROOFSTEP]
use Multiset.card fx
[GOAL]
case h
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
⊢ Associated x (ϖ ^ ↑Multiset.card fx)
[PROOFSTEP]
have H := hfx.2
[GOAL]
case h
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associated (Multiset.prod fx) x
⊢ Associated x (ϖ ^ ↑Multiset.card fx)
[PROOFSTEP]
rw [← Associates.mk_eq_mk_iff_associated] at H ⊢
[GOAL]
case h
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ Associates.mk x = Associates.mk (ϖ ^ ↑Multiset.card fx)
[PROOFSTEP]
rw [← H, ← Associates.prod_mk, Associates.mk_pow, ← Multiset.prod_replicate]
[GOAL]
case h
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ Multiset.prod (Multiset.map Associates.mk fx) =
    Multiset.prod (Multiset.replicate (↑Multiset.card fx) (Associates.mk ϖ))
[PROOFSTEP]
congr 1
[GOAL]
case h.e_a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ Multiset.map Associates.mk fx = Multiset.replicate (↑Multiset.card fx) (Associates.mk ϖ)
[PROOFSTEP]
rw [Multiset.eq_replicate]
[GOAL]
case h.e_a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ ↑Multiset.card (Multiset.map Associates.mk fx) = ↑Multiset.card fx ∧
    ∀ (b : Associates R), b ∈ Multiset.map Associates.mk fx → b = Associates.mk ϖ
[PROOFSTEP]
simp only [true_and_iff, and_imp, Multiset.card_map, eq_self_iff_true, Multiset.mem_map, exists_imp]
[GOAL]
case h.e_a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
⊢ ∀ (b : Associates R) (x : R), x ∈ fx → Associates.mk x = b → b = Associates.mk ϖ
[PROOFSTEP]
rintro _ _ _ rfl
[GOAL]
case h.e_a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
x✝ : R
a✝ : x✝ ∈ fx
⊢ Associates.mk x✝ = Associates.mk ϖ
[PROOFSTEP]
rw [Associates.mk_eq_mk_iff_associated]
[GOAL]
case h.e_a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
x✝ : R
a✝ : x✝ ∈ fx
⊢ Associated x✝ ϖ
[PROOFSTEP]
refine' associated_of_irreducible _ _ hirr
[GOAL]
case h.e_a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
x✝ : R
a✝ : x✝ ∈ fx
⊢ Irreducible x✝
[PROOFSTEP]
apply hfx.1
[GOAL]
case h.e_a.a
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
this : WfDvdMonoid R
fx : Multiset R
hfx : (∀ (b : R), b ∈ fx → Irreducible b) ∧ Associated (Multiset.prod fx) x
H : Associates.mk (Multiset.prod fx) = Associates.mk x
x✝ : R
a✝ : x✝ ∈ fx
⊢ x✝ ∈ fx
[PROOFSTEP]
assumption
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
⊢ ∃ n u, x = ↑u * ϖ ^ n
[PROOFSTEP]
obtain ⟨n, hn⟩ := associated_pow_irreducible hx hirr
[GOAL]
case intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : x ≠ 0
ϖ : R
hirr : Irreducible ϖ
n : ℕ
hn : Associated x (ϖ ^ n)
⊢ ∃ n u, x = ↑u * ϖ ^ n
[PROOFSTEP]
obtain ⟨u, rfl⟩ := hn.symm
[GOAL]
case intro.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
ϖ : R
hirr : Irreducible ϖ
n : ℕ
u : Rˣ
hx : ϖ ^ n * ↑u ≠ 0
hn : Associated (ϖ ^ n * ↑u) (ϖ ^ n)
⊢ ∃ n_1 u_1, ϖ ^ n * ↑u = ↑u_1 * ϖ ^ n_1
[PROOFSTEP]
use n, u
[GOAL]
case h
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
ϖ : R
hirr : Irreducible ϖ
n : ℕ
u : Rˣ
hx : ϖ ^ n * ↑u ≠ 0
hn : Associated (ϖ ^ n * ↑u) (ϖ ^ n)
⊢ ϖ ^ n * ↑u = ↑u * ϖ ^ n
[PROOFSTEP]
apply mul_comm
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
s : Ideal R
hs : s ≠ ⊥
ϖ : R
hirr : Irreducible ϖ
⊢ ∃ n, s = span {ϖ ^ n}
[PROOFSTEP]
have gen_ne_zero : generator s ≠ 0 := by
  rw [Ne.def, ← eq_bot_iff_generator_eq_zero]
  assumption
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
s : Ideal R
hs : s ≠ ⊥
ϖ : R
hirr : Irreducible ϖ
⊢ generator s ≠ 0
[PROOFSTEP]
rw [Ne.def, ← eq_bot_iff_generator_eq_zero]
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
s : Ideal R
hs : s ≠ ⊥
ϖ : R
hirr : Irreducible ϖ
⊢ ¬s = ⊥
[PROOFSTEP]
assumption
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
s : Ideal R
hs : s ≠ ⊥
ϖ : R
hirr : Irreducible ϖ
gen_ne_zero : generator s ≠ 0
⊢ ∃ n, s = span {ϖ ^ n}
[PROOFSTEP]
rcases associated_pow_irreducible gen_ne_zero hirr with ⟨n, u, hnu⟩
[GOAL]
case intro.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
s : Ideal R
hs : s ≠ ⊥
ϖ : R
hirr : Irreducible ϖ
gen_ne_zero : generator s ≠ 0
n : ℕ
u : Rˣ
hnu : generator s * ↑u = ϖ ^ n
⊢ ∃ n, s = span {ϖ ^ n}
[PROOFSTEP]
use n
[GOAL]
case h
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
s : Ideal R
hs : s ≠ ⊥
ϖ : R
hirr : Irreducible ϖ
gen_ne_zero : generator s ≠ 0
n : ℕ
u : Rˣ
hnu : generator s * ↑u = ϖ ^ n
⊢ s = span {ϖ ^ n}
[PROOFSTEP]
have : span _ = _ := Ideal.span_singleton_generator s
[GOAL]
case h
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
s : Ideal R
hs : s ≠ ⊥
ϖ : R
hirr : Irreducible ϖ
gen_ne_zero : generator s ≠ 0
n : ℕ
u : Rˣ
hnu : generator s * ↑u = ϖ ^ n
this : span {generator s} = s
⊢ s = span {ϖ ^ n}
[PROOFSTEP]
rw [← this, ← hnu, span_singleton_eq_span_singleton]
[GOAL]
case h
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
s : Ideal R
hs : s ≠ ⊥
ϖ : R
hirr : Irreducible ϖ
gen_ne_zero : generator s ≠ 0
n : ℕ
u : Rˣ
hnu : generator s * ↑u = ϖ ^ n
this : span {generator s} = s
⊢ Associated (generator s) (generator s * ↑u)
[PROOFSTEP]
use u
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ m = n
[PROOFSTEP]
have key : Associated (Multiset.replicate m p).prod (Multiset.replicate n q).prod :=
  by
  rw [Multiset.prod_replicate, Multiset.prod_replicate, Associated]
  refine' ⟨u * v⁻¹, _⟩
  simp only [Units.val_mul]
  rw [mul_left_comm, ← mul_assoc, h, mul_right_comm, Units.mul_inv, one_mul]
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ Associated (Multiset.prod (Multiset.replicate m p)) (Multiset.prod (Multiset.replicate n q))
[PROOFSTEP]
rw [Multiset.prod_replicate, Multiset.prod_replicate, Associated]
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ ∃ u, p ^ m * ↑u = q ^ n
[PROOFSTEP]
refine' ⟨u * v⁻¹, _⟩
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ p ^ m * ↑(u * v⁻¹) = q ^ n
[PROOFSTEP]
simp only [Units.val_mul]
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
⊢ p ^ m * (↑u * ↑v⁻¹) = q ^ n
[PROOFSTEP]
rw [mul_left_comm, ← mul_assoc, h, mul_right_comm, Units.mul_inv, one_mul]
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.prod (Multiset.replicate m p)) (Multiset.prod (Multiset.replicate n q))
⊢ m = n
[PROOFSTEP]
have := by
  refine' Multiset.card_eq_card_of_rel (UniqueFactorizationMonoid.factors_unique _ _ key)
  all_goals
    intro x hx
    obtain rfl := Multiset.eq_of_mem_replicate hx
    assumption
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.prod (Multiset.replicate m p)) (Multiset.prod (Multiset.replicate n q))
⊢ ?m.283362
[PROOFSTEP]
refine' Multiset.card_eq_card_of_rel (UniqueFactorizationMonoid.factors_unique _ _ key)
[GOAL]
case refine'_1
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.prod (Multiset.replicate m p)) (Multiset.prod (Multiset.replicate n q))
⊢ ∀ (x : R), x ∈ Multiset.replicate m p → Irreducible x
case refine'_2
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.prod (Multiset.replicate m p)) (Multiset.prod (Multiset.replicate n q))
⊢ ∀ (x : R), x ∈ Multiset.replicate n q → Irreducible x
[PROOFSTEP]
all_goals
  intro x hx
  obtain rfl := Multiset.eq_of_mem_replicate hx
  assumption
[GOAL]
case refine'_1
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.prod (Multiset.replicate m p)) (Multiset.prod (Multiset.replicate n q))
⊢ ∀ (x : R), x ∈ Multiset.replicate m p → Irreducible x
[PROOFSTEP]
intro x hx
[GOAL]
case refine'_1
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.prod (Multiset.replicate m p)) (Multiset.prod (Multiset.replicate n q))
x : R
hx : x ∈ Multiset.replicate m p
⊢ Irreducible x
[PROOFSTEP]
obtain rfl := Multiset.eq_of_mem_replicate hx
[GOAL]
case refine'_1
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
q : R
hq : Irreducible q
u v : Rˣ
m n : ℕ
x : R
hp : Irreducible x
h : ↑u * x ^ m = ↑v * q ^ n
key : Associated (Multiset.prod (Multiset.replicate m x)) (Multiset.prod (Multiset.replicate n q))
hx : x ∈ Multiset.replicate m x
⊢ Irreducible x
[PROOFSTEP]
assumption
[GOAL]
case refine'_2
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.prod (Multiset.replicate m p)) (Multiset.prod (Multiset.replicate n q))
⊢ ∀ (x : R), x ∈ Multiset.replicate n q → Irreducible x
[PROOFSTEP]
intro x hx
[GOAL]
case refine'_2
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.prod (Multiset.replicate m p)) (Multiset.prod (Multiset.replicate n q))
x : R
hx : x ∈ Multiset.replicate n q
⊢ Irreducible x
[PROOFSTEP]
obtain rfl := Multiset.eq_of_mem_replicate hx
[GOAL]
case refine'_2
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p : R
hp : Irreducible p
u v : Rˣ
m n : ℕ
x : R
hq : Irreducible x
h : ↑u * p ^ m = ↑v * x ^ n
key : Associated (Multiset.prod (Multiset.replicate m p)) (Multiset.prod (Multiset.replicate n x))
hx : x ∈ Multiset.replicate n x
⊢ Irreducible x
[PROOFSTEP]
assumption
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
p q : R
hp : Irreducible p
hq : Irreducible q
u v : Rˣ
m n : ℕ
h : ↑u * p ^ m = ↑v * q ^ n
key : Associated (Multiset.prod (Multiset.replicate m p)) (Multiset.prod (Multiset.replicate n q))
this : ↑Multiset.card (Multiset.replicate m p) = ↑Multiset.card (Multiset.replicate n q)
⊢ m = n
[PROOFSTEP]
simpa only [Multiset.card_replicate]
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
ϖ : R
hirr : Irreducible ϖ
u v : Rˣ
m n : ℕ
h : ↑u * ϖ ^ m = ↑v * ϖ ^ n
⊢ u = v
[PROOFSTEP]
obtain rfl : m = n := unit_mul_pow_congr_pow hirr hirr u v m n h
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
ϖ : R
hirr : Irreducible ϖ
u v : Rˣ
m : ℕ
h : ↑u * ϖ ^ m = ↑v * ϖ ^ m
⊢ u = v
[PROOFSTEP]
rw [← sub_eq_zero] at h 
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
ϖ : R
hirr : Irreducible ϖ
u v : Rˣ
m : ℕ
h✝ : ↑u * ϖ ^ m = ↑v * ϖ ^ m
h : ↑u * ϖ ^ m - ↑v * ϖ ^ m = 0
⊢ u = v
[PROOFSTEP]
rw [← sub_mul, mul_eq_zero] at h 
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
ϖ : R
hirr : Irreducible ϖ
u v : Rˣ
m : ℕ
h✝ : ↑u * ϖ ^ m = ↑v * ϖ ^ m
h : ↑u - ↑v = 0 ∨ ϖ ^ m = 0
⊢ u = v
[PROOFSTEP]
cases' h with h h
[GOAL]
case inl
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
ϖ : R
hirr : Irreducible ϖ
u v : Rˣ
m : ℕ
h✝ : ↑u * ϖ ^ m = ↑v * ϖ ^ m
h : ↑u - ↑v = 0
⊢ u = v
[PROOFSTEP]
rw [sub_eq_zero] at h 
[GOAL]
case inl
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
ϖ : R
hirr : Irreducible ϖ
u v : Rˣ
m : ℕ
h✝ : ↑u * ϖ ^ m = ↑v * ϖ ^ m
h : ↑u = ↑v
⊢ u = v
[PROOFSTEP]
exact_mod_cast h
[GOAL]
case inr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
ϖ : R
hirr : Irreducible ϖ
u v : Rˣ
m : ℕ
h✝ : ↑u * ϖ ^ m = ↑v * ϖ ^ m
h : ϖ ^ m = 0
⊢ u = v
[PROOFSTEP]
apply (hirr.ne_zero (pow_eq_zero h)).elim
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
r : R
u : Rˣ
ϖ : R
hϖ : Irreducible ϖ
n : ℕ
hr : r = ↑u * ϖ ^ n
⊢ ↑(addVal R) r = ↑n
[PROOFSTEP]
rw [addVal, addValuation_apply, hr,
  eq_of_associated_left (associated_of_irreducible R hϖ (Classical.choose_spec (exists_prime R)).irreducible),
  eq_of_associated_right (Associated.symm ⟨u, mul_comm _ _⟩),
  multiplicity_pow_self_of_prime (PrincipalIdealRing.irreducible_iff_prime.1 hϖ)]
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
ϖ : R
hϖ : Irreducible ϖ
⊢ ↑(addVal R) ϖ = 1
[PROOFSTEP]
simpa only [one_mul, eq_self_iff_true, Units.val_one, pow_one, forall_true_left, Nat.cast_one] using addVal_def ϖ 1 hϖ 1
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
ϖ : R
h : Irreducible ϖ
n : ℕ
⊢ ↑(addVal R) (ϖ ^ n) = ↑n
[PROOFSTEP]
rw [addVal_pow, addVal_uniformizer h, nsmul_one]
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
⊢ ↑(addVal R) a = ⊤ ↔ a = 0
[PROOFSTEP]
have hi := (Classical.choose_spec (exists_prime R)).irreducible
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (choose (_ : ∃ ϖ, Prime ϖ))
⊢ ↑(addVal R) a = ⊤ ↔ a = 0
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (choose (_ : ∃ ϖ, Prime ϖ))
⊢ ↑(addVal R) a = ⊤ → a = 0
[PROOFSTEP]
contrapose
[GOAL]
case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (choose (_ : ∃ ϖ, Prime ϖ))
⊢ ¬a = 0 → ¬↑(addVal R) a = ⊤
[PROOFSTEP]
intro h
[GOAL]
case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (choose (_ : ∃ ϖ, Prime ϖ))
h : ¬a = 0
⊢ ¬↑(addVal R) a = ⊤
[PROOFSTEP]
obtain ⟨n, ha⟩ := associated_pow_irreducible h hi
[GOAL]
case mp.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (choose (_ : ∃ ϖ, Prime ϖ))
h : ¬a = 0
n : ℕ
ha : Associated a (choose (_ : ∃ ϖ, Prime ϖ) ^ n)
⊢ ¬↑(addVal R) a = ⊤
[PROOFSTEP]
obtain ⟨u, rfl⟩ := ha.symm
[GOAL]
case mp.intro.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
hi : Irreducible (choose (_ : ∃ ϖ, Prime ϖ))
n : ℕ
u : Rˣ
h : ¬choose (_ : ∃ ϖ, Prime ϖ) ^ n * ↑u = 0
ha : Associated (choose (_ : ∃ ϖ, Prime ϖ) ^ n * ↑u) (choose (_ : ∃ ϖ, Prime ϖ) ^ n)
⊢ ¬↑(addVal R) (choose (_ : ∃ ϖ, Prime ϖ) ^ n * ↑u) = ⊤
[PROOFSTEP]
rw [mul_comm, addVal_def' u hi n]
[GOAL]
case mp.intro.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
hi : Irreducible (choose (_ : ∃ ϖ, Prime ϖ))
n : ℕ
u : Rˣ
h : ¬choose (_ : ∃ ϖ, Prime ϖ) ^ n * ↑u = 0
ha : Associated (choose (_ : ∃ ϖ, Prime ϖ) ^ n * ↑u) (choose (_ : ∃ ϖ, Prime ϖ) ^ n)
⊢ ¬↑n = ⊤
[PROOFSTEP]
exact PartENat.natCast_ne_top _
[GOAL]
case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a : R
hi : Irreducible (choose (_ : ∃ ϖ, Prime ϖ))
⊢ a = 0 → ↑(addVal R) a = ⊤
[PROOFSTEP]
rintro rfl
[GOAL]
case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
hi : Irreducible (choose (_ : ∃ ϖ, Prime ϖ))
⊢ ↑(addVal R) 0 = ⊤
[PROOFSTEP]
exact addVal_zero
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
⊢ ↑(addVal R) a ≤ ↑(addVal R) b ↔ a ∣ b
[PROOFSTEP]
have hp := Classical.choose_spec (exists_prime R)
[GOAL]
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (choose (_ : ∃ ϖ, Prime ϖ))
⊢ ↑(addVal R) a ≤ ↑(addVal R) b ↔ a ∣ b
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (choose (_ : ∃ ϖ, Prime ϖ))
⊢ ↑(addVal R) a ≤ ↑(addVal R) b → a ∣ b
[PROOFSTEP]
intro h
[GOAL]
case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (choose (_ : ∃ ϖ, Prime ϖ))
⊢ a ∣ b → ↑(addVal R) a ≤ ↑(addVal R) b
[PROOFSTEP]
intro h
[GOAL]
case mp
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (choose (_ : ∃ ϖ, Prime ϖ))
h : ↑(addVal R) a ≤ ↑(addVal R) b
⊢ a ∣ b
[PROOFSTEP]
by_cases ha0 : a = 0
[GOAL]
case pos
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (choose (_ : ∃ ϖ, Prime ϖ))
h : ↑(addVal R) a ≤ ↑(addVal R) b
ha0 : a = 0
⊢ a ∣ b
[PROOFSTEP]
rw [ha0, addVal_zero, top_le_iff, addVal_eq_top_iff] at h 
[GOAL]
case pos
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (choose (_ : ∃ ϖ, Prime ϖ))
h : b = 0
ha0 : a = 0
⊢ a ∣ b
[PROOFSTEP]
rw [h]
[GOAL]
case pos
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (choose (_ : ∃ ϖ, Prime ϖ))
h : b = 0
ha0 : a = 0
⊢ a ∣ 0
[PROOFSTEP]
apply dvd_zero
[GOAL]
case neg
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (choose (_ : ∃ ϖ, Prime ϖ))
h : ↑(addVal R) a ≤ ↑(addVal R) b
ha0 : ¬a = 0
⊢ a ∣ b
[PROOFSTEP]
obtain ⟨n, ha⟩ := associated_pow_irreducible ha0 hp.irreducible
[GOAL]
case neg.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (choose (_ : ∃ ϖ, Prime ϖ))
h : ↑(addVal R) a ≤ ↑(addVal R) b
ha0 : ¬a = 0
n : ℕ
ha : Associated a (choose (_ : ∃ ϖ, Prime ϖ) ^ n)
⊢ a ∣ b
[PROOFSTEP]
rw [addVal, addValuation_apply, addValuation_apply, multiplicity_le_multiplicity_iff] at h 
[GOAL]
case neg.intro
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (choose (_ : ∃ ϖ, Prime ϖ))
h : ∀ (n : ℕ), choose (_ : ∃ ϖ, Prime ϖ) ^ n ∣ a → choose (_ : ∃ ϖ, Prime ϖ) ^ n ∣ b
ha0 : ¬a = 0
n : ℕ
ha : Associated a (choose (_ : ∃ ϖ, Prime ϖ) ^ n)
⊢ a ∣ b
[PROOFSTEP]
exact ha.dvd.trans (h n ha.symm.dvd)
[GOAL]
case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (choose (_ : ∃ ϖ, Prime ϖ))
h : a ∣ b
⊢ ↑(addVal R) a ≤ ↑(addVal R) b
[PROOFSTEP]
rw [addVal, addValuation_apply, addValuation_apply]
[GOAL]
case mpr
R : Type u_1
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
a b : R
hp : Prime (choose (_ : ∃ ϖ, Prime ϖ))
h : a ∣ b
⊢ multiplicity (choose (_ : ∃ ϖ, Prime ϖ)) a ≤ multiplicity (choose (_ : ∃ ϖ, Prime ϖ)) b
[PROOFSTEP]
exact multiplicity_le_multiplicity_of_dvd_right h
[GOAL]
R✝ : Type u_1
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : ∀ (n : ℕ), x ≡ 0 [SMOD maximalIdeal R ^ n • ⊤]
⊢ x = 0
[PROOFSTEP]
obtain ⟨ϖ, hϖ⟩ := exists_irreducible R
[GOAL]
case intro
R✝ : Type u_1
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x : R
hx : ∀ (n : ℕ), x ≡ 0 [SMOD maximalIdeal R ^ n • ⊤]
ϖ : R
hϖ : Irreducible ϖ
⊢ x = 0
[PROOFSTEP]
simp only [← Ideal.one_eq_top, smul_eq_mul, mul_one, SModEq.zero, hϖ.maximalIdeal_eq, Ideal.span_singleton_pow,
  Ideal.mem_span_singleton, ← addVal_le_iff_dvd, hϖ.addVal_pow] at hx 
[GOAL]
case intro
R✝ : Type u_1
R : Type u_2
inst✝² : CommRing R
inst✝¹ : IsDomain R
inst✝ : DiscreteValuationRing R
x ϖ : R
hϖ : Irreducible ϖ
hx : ∀ (n : ℕ), ↑n ≤ ↑(addVal R) x
⊢ x = 0
[PROOFSTEP]
rwa [← addVal_eq_top_iff, PartENat.eq_top_iff_forall_le]
