l3lab/ntp-mathlib huggingface dataset:
noncomputable instance linearOrderedCommGroupWithZero :
    LinearOrderedCommGroupWithZero (ValueGroup A K) :=
  { linearOrder .. with
    mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; apply Quotient.sound'; rw [mul_assoc]; apply Setoid.refl'
    one_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [one_mul]; apply Setoid.refl'
    mul_one := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_one]; apply Setoid.refl'
    mul_comm := by rintro ⟨a⟩ ⟨b⟩; apply Quotient.sound'; rw [mul_comm]; apply Setoid.refl'
    mul_le_mul_left := by
      rintro ⟨a⟩ ⟨b⟩ ⟨c, rfl⟩ ⟨d⟩
      use c; simp only [Algebra.smul_def]; ring
    zero_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [zero_mul]; apply Setoid.refl'
    mul_zero := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_zero]; apply Setoid.refl'
    zero_le_one := ⟨0, by rw [zero_smul]⟩
    exists_pair_ne := by
      use 0, 1
      intro c; obtain ⟨d, hd⟩ := Quotient.exact' c
      apply_fun fun t => d⁻¹ • t at hd
      simp only [inv_smul_smul, smul_zero, one_ne_zero] at hd
    inv_zero := by apply Quotient.sound'; rw [inv_zero]; 

Proof state:
case a
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
src✝ : LinearOrder (ValueGroup A K) := linearOrder A K
⊢ Setoid.r 0 0

Next tactic:
apply Setoid.refl'
noncomputable instance linearOrderedCommGroupWithZero :
    LinearOrderedCommGroupWithZero (ValueGroup A K) :=
  { linearOrder .. with
    mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; apply Quotient.sound'; rw [mul_assoc]; apply Setoid.refl'
    one_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [one_mul]; apply Setoid.refl'
    mul_one := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_one]; apply Setoid.refl'
    mul_comm := by rintro ⟨a⟩ ⟨b⟩; apply Quotient.sound'; rw [mul_comm]; apply Setoid.refl'
    mul_le_mul_left := by
      rintro ⟨a⟩ ⟨b⟩ ⟨c, rfl⟩ ⟨d⟩
      use c; simp only [Algebra.smul_def]; ring
    zero_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [zero_mul]; apply Setoid.refl'
    mul_zero := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_zero]; apply Setoid.refl'
    zero_le_one := ⟨0, by rw [zero_smul]⟩
    exists_pair_ne := by
      use 0, 1
      intro c; obtain ⟨d, hd⟩ := Quotient.exact' c
      apply_fun fun t => d⁻¹ • t at hd
      simp only [inv_smul_smul, smul_zero, one_ne_zero] at hd
    inv_zero := by apply Quotient.sound'; rw [inv_zero]; apply Setoid.refl'
    mul_inv_cancel := by
      

Proof state:
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
src✝ : LinearOrder (ValueGroup A K) := linearOrder A K
⊢ ∀ (a : ValueGroup A K), a ≠ 0 → a * a⁻¹ = 1

Next tactic:
rintro ⟨a⟩ ha
noncomputable instance linearOrderedCommGroupWithZero :
    LinearOrderedCommGroupWithZero (ValueGroup A K) :=
  { linearOrder .. with
    mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; apply Quotient.sound'; rw [mul_assoc]; apply Setoid.refl'
    one_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [one_mul]; apply Setoid.refl'
    mul_one := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_one]; apply Setoid.refl'
    mul_comm := by rintro ⟨a⟩ ⟨b⟩; apply Quotient.sound'; rw [mul_comm]; apply Setoid.refl'
    mul_le_mul_left := by
      rintro ⟨a⟩ ⟨b⟩ ⟨c, rfl⟩ ⟨d⟩
      use c; simp only [Algebra.smul_def]; ring
    zero_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [zero_mul]; apply Setoid.refl'
    mul_zero := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_zero]; apply Setoid.refl'
    zero_le_one := ⟨0, by rw [zero_smul]⟩
    exists_pair_ne := by
      use 0, 1
      intro c; obtain ⟨d, hd⟩ := Quotient.exact' c
      apply_fun fun t => d⁻¹ • t at hd
      simp only [inv_smul_smul, smul_zero, one_ne_zero] at hd
    inv_zero := by apply Quotient.sound'; rw [inv_zero]; apply Setoid.refl'
    mul_inv_cancel := by
      rintro ⟨a⟩ ha
      

