Theorem: Polynomial.contraction_degree_eq_or_insep
File: Mathlib/FieldTheory/SeparableDegree.lean

tactic: wlog hm : m ≤ m'
state_before: F : Type u_1
inst✝¹ : Field F
q : ℕ
f : F[X]
hf : HasSeparableContraction q f
hq : NeZero q
inst✝ : CharP F q
g g' : F[X]
m m' : ℕ
h_expand : ↑(expand F (q ^ m)) g = ↑(expand F (q ^ m')) g'
hg : Separable g
hg' : Separable g'
⊢ natDegree g = natDegree g'

tactic: obtain ⟨s, rfl⟩ := exists_add_of_le hm
state_before: F✝ : Type u_1
inst✝² : Field F✝
q✝ : ℕ
F : Type u_1
inst✝¹ : Field F
q : ℕ
f : F[X]
hf : HasSeparableContraction q f
hq : NeZero q
inst✝ : CharP F q
g g' : F[X]
m m' : ℕ
h_expand : ↑(expand F (q ^ m)) g = ↑(expand F (q ^ m')) g'
hg : Separable g
hg' : Separable g'
hm : m ≤ m'
⊢ natDegree g = natDegree g'

tactic: rw [pow_add, expand_mul, expand_inj (pow_pos (NeZero.pos q) m)] at h_expand
state_before: case intro
F✝ : Type u_1
inst✝² : Field F✝
q✝ : ℕ
F : Type u_1
inst✝¹ : Field F
q : ℕ
f : F[X]
hf : HasSeparableContraction q f
hq : NeZero q
inst✝ : CharP F q
g g' : F[X]
m : ℕ
hg : Separable g
hg' : Separable g'
s : ℕ
h_expand : ↑(expand F (q ^ m)) g = ↑(expand F (q ^ (m + s))) g'
hm : m ≤ m + s
⊢ natDegree g = natDegree g'

tactic: subst h_expand
state_before: case intro
F✝ : Type u_1
inst✝² : Field F✝
q✝ : ℕ
F : Type u_1
inst✝¹ : Field F
q : ℕ
f : F[X]
hf : HasSeparableContraction q f
hq : NeZero q
inst✝ : CharP F q
g g' : F[X]
m : ℕ
hg : Separable g
hg' : Separable g'
s : ℕ
h_expand : g = ↑(expand F (q ^ s)) g'
hm : m ≤ m + s
⊢ natDegree g = natDegree g'

tactic: rcases isUnit_or_eq_zero_of_separable_expand q s (NeZero.pos q) hg with (h | rfl)
state_before: case intro
F✝ : Type u_1
inst✝² : Field F✝
q✝ : ℕ
F : Type u_1
inst✝¹ : Field F
q : ℕ
f : F[X]
hf : HasSeparableContraction q f
hq : NeZero q
inst✝ : CharP F q
g' : F[X]
m : ℕ
hg' : Separable g'
s : ℕ
hm : m ≤ m + s
hg : Separable (↑(expand F (q ^ s)) g')
⊢ natDegree (↑(expand F (q ^ s)) g') = natDegree g'

tactic: exact (this q hf g' g m' m h_expand.symm hg' hg (le_of_not_le hm)).symm
state_before: case inr
F : Type u_1
inst✝¹ : Field F
q : ℕ
f : F[X]
hf : HasSeparableContraction q f
hq : NeZero q
inst✝ : CharP F q
g g' : F[X]
m m' : ℕ
h_expand : ↑(expand F (q ^ m)) g = ↑(expand F (q ^ m')) g'
hg : Separable g
hg' : Separable g'
this :
  ∀ {F : Type u_1} [inst : Field F] (q : ℕ) {f : F[X]},
    HasSeparableContraction q f →
      ∀ [hq : NeZero q] [inst_1 : CharP F q] (g g' : F[X]) (m m' : ℕ),
        ↑(expand F (q ^ m)) g = ↑(expand F (q ^ m')) g' →
          Separable g → Separable g' → m ≤ m' → natDegree g = natDegree g'
hm : ¬m ≤ m'
⊢ natDegree g = natDegree g'

tactic: rw [natDegree_expand, natDegree_eq_zero_of_isUnit h, MulZeroClass.zero_mul]
state_before: case intro.inl
F✝ : Type u_1
inst✝² : Field F✝
q✝ : ℕ
F : Type u_1
inst✝¹ : Field F
q : ℕ
f : F[X]
hf : HasSeparableContraction q f
hq : NeZero q
inst✝ : CharP F q
g' : F[X]
m : ℕ
hg' : Separable g'
s : ℕ
hm : m ≤ m + s
hg : Separable (↑(expand F (q ^ s)) g')
h : IsUnit g'
⊢ natDegree (↑(expand F (q ^ s)) g') = natDegree g'

tactic: rw [natDegree_expand, pow_zero, mul_one]
state_before: case intro.inr
F✝ : Type u_1
inst✝² : Field F✝
q✝ : ℕ
F : Type u_1
inst✝¹ : Field F
q : ℕ
f : F[X]
hf : HasSeparableContraction q f
hq : NeZero q
inst✝ : CharP F q
g' : F[X]
m : ℕ
hg' : Separable g'
hm : m ≤ m + 0
hg : Separable (↑(expand F (q ^ 0)) g')
⊢ natDegree (↑(expand F (q ^ 0)) g') = natDegree g'