(* (c) Copyright 2006-2016 Microsoft Corporation and Inria.                  *)
(* Distributed under the terms of CeCILL-B.                                  *)
From mathcomp
From mathcomp
From mathcomp
From mathcomp
(******************************************************************************)
(* This file provides a theory of separable and inseparable field extensions. *)
(*                                                                            *)
(*      separable_poly p <=> p has no multiple roots in any field extension.  *)
(* separable_element K x <=> the minimal polynomial of x over K is separable. *)
(*         separable K E <=> every member of E is separable over K.           *)
(* separable_generator K E == some x \in E that generates the largest         *)
(*                           subfield K[x] that is separable over K.          *)
(* purely_inseparable_element K x <=> there is a [char L].-nat n such that    *)
(*                           x ^+ n \in K.                                    *)
(* purely_inseparable K E <=> every member of E is purely inseparable over K. *)
(*                                                                            *)
(*  Derivations are introduced to prove the adjoin_separableP Lemma:          *)
(*        Derivation K D <=> the linear operator D satifies the Leibniz       *)
(*                           product rule inside K.                           *)
(* extendDerivation x D K == given a derivation D on K and a separable        *)
(*                           element x over K, this function returns the      *)
(*                           unique extension of D to K(x).                   *)
(******************************************************************************)
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Local Open Scope ring_scope.
Section SeparablePoly.
Variable R : idomainType.
Implicit Types p q d u v : {poly R}.
Definition separable_poly p := coprimep p p^`().
Local Notation separable := separable_poly.
Local Notation lcn_neq0 := (Pdiv.Idomain.lc_expn_scalp_neq0 _).

(* Specifications: *)
Lemma separable_poly_neq0 p : separable p -> p != 0.
Lemma poly_square_freeP p :
(forall u v, u * v %| p -> coprimep u v)
<-> (forall u, size u != 1%N -> ~~ (u ^+ 2 %| p)).
Lemma separable_polyP {p} :
reflect [/\ forall u v, u * v %| p -> coprimep u v
& forall u, u %| p -> 1 < size u -> u^`() != 0]
(separable p).
Lemma separable_coprime p u v : separable p -> u * v %| p -> coprimep u v.
Lemma separable_deriv_eq0 p u :
separable p -> u %| p -> 1 < size u -> (u^`() == 0) = false.
Lemma separable_mul p q :
separable (p * q) = [&& separable p, separable q & coprimep p q].
Lemma eqp_separable p q : p %= q -> separable p = separable q.
Lemma separable_prod_XsubC (r : seq R) :
separable (\prod_(x <- r) ('X - x%:P)) = uniq r.
Lemma make_separable p : p != 0 -> separable (p %/ gcdp p p^`()).
End SeparablePoly.