Proof state:
case mk
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
src✝ : LinearOrder (ValueGroup A K) := linearOrder A K
a✝ : ValueGroup A K
a : K
ha : Quot.mk Setoid.r a ≠ 0
⊢ Quot.mk Setoid.r a * (Quot.mk Setoid.r a)⁻¹ = 1

Next tactic:
apply Quotient.sound'
noncomputable instance linearOrderedCommGroupWithZero :
    LinearOrderedCommGroupWithZero (ValueGroup A K) :=
  { linearOrder .. with
    mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; apply Quotient.sound'; rw [mul_assoc]; apply Setoid.refl'
    one_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [one_mul]; apply Setoid.refl'
    mul_one := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_one]; apply Setoid.refl'
    mul_comm := by rintro ⟨a⟩ ⟨b⟩; apply Quotient.sound'; rw [mul_comm]; apply Setoid.refl'
    mul_le_mul_left := by
      rintro ⟨a⟩ ⟨b⟩ ⟨c, rfl⟩ ⟨d⟩
      use c; simp only [Algebra.smul_def]; ring
    zero_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [zero_mul]; apply Setoid.refl'
    mul_zero := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_zero]; apply Setoid.refl'
    zero_le_one := ⟨0, by rw [zero_smul]⟩
    exists_pair_ne := by
      use 0, 1
      intro c; obtain ⟨d, hd⟩ := Quotient.exact' c
      apply_fun fun t => d⁻¹ • t at hd
      simp only [inv_smul_smul, smul_zero, one_ne_zero] at hd
    inv_zero := by apply Quotient.sound'; rw [inv_zero]; apply Setoid.refl'
    mul_inv_cancel := by
      rintro ⟨a⟩ ha
      apply Quotient.sound'
      

Proof state:
case mk.a
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
src✝ : LinearOrder (ValueGroup A K) := linearOrder A K
a✝ : ValueGroup A K
a : K
ha : Quot.mk Setoid.r a ≠ 0
⊢ Setoid.r (a * a⁻¹) 1

Next tactic:
use 1
noncomputable instance linearOrderedCommGroupWithZero :
    LinearOrderedCommGroupWithZero (ValueGroup A K) :=
  { linearOrder .. with
    mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; apply Quotient.sound'; rw [mul_assoc]; apply Setoid.refl'
    one_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [one_mul]; apply Setoid.refl'
    mul_one := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_one]; apply Setoid.refl'
    mul_comm := by rintro ⟨a⟩ ⟨b⟩; apply Quotient.sound'; rw [mul_comm]; apply Setoid.refl'
    mul_le_mul_left := by
      rintro ⟨a⟩ ⟨b⟩ ⟨c, rfl⟩ ⟨d⟩
      use c; simp only [Algebra.smul_def]; ring
    zero_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [zero_mul]; apply Setoid.refl'
    mul_zero := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_zero]; apply Setoid.refl'
    zero_le_one := ⟨0, by rw [zero_smul]⟩
    exists_pair_ne := by
      use 0, 1
      intro c; obtain ⟨d, hd⟩ := Quotient.exact' c
      apply_fun fun t => d⁻¹ • t at hd
      simp only [inv_smul_smul, smul_zero, one_ne_zero] at hd
    inv_zero := by apply Quotient.sound'; rw [inv_zero]; apply Setoid.refl'
    mul_inv_cancel := by
      rintro ⟨a⟩ ha
      apply Quotient.sound'
      use 1
      

Proof state:
case h
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
src✝ : LinearOrder (ValueGroup A K) := linearOrder A K
a✝ : ValueGroup A K
a : K
ha : Quot.mk Setoid.r a ≠ 0
⊢ (fun m => m • 1) 1 = a * a⁻¹

