l3lab/ntp-mathlib huggingface dataset:
instance : ValuationClass (Valuation R Γ₀) R Γ₀ where
  coe f := f.toFun
  coe_injective' f g h := by
    obtain ⟨⟨⟨_,_⟩, _⟩, _⟩ := f
    

Proof state:
case mk.mk.mk
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁴ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝³ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝² : Ring R
inst✝¹ : LinearOrderedCommMonoidWithZero Γ₀
inst✝ : LinearOrderedCommMonoidWithZero Γ'₀
g : Valuation R Γ₀
toFun✝ : R → Γ₀
map_zero'✝ : toFun✝ 0 = 0
map_one'✝ : ZeroHom.toFun { toFun := toFun✝, map_zero' := map_zero'✝ } 1 = 1
map_mul'✝ :
  ∀ (x y : R),
    ZeroHom.toFun { toFun := toFun✝, map_zero' := map_zero'✝ } (x * y) =
      ZeroHom.toFun { toFun := toFun✝, map_zero' := map_zero'✝ } x *
        ZeroHom.toFun { toFun := toFun✝, map_zero' := map_zero'✝ } y
map_add_le_max'✝ :
  ∀ (x y : R),
    ZeroHom.toFun
        (↑{ toZeroHom := { toFun := toFun✝, map_zero' := map_zero'✝ }, map_one' := map_one'✝, map_mul' := map_mul'✝ })
        (x + y) ≤
      max
        (ZeroHom.toFun
          (↑{ toZeroHom := { toFun := toFun✝, map_zero' := map_zero'✝ }, map_one' := map_one'✝, map_mul' := map_mul'✝ })
          x)
        (ZeroHom.toFun
          (↑{ toZeroHom := { toFun := toFun✝, map_zero' := map_zero'✝ }, map_one' := map_one'✝, map_mul' := map_mul'✝ })
          y)
h :
  (fun f => f.toFun)
      {
        toMonoidWithZeroHom :=
          { toZeroHom := { toFun := toFun✝, map_zero' := map_zero'✝ }, map_one' := map_one'✝, map_mul' := map_mul'✝ },
        map_add_le_max' := map_add_le_max'✝ } =
    (fun f => f.toFun) g
⊢ {
      toMonoidWithZeroHom :=
        { toZeroHom := { toFun := toFun✝, map_zero' := map_zero'✝ }, map_one' := map_one'✝, map_mul' := map_mul'✝ },
      map_add_le_max' := map_add_le_max'✝ } =
    g

Next tactic:
congr
@[simp]
theorem map_add' : ∀ x y, v (x + y) ≤ v x ∨ v (x + y) ≤ v y := by
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁴ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝³ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝² : Ring R
inst✝¹ : LinearOrderedCommMonoidWithZero Γ₀
inst✝ : LinearOrderedCommMonoidWithZero Γ'₀
v : Valuation R Γ₀
x y z : R
⊢ ∀ (x y : R), v (x + y) ≤ v x ∨ v (x + y) ≤ v y

Next tactic:
intro x y
@[simp]
theorem map_add' : ∀ x y, v (x + y) ≤ v x ∨ v (x + y) ≤ v y := by
  intro x y
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁴ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝³ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝² : Ring R
inst✝¹ : LinearOrderedCommMonoidWithZero Γ₀
inst✝ : LinearOrderedCommMonoidWithZero Γ'₀
v : Valuation R Γ₀
x✝ y✝ z x y : R
⊢ v (x + y) ≤ v x ∨ v (x + y) ≤ v y

Next tactic:
rw [← le_max_iff, ← ge_iff_le]
@[simp]
theorem map_add' : ∀ x y, v (x + y) ≤ v x ∨ v (x + y) ≤ v y := by
  intro x y
  rw [← le_max_iff, ← ge_iff_le]
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁴ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝³ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝² : Ring R
inst✝¹ : LinearOrderedCommMonoidWithZero Γ₀
inst✝ : LinearOrderedCommMonoidWithZero Γ'₀
v : Valuation R Γ₀
x✝ y✝ z x y : R
⊢ max (v x) (v y) ≥ v (x + y)

