Theorem: Polynomial.cardPowDegree_anti_archimedean
File: Mathlib/NumberTheory/ClassNumber/AdmissibleCardPowDegree.lean

tactic: have ha : 0 < a := lt_of_le_of_lt (AbsoluteValue.nonneg _ _) hxy
state_before: Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
⊢ ↑cardPowDegree (x - z) < a

tactic: by_cases hxy' : x = y
state_before: Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
⊢ ↑cardPowDegree (x - z) < a

tactic: by_cases hyz' : y = z
state_before: case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy' : ¬x = y
⊢ ↑cardPowDegree (x - z) < a

tactic: by_cases hxz' : x = z
state_before: case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy' : ¬x = y
hyz' : ¬y = z
⊢ ↑cardPowDegree (x - z) < a

tactic: rw [← Ne.def, ← sub_ne_zero] at hxy' hyz' hxz'
state_before: case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy' : ¬x = y
hyz' : ¬y = z
hxz' : ¬x = z
⊢ ↑cardPowDegree (x - z) < a

tactic: refine' lt_of_le_of_lt _ (max_lt hxy hyz)
state_before: case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy'✝ : x ≠ y
hxy' : x - y ≠ 0
hyz'✝ : y ≠ z
hyz' : y - z ≠ 0
hxz'✝ : x ≠ z
hxz' : x - z ≠ 0
⊢ ↑cardPowDegree (x - z) < a

tactic: rw [cardPowDegree_nonzero _ hxz', cardPowDegree_nonzero _ hxy',
  cardPowDegree_nonzero _ hyz']
state_before: case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy'✝ : x ≠ y
hxy' : x - y ≠ 0
hyz'✝ : y ≠ z
hyz' : y - z ≠ 0
hxz'✝ : x ≠ z
hxz' : x - z ≠ 0
⊢ ↑cardPowDegree (x - z) ≤ max (↑cardPowDegree (x - y)) (↑cardPowDegree (y - z))

tactic: have : (1 : ℤ) ≤ Fintype.card Fq := by exact_mod_cast (@Fintype.one_lt_card Fq _ _).le
state_before: case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy'✝ : x ≠ y
hxy' : x - y ≠ 0
hyz'✝ : y ≠ z
hyz' : y - z ≠ 0
hxz'✝ : x ≠ z
hxz' : x - z ≠ 0
⊢ ↑(Fintype.card Fq) ^ natDegree (x - z) ≤
    max (↑(Fintype.card Fq) ^ natDegree (x - y)) (↑(Fintype.card Fq) ^ natDegree (y - z))

tactic: simp only [Int.cast_pow, Int.cast_ofNat, le_max_iff]
state_before: case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy'✝ : x ≠ y
hxy' : x - y ≠ 0
hyz'✝ : y ≠ z
hyz' : y - z ≠ 0
hxz'✝ : x ≠ z
hxz' : x - z ≠ 0
this : 1 ≤ ↑(Fintype.card Fq)
⊢ ↑(Fintype.card Fq) ^ natDegree (x - z) ≤
    max (↑(Fintype.card Fq) ^ natDegree (x - y)) (↑(Fintype.card Fq) ^ natDegree (y - z))

tactic: refine' Or.imp (pow_le_pow this) (pow_le_pow this) _
state_before: case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy'✝ : x ≠ y
hxy' : x - y ≠ 0
hyz'✝ : y ≠ z
hyz' : y - z ≠ 0
hxz'✝ : x ≠ z
hxz' : x - z ≠ 0
this : 1 ≤ ↑(Fintype.card Fq)
⊢ ↑(Fintype.card Fq) ^ natDegree (x - z) ≤ ↑(Fintype.card Fq) ^ natDegree (x - y) ∨
    ↑(Fintype.card Fq) ^ natDegree (x - z) ≤ ↑(Fintype.card Fq) ^ natDegree (y - z)

tactic: rw [natDegree_le_iff_degree_le, natDegree_le_iff_degree_le, ← le_max_iff, ←
  degree_eq_natDegree hxy', ← degree_eq_natDegree hyz']
state_before: case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy'✝ : x ≠ y
hxy' : x - y ≠ 0
hyz'✝ : y ≠ z
hyz' : y - z ≠ 0
hxz'✝ : x ≠ z
hxz' : x - z ≠ 0
this : 1 ≤ ↑(Fintype.card Fq)
⊢ natDegree (x - z) ≤ natDegree (x - y) ∨ natDegree (x - z) ≤ natDegree (y - z)

tactic: convert degree_add_le (x - y) (y - z) using 2
state_before: case neg
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy'✝ : x ≠ y
hxy' : x - y ≠ 0
hyz'✝ : y ≠ z
hyz' : y - z ≠ 0
hxz'✝ : x ≠ z
hxz' : x - z ≠ 0
this : 1 ≤ ↑(Fintype.card Fq)
⊢ degree (x - z) ≤ max (degree (x - y)) (degree (y - z))

tactic: exact (sub_add_sub_cancel _ _ _).symm
state_before: case h.e'_3.h.e'_3
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy'✝ : x ≠ y
hxy' : x - y ≠ 0
hyz'✝ : y ≠ z
hyz' : y - z ≠ 0
hxz'✝ : x ≠ z
hxz' : x - z ≠ 0
this : 1 ≤ ↑(Fintype.card Fq)
⊢ x - z = x - y + (y - z)

tactic: rwa [hxy']
state_before: case pos
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy' : x = y
⊢ ↑cardPowDegree (x - z) < a

tactic: rwa [← hyz']
state_before: case pos
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy' : ¬x = y
hyz' : y = z
⊢ ↑cardPowDegree (x - z) < a

tactic: rwa [hxz', sub_self, map_zero]
state_before: case pos
Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy' : ¬x = y
hyz' : ¬y = z
hxz' : x = z
⊢ ↑cardPowDegree (x - z) < a

tactic: exact_mod_cast (@Fintype.one_lt_card Fq _ _).le
state_before: Fq : Type u_1
inst✝¹ : Fintype Fq
inst✝ : Field Fq
x y z : Fq[X]
a : ℤ
hxy : ↑cardPowDegree (x - y) < a
hyz : ↑cardPowDegree (y - z) < a
ha : 0 < a
hxy'✝ : x ≠ y
hxy' : x - y ≠ 0
hyz'✝ : y ≠ z
hyz' : y - z ≠ 0
hxz'✝ : x ≠ z
hxz' : x - z ≠ 0
⊢ 1 ≤ ↑(Fintype.card Fq)