Next tactic:
simp only [one_smul, ne_eq]
noncomputable instance linearOrderedCommGroupWithZero :
    LinearOrderedCommGroupWithZero (ValueGroup A K) :=
  { linearOrder .. with
    mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; apply Quotient.sound'; rw [mul_assoc]; apply Setoid.refl'
    one_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [one_mul]; apply Setoid.refl'
    mul_one := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_one]; apply Setoid.refl'
    mul_comm := by rintro ⟨a⟩ ⟨b⟩; apply Quotient.sound'; rw [mul_comm]; apply Setoid.refl'
    mul_le_mul_left := by
      rintro ⟨a⟩ ⟨b⟩ ⟨c, rfl⟩ ⟨d⟩
      use c; simp only [Algebra.smul_def]; ring
    zero_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [zero_mul]; apply Setoid.refl'
    mul_zero := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_zero]; apply Setoid.refl'
    zero_le_one := ⟨0, by rw [zero_smul]⟩
    exists_pair_ne := by
      use 0, 1
      intro c; obtain ⟨d, hd⟩ := Quotient.exact' c
      apply_fun fun t => d⁻¹ • t at hd
      simp only [inv_smul_smul, smul_zero, one_ne_zero] at hd
    inv_zero := by apply Quotient.sound'; rw [inv_zero]; apply Setoid.refl'
    mul_inv_cancel := by
      rintro ⟨a⟩ ha
      apply Quotient.sound'
      use 1
      simp only [one_smul, ne_eq]
      

Proof state:
case h
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
src✝ : LinearOrder (ValueGroup A K) := linearOrder A K
a✝ : ValueGroup A K
a : K
ha : Quot.mk Setoid.r a ≠ 0
⊢ 1 = a * a⁻¹

Next tactic:
apply (mul_inv_cancel _).symm
noncomputable instance linearOrderedCommGroupWithZero :
    LinearOrderedCommGroupWithZero (ValueGroup A K) :=
  { linearOrder .. with
    mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; apply Quotient.sound'; rw [mul_assoc]; apply Setoid.refl'
    one_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [one_mul]; apply Setoid.refl'
    mul_one := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_one]; apply Setoid.refl'
    mul_comm := by rintro ⟨a⟩ ⟨b⟩; apply Quotient.sound'; rw [mul_comm]; apply Setoid.refl'
    mul_le_mul_left := by
      rintro ⟨a⟩ ⟨b⟩ ⟨c, rfl⟩ ⟨d⟩
      use c; simp only [Algebra.smul_def]; ring
    zero_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [zero_mul]; apply Setoid.refl'
    mul_zero := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_zero]; apply Setoid.refl'
    zero_le_one := ⟨0, by rw [zero_smul]⟩
    exists_pair_ne := by
      use 0, 1
      intro c; obtain ⟨d, hd⟩ := Quotient.exact' c
      apply_fun fun t => d⁻¹ • t at hd
      simp only [inv_smul_smul, smul_zero, one_ne_zero] at hd
    inv_zero := by apply Quotient.sound'; rw [inv_zero]; apply Setoid.refl'
    mul_inv_cancel := by
      rintro ⟨a⟩ ha
      apply Quotient.sound'
      use 1
      simp only [one_smul, ne_eq]
      apply (mul_inv_cancel _).symm
      

Proof state:
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
src✝ : LinearOrder (ValueGroup A K) := linearOrder A K
a✝ : ValueGroup A K
a : K
ha : Quot.mk Setoid.r a ≠ 0
⊢ a ≠ 0

Next tactic:
contrapose ha
noncomputable instance linearOrderedCommGroupWithZero :
    LinearOrderedCommGroupWithZero (ValueGroup A K) :=
  { linearOrder .. with
    mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; apply Quotient.sound'; rw [mul_assoc]; apply Setoid.refl'
    one_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [one_mul]; apply Setoid.refl'
    mul_one := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_one]; apply Setoid.refl'
    mul_comm := by rintro ⟨a⟩ ⟨b⟩; apply Quotient.sound'; rw [mul_comm]; apply Setoid.refl'
    mul_le_mul_left := by
      rintro ⟨a⟩ ⟨b⟩ ⟨c, rfl⟩ ⟨d⟩
      use c; simp only [Algebra.smul_def]; ring
    zero_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [zero_mul]; apply Setoid.refl'
    mul_zero := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_zero]; apply Setoid.refl'
    zero_le_one := ⟨0, by rw [zero_smul]⟩
    exists_pair_ne := by
      use 0, 1
      intro c; obtain ⟨d, hd⟩ := Quotient.exact' c
      apply_fun fun t => d⁻¹ • t at hd
      simp only [inv_smul_smul, smul_zero, one_ne_zero] at hd
    inv_zero := by apply Quotient.sound'; rw [inv_zero]; apply Setoid.refl'
    mul_inv_cancel := by
      rintro ⟨a⟩ ha
      apply Quotient.sound'
      use 1
      simp only [one_smul, ne_eq]
      apply (mul_inv_cancel _).symm
      contrapose ha
      

