Theorem: ModP.preVal_add
File: Mathlib/RingTheory/Perfection.lean

Proof steps:
state_before: K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
x y : ModP K v O hv p
⊢ preVal K v O hv p (x + y) ≤ max (preVal K v O hv p x) (preVal K v O hv p y)
state_after: case pos
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
x y : ModP K v O hv p
hx0 : x = 0
⊢ preVal K v O hv p (x + y) ≤ max (preVal K v O hv p x) (preVal K v O hv p y)

case neg
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
x y : ModP K v O hv p
hx0 : ¬x = 0
⊢ preVal K v O hv p (x + y) ≤ max (preVal K v O hv p x) (preVal K v O hv p y)
tactic: by_cases hx0 : x = 0
state_before: case neg
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
x y : ModP K v O hv p
hx0 : ¬x = 0
⊢ preVal K v O hv p (x + y) ≤ max (preVal K v O hv p x) (preVal K v O hv p y)
state_after: case pos
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
x y : ModP K v O hv p
hx0 : ¬x = 0
hy0 : y = 0
⊢ preVal K v O hv p (x + y) ≤ max (preVal K v O hv p x) (preVal K v O hv p y)

case neg
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
x y : ModP K v O hv p
hx0 : ¬x = 0
hy0 : ¬y = 0
⊢ preVal K v O hv p (x + y) ≤ max (preVal K v O hv p x) (preVal K v O hv p y)
tactic: by_cases hy0 : y = 0
state_before: case neg
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
x y : ModP K v O hv p
hx0 : ¬x = 0
hy0 : ¬y = 0
⊢ preVal K v O hv p (x + y) ≤ max (preVal K v O hv p x) (preVal K v O hv p y)
state_after: case pos
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
x y : ModP K v O hv p
hx0 : ¬x = 0
hy0 : ¬y = 0
hxy0 : x + y = 0
⊢ preVal K v O hv p (x + y) ≤ max (preVal K v O hv p x) (preVal K v O hv p y)

case neg
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
x y : ModP K v O hv p
hx0 : ¬x = 0
hy0 : ¬y = 0
hxy0 : ¬x + y = 0
⊢ preVal K v O hv p (x + y) ≤ max (preVal K v O hv p x) (preVal K v O hv p y)
tactic: by_cases hxy0 : x + y = 0
state_before: case neg
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
x y : ModP K v O hv p
hx0 : ¬x = 0
hy0 : ¬y = 0
hxy0 : ¬x + y = 0
⊢ preVal K v O hv p (x + y) ≤ max (preVal K v O hv p x) (preVal K v O hv p y)
state_after: case neg.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
y : ModP K v O hv p
hy0 : ¬y = 0
r : O
hx0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) r = 0
hxy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) r + y = 0
⊢ preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) r + y) ≤
    max (preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) r)) (preVal K v O hv p y)
tactic: obtain ⟨r, rfl⟩ := Ideal.Quotient.mk_surjective x
state_before: case neg.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
y : ModP K v O hv p
hy0 : ¬y = 0
r : O
hx0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) r = 0
hxy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) r + y = 0
⊢ preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) r + y) ≤
    max (preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) r)) (preVal K v O hv p y)
state_after: case neg.intro.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
r : O
hx0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) r = 0
s : O
hy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) s = 0
hxy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) r + (Ideal.Quotient.mk (Ideal.span {↑p})) s = 0
⊢ preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) r + (Ideal.Quotient.mk (Ideal.span {↑p})) s) ≤
    max (preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) r))
      (preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) s))
tactic: obtain ⟨s, rfl⟩ := Ideal.Quotient.mk_surjective y
state_before: case neg.intro.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
r : O
hx0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) r = 0
s : O
hy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) s = 0
hxy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) r + (Ideal.Quotient.mk (Ideal.span {↑p})) s = 0
⊢ preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) r + (Ideal.Quotient.mk (Ideal.span {↑p})) s) ≤
    max (preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) r))
      (preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) s))
state_after: case neg.intro.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
r : O
hx0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) r = 0
s : O
hy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) s = 0
hxy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) (r + s) = 0
⊢ preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) (r + s)) ≤
    max (preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) r))
      (preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) s))
tactic: rw [← map_add (Ideal.Quotient.mk (Ideal.span {↑p})) r s] at hxy0 ⊢
state_before: case neg.intro.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
r : O
hx0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) r = 0
s : O
hy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) s = 0
hxy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) (r + s) = 0
⊢ preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) (r + s)) ≤
    max (preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) r))
      (preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) s))
state_after: case neg.intro.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
r : O
hx0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) r = 0
s : O
hy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) s = 0
hxy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) (r + s) = 0
⊢ v ((algebraMap O K) r + (algebraMap O K) s) ≤ max (v ((algebraMap O K) r)) (v ((algebraMap O K) s))
tactic: rw [preVal_mk hx0, preVal_mk hy0, preVal_mk hxy0, RingHom.map_add]
state_before: case neg.intro.intro
K : Type u₁
inst✝² : Field K
v : Valuation K ℝ≥0
O : Type u₂
inst✝¹ : CommRing O
inst✝ : Algebra O K
hv : v.Integers O
p : ℕ
hp : Fact (Nat.Prime p)
hvp : Fact (v ↑p ≠ 1)
r : O
hx0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) r = 0
s : O
hy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) s = 0
hxy0 : ¬(Ideal.Quotient.mk (Ideal.span {↑p})) (r + s) = 0
⊢ v ((algebraMap O K) r + (algebraMap O K) s) ≤ max (v ((algebraMap O K) r)) (v ((algebraMap O K) s))
state_after: no goals
tactic: exact v.map_add _ _