Theorem: ValuationRing.iff_local_bezout_domain
File: Mathlib/RingTheory/Valuation/ValuationRing.lean

tactic: refine ⟨fun H => ⟨inferInstance, inferInstance⟩, ?_⟩
state_before: R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
⊢ ValuationRing R ↔ LocalRing R ∧ IsBezout R

tactic: rintro ⟨h₁, h₂⟩
state_before: R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
⊢ LocalRing R ∧ IsBezout R → ValuationRing R

tactic: refine iff_dvd_total.mpr ⟨fun a b => ?_⟩
state_before: case intro
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
⊢ ValuationRing R

tactic: obtain ⟨g, e : _ = Ideal.span _⟩ := IsBezout.span_pair_isPrincipal a b
state_before: case intro
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
a b : R
⊢ a ∣ b ∨ b ∣ a

tactic: obtain ⟨a, rfl⟩ := Ideal.mem_span_singleton'.mp
    (show a ∈ Ideal.span {g} by rw [← e]; exact Ideal.subset_span (by simp))
state_before: case intro.mk.intro
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
a b g : R
e : Ideal.span {a, b} = Ideal.span {g}
⊢ a ∣ b ∨ b ∣ a

tactic: obtain ⟨b, rfl⟩ := Ideal.mem_span_singleton'.mp
    (show b ∈ Ideal.span {g} by rw [← e]; exact Ideal.subset_span (by simp))
state_before: case intro.mk.intro.intro
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
b g a : R
e : Ideal.span {a * g, b} = Ideal.span {g}
⊢ a * g ∣ b ∨ b ∣ a * g

tactic: obtain ⟨x, y, e'⟩ := Ideal.mem_span_pair.mp
    (show g ∈ Ideal.span {a * g, b * g} by rw [e]; exact Ideal.subset_span (by simp))
state_before: case intro.mk.intro.intro.intro
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
⊢ a * g ∣ b * g ∨ b * g ∣ a * g

tactic: cases' eq_or_ne g 0 with h h
state_before: case intro.mk.intro.intro.intro.intro.intro
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
⊢ a * g ∣ b * g ∨ b * g ∣ a * g

tactic: have : x * a + y * b = 1 := by
  apply mul_left_injective₀ h; convert e' using 1 <;> ring
state_before: case intro.mk.intro.intro.intro.intro.intro.inr
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
⊢ a * g ∣ b * g ∨ b * g ∣ a * g

tactic: cases' LocalRing.isUnit_or_isUnit_of_add_one this with h' h'
state_before: case intro.mk.intro.intro.intro.intro.intro.inr
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
this : x * a + y * b = 1
⊢ a * g ∣ b * g ∨ b * g ∣ a * g

tactic: left
state_before: case intro.mk.intro.intro.intro.intro.intro.inr.inl
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
this : x * a + y * b = 1
h' : IsUnit (x * a)
⊢ a * g ∣ b * g ∨ b * g ∣ a * g

case intro.mk.intro.intro.intro.intro.intro.inr.inr
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
this : x * a + y * b = 1
h' : IsUnit (y * b)
⊢ a * g ∣ b * g ∨ b * g ∣ a * g

tactic: swap
state_before: case intro.mk.intro.intro.intro.intro.intro.inr.inl.h
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
this : x * a + y * b = 1
h' : IsUnit (x * a)
⊢ a * g ∣ b * g

case intro.mk.intro.intro.intro.intro.intro.inr.inr
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
this : x * a + y * b = 1
h' : IsUnit (y * b)
⊢ a * g ∣ b * g ∨ b * g ∣ a * g

tactic: right
state_before: case intro.mk.intro.intro.intro.intro.intro.inr.inr
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
this : x * a + y * b = 1
h' : IsUnit (y * b)
⊢ a * g ∣ b * g ∨ b * g ∣ a * g

case intro.mk.intro.intro.intro.intro.intro.inr.inl.h
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
this : x * a + y * b = 1
h' : IsUnit (x * a)
⊢ a * g ∣ b * g

tactic: all_goals exact mul_dvd_mul_right (isUnit_iff_forall_dvd.mp (isUnit_of_mul_isUnit_right h') _) _
state_before: case intro.mk.intro.intro.intro.intro.intro.inr.inr.h
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
this : x * a + y * b = 1
h' : IsUnit (y * b)
⊢ b * g ∣ a * g

case intro.mk.intro.intro.intro.intro.intro.inr.inl.h
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
this : x * a + y * b = 1
h' : IsUnit (x * a)
⊢ a * g ∣ b * g

tactic: rw [← e]
state_before: R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
a b g : R
e : Ideal.span {a, b} = Ideal.span {g}
⊢ a ∈ Ideal.span {g}

tactic: exact Ideal.subset_span (by simp)
state_before: R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
a b g : R
e : Ideal.span {a, b} = Ideal.span {g}
⊢ a ∈ Ideal.span {a, b}

tactic: simp
state_before: R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
a b g : R
e : Ideal.span {a, b} = Ideal.span {g}
⊢ a ∈ {a, b}

tactic: rw [← e]
state_before: R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
b g a : R
e : Ideal.span {a * g, b} = Ideal.span {g}
⊢ b ∈ Ideal.span {g}

tactic: exact Ideal.subset_span (by simp)
state_before: R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
b g a : R
e : Ideal.span {a * g, b} = Ideal.span {g}
⊢ b ∈ Ideal.span {a * g, b}

tactic: simp
state_before: R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
b g a : R
e : Ideal.span {a * g, b} = Ideal.span {g}
⊢ b ∈ {a * g, b}

tactic: rw [e]
state_before: R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
⊢ g ∈ Ideal.span {a * g, b * g}

tactic: exact Ideal.subset_span (by simp)
state_before: R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
⊢ g ∈ Ideal.span {g}

tactic: simp
state_before: R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
⊢ g ∈ {g}

tactic: simp [h]
state_before: case intro.mk.intro.intro.intro.intro.intro.inl
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g = 0
⊢ a * g ∣ b * g ∨ b * g ∣ a * g

tactic: apply mul_left_injective₀ h
state_before: R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
⊢ x * a + y * b = 1

tactic: convert e' using 1 <;> ring
state_before: case a
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
⊢ (fun a => a * g) (x * a + y * b) = (fun a => a * g) 1

tactic: exact mul_dvd_mul_right (isUnit_iff_forall_dvd.mp (isUnit_of_mul_isUnit_right h') _) _
state_before: case intro.mk.intro.intro.intro.intro.intro.inr.inl.h
R : Type u_1
inst✝⁴ : CommRing R
inst✝³ : IsDomain R
K : Type ?u.591460
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
h₁ : LocalRing R
h₂ : IsBezout R
g a b : R
e : Ideal.span {a * g, b * g} = Ideal.span {g}
x y : R
e' : x * (a * g) + y * (b * g) = g
h : g ≠ 0
this : x * a + y * b = 1
h' : IsUnit (x * a)
⊢ a * g ∣ b * g