Proof state:
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
src✝ : LinearOrder (ValueGroup A K) := linearOrder A K
a✝ : ValueGroup A K
a : K
ha : ¬a ≠ 0
⊢ ¬Quot.mk Setoid.r a ≠ 0

Next tactic:
simp only [Classical.not_not] at ha ⊢
noncomputable instance linearOrderedCommGroupWithZero :
    LinearOrderedCommGroupWithZero (ValueGroup A K) :=
  { linearOrder .. with
    mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; apply Quotient.sound'; rw [mul_assoc]; apply Setoid.refl'
    one_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [one_mul]; apply Setoid.refl'
    mul_one := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_one]; apply Setoid.refl'
    mul_comm := by rintro ⟨a⟩ ⟨b⟩; apply Quotient.sound'; rw [mul_comm]; apply Setoid.refl'
    mul_le_mul_left := by
      rintro ⟨a⟩ ⟨b⟩ ⟨c, rfl⟩ ⟨d⟩
      use c; simp only [Algebra.smul_def]; ring
    zero_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [zero_mul]; apply Setoid.refl'
    mul_zero := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_zero]; apply Setoid.refl'
    zero_le_one := ⟨0, by rw [zero_smul]⟩
    exists_pair_ne := by
      use 0, 1
      intro c; obtain ⟨d, hd⟩ := Quotient.exact' c
      apply_fun fun t => d⁻¹ • t at hd
      simp only [inv_smul_smul, smul_zero, one_ne_zero] at hd
    inv_zero := by apply Quotient.sound'; rw [inv_zero]; apply Setoid.refl'
    mul_inv_cancel := by
      rintro ⟨a⟩ ha
      apply Quotient.sound'
      use 1
      simp only [one_smul, ne_eq]
      apply (mul_inv_cancel _).symm
      contrapose ha
      simp only [Classical.not_not] at ha ⊢
      

Proof state:
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
src✝ : LinearOrder (ValueGroup A K) := linearOrder A K
a✝ : ValueGroup A K
a : K
ha : a = 0
⊢ Quot.mk Setoid.r a = 0

Next tactic:
rw [ha]
noncomputable instance linearOrderedCommGroupWithZero :
    LinearOrderedCommGroupWithZero (ValueGroup A K) :=
  { linearOrder .. with
    mul_assoc := by rintro ⟨a⟩ ⟨b⟩ ⟨c⟩; apply Quotient.sound'; rw [mul_assoc]; apply Setoid.refl'
    one_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [one_mul]; apply Setoid.refl'
    mul_one := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_one]; apply Setoid.refl'
    mul_comm := by rintro ⟨a⟩ ⟨b⟩; apply Quotient.sound'; rw [mul_comm]; apply Setoid.refl'
    mul_le_mul_left := by
      rintro ⟨a⟩ ⟨b⟩ ⟨c, rfl⟩ ⟨d⟩
      use c; simp only [Algebra.smul_def]; ring
    zero_mul := by rintro ⟨a⟩; apply Quotient.sound'; rw [zero_mul]; apply Setoid.refl'
    mul_zero := by rintro ⟨a⟩; apply Quotient.sound'; rw [mul_zero]; apply Setoid.refl'
    zero_le_one := ⟨0, by rw [zero_smul]⟩
    exists_pair_ne := by
      use 0, 1
      intro c; obtain ⟨d, hd⟩ := Quotient.exact' c
      apply_fun fun t => d⁻¹ • t at hd
      simp only [inv_smul_smul, smul_zero, one_ne_zero] at hd
    inv_zero := by apply Quotient.sound'; rw [inv_zero]; apply Setoid.refl'
    mul_inv_cancel := by
      rintro ⟨a⟩ ha
      apply Quotient.sound'
      use 1
      simp only [one_smul, ne_eq]
      apply (mul_inv_cancel _).symm
      contrapose ha
      simp only [Classical.not_not] at ha ⊢
      rw [ha]
      

Proof state:
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
src✝ : LinearOrder (ValueGroup A K) := linearOrder A K
a✝ : ValueGroup A K
a : K
ha : a = 0
⊢ Quot.mk Setoid.r 0 = 0

Next tactic:
rfl
/-- Any valuation ring induces a valuation on its fraction field. -/
def valuation : Valuation K (ValueGroup A K) where
  toFun := Quotient.mk''
  map_zero' := rfl
  map_one' := rfl
  map_mul' _ _ := rfl
  map_add_le_max' := by
    