Next tactic:
apply map_add
theorem map_sum_le {ι : Type*} {s : Finset ι} {f : ι → R} {g : Γ₀} (hf : ∀ i ∈ s, v (f i) ≤ g) :
    v (∑ i in s, f i) ≤ g := by
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁴ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝³ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝² : Ring R
inst✝¹ : LinearOrderedCommMonoidWithZero Γ₀
inst✝ : LinearOrderedCommMonoidWithZero Γ'₀
v : Valuation R Γ₀
x y z : R
ι : Type u_7
s : Finset ι
f : ι → R
g : Γ₀
hf : ∀ i ∈ s, v (f i) ≤ g
⊢ v (∑ i in s, f i) ≤ g

Next tactic:
refine'
    Finset.induction_on s (fun _ => v.map_zero ▸ zero_le')
      (fun a s has ih hf => _) hf
theorem map_sum_le {ι : Type*} {s : Finset ι} {f : ι → R} {g : Γ₀} (hf : ∀ i ∈ s, v (f i) ≤ g) :
    v (∑ i in s, f i) ≤ g := by
  refine'
    Finset.induction_on s (fun _ => v.map_zero ▸ zero_le')
      (fun a s has ih hf => _) hf
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁴ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝³ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝² : Ring R
inst✝¹ : LinearOrderedCommMonoidWithZero Γ₀
inst✝ : LinearOrderedCommMonoidWithZero Γ'₀
v : Valuation R Γ₀
x y z : R
ι : Type u_7
s✝ : Finset ι
f : ι → R
g : Γ₀
hf✝ : ∀ i ∈ s✝, v (f i) ≤ g
a : ι
s : Finset ι
has : a ∉ s
ih : (∀ i ∈ s, v (f i) ≤ g) → v (∑ i in s, f i) ≤ g
hf : ∀ i ∈ insert a s, v (f i) ≤ g
⊢ v (∑ i in insert a s, f i) ≤ g

Next tactic:
rw [Finset.forall_mem_insert] at hf
theorem map_sum_le {ι : Type*} {s : Finset ι} {f : ι → R} {g : Γ₀} (hf : ∀ i ∈ s, v (f i) ≤ g) :
    v (∑ i in s, f i) ≤ g := by
  refine'
    Finset.induction_on s (fun _ => v.map_zero ▸ zero_le')
      (fun a s has ih hf => _) hf
  rw [Finset.forall_mem_insert] at hf; 

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁴ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝³ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝² : Ring R
inst✝¹ : LinearOrderedCommMonoidWithZero Γ₀
inst✝ : LinearOrderedCommMonoidWithZero Γ'₀
v : Valuation R Γ₀
x y z : R
ι : Type u_7
s✝ : Finset ι
f : ι → R
g : Γ₀
hf✝ : ∀ i ∈ s✝, v (f i) ≤ g
a : ι
s : Finset ι
has : a ∉ s
ih : (∀ i ∈ s, v (f i) ≤ g) → v (∑ i in s, f i) ≤ g
hf : v (f a) ≤ g ∧ ∀ x ∈ s, v (f x) ≤ g
⊢ v (∑ i in insert a s, f i) ≤ g

Next tactic:
rw [Finset.sum_insert has]
theorem map_sum_le {ι : Type*} {s : Finset ι} {f : ι → R} {g : Γ₀} (hf : ∀ i ∈ s, v (f i) ≤ g) :
    v (∑ i in s, f i) ≤ g := by
  refine'
    Finset.induction_on s (fun _ => v.map_zero ▸ zero_le')
      (fun a s has ih hf => _) hf
  rw [Finset.forall_mem_insert] at hf; rw [Finset.sum_insert has]
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁴ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝³ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝² : Ring R
inst✝¹ : LinearOrderedCommMonoidWithZero Γ₀
inst✝ : LinearOrderedCommMonoidWithZero Γ'₀
v : Valuation R Γ₀
x y z : R
ι : Type u_7
s✝ : Finset ι
f : ι → R
g : Γ₀
hf✝ : ∀ i ∈ s✝, v (f i) ≤ g
a : ι
s : Finset ι
has : a ∉ s
ih : (∀ i ∈ s, v (f i) ≤ g) → v (∑ i in s, f i) ≤ g
hf : v (f a) ≤ g ∧ ∀ x ∈ s, v (f x) ≤ g
⊢ v (f a + ∑ x in s, f x) ≤ g

Next tactic:
exact v.map_add_le hf.1 (ih hf.2)
theorem map_sum_lt {ι : Type*} {s : Finset ι} {f : ι → R} {g : Γ₀} (hg : g ≠ 0)
    (hf : ∀ i ∈ s, v (f i) < g) : v (∑ i in s, f i) < g := by
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁴ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝³ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝² : Ring R
inst✝¹ : LinearOrderedCommMonoidWithZero Γ₀
inst✝ : LinearOrderedCommMonoidWithZero Γ'₀
v : Valuation R Γ₀
x y z : R
ι : Type u_7
s : Finset ι
f : ι → R
g : Γ₀
hg : g ≠ 0
hf : ∀ i ∈ s, v (f i) < g
⊢ v (∑ i in s, f i) < g

Next tactic:
refine'
    Finset.induction_on s (fun _ => v.map_zero ▸ (zero_lt_iff.2 hg))
      (fun a s has ih hf => _) hf
theorem map_sum_lt {ι : Type*} {s : Finset ι} {f : ι → R} {g : Γ₀} (hg : g ≠ 0)
    (hf : ∀ i ∈ s, v (f i) < g) : v (∑ i in s, f i) < g := by
  refine'
    Finset.induction_on s (fun _ => v.map_zero ▸ (zero_lt_iff.2 hg))
      (fun a s has ih hf => _) hf
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁴ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝³ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝² : Ring R
inst✝¹ : LinearOrderedCommMonoidWithZero Γ₀
inst✝ : LinearOrderedCommMonoidWithZero Γ'₀
v : Valuation R Γ₀
x y z : R
ι : Type u_7
s✝ : Finset ι
f : ι → R
g : Γ₀
hg : g ≠ 0
hf✝ : ∀ i ∈ s✝, v (f i) < g
a : ι
s : Finset ι
has : a ∉ s
ih : (∀ i ∈ s, v (f i) < g) → v (∑ i in s, f i) < g
hf : ∀ i ∈ insert a s, v (f i) < g
⊢ v (∑ i in insert a s, f i) < g

Next tactic:
rw [Finset.forall_mem_insert] at hf
theorem map_sum_lt {ι : Type*} {s : Finset ι} {f : ι → R} {g : Γ₀} (hg : g ≠ 0)
    (hf : ∀ i ∈ s, v (f i) < g) : v (∑ i in s, f i) < g := by
  refine'
    Finset.induction_on s (fun _ => v.map_zero ▸ (zero_lt_iff.2 hg))
      (fun a s has ih hf => _) hf
  rw [Finset.forall_mem_insert] at hf; 

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁴ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝³ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝² : Ring R
inst✝¹ : LinearOrderedCommMonoidWithZero Γ₀
inst✝ : LinearOrderedCommMonoidWithZero Γ'₀
v : Valuation R Γ₀
x y z : R
ι : Type u_7
s✝ : Finset ι
f : ι → R
g : Γ₀
hg : g ≠ 0
hf✝ : ∀ i ∈ s✝, v (f i) < g
a : ι
s : Finset ι
has : a ∉ s
ih : (∀ i ∈ s, v (f i) < g) → v (∑ i in s, f i) < g
hf : v (f a) < g ∧ ∀ x ∈ s, v (f x) < g
⊢ v (∑ i in insert a s, f i) < g

Next tactic:
rw [Finset.sum_insert has]
theorem map_sum_lt {ι : Type*} {s : Finset ι} {f : ι → R} {g : Γ₀} (hg : g ≠ 0)
    (hf : ∀ i ∈ s, v (f i) < g) : v (∑ i in s, f i) < g := by
  refine'
    Finset.induction_on s (fun _ => v.map_zero ▸ (zero_lt_iff.2 hg))
      (fun a s has ih hf => _) hf
  rw [Finset.forall_mem_insert] at hf; rw [Finset.sum_insert has]
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁴ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝³ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝² : Ring R
inst✝¹ : LinearOrderedCommMonoidWithZero Γ₀
inst✝ : LinearOrderedCommMonoidWithZero Γ'₀
v : Valuation R Γ₀
x y z : R
ι : Type u_7
s✝ : Finset ι
f : ι → R
g : Γ₀
hg : g ≠ 0
hf✝ : ∀ i ∈ s✝, v (f i) < g
a : ι
s : Finset ι
has : a ∉ s
ih : (∀ i ∈ s, v (f i) < g) → v (∑ i in s, f i) < g
hf : v (f a) < g ∧ ∀ x ∈ s, v (f x) < g
⊢ v (f a + ∑ x in s, f x) < g

Next tactic:
exact v.map_add_lt hf.1 (ih hf.2)
/-- A ring homomorphism `S → R` induces a map `Valuation R Γ₀ → Valuation S Γ₀`. -/
def comap {S : Type*} [Ring S] (f : S →+* R) (v : Valuation R Γ₀) : Valuation S Γ₀ :=
  { v.toMonoidWithZeroHom.comp f.toMonoidWithZeroHom with
    toFun := v ∘ f
    map_add_le_max' := fun x y => by 

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝⁵ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝⁴ : LinearOrderedCommMonoidWithZero Γ''₀
inst✝³ : Ring R
inst✝² : LinearOrderedCommMonoidWithZero Γ₀
inst✝¹ : LinearOrderedCommMonoidWithZero Γ'₀
v✝ : Valuation R Γ₀
x✝ y✝ z : R
S : Type u_7
inst✝ : Ring S
f : S →+* R
v : Valuation R Γ₀
src✝ : S →*₀ Γ₀ := MonoidWithZeroHom.comp v.toMonoidWithZeroHom (RingHom.toMonoidWithZeroHom f)
x y : S
⊢ ZeroHom.toFun
      (↑{ toZeroHom := { toFun := ⇑v ∘ ⇑f, map_zero' := (_ : ZeroHom.toFun (↑src✝) 0 = 0) },
          map_one' := (_ : ZeroHom.toFun (↑src✝) 1 = 1),
          map_mul' :=
            (_ : ∀ (x y : S), ZeroHom.toFun (↑src✝) (x * y) = ZeroHom.toFun (↑src✝) x * ZeroHom.toFun (↑src✝) y) })
      (x + y) ≤
    max
      (ZeroHom.toFun
        (↑{ toZeroHom := { toFun := ⇑v ∘ ⇑f, map_zero' := (_ : ZeroHom.toFun (↑src✝) 0 = 0) },
            map_one' := (_ : ZeroHom.toFun (↑src✝) 1 = 1),
            map_mul' :=
              (_ : ∀ (x y : S), ZeroHom.toFun (↑src✝) (x * y) = ZeroHom.toFun (↑src✝) x * ZeroHom.toFun (↑src✝) y) })
        x)
      (ZeroHom.toFun
        (↑{ toZeroHom := { toFun := ⇑v ∘ ⇑f, map_zero' := (_ : ZeroHom.toFun (↑src✝) 0 = 0) },
            map_one' := (_ : ZeroHom.toFun (↑src✝) 1 = 1),
            map_mul' :=
              (_ : ∀ (x y : S), ZeroHom.toFun (↑src✝) (x * y) = ZeroHom.toFun (↑src✝) x * ZeroHom.toFun (↑src✝) y) })
        y)

Next tactic:
simp only [comp_apply, map_add, f.map_add]
theorem map_sub (x y : R) : v (x - y) ≤ max (v x) (v y) :=
  calc
    v (x - y) = v (x + -y) := by 

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x✝ y✝ z x y : R
⊢ v (x - y) = v (x + -y)

Next tactic:
rw [sub_eq_add_neg]
theorem map_sub (x y : R) : v (x - y) ≤ max (v x) (v y) :=
  calc
    v (x - y) = v (x + -y) := by rw [sub_eq_add_neg]
    _ ≤ max (v x) (v <| -y) := (v.map_add _ _)
    _ = max (v x) (v y) := by 

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x✝ y✝ z x y : R
⊢ max (v x) (v (-y)) = max (v x) (v y)

Next tactic:
rw [map_neg]
theorem map_sub_le {x y g} (hx : v x ≤ g) (hy : v y ≤ g) : v (x - y) ≤ g := by
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x✝ y✝ z x y : R
g : Γ₀
hx : v x ≤ g
hy : v y ≤ g
⊢ v (x - y) ≤ g

Next tactic:
rw [sub_eq_add_neg]
theorem map_sub_le {x y g} (hx : v x ≤ g) (hy : v y ≤ g) : v (x - y) ≤ g := by
  rw [sub_eq_add_neg]
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x✝ y✝ z x y : R
g : Γ₀
hx : v x ≤ g
hy : v y ≤ g
⊢ v (x + -y) ≤ g

Next tactic:
exact v.map_add_le hx (le_trans (le_of_eq (v.map_neg y)) hy)
theorem map_add_of_distinct_val (h : v x ≠ v y) : v (x + y) = max (v x) (v y) := by
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v x ≠ v y
⊢ v (x + y) = max (v x) (v y)

Next tactic:
suffices : ¬v (x + y) < max (v x) (v y)
theorem map_add_of_distinct_val (h : v x ≠ v y) : v (x + y) = max (v x) (v y) := by
  suffices : ¬v (x + y) < max (v x) (v y)
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v x ≠ v y
this : ¬v (x + y) < max (v x) (v y)
⊢ v (x + y) = max (v x) (v y)
case this
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v x ≠ v y
⊢ ¬v (x + y) < max (v x) (v y)

Next tactic:
exact or_iff_not_imp_right.1 (le_iff_eq_or_lt.1 (v.map_add x y)) this
theorem map_add_of_distinct_val (h : v x ≠ v y) : v (x + y) = max (v x) (v y) := by
  suffices : ¬v (x + y) < max (v x) (v y)
  exact or_iff_not_imp_right.1 (le_iff_eq_or_lt.1 (v.map_add x y)) this
  

Proof state:
case this
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v x ≠ v y
⊢ ¬v (x + y) < max (v x) (v y)

Next tactic:
intro h'
theorem map_add_of_distinct_val (h : v x ≠ v y) : v (x + y) = max (v x) (v y) := by
  suffices : ¬v (x + y) < max (v x) (v y)
  exact or_iff_not_imp_right.1 (le_iff_eq_or_lt.1 (v.map_add x y)) this
  intro h'
  

Proof state:
case this
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v x ≠ v y
h' : v (x + y) < max (v x) (v y)
⊢ False

Next tactic:
wlog vyx : v y < v x generalizing x y
theorem map_add_of_distinct_val (h : v x ≠ v y) : v (x + y) = max (v x) (v y) := by
  suffices : ¬v (x + y) < max (v x) (v y)
  exact or_iff_not_imp_right.1 (le_iff_eq_or_lt.1 (v.map_add x y)) this
  intro h'
  wlog vyx : v y < v x generalizing x y
  · 

Proof state:
case this.inr
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v x ≠ v y
h' : v (x + y) < max (v x) (v y)
this : ∀ {x y : R}, v x ≠ v y → v (x + y) < max (v x) (v y) → v y < v x → False
vyx : ¬v y < v x
⊢ False

Next tactic:
refine' this h.symm _ (h.lt_or_lt.resolve_right vyx)
theorem map_add_of_distinct_val (h : v x ≠ v y) : v (x + y) = max (v x) (v y) := by
  suffices : ¬v (x + y) < max (v x) (v y)
  exact or_iff_not_imp_right.1 (le_iff_eq_or_lt.1 (v.map_add x y)) this
  intro h'
  wlog vyx : v y < v x generalizing x y
  · refine' this h.symm _ (h.lt_or_lt.resolve_right vyx)
    

Proof state:
case this.inr
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v x ≠ v y
h' : v (x + y) < max (v x) (v y)
this : ∀ {x y : R}, v x ≠ v y → v (x + y) < max (v x) (v y) → v y < v x → False
vyx : ¬v y < v x
⊢ v (y + x) < max (v y) (v x)

Next tactic:
rwa [add_comm, max_comm]
theorem map_add_of_distinct_val (h : v x ≠ v y) : v (x + y) = max (v x) (v y) := by
  suffices : ¬v (x + y) < max (v x) (v y)
  exact or_iff_not_imp_right.1 (le_iff_eq_or_lt.1 (v.map_add x y)) this
  intro h'
  wlog vyx : v y < v x generalizing x y
  · refine' this h.symm _ (h.lt_or_lt.resolve_right vyx)
    rwa [add_comm, max_comm]
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x✝ y✝ z x y : R
h : v x ≠ v y
h' : v (x + y) < max (v x) (v y)
vyx : v y < v x
⊢ False

Next tactic:
rw [max_eq_left_of_lt vyx] at h'
theorem map_add_of_distinct_val (h : v x ≠ v y) : v (x + y) = max (v x) (v y) := by
  suffices : ¬v (x + y) < max (v x) (v y)
  exact or_iff_not_imp_right.1 (le_iff_eq_or_lt.1 (v.map_add x y)) this
  intro h'
  wlog vyx : v y < v x generalizing x y
  · refine' this h.symm _ (h.lt_or_lt.resolve_right vyx)
    rwa [add_comm, max_comm]
  rw [max_eq_left_of_lt vyx] at h'
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x✝ y✝ z x y : R
h : v x ≠ v y
h' : v (x + y) < v x
vyx : v y < v x
⊢ False

Next tactic:
apply lt_irrefl (v x)
theorem map_add_of_distinct_val (h : v x ≠ v y) : v (x + y) = max (v x) (v y) := by
  suffices : ¬v (x + y) < max (v x) (v y)
  exact or_iff_not_imp_right.1 (le_iff_eq_or_lt.1 (v.map_add x y)) this
  intro h'
  wlog vyx : v y < v x generalizing x y
  · refine' this h.symm _ (h.lt_or_lt.resolve_right vyx)
    rwa [add_comm, max_comm]
  rw [max_eq_left_of_lt vyx] at h'
  apply lt_irrefl (v x)
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x✝ y✝ z x y : R
h : v x ≠ v y
h' : v (x + y) < v x
vyx : v y < v x
⊢ v x < v x

Next tactic:
calc
    v x = v (x + y - y) := by simp
    _ ≤ max (v <| x + y) (v y) := (map_sub _ _ _)
    _ < v x := max_lt h' vyx
theorem map_add_of_distinct_val (h : v x ≠ v y) : v (x + y) = max (v x) (v y) := by
  suffices : ¬v (x + y) < max (v x) (v y)
  exact or_iff_not_imp_right.1 (le_iff_eq_or_lt.1 (v.map_add x y)) this
  intro h'
  wlog vyx : v y < v x generalizing x y
  · refine' this h.symm _ (h.lt_or_lt.resolve_right vyx)
    rwa [add_comm, max_comm]
  rw [max_eq_left_of_lt vyx] at h'
  apply lt_irrefl (v x)
  calc
    v x = v (x + y - y) := by 

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x✝ y✝ z x y : R
h : v x ≠ v y
h' : v (x + y) < v x
vyx : v y < v x
⊢ v x = v (x + y - y)

Next tactic:
simp
theorem map_add_eq_of_lt_left (h : v y < v x) : v (x + y) = v x := by
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v y < v x
⊢ v (x + y) = v x

Next tactic:
rw [add_comm]
theorem map_add_eq_of_lt_left (h : v y < v x) : v (x + y) = v x := by
  rw [add_comm]; 

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v y < v x
⊢ v (y + x) = v x

Next tactic:
exact map_add_eq_of_lt_right _ h
theorem map_eq_of_sub_lt (h : v (y - x) < v x) : v y = v x := by
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v (y - x) < v x
⊢ v y = v x

Next tactic:
have := Valuation.map_add_of_distinct_val v (ne_of_gt h).symm
theorem map_eq_of_sub_lt (h : v (y - x) < v x) : v y = v x := by
  have := Valuation.map_add_of_distinct_val v (ne_of_gt h).symm
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v (y - x) < v x
this : v (y - x + x) = max (v (y - x)) (v x)
⊢ v y = v x

Next tactic:
rw [max_eq_right (le_of_lt h)] at this
theorem map_eq_of_sub_lt (h : v (y - x) < v x) : v y = v x := by
  have := Valuation.map_add_of_distinct_val v (ne_of_gt h).symm
  rw [max_eq_right (le_of_lt h)] at this
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v (y - x) < v x
this : v (y - x + x) = v x
⊢ v y = v x

Next tactic:
simpa using this
theorem map_one_add_of_lt (h : v x < 1) : v (1 + x) = 1 := by
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v x < 1
⊢ v (1 + x) = 1

Next tactic:
rw [← v.map_one] at h
theorem map_one_add_of_lt (h : v x < 1) : v (1 + x) = 1 := by
  rw [← v.map_one] at h
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v x < v 1
⊢ v (1 + x) = 1

Next tactic:
simpa only [v.map_one] using v.map_add_eq_of_lt_left h
theorem map_one_sub_of_lt (h : v x < 1) : v (1 - x) = 1 := by
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v x < 1
⊢ v (1 - x) = 1

Next tactic:
rw [← v.map_one, ← v.map_neg] at h
theorem map_one_sub_of_lt (h : v x < 1) : v (1 - x) = 1 := by
  rw [← v.map_one, ← v.map_neg] at h
  

Proof state:
K : Type u_1
F : Type u_2
R : Type u_3
inst✝³ : DivisionRing K
Γ₀ : Type u_4
Γ'₀ : Type u_5
Γ''₀ : Type u_6
inst✝² : LinearOrderedCommMonoidWithZero Γ''₀
inst✝¹ : Ring R
inst✝ : LinearOrderedCommGroupWithZero Γ₀
v : Valuation R Γ₀
x y z : R
h : v (-x) < v 1
⊢ v (1 - x) = 1

Next tactic:
rw [sub_eq_add_neg 1 x]