Library mathcomp.field.algC
(* (c) Copyright 2006-2016 Microsoft Corporation and Inria.
Distributed under the terms of CeCILL-B. *)
From HB Require Import structures.
From mathcomp Require Import ssreflect ssrbool ssrfun ssrnat eqtype seq choice.
From mathcomp Require Import div fintype path bigop finset prime order ssralg.
From mathcomp Require Import poly polydiv mxpoly generic_quotient countalg.
From mathcomp Require Import ssrnum closed_field ssrint archimedean rat intdiv.
From mathcomp Require Import algebraics_fundamentals.
Distributed under the terms of CeCILL-B. *)
From HB Require Import structures.
From mathcomp Require Import ssreflect ssrbool ssrfun ssrnat eqtype seq choice.
From mathcomp Require Import div fintype path bigop finset prime order ssralg.
From mathcomp Require Import poly polydiv mxpoly generic_quotient countalg.
From mathcomp Require Import ssrnum closed_field ssrint archimedean rat intdiv.
From mathcomp Require Import algebraics_fundamentals.
This file provides an axiomatic construction of the algebraic numbers.
The construction only assumes the existence of an algebraically closed
filed with an automorphism of order 2; this amounts to the purely
algebraic contents of the Fundamenta Theorem of Algebra.
algC == the closed, countable field of algebraic numbers.
algCeq, algCring, ..., algCnumField == structures for algC.
The ssrnum interfaces are implemented for algC as follows:
x <= y <=> (y - x) is a nonnegative real
x < y <=> (y - x) is a (strictly) positive real
`|z| == the complex norm of z, i.e., sqrtC (z * z^* ).
Creal == the subset of real numbers (:= Num.real for algC).
'i == the imaginary number (:= sqrtC (-1)).
'Re z == the real component of z.
'Im z == the imaginary component of z.
z^* == the complex conjugate of z (:= conjC z).
sqrtC z == a nonnegative square root of z, i.e., 0 <= sqrt x if 0 <= x.
n.-root z == more generally, for n > 0, an nth root of z, chosen with a
minimal non-negative argument for n > 1 (i.e., with a
maximal real part subject to a nonnegative imaginary part).
Note that n.-root (-1) is a primitive 2nth root of unity,
an thus not equal to -1 for n odd > 1 (this will be shown in
file cyclotomic.v).
In addition, we provide:
Crat == the subset of rational numbers.
getCrat z == some a : rat such that ratr a = z, provided z \in Crat.
minCpoly z == the minimal (monic) polynomial over Crat with root z.
algC_invaut nu == an inverse of nu : {rmorphism algC -> algC}.
(x %| y)%C <=> y is an integer (Num.int) multiple of x; if x or y
(x %| y)%Cx are of type nat or int they are coerced to algC.
The (x %| y)%Cx display form is a workaround for
design limitations of the Coq Notation facilities.
(x == y % [mod z])%C <=> x and y differ by an integer (Num.int) multiple of
z; as above, arguments of type nat or int are cast to algC.
(x != y % [mod z])%C <=> x and y do not differ by an integer multiple of z.
Note that in file algnum we give an alternative definition of divisibility
based on algebraic integers, overloading the notation in the %A scope.
Set Implicit Arguments.
Declare Scope C_scope.
Declare Scope C_core_scope.
Declare Scope C_expanded_scope.
Import Order.TTheory GRing.Theory Num.Theory.
Local Open Scope ring_scope.
Lemma nz2: 2 != 0 :> L.
Lemma mul2I: injective (fun z : L ⇒ z *+ 2).
Definition sqrt x : L :=
sval (sig_eqW (@solve_monicpoly _ 2%N (nth 0 [:: x]) isT)).
Lemma sqrtK x: sqrt x ^+ 2 = x.
Lemma sqrtE x y: y ^+ 2 = x → {b : bool | y = (-1) ^+ b × sqrt x}.
Definition i := sqrt (- 1).
Lemma sqrMi x: (i × x) ^+ 2 = - x ^+ 2.
Lemma iJ : conj i = - i.
Definition norm x := sqrt x × conj (sqrt x).
Lemma normK x : norm x ^+ 2 = x × conj x.
Lemma normE x y : y ^+ 2 = x → norm x = y × conj y.
Lemma norm_eq0 x : norm x = 0 → x = 0.
Lemma normM x y : norm (x × y) = norm x × norm y.
Lemma normN x : norm (- x) = norm x.
Definition le x y := norm (y - x) == y - x.
Definition lt x y := (y != x) && le x y.
Lemma posE x: le 0 x = (norm x == x).
Lemma leB x y: le x y = le 0 (y - x).
Lemma posP x : reflect (∃ y, x = y × conj y) (le 0 x).
Lemma posJ x : le 0 x → conj x = x.
Lemma pos_linear x y : le 0 x → le 0 y → le x y || le y x.
Lemma sposDl x y : lt 0 x → le 0 y → lt 0 (x + y).
Lemma sposD x y : lt 0 x → lt 0 y → lt 0 (x + y).
Lemma normD x y : le (norm (x + y)) (norm x + norm y).
Module Algebraics.
Module Type Specification.
Parameter type : Type.
Parameter conjMixin : Num.ClosedField type.
Parameter isCountable : Countable type.
Note that this cannot be included in conjMixin since a few proofs
depend from nat_num being definitionally equal to (trunc x)%:R == x
Axiom archimedean : Num.archimedean_axiom (Num.ClosedField.Pack conjMixin).
Axiom algebraic : integralRange (@ratr (Num.ClosedField.Pack conjMixin)).
End Specification.
Module Implementation : Specification.
Definition L := tag Fundamental_Theorem_of_Algebraics.
Definition conjL : {rmorphism L → L} :=
s2val (tagged Fundamental_Theorem_of_Algebraics).
Fact conjL_K : involutive conjL.
Fact conjL_nt : ¬ conjL =1 id.
Definition L' : Type := eta L.
Notation cfType := (L' : closedFieldType).
Definition QtoL : {rmorphism _ → _} := @ratr cfType.
Notation pQtoL := (map_poly QtoL).
Definition rootQtoL p_j :=
if p_j.1 == 0 then 0 else
(sval (closed_field_poly_normal (pQtoL p_j.1)))`_p_j.2.
Definition eq_root p_j q_k := rootQtoL p_j == rootQtoL q_k.
Fact eq_root_is_equiv : equiv_class_of eq_root.
Canonical eq_root_equiv := EquivRelPack eq_root_is_equiv.
Definition type : Type := {eq_quot eq_root}%qT.
Definition CtoL (u : type) := rootQtoL (repr u).
Fact CtoL_inj : injective CtoL.
Fact CtoL_P u : integralOver QtoL (CtoL u).
Fact LtoC_subproof z : integralOver QtoL z → {u | CtoL u = z}.
Definition LtoC z Az := sval (@LtoC_subproof z Az).
Fact LtoC_K z Az : CtoL (@LtoC z Az) = z.
Fact CtoL_K u : LtoC (CtoL_P u) = u.
Definition zero := LtoC (integral0 _).
Definition add u v := LtoC (integral_add (CtoL_P u) (CtoL_P v)).
Definition opp u := LtoC (integral_opp (CtoL_P u)).
Fact addA : associative add.
Fact addC : commutative add.
Fact add0 : left_id zero add.
Fact addN : left_inverse zero opp add.
Fact CtoL_is_additive : additive CtoL.
Definition one := LtoC (integral1 _).
Definition mul u v := LtoC (integral_mul (CtoL_P u) (CtoL_P v)).
Definition inv u := LtoC (integral_inv (CtoL_P u)).
Fact mulA : associative mul.
Fact mulC : commutative mul.
Fact mul1 : left_id one mul.
Fact mulD : left_distributive mul +%R.
Fact one_nz : one != 0 :> type.
Fact CtoL_is_multiplicative : multiplicative CtoL.
Fact mulVf u : u != 0 → inv u × u = 1.
Fact inv0 : inv 0 = 0.
Fact closedFieldAxiom : GRing.closed_field_axiom type.
Fact conj_subproof u : integralOver QtoL (conjL (CtoL u)).
Fact conj_is_semi_additive : semi_additive (fun u ⇒ LtoC (conj_subproof u)).
Fact conj_is_additive : {morph (fun u ⇒ LtoC (conj_subproof u)) : x / - x}.
Fact conj_is_multiplicative : multiplicative (fun u ⇒ LtoC (conj_subproof u)).
Definition conj : {rmorphism type → type} :=
GRing.RMorphism.Pack
(GRing.RMorphism.Class
(GRing.isSemiAdditive.Build _ _ _ conj_is_semi_additive)
(GRing.isMultiplicative.Build _ _ _ conj_is_multiplicative)).
Lemma conjK : involutive conj.
Fact conj_nt : ¬ conj =1 id.
Definition conjMixin := Num.ClosedField.on type.
Lemma algebraic : integralRange (@ratr type).
Fact archimedean : Num.archimedean_axiom type.
Definition isCountable := Countable.on type.
End Implementation.
Definition divisor := Implementation.type.
#[export] HB.instance Definition _ := Implementation.conjMixin.
#[export] HB.instance Definition _ :=
Num.NumDomain_bounded_isArchimedean.Build Implementation.type
Implementation.archimedean.
#[export] HB.instance Definition _ := Implementation.isCountable.
Module Internals.
Import Implementation.
Local Notation algC := type.
Local Notation QtoC := (ratr : rat → algC).
Local Notation pQtoC := (map_poly QtoC : {poly rat} → {poly algC}).
Fact algCi_subproof : {i : algC | i ^+ 2 = -1}.
Variant getCrat_spec : Type := GetCrat_spec CtoQ of cancel QtoC CtoQ.
Fact getCrat_subproof : getCrat_spec.
Fact minCpoly_subproof (x : algC) :
{p : {poly rat} | p \is monic & ∀ q, root (pQtoC q) x = (p %| q)%R}.
Definition algC_divisor (x : algC) := x : divisor.
Definition int_divisor m := m%:~R : divisor.
Definition nat_divisor n := n%:R : divisor.
End Internals.
Module Import Exports.
Import Implementation Internals.
Notation algC := type.
Delimit Scope C_scope with C.
Delimit Scope C_core_scope with Cc.
Delimit Scope C_expanded_scope with Cx.
Open Scope C_core_scope.
Notation algCeq := (type : eqType).
Notation algCzmod := (type : zmodType).
Notation algCring := (type : ringType).
Notation algCuring := (type : unitRingType).
Notation algCnum := (type : numDomainType).
Notation algCfield := (type : fieldType).
Notation algCnumField := (type : numFieldType).
Notation algCnumClosedField := (type : numClosedFieldType).
Notation Creal := (@Num.Def.Rreal algCnum).
Definition getCrat := let: GetCrat_spec CtoQ _ := getCrat_subproof in CtoQ.
Definition Crat : {pred algC} := fun x ⇒ ratr (getCrat x) == x.
Definition minCpoly x : {poly algC} :=
let: exist2 p _ _ := minCpoly_subproof x in map_poly ratr p.
Coercion nat_divisor : nat >-> divisor.
Coercion int_divisor : int >-> divisor.
Coercion algC_divisor : algC >-> divisor.
Lemma nCdivE (p : nat) : p = p%:R :> divisor.
Lemma zCdivE (p : int) : p = p%:~R :> divisor.
Definition CdivE := (nCdivE, zCdivE).
Definition dvdC (x : divisor) : {pred algC} :=
fun y ⇒ if x == 0 then y == 0 else y / x \in Num.int.
Notation "x %| y" := (y \in dvdC x) : C_expanded_scope.
Notation "x %| y" := (@in_mem divisor y (mem (dvdC x))) : C_scope.
Definition eqCmod (e x y : divisor) := (e %| x - y)%C.
Notation "x == y %[mod e ]" := (eqCmod e x y) : C_scope.
Notation "x != y %[mod e ]" := (~~ (x == y %[mod e])%C) : C_scope.
End Exports.
Module HBExports. End HBExports.
End Algebraics.
Export Algebraics.Exports.
Export Algebraics.HBExports.
Section AlgebraicsTheory.
Implicit Types (x y z : algC) (n : nat) (m : int) (b : bool).
Import Algebraics.Internals.
Local Notation ZtoQ := (intr : int → rat).
Local Notation ZtoC := (intr : int → algC).
Local Notation QtoC := (ratr : rat → algC).
Local Notation CtoQ := getCrat.
Local Notation intrp := (map_poly intr).
Local Notation pZtoQ := (map_poly ZtoQ).
Local Notation pZtoC := (map_poly ZtoC).
Local Notation pQtoC := (map_poly ratr).
Let intr_inj_ZtoC := (intr_inj : injective ZtoC).
#[local] Hint Resolve intr_inj_ZtoC : core.
Axiom algebraic : integralRange (@ratr (Num.ClosedField.Pack conjMixin)).
End Specification.
Module Implementation : Specification.
Definition L := tag Fundamental_Theorem_of_Algebraics.
Definition conjL : {rmorphism L → L} :=
s2val (tagged Fundamental_Theorem_of_Algebraics).
Fact conjL_K : involutive conjL.
Fact conjL_nt : ¬ conjL =1 id.
Definition L' : Type := eta L.
Notation cfType := (L' : closedFieldType).
Definition QtoL : {rmorphism _ → _} := @ratr cfType.
Notation pQtoL := (map_poly QtoL).
Definition rootQtoL p_j :=
if p_j.1 == 0 then 0 else
(sval (closed_field_poly_normal (pQtoL p_j.1)))`_p_j.2.
Definition eq_root p_j q_k := rootQtoL p_j == rootQtoL q_k.
Fact eq_root_is_equiv : equiv_class_of eq_root.
Canonical eq_root_equiv := EquivRelPack eq_root_is_equiv.
Definition type : Type := {eq_quot eq_root}%qT.
Definition CtoL (u : type) := rootQtoL (repr u).
Fact CtoL_inj : injective CtoL.
Fact CtoL_P u : integralOver QtoL (CtoL u).
Fact LtoC_subproof z : integralOver QtoL z → {u | CtoL u = z}.
Definition LtoC z Az := sval (@LtoC_subproof z Az).
Fact LtoC_K z Az : CtoL (@LtoC z Az) = z.
Fact CtoL_K u : LtoC (CtoL_P u) = u.
Definition zero := LtoC (integral0 _).
Definition add u v := LtoC (integral_add (CtoL_P u) (CtoL_P v)).
Definition opp u := LtoC (integral_opp (CtoL_P u)).
Fact addA : associative add.
Fact addC : commutative add.
Fact add0 : left_id zero add.
Fact addN : left_inverse zero opp add.
Fact CtoL_is_additive : additive CtoL.
Definition one := LtoC (integral1 _).
Definition mul u v := LtoC (integral_mul (CtoL_P u) (CtoL_P v)).
Definition inv u := LtoC (integral_inv (CtoL_P u)).
Fact mulA : associative mul.
Fact mulC : commutative mul.
Fact mul1 : left_id one mul.
Fact mulD : left_distributive mul +%R.
Fact one_nz : one != 0 :> type.
Fact CtoL_is_multiplicative : multiplicative CtoL.
Fact mulVf u : u != 0 → inv u × u = 1.
Fact inv0 : inv 0 = 0.
Fact closedFieldAxiom : GRing.closed_field_axiom type.
Fact conj_subproof u : integralOver QtoL (conjL (CtoL u)).
Fact conj_is_semi_additive : semi_additive (fun u ⇒ LtoC (conj_subproof u)).
Fact conj_is_additive : {morph (fun u ⇒ LtoC (conj_subproof u)) : x / - x}.
Fact conj_is_multiplicative : multiplicative (fun u ⇒ LtoC (conj_subproof u)).
Definition conj : {rmorphism type → type} :=
GRing.RMorphism.Pack
(GRing.RMorphism.Class
(GRing.isSemiAdditive.Build _ _ _ conj_is_semi_additive)
(GRing.isMultiplicative.Build _ _ _ conj_is_multiplicative)).
Lemma conjK : involutive conj.
Fact conj_nt : ¬ conj =1 id.
Definition conjMixin := Num.ClosedField.on type.
Lemma algebraic : integralRange (@ratr type).
Fact archimedean : Num.archimedean_axiom type.
Definition isCountable := Countable.on type.
End Implementation.
Definition divisor := Implementation.type.
#[export] HB.instance Definition _ := Implementation.conjMixin.
#[export] HB.instance Definition _ :=
Num.NumDomain_bounded_isArchimedean.Build Implementation.type
Implementation.archimedean.
#[export] HB.instance Definition _ := Implementation.isCountable.
Module Internals.
Import Implementation.
Local Notation algC := type.
Local Notation QtoC := (ratr : rat → algC).
Local Notation pQtoC := (map_poly QtoC : {poly rat} → {poly algC}).
Fact algCi_subproof : {i : algC | i ^+ 2 = -1}.
Variant getCrat_spec : Type := GetCrat_spec CtoQ of cancel QtoC CtoQ.
Fact getCrat_subproof : getCrat_spec.
Fact minCpoly_subproof (x : algC) :
{p : {poly rat} | p \is monic & ∀ q, root (pQtoC q) x = (p %| q)%R}.
Definition algC_divisor (x : algC) := x : divisor.
Definition int_divisor m := m%:~R : divisor.
Definition nat_divisor n := n%:R : divisor.
End Internals.
Module Import Exports.
Import Implementation Internals.
Notation algC := type.
Delimit Scope C_scope with C.
Delimit Scope C_core_scope with Cc.
Delimit Scope C_expanded_scope with Cx.
Open Scope C_core_scope.
Notation algCeq := (type : eqType).
Notation algCzmod := (type : zmodType).
Notation algCring := (type : ringType).
Notation algCuring := (type : unitRingType).
Notation algCnum := (type : numDomainType).
Notation algCfield := (type : fieldType).
Notation algCnumField := (type : numFieldType).
Notation algCnumClosedField := (type : numClosedFieldType).
Notation Creal := (@Num.Def.Rreal algCnum).
Definition getCrat := let: GetCrat_spec CtoQ _ := getCrat_subproof in CtoQ.
Definition Crat : {pred algC} := fun x ⇒ ratr (getCrat x) == x.
Definition minCpoly x : {poly algC} :=
let: exist2 p _ _ := minCpoly_subproof x in map_poly ratr p.
Coercion nat_divisor : nat >-> divisor.
Coercion int_divisor : int >-> divisor.
Coercion algC_divisor : algC >-> divisor.
Lemma nCdivE (p : nat) : p = p%:R :> divisor.
Lemma zCdivE (p : int) : p = p%:~R :> divisor.
Definition CdivE := (nCdivE, zCdivE).
Definition dvdC (x : divisor) : {pred algC} :=
fun y ⇒ if x == 0 then y == 0 else y / x \in Num.int.
Notation "x %| y" := (y \in dvdC x) : C_expanded_scope.
Notation "x %| y" := (@in_mem divisor y (mem (dvdC x))) : C_scope.
Definition eqCmod (e x y : divisor) := (e %| x - y)%C.
Notation "x == y %[mod e ]" := (eqCmod e x y) : C_scope.
Notation "x != y %[mod e ]" := (~~ (x == y %[mod e])%C) : C_scope.
End Exports.
Module HBExports. End HBExports.
End Algebraics.
Export Algebraics.Exports.
Export Algebraics.HBExports.
Section AlgebraicsTheory.
Implicit Types (x y z : algC) (n : nat) (m : int) (b : bool).
Import Algebraics.Internals.
Local Notation ZtoQ := (intr : int → rat).
Local Notation ZtoC := (intr : int → algC).
Local Notation QtoC := (ratr : rat → algC).
Local Notation CtoQ := getCrat.
Local Notation intrp := (map_poly intr).
Local Notation pZtoQ := (map_poly ZtoQ).
Local Notation pZtoC := (map_poly ZtoC).
Local Notation pQtoC := (map_poly ratr).
Let intr_inj_ZtoC := (intr_inj : injective ZtoC).
#[local] Hint Resolve intr_inj_ZtoC : core.
Specialization of a few basic ssrnum order lemmas.
Definition eqC_nat n p : (n%:R == p%:R :> algC) = (n == p) := eqr_nat _ n p.
Definition leC_nat n p : (n%:R ≤ p%:R :> algC) = (n ≤ p)%N := ler_nat _ n p.
Definition ltC_nat n p : (n%:R < p%:R :> algC) = (n < p)%N := ltr_nat _ n p.
Definition Cchar : [char algC] =i pred0 := @char_num _.
This can be used in the converse direction to evaluate assertions over
manifest rationals, such as 3^-1 + 7%:%^-1 < 2%:%^-1 :> algC.
Missing norm and integer exponent, due to gaps in ssrint and rat.
Definition CratrE :=
let CnF : numClosedFieldType := algC in
let QtoCm : {rmorphism _ → _} := @ratr CnF in
((rmorph0 QtoCm, rmorph1 QtoCm, rmorphMn QtoCm, rmorphN QtoCm, rmorphD QtoCm),
(rmorphM QtoCm, rmorphXn QtoCm, fmorphV QtoCm),
(rmorphMz QtoCm, rmorphXz QtoCm, @ratr_norm CnF, @ratr_sg CnF),
=^~ (@ler_rat CnF, @ltr_rat CnF, (inj_eq (fmorph_inj QtoCm)))).
Definition CintrE :=
let CnF : numClosedFieldType := algC in
let ZtoCm : {rmorphism _ → _} := *~%R (1 : CnF) in
((rmorph0 ZtoCm, rmorph1 ZtoCm, rmorphMn ZtoCm, rmorphN ZtoCm, rmorphD ZtoCm),
(rmorphM ZtoCm, rmorphXn ZtoCm),
(rmorphMz ZtoCm, @intr_norm CnF, @intr_sg CnF),
=^~ (@ler_int CnF, @ltr_int CnF, (inj_eq (@intr_inj CnF)))).
Let nz2 : 2 != 0 :> algC.
let CnF : numClosedFieldType := algC in
let QtoCm : {rmorphism _ → _} := @ratr CnF in
((rmorph0 QtoCm, rmorph1 QtoCm, rmorphMn QtoCm, rmorphN QtoCm, rmorphD QtoCm),
(rmorphM QtoCm, rmorphXn QtoCm, fmorphV QtoCm),
(rmorphMz QtoCm, rmorphXz QtoCm, @ratr_norm CnF, @ratr_sg CnF),
=^~ (@ler_rat CnF, @ltr_rat CnF, (inj_eq (fmorph_inj QtoCm)))).
Definition CintrE :=
let CnF : numClosedFieldType := algC in
let ZtoCm : {rmorphism _ → _} := *~%R (1 : CnF) in
((rmorph0 ZtoCm, rmorph1 ZtoCm, rmorphMn ZtoCm, rmorphN ZtoCm, rmorphD ZtoCm),
(rmorphM ZtoCm, rmorphXn ZtoCm),
(rmorphMz ZtoCm, @intr_norm CnF, @intr_sg CnF),
=^~ (@ler_int CnF, @ltr_int CnF, (inj_eq (@intr_inj CnF)))).
Let nz2 : 2 != 0 :> algC.
Conjugation and norm.
Real number subset.
Lemma algCrect x : x = 'Re x + 'i × 'Im x.
Lemma algCreal_Re x : 'Re x \is Creal.
Lemma algCreal_Im x : 'Im x \is Creal.
Hint Resolve algCreal_Re algCreal_Im : core.
Integer divisibility.
Lemma dvdCP x y : reflect (exists2 z, z \in Num.int & y = z × x) (x %| y)%C.
Lemma dvdCP_nat x y : 0 ≤ x → 0 ≤ y → (x %| y)%C → {n | y = n%:R × x}.
Lemma dvdC0 x : (x %| 0)%C.
Lemma dvd0C x : (0 %| x)%C = (x == 0).
Lemma dvdC_mull x y z : y \in Num.int → (x %| z)%C → (x %| y × z)%C.
Lemma dvdC_mulr x y z : y \in Num.int → (x %| z)%C → (x %| z × y)%C.
Lemma dvdC_mul2r x y z : y != 0 → (x × y %| z × y)%C = (x %| z)%C.
Lemma dvdC_mul2l x y z : y != 0 → (y × x %| y × z)%C = (x %| z)%C.
Lemma dvdC_trans x y z : (x %| y)%C → (y %| z)%C → (x %| z)%C.
Lemma dvdC_refl x : (x %| x)%C.
Hint Resolve dvdC_refl : core.
Lemma dvdC_zmod x : zmod_closed (dvdC x).
Lemma dvdC_nat (p n : nat) : (p %| n)%C = (p %| n)%N.
Lemma dvdC_int (p : nat) x :
x \in Num.int → (p %| x)%C = (p %| `|Num.floor x|)%N.
Elementary modular arithmetic.
Lemma eqCmod_refl e x : (x == x %[mod e])%C.
Lemma eqCmodm0 e : (e == 0 %[mod e])%C.
Hint Resolve eqCmod_refl eqCmodm0 : core.
Lemma eqCmod0 e x : (x == 0 %[mod e])%C = (e %| x)%C.
Lemma eqCmod_sym e x y : ((x == y %[mod e]) = (y == x %[mod e]))%C.
Lemma eqCmod_trans e y x z :
(x == y %[mod e] → y == z %[mod e] → x == z %[mod e])%C.
Lemma eqCmod_transl e x y z :
(x == y %[mod e])%C → (x == z %[mod e])%C = (y == z %[mod e])%C.
Lemma eqCmod_transr e x y z :
(x == y %[mod e])%C → (z == x %[mod e])%C = (z == y %[mod e])%C.
Lemma eqCmodN e x y : (- x == y %[mod e])%C = (x == - y %[mod e])%C.
Lemma eqCmodDr e x y z : (y + x == z + x %[mod e])%C = (y == z %[mod e])%C.
Lemma eqCmodDl e x y z : (x + y == x + z %[mod e])%C = (y == z %[mod e])%C.
Lemma eqCmodD e x1 x2 y1 y2 :
(x1 == x2 %[mod e] → y1 == y2 %[mod e] → x1 + y1 == x2 + y2 %[mod e])%C.
Lemma eqCmod_nat (e m n : nat) : (m == n %[mod e])%C = (m == n %[mod e]).
Lemma eqCmod0_nat (e m : nat) : (m == 0 %[mod e])%C = (e %| m)%N.
Lemma eqCmodMr e :
{in Num.int, ∀ z x y, x == y %[mod e] → x × z == y × z %[mod e]}%C.
Lemma eqCmodMl e :
{in Num.int, ∀ z x y, x == y %[mod e] → z × x == z × y %[mod e]}%C.
Lemma eqCmodMl0 e : {in Num.int, ∀ x, x × e == 0 %[mod e]}%C.
Lemma eqCmodMr0 e : {in Num.int, ∀ x, e × x == 0 %[mod e]}%C.
Lemma eqCmod_addl_mul e : {in Num.int, ∀ x y, x × e + y == y %[mod e]}%C.
Lemma eqCmodM e : {in Num.int & Num.int, ∀ x1 y2 x2 y1,
x1 == x2 %[mod e] → y1 == y2 %[mod e] → x1 × y1 == x2 × y2 %[mod e]}%C.
Rational number subset.
Lemma ratCK : cancel QtoC CtoQ.
Lemma getCratK : {in Crat, cancel CtoQ QtoC}.
Lemma Crat_rat (a : rat) : QtoC a \in Crat.
Lemma CratP x : reflect (∃ a, x = QtoC a) (x \in Crat).
Lemma Crat0 : 0 \in Crat.
Lemma Crat1 : 1 \in Crat.
#[local] Hint Resolve Crat0 Crat1 : core.
Fact Crat_divring_closed : divring_closed Crat.
Lemma rpred_Crat (S : divringClosed algC) : {subset Crat ≤ S}.
Lemma conj_Crat z : z \in Crat → z^* = z.
Lemma Creal_Crat : {subset Crat ≤ Creal}.
Lemma Cint_rat a : (QtoC a \in Num.int) = (a \in Num.int).
Lemma minCpolyP x :
{p : {poly rat} | minCpoly x = pQtoC p ∧ p \is monic
& ∀ q, root (pQtoC q) x = (p %| q)%R}.
Lemma minCpoly_monic x : minCpoly x \is monic.
Lemma minCpoly_eq0 x : (minCpoly x == 0) = false.
Lemma root_minCpoly x : root (minCpoly x) x.
Lemma size_minCpoly x : (1 < size (minCpoly x))%N.
Basic properties of automorphisms.
Section AutC.
Implicit Type nu : {rmorphism algC → algC}.
Lemma aut_Crat nu : {in Crat, nu =1 id}.
Lemma Crat_aut nu x : (nu x \in Crat) = (x \in Crat).
Lemma algC_invaut_subproof nu x : {y | nu y = x}.
Definition algC_invaut nu x := sval (algC_invaut_subproof nu x).
Lemma algC_invautK nu : cancel (algC_invaut nu) nu.
Lemma algC_autK nu : cancel nu (algC_invaut nu).
Fact algC_invaut_is_additive nu : additive (algC_invaut nu).
Fact algC_invaut_is_rmorphism nu : multiplicative (algC_invaut nu).
Lemma minCpoly_aut nu x : minCpoly (nu x) = minCpoly x.
End AutC.
End AlgebraicsTheory.
#[global] Hint Resolve Crat0 Crat1 dvdC0 dvdC_refl eqCmod_refl eqCmodm0 : core.
Implicit Type nu : {rmorphism algC → algC}.
Lemma aut_Crat nu : {in Crat, nu =1 id}.
Lemma Crat_aut nu x : (nu x \in Crat) = (x \in Crat).
Lemma algC_invaut_subproof nu x : {y | nu y = x}.
Definition algC_invaut nu x := sval (algC_invaut_subproof nu x).
Lemma algC_invautK nu : cancel (algC_invaut nu) nu.
Lemma algC_autK nu : cancel nu (algC_invaut nu).
Fact algC_invaut_is_additive nu : additive (algC_invaut nu).
Fact algC_invaut_is_rmorphism nu : multiplicative (algC_invaut nu).
Lemma minCpoly_aut nu x : minCpoly (nu x) = minCpoly x.
End AutC.
End AlgebraicsTheory.
#[global] Hint Resolve Crat0 Crat1 dvdC0 dvdC_refl eqCmod_refl eqCmodm0 : core.