Proof state:
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
⊢ ∀ (x y : K),
    ZeroHom.toFun
        (↑{ toZeroHom := { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) },
            map_one' :=
              (_ :
                ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1 =
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1),
            map_mul' :=
              (_ :
                ∀ (x x_1 : K),
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                      (x * x_1) =
                    ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                      (x * x_1)) })
        (x + y) ≤
      max
        (ZeroHom.toFun
          (↑{ toZeroHom := { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) },
              map_one' :=
                (_ :
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1 =
                    ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1),
              map_mul' :=
                (_ :
                  ∀ (x x_1 : K),
                    ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                        (x * x_1) =
                      ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                        (x * x_1)) })
          x)
        (ZeroHom.toFun
          (↑{ toZeroHom := { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) },
              map_one' :=
                (_ :
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1 =
                    ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1),
              map_mul' :=
                (_ :
                  ∀ (x x_1 : K),
                    ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                        (x * x_1) =
                      ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                        (x * x_1)) })
          y)

Next tactic:
intro a b
/-- Any valuation ring induces a valuation on its fraction field. -/
def valuation : Valuation K (ValueGroup A K) where
  toFun := Quotient.mk''
  map_zero' := rfl
  map_one' := rfl
  map_mul' _ _ := rfl
  map_add_le_max' := by
    intro a b
    

Proof state:
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
a b : K
⊢ ZeroHom.toFun
      (↑{ toZeroHom := { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) },
          map_one' :=
            (_ :
              ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1 =
                ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1),
          map_mul' :=
            (_ :
              ∀ (x x_1 : K),
                ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                    (x * x_1) =
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                    (x * x_1)) })
      (a + b) ≤
    max
      (ZeroHom.toFun
        (↑{ toZeroHom := { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) },
            map_one' :=
              (_ :
                ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1 =
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1),
            map_mul' :=
              (_ :
                ∀ (x x_1 : K),
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                      (x * x_1) =
                    ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                      (x * x_1)) })
        a)
      (ZeroHom.toFun
        (↑{ toZeroHom := { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) },
            map_one' :=
              (_ :
                ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1 =
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1),
            map_mul' :=
              (_ :
                ∀ (x x_1 : K),
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                      (x * x_1) =
                    ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                      (x * x_1)) })
        b)

Next tactic:
obtain ⟨xa, ya, hya, rfl⟩ : ∃ a b : A, _ := IsFractionRing.div_surjective a
/-- Any valuation ring induces a valuation on its fraction field. -/
def valuation : Valuation K (ValueGroup A K) where
  toFun := Quotient.mk''
  map_zero' := rfl
  map_one' := rfl
  map_mul' _ _ := rfl
  map_add_le_max' := by
    intro a b
    obtain ⟨xa, ya, hya, rfl⟩ : ∃ a b : A, _ := IsFractionRing.div_surjective a
    

Proof state:
case intro.intro.intro
A : Type u
inst✝⁵ : CommRing A
K : Type v
inst✝⁴ : Field K
inst✝³ : Algebra A K
inst✝² : IsDomain A
inst✝¹ : ValuationRing A
inst✝ : IsFractionRing A K
b : K
xa ya : A
hya : ya ∈ nonZeroDivisors A
⊢ ZeroHom.toFun
      (↑{ toZeroHom := { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) },
          map_one' :=
            (_ :
              ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1 =
                ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1),
          map_mul' :=
            (_ :
              ∀ (x x_1 : K),
                ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                    (x * x_1) =
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                    (x * x_1)) })
      ((algebraMap A K) xa / (algebraMap A K) ya + b) ≤
    max
      (ZeroHom.toFun
        (↑{ toZeroHom := { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) },
            map_one' :=
              (_ :
                ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1 =
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1),
            map_mul' :=
              (_ :
                ∀ (x x_1 : K),
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                      (x * x_1) =
                    ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                      (x * x_1)) })
        ((algebraMap A K) xa / (algebraMap A K) ya))
      (ZeroHom.toFun
        (↑{ toZeroHom := { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) },
            map_one' :=
              (_ :
                ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1 =
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) } 1),
            map_mul' :=
              (_ :
                ∀ (x x_1 : K),
                  ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                      (x * x_1) =
                    ZeroHom.toFun { toFun := Quotient.mk'', map_zero' := (_ : Quotient.mk'' 0 = Quotient.mk'' 0) }
                      (x * x_1)) })
        b)

Next tactic:
obtain ⟨xb, yb, hyb, rfl⟩ : ∃ a b : A, _ := IsFractionRing.div_surjective b