Theorem: FiniteField.roots_X_pow_card_sub_X
File: Mathlib/FieldTheory/Finite/Basic.lean

tactic: classical
  have aux : (X ^ q - X : K[X]) ≠ 0 := X_pow_card_sub_X_ne_zero K Fintype.one_lt_card
  have : (roots (X ^ q - X : K[X])).toFinset = Finset.univ := by
    rw [eq_univ_iff_forall]
    intro x
    rw [Multiset.mem_toFinset, mem_roots aux, IsRoot.def, eval_sub, eval_pow, eval_X,
      sub_eq_zero, pow_card]
  rw [← this, Multiset.toFinset_val, eq_comm, Multiset.dedup_eq_self]
  apply nodup_roots
  rw [separable_def]
  convert isCoprime_one_right.neg_right (R := K[X]) using 1
  rw [derivative_sub, derivative_X, derivative_X_pow, Nat.cast_card_eq_zero K, C_0,
    zero_mul, zero_sub]
state_before: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
⊢ (X ^ q - X).roots = univ.val
state_after: no goals

tactic: have aux : (X ^ q - X : K[X]) ≠ 0 := X_pow_card_sub_X_ne_zero K Fintype.one_lt_card
state_before: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
⊢ (X ^ q - X).roots = univ.val
state_after: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
⊢ (X ^ q - X).roots = univ.val

tactic: have : (roots (X ^ q - X : K[X])).toFinset = Finset.univ := by
  rw [eq_univ_iff_forall]
  intro x
  rw [Multiset.mem_toFinset, mem_roots aux, IsRoot.def, eval_sub, eval_pow, eval_X,
    sub_eq_zero, pow_card]
state_before: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
⊢ (X ^ q - X).roots = univ.val
state_after: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
this : (X ^ q - X).roots.toFinset = univ
⊢ (X ^ q - X).roots = univ.val

tactic: rw [← this, Multiset.toFinset_val, eq_comm, Multiset.dedup_eq_self]
state_before: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
this : (X ^ q - X).roots.toFinset = univ
⊢ (X ^ q - X).roots = univ.val
state_after: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
this : (X ^ q - X).roots.toFinset = univ
⊢ (X ^ q - X).roots.Nodup

tactic: apply nodup_roots
state_before: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
this : (X ^ q - X).roots.toFinset = univ
⊢ (X ^ q - X).roots.Nodup
state_after: case hsep
K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
this : (X ^ q - X).roots.toFinset = univ
⊢ (X ^ q - X).Separable

tactic: rw [separable_def]
state_before: case hsep
K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
this : (X ^ q - X).roots.toFinset = univ
⊢ (X ^ q - X).Separable
state_after: case hsep
K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
this : (X ^ q - X).roots.toFinset = univ
⊢ IsCoprime (X ^ q - X) (derivative (X ^ q - X))

tactic: convert isCoprime_one_right.neg_right (R := K[X]) using 1
state_before: case hsep
K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
this : (X ^ q - X).roots.toFinset = univ
⊢ IsCoprime (X ^ q - X) (derivative (X ^ q - X))
state_after: case h.e'_4
K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
this : (X ^ q - X).roots.toFinset = univ
⊢ derivative (X ^ q - X) = -1

tactic: rw [derivative_sub, derivative_X, derivative_X_pow, Nat.cast_card_eq_zero K, C_0,
  zero_mul, zero_sub]
state_before: case h.e'_4
K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
this : (X ^ q - X).roots.toFinset = univ
⊢ derivative (X ^ q - X) = -1
state_after: no goals

tactic: rw [eq_univ_iff_forall]
state_before: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
⊢ (X ^ q - X).roots.toFinset = univ
state_after: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
⊢ ∀ (x : K), x ∈ (X ^ q - X).roots.toFinset

tactic: intro x
state_before: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
⊢ ∀ (x : K), x ∈ (X ^ q - X).roots.toFinset
state_after: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
x : K
⊢ x ∈ (X ^ q - X).roots.toFinset

tactic: rw [Multiset.mem_toFinset, mem_roots aux, IsRoot.def, eval_sub, eval_pow, eval_X,
  sub_eq_zero, pow_card]
state_before: K : Type u_1
R : Type u_2
inst✝³ : Field K
inst✝² : Fintype K
p : ℕ
inst✝¹ : Fact (Nat.Prime p)
inst✝ : Algebra (ZMod p) K
aux : X ^ q - X ≠ 0
x : K
⊢ x ∈ (X ^ q - X).roots.toFinset
state_after